Package com.attivio.client
Class LazyContentStoreClient
- java.lang.Object
-
- com.attivio.client.LazyContentStoreClient
-
- All Implemented Interfaces:
ContentStoreClient
,java.io.Closeable
,java.lang.AutoCloseable
public class LazyContentStoreClient extends java.lang.Object implements ContentStoreClient, java.io.Closeable
AContentStoreClient
that does not get created until one of its methods is used.
-
-
Field Summary
-
Fields inherited from interface com.attivio.sdk.client.ContentStoreClient
DEFAULT_NAMESPACE, GET_EXTERNAL_URI, OK_STORE_RESPONSE
-
-
Constructor Summary
Constructors Constructor Description LazyContentStoreClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
contains(java.lang.String id)
True if the content store has a stream for this id.void
delete(java.lang.String id)
Delete a record by id from the content store.void
deleteAll()
Delete all content in the content store.long
getTotalRecords()
Get the total number of records in the content store.ContentPointer
retrieve(java.lang.String id)
Retrieve a ContentPointer in the ContentStore.void
setNamespace(java.lang.String namespace)
Sets the namespace all ids will be stored in.ContentPointer
store(java.lang.String id, InputStreamBuilder input)
Store a ContentPointer in the ContentStore.
-
-
-
Method Detail
-
setNamespace
public void setNamespace(java.lang.String namespace)
Sets the namespace all ids will be stored in. Defaults to "content".- Specified by:
setNamespace
in interfaceContentStoreClient
-
store
public ContentPointer store(java.lang.String id, InputStreamBuilder input) throws AttivioException
Store a ContentPointer in the ContentStore.- Specified by:
store
in interfaceContentStoreClient
- Throws:
AttivioException
-
retrieve
public ContentPointer retrieve(java.lang.String id) throws AttivioException
Retrieve a ContentPointer in the ContentStore.- Specified by:
retrieve
in interfaceContentStoreClient
- Returns:
- the ContentPointer or null if
id
is not in the store. - Throws:
AttivioException
-
delete
public void delete(java.lang.String id) throws AttivioException
Delete a record by id from the content store.- Specified by:
delete
in interfaceContentStoreClient
- Throws:
AttivioException
-
deleteAll
public void deleteAll() throws AttivioException
Delete all content in the content store.- Specified by:
deleteAll
in interfaceContentStoreClient
- Throws:
AttivioException
-
getTotalRecords
public long getTotalRecords() throws AttivioException
Get the total number of records in the content store.- Specified by:
getTotalRecords
in interfaceContentStoreClient
- Throws:
AttivioException
-
contains
public boolean contains(java.lang.String id) throws AttivioException
True if the content store has a stream for this id.- Specified by:
contains
in interfaceContentStoreClient
- Throws:
AttivioException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-