X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Futil%2FReplayCache.h;h=0f0d6e27d6987be00a934dfaf504330e375db69e;hb=30654333446e3148ff35914b2fe087da0719889b;hp=590b519b131703e10a351aab05d8c2cff7dd69b9;hpb=b6efc574367bbc5c5efb00154db20f020db1c4ca;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/util/ReplayCache.h b/xmltooling/util/ReplayCache.h index 590b519..0f0d6e2 100644 --- a/xmltooling/util/ReplayCache.h +++ b/xmltooling/util/ReplayCache.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,19 +20,21 @@ * Helper class on top of StorageService for detecting message replay. */ -#ifndef __xmltooling_replay_h__ +#if !defined(__xmltooling_replay_h__) && !defined(XMLTOOLING_LITE) #define __xmltooling_replay_h__ -#include +#include namespace xmltooling { + class XMLTOOL_API StorageService; + /** * Helper class on top of StorageService for detecting message replay. */ class XMLTOOL_API ReplayCache { - MAKE_NONCOPYABLE(ReplayCache); + MAKE_NONCOPYABLE(ReplayCache); public: /** @@ -56,8 +58,15 @@ namespace xmltooling { */ virtual bool check(const char* context, const char* s, time_t expires); - bool check(const char* context, const XMLCh* str, time_t expires) { - auto_ptr_char temp(str); + /** + * Returns true iff the check value is not found in the cache, and stores it. + * + * @param context a context label to subdivide the cache + * @param s value to check + * @param expires time for disposal of value from cache + */ + bool check(const char* context, const XMLCh* s, time_t expires) { + auto_ptr_char temp(s); return check(context, temp.get(), expires); }