Package com.attivio.sdk.api
Interface ContentStoreProvider
-
- All Known Implementing Classes:
MockContentStoreProvider
public interface ContentStoreProvider
TheContentStoreProvider
provides access to AIE's content store. Content is stored within namespaces, each identified by a unique String. Content may be any series of bytes and is identified by a String id unique within the namespace. The result of simultaneous operations (method calls) that change the state of the content (add, delete, deleteAll) is undefined.The
DEFAULT_NAMESPACE
is optimized for storage of temporary files. Storage of non-ephemeral content should use a custom namespace.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_NAMESPACE
static java.lang.String
description
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(java.lang.String namespace, java.lang.String id, java.io.InputStream in)
Content will be copied from the InputStream and stored within thenamespace
under theid
.boolean
contains(java.lang.String namespace, java.lang.String id)
void
delete(java.lang.String namespace, java.lang.String id)
Deletesid
from thenamespace
.void
deleteAll(java.lang.String namespace)
Deletes all content from the store within the namespacejava.lang.String
externalize(java.lang.String storeName, java.lang.String id)
Returns an externally accessible URI for the content suitable for HTTP GET.java.io.InputStream
get(java.lang.String namespace, java.lang.String id)
Returns an InputStream to access the content.long
getDiskUtilization()
long
getLastModified(java.lang.String namespace, java.lang.String id)
java.util.List<java.lang.String>
getNamespaces()
long
getSize(java.lang.String namespace, java.lang.String id)
long
getTotalRecords(java.lang.String namespace)
-
-
-
Field Detail
-
description
static final java.lang.String description
- See Also:
- Constant Field Values
-
DEFAULT_NAMESPACE
static final java.lang.String DEFAULT_NAMESPACE
- See Also:
- Constant Field Values
-
-
Method Detail
-
contains
boolean contains(java.lang.String namespace, java.lang.String id) throws AttivioException
- Parameters:
namespace
- the namespace for the contentid
- the id of the content- Returns:
- true if
id
exists within thenamespace
- Throws:
AttivioException
-
add
void add(java.lang.String namespace, java.lang.String id, java.io.InputStream in) throws AttivioException
Content will be copied from the InputStream and stored within thenamespace
under theid
. If the content currently exists, it will be replaced. The stream is not closed.- Parameters:
namespace
- the namespace for the contentid
- the id of the contentin
- stream containing the content.- Throws:
AttivioException
-
delete
void delete(java.lang.String namespace, java.lang.String id) throws AttivioException
Deletesid
from thenamespace
. The content need not be present.- Parameters:
namespace
- the namespace for the contentid
- the id of the content- Throws:
AttivioException
-
deleteAll
void deleteAll(java.lang.String namespace) throws AttivioException
Deletes all content from the store within the namespace- Parameters:
namespace
- the namespace to delete- Throws:
AttivioException
-
getTotalRecords
long getTotalRecords(java.lang.String namespace) throws AttivioException
- Parameters:
namespace
- the namespace to query- Returns:
- the number of unique content records associated with the namespace.
- Throws:
AttivioException
-
getDiskUtilization
long getDiskUtilization() throws AttivioException
- Returns:
- the disk space consumed by content store entries
- Throws:
AttivioException
-
getNamespaces
java.util.List<java.lang.String> getNamespaces() throws AttivioException
- Returns:
- list of all namespaces in the content store
- Throws:
AttivioException
-
get
java.io.InputStream get(java.lang.String namespace, java.lang.String id) throws AttivioException
Returns an InputStream to access the content.- Parameters:
namespace
- the namespace for the contentid
- the id of the content- Returns:
- an InputStream for the content or
null
if it does not exist - Throws:
AttivioException
-
getSize
long getSize(java.lang.String namespace, java.lang.String id) throws AttivioException
- Parameters:
namespace
- the namespace for the contentid
- the id of the content- Returns:
- the number of bytes the InputStream returned by
get(String, String)
should provide. - Throws:
AttivioException
-
getLastModified
long getLastModified(java.lang.String namespace, java.lang.String id) throws AttivioException
- Parameters:
namespace
- the namespace for the contentid
- the id of the content- Returns:
- the time of the last
add(String, String, InputStream)
for the content. - Throws:
AttivioException
-
externalize
java.lang.String externalize(java.lang.String storeName, java.lang.String id) throws AttivioException
Returns an externally accessible URI for the content suitable for HTTP GET.- Parameters:
storeName
- namespace for the contentid
- id for the content- Returns:
- URI as a string
- Throws:
AttivioException
-
-