/*
- * Copyright 2001-2007 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.
/**
* @file xmltooling/util/StorageService.h
*
- * Generic data storage interface
+ * Generic data storage interface.
*/
#if !defined(__xmltooling_storage_h__) && !defined(XMLTOOLING_LITE)
#define __xmltooling_storage_h__
-#include <xmltooling/XMLObject.h>
+#include <xmltooling/base.h>
#include <ctime>
* @param key null-terminated unique key of up to 255 bytes
* @param value null-terminated value of up to 255 bytes to store
* @param expiration an expiration timestamp, after which the record can be purged
+ * @return true iff record was inserted, false iff a duplicate was found
*
- * @throws IOException raised if errors occur in the insertion process
+ * @throws IOException raised if fatal errors occur in the insertion process
*/
- virtual void createString(const char* context, const char* key, const char* value, time_t expiration)=0;
+ virtual bool createString(const char* context, const char* key, const char* value, time_t expiration)=0;
/**
* Returns an existing "short" record from the storage service.
* @param key null-terminated unique key of up to 255 bytes
* @param value null-terminated value of arbitrary length
* @param expiration an expiration timestamp, after which the record can be purged
+ * @return true iff record was inserted, false iff a duplicate was found
*
* @throws IOException raised if errors occur in the insertion process
*/
- virtual void createText(const char* context, const char* key, const char* value, time_t expiration)=0;
+ virtual bool createText(const char* context, const char* key, const char* value, time_t expiration)=0;
/**
* Returns an existing "long" record from the storage service.