public interface ContentStorageManager
CSM mediates access to the subsystem that stores, retrieves, and otherwise manages binary content. This subsystem includes:
Modifier and Type | Method and Description |
---|---|
byte[] |
acquireByteBuffer()
Acquires a byte buffer.
|
void |
deleteFromContextRouter(Long coId)
Deletes a row from the context router table.
|
int |
deleteOldFilteredContent(S_LibrarySession session,
long age)
Delete old filtered content entries.
|
void |
destroyContent(S_Media media,
Long cid,
Long coId,
S_LibraryObjectDefinition sdef)
Destroys the content, if any, for the specified ContentObject.
|
void |
destroyTextRenditions(S_ContentObject co)
Destroy all text renditions: themes, summaries, and filtered content.
|
void |
dispose()
Disposes this CSM.
|
Long |
extractContentForIndexing(Long prevContentObjectId,
int batchSize)
Called by the ContentAgent, identifies rows in ODMZ_CONTEXT_ROUTER whose
content is ready for indirect full-text indexing, and for each such row,
sets the INDEXABLECONTENT BLOB column to the content.
|
void |
filterContent(S_ContentObject co,
boolean plaintext)
Generate filtered content for the specified ContentObject.
|
void |
generateSummary(S_ContentObject co,
String pointOfView,
long sizeAsPercent,
long sizeAsNumParagraphs,
String summaryLevel)
Generate Summary for specified ContentObject.
|
void |
generateThemes(S_ContentObject co,
boolean fullThemes)
Generate Themes for specified ContentObject.
|
int |
getByteBufferSize()
Estimates the size, in bytes, of a buffer that would be returned by
acquireByteBuffer . |
S_RandomAccessorImpl |
getContentByRandomAccess(S_Document doc,
S_ContentObject co)
Gets a RandomAccessor for randomly reading the content of the specified
document.
|
Reader |
getContentReader(S_ContentObject co)
Gets the content of the specified ContentObject as a Reader.
|
InputStream |
getContentStream(S_ContentObject co)
Gets the content of the specified ContentObject as an InputStream.
|
Reader |
getFilteredContent(S_ContentObject co)
Gets the filtered content for specified ContentObject.
|
String |
getFullTextIndexName()
Gets the name of the full text index.
|
Date |
getLastAccessDate(Long coId)
Gets the last access date for the specified ContentObject.
|
Long |
getNewContentID()
Gets a new ID to use for created new content.
|
Reader |
getSummary(S_ContentObject co,
String pointOfView)
Gets the summary for specified ContentObject and point of view.
|
ContextTheme[] |
getThemes(S_ContentObject co)
Gets the generate Themes for specified ContentObject.
|
void |
insertIntoContextRouter(Long coId,
Long coClassId,
Long cid,
S_Media media,
S_ContentVaultEntry cve,
long contentSize,
String oracleCharacterSet,
String oracleLanguage,
boolean text,
boolean indirectFullTextIndexing)
Inserts a row in the context router table.
|
void |
invalidateFilteredContent(S_ContentObject co)
Invalidates any Filtered Content that was generated for specified ContentObject.
|
void |
invalidateSummaries(S_ContentObject co)
Invalidates any Summary that was generated for specified ContentObject.
|
void |
invalidateThemes(S_ContentObject co)
Invalidates any Themes that have been generated for specified ContentObject.
|
boolean |
isFullTextIndexingEnabled()
Gets whether full-text indexing is enabled.
|
void |
manuallyInsertIntoContextRouter(S_ContentObject co,
Reader reader)
Insert of a row in the context router table for the
case of manual text indexing.
|
void |
registerBfile(Object bfile)
Binds the specified BFILE to this session.
|
void |
registerRandomAccessor(S_RandomAccessorImpl ra)
Binds the specified RandomAccessor to this session.
|
void |
releaseByteBuffer(byte[] buffer)
Releases a byte buffer previously acquired by
acquireByteBuffer . |
String |
resolveCharacterSet(S_LibraryObjectDefinition def)
Gets the CHARACTERSET attribute of the specified ContentObject definition,
setting a default CHARACTERSET attribute if one isn't set.
|
Serializable |
retrieveSerializedObject(Long contentRef)
Retrieve serializable object from the default Media instance.
|
S_Media |
selectMedia(S_ContentObject co,
S_LibraryObjectDefinition def)
Selects the media to use for the specified ContentObject.
|
void |
setContentProperties(S_LibraryObjectDefinition sdef,
S_ContentObject sco)
Cascades updates to a ContentObject, defined in the specified definition,
to other data structures.
|
Long |
storeSerializedObject(Serializable obj)
Store serializable object in the default Media instance.
|
void |
syncIndex()
Synchronize the full text index.
|
void |
unregisterBfile(Object bfile)
Unbinds the specified BFILE from this session.
|
void |
unregisterRandomAccessor(S_RandomAccessorImpl ra)
Unbinds the specified RandomAccessor from this session.
|
S_RandomAccessorImpl |
updateContentByRandomAccess(S_Document doc,
S_ContentObject co,
S_LibraryObjectDefinition sdocdef,
Long expirationPeriod)
Gets a RandomAccessor for randomly writing and reading the content of
the specified document.
|
S_Media |
validateMedia(S_ContentObject co,
S_LibraryObjectDefinition def)
Sets the content of the specified ContentObject.
|
void |
validateMediaAndSetContent(S_ContentObject co,
S_LibraryObjectDefinition def)
Sets the content of the specified ContentObject.
|
void |
verifyCanDestroyContent(S_Media media,
Long cid)
Verify that content can be destroyed for the specified Media.
|
void dispose()
S_Media validateMedia(S_ContentObject co, S_LibraryObjectDefinition def) throws IfsException
If media is specified in the definition, it is validated. Otherwise a media is chosen by default and set in the definition.
co
- the ContentObject; requireddef
- the ContentObject definition; requiredIfsException
- if the operation failsS_Media selectMedia(S_ContentObject co, S_LibraryObjectDefinition def) throws IfsException
If media is specified in the definition, it is validated. Otherwise a media is chosen by default and set in the definition.
co
- the ContentObject; requireddef
- the ContentObject definition; requiredIfsException
- if the operation failsvoid validateMediaAndSetContent(S_ContentObject co, S_LibraryObjectDefinition def) throws IfsException
The ContentObject may be existing or new. An existing ContentObject must
not already have content (or destroyContent
must be called
prior to this method.)
co
- the ContentObject; requireddef
- the ContentObject definition; requiredIfsException
- if the operation failsString resolveCharacterSet(S_LibraryObjectDefinition def) throws IfsException
The CHARACTERSET attribute, if set, should be a valid IANA charset (preferred) or the canonical name or alias of a valid Java charset. (In general, Java charset names follow the IANA charset conventions.) Although the CHARACTERSET attribute is not validated, some CMSDK operations (such as getting content as a Reader) will succeed only if the CHARACTERSET is a valid Java charset.
If the specified definition has the CHARACTERSET attribute set (including set to null), then that CHARACTERSET is returned. Otherwise, gets the default character set from the session's Localizer, sets the definition's CHARACTERSET attribute to that value, and also returns that value.
This method is called only if either the definition's FORMAT attribute has a BINARY value of false or content is set by Reader. In all other cases, no default CHARACTERSET is set on a ContentObject.
def
- the ContentObject definitionIfsException
- if the operation failsInputStream getContentStream(S_ContentObject co) throws IfsException
co
- the ContentObject; requiredIfsException
- if the operation failsReader getContentReader(S_ContentObject co) throws IfsException
co
- the ContentObject; requiredIfsException
- if the operation failsvoid setContentProperties(S_LibraryObjectDefinition sdef, S_ContentObject sco) throws IfsException
sdef
- definition containing the uppdatessco
- the existing ContentObject being updatedIfsException
- if the operation failsDate getLastAccessDate(Long coId) throws IfsException
coId
- the ContentObject id; requiredIfsException
- if the operation failsvoid destroyContent(S_Media media, Long cid, Long coId, S_LibraryObjectDefinition sdef) throws IfsException
media
- the mediacid
- the content idcoId
- the ContentObject idsdef
- the ContentObject definitionIfsException
- if the operation failsboolean isFullTextIndexingEnabled() throws IfsException
Each invocation of this method queries the database.
S_LibrarySession.isFullTextIndexingEnabled()
caches the value
returned by this method, and should almost always be used instead of
this method.
IfsException
- if the operation failsString getFullTextIndexName()
void syncIndex() throws IfsException
IfsException
- if the operation failsvoid insertIntoContextRouter(Long coId, Long coClassId, Long cid, S_Media media, S_ContentVaultEntry cve, long contentSize, String oracleCharacterSet, String oracleLanguage, boolean text, boolean indirectFullTextIndexing) throws IfsException
coId
- the ContentObject id; requiredcoClassId
- the ContentObject class id; requiredcid
- the content id; requiredmedia
- the Media where the content is stored; requiredcve
- the ContentVaultEntry (can be null)contentSize
- the content size; requiredoracleCharacterSet
- the Oracle character set codeoracleLanguage
- the Oracle language codetext
- whether the context is a text formatindirectFullTextIndexing
- whether to perform indirect full-text
indexingIfsException
- if the operation failsvoid manuallyInsertIntoContextRouter(S_ContentObject co, Reader reader) throws IfsException
Unlike Oracle, Postgres uses a different Full text search insert mode known as "manual text indexing". This is driven by an agent.
co
- the ContentObject; requiredreader
- the manually obtained text reader to be indexedIfsException
- if the operation failsvoid deleteFromContextRouter(Long coId) throws IfsException
coId
- the ContentObject id; requiredIfsException
- if the operation failsLong extractContentForIndexing(Long prevContentObjectId, int batchSize) throws IfsException
To avoid long-running transactions, this method is repeatedly called to
extract content in batches. Only rows in ODMZ_CONTEXT_ROUTER whose id
is greater than previousContentObjectId
are considered.
Each invocation processes no more than batchSize
rows in
ODMZ_CONTEXT_ROUTER.
prevContentObjectId
- the id of the last ODMZ_CONTEXT_ROUTER
row processed in the previous batch, or
null if this is the first batchbatchSize
- the maximum number of rows to process in
this batchIfsException
- 32385: if the operation failsvoid generateThemes(S_ContentObject co, boolean fullThemes) throws IfsException
co
- the ContentObjectfullThemes
- whether full themes are desiredIfsException
- if the operation failsContextTheme[] getThemes(S_ContentObject co) throws IfsException
co
- the ContentObjectIfsException
- if the operation failsvoid invalidateThemes(S_ContentObject co) throws IfsException
co
- the ContentObjectIfsException
- if the operation failsvoid generateSummary(S_ContentObject co, String pointOfView, long sizeAsPercent, long sizeAsNumParagraphs, String summaryLevel) throws IfsException
co
- the ContentObjectpointOfView
- the point Of viewsizeAsPercent
- the size As PercentsizeAsNumParagraphs
- the size As number of paragraphssummaryLevel
- the summary levelIfsException
- if the operation failsReader getSummary(S_ContentObject co, String pointOfView) throws IfsException
co
- the ContentObjectpointOfView
- the point Of viewIfsException
- if the operation failsvoid invalidateSummaries(S_ContentObject co) throws IfsException
co
- the ContentObjectIfsException
- if the operation failsvoid filterContent(S_ContentObject co, boolean plaintext) throws IfsException
co
- the ContentObjectplaintext
- whether to use plain textIfsException
- if the operation failsReader getFilteredContent(S_ContentObject co) throws IfsException
co
- the ContentObjectIfsException
- if the operation failsvoid invalidateFilteredContent(S_ContentObject co) throws IfsException
co
- the ContentObjectIfsException
- if the operation failsint deleteOldFilteredContent(S_LibrarySession session, long age) throws IfsException
session
- the S_LibrarySessionage
- the number of seconds that constitutes
an "old" entryIfsException
- if the operation failsvoid destroyTextRenditions(S_ContentObject co) throws IfsException
co
- the ContentObjectIfsException
- if the operation failsvoid registerBfile(Object bfile) throws IfsException
bfile
- the BFILEIfsException
- if the operation failsvoid unregisterBfile(Object bfile) throws IfsException
bfile
- the BFILEIfsException
- if the operation failsS_RandomAccessorImpl getContentByRandomAccess(S_Document doc, S_ContentObject co) throws IfsException
doc
- the documentco
- the ContentObject of the documentIfsException
- if the operation failsS_RandomAccessorImpl updateContentByRandomAccess(S_Document doc, S_ContentObject co, S_LibraryObjectDefinition sdocdef, Long expirationPeriod) throws IfsException
doc
- the documentco
- the ContentObject of the documentsdocdef
- a DocumentDefinition, as a
S_LibraryObjectDefinitionexpirationPeriod
- the expiration period for the RandomAccessor,
in seconds, or null for the default expiration
periodIfsException
- if the operation failsvoid registerRandomAccessor(S_RandomAccessorImpl ra) throws IfsException
ra
- the random acccessorIfsException
- if the operation failsvoid unregisterRandomAccessor(S_RandomAccessorImpl ra) throws IfsException
ra
- the random accessorIfsException
- if the operation failsLong getNewContentID() throws IfsException
IfsException
- if the operation failsLong storeSerializedObject(Serializable obj) throws IfsException
obj
- the object to storeIfsException
- if the operation failsSerializable retrieveSerializedObject(Long contentRef) throws IfsException
contentRef
- the ID that identifies the newly stored objectIfsException
- if the operation failsvoid verifyCanDestroyContent(S_Media media, Long cid) throws IfsException
media
- the Media to checkcid
- the content IDIfsException
- if the operation failsint getByteBufferSize() throws IfsException
acquireByteBuffer
.IfsException
- if the operation failsbyte[] acquireByteBuffer() throws IfsException
releaseByteBuffer
must be called to release the byte buffer
when it is no longer needed.
IfsException
- if the operation failsvoid releaseByteBuffer(byte[] buffer) throws IfsException
acquireByteBuffer
.buffer
- the bufferIfsException
- if the operation failsCopyright © 2023. All rights reserved.