/*
- * Copyright 2001-2006 Internet2
+ * Copyright 2001-2010 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "internal.h"
#include "util/ReplayCache.h"
+#include "util/StorageService.h"
using namespace xmltooling;
using namespace std;
-ReplayCache::ReplayCache(StorageService* storage) : m_owned(storage==NULL), m_storage(storage)
+ReplayCache::ReplayCache(StorageService* storage) : m_owned(storage==nullptr), m_storage(storage)
{
if (!m_storage)
- m_storage = XMLToolingConfig::getConfig().StorageServiceManager.newPlugin(MEMORY_STORAGE_SERVICE, NULL);
+ m_storage = XMLToolingConfig::getConfig().StorageServiceManager.newPlugin(MEMORY_STORAGE_SERVICE, nullptr);
}
ReplayCache::~ReplayCache()
// In storage already?
if (m_storage->readString(context, s))
return false;
- m_storage->createText(context, s, "x", expires);
+ m_storage->createString(context, s, "x", expires);
return true;
}
+
+bool ReplayCache::check(const char* context, const XMLCh* s, time_t expires)
+{
+ auto_ptr_char temp(s);
+ return check(context, temp.get(), expires);
+}