Package com.attivio.sdk.api
Interface ContentStoreProvider
-
- All Known Implementing Classes:
MockContentStoreProvider
public interface ContentStoreProviderTheContentStoreProviderprovides 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_NAMESPACEis 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.StringDEFAULT_NAMESPACEstatic java.lang.Stringdescription
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(java.lang.String namespace, java.lang.String id, java.io.InputStream in)Content will be copied from the InputStream and stored within thenamespaceunder theid.booleancontains(java.lang.String namespace, java.lang.String id)voiddelete(java.lang.String namespace, java.lang.String id)Deletesidfrom thenamespace.voiddeleteAll(java.lang.String namespace)Deletes all content from the store within the namespacejava.lang.Stringexternalize(java.lang.String storeName, java.lang.String id)Returns an externally accessible URI for the content suitable for HTTP GET.java.io.InputStreamget(java.lang.String namespace, java.lang.String id)Returns an InputStream to access the content.longgetDiskUtilization()longgetLastModified(java.lang.String namespace, java.lang.String id)java.util.List<java.lang.String>getNamespaces()longgetSize(java.lang.String namespace, java.lang.String id)longgetTotalRecords(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
idexists within thenamespace - Throws:
AttivioException
-
add
void add(java.lang.String namespace, java.lang.String id, java.io.InputStream in) throws AttivioExceptionContent will be copied from the InputStream and stored within thenamespaceunder 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 AttivioExceptionDeletesidfrom 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 AttivioExceptionDeletes 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 AttivioExceptionReturns 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
nullif 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 AttivioExceptionReturns 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
-
-