public abstract class S_LibrarySessionContentStorageManager extends Object implements ContentStorageManager
An S_LibrarySessionContentStorageManager ("CSM") is created for and bound to each S_LibrarySession. CSM mediates access to the subsystem that stores, retrieves, and otherwise manages binary content. This subsystem includes:
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXTROUTERTABLE_TABLENAME
Name of the context router table.
|
protected static Long |
INDEXINGSTATE_AWAITING_EXTRACTION
The value of the INDEXINGSTATE column in ODMZ_CONTEXT_ROUTER to
indicate content ready to be extracted for indirect full-text
indexing.
|
protected static Long |
INDEXINGSTATE_COMPLETE
The value of the INDEXINGSTATE column in ODMZ_CONTEXT_ROUTER to
indicate content requiring no further processing by CMSDK with
respect to full-text indexing.
|
Modifier | Constructor and Description |
---|---|
protected |
S_LibrarySessionContentStorageManager(S_LibrarySession session)
Constructs a CSM.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
acquireByteBuffer()
Acquires a byte buffer.
|
void |
deleteFromContextRouter(Long coId)
Deletes a row from the context router table.
|
abstract 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.
|
abstract void |
destroyTextRenditions(S_ContentObject co)
Destroy all text renditions: themes, summaries, and filtered content.
|
void |
dispose()
Disposes this CSM.
|
Long |
extractContentForIndexing(Long previousContentObjectId,
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.
|
protected abstract void |
extractContentForIndexing(S_ContentObject co)
For the specified ContentObject, extracts the content and loads it into
the INDEXABLECONTENT column in the corresponding ODMZ_CONTEXT_ROUTER row.
|
abstract void |
filterContent(S_ContentObject co,
boolean plaintext)
Generate filtered content for the specified ContentObject.
|
abstract void |
generateSummary(S_ContentObject co,
String pointOfView,
long sizeAsPercent,
long sizeAsNumParagraphs,
String summaryLevel)
Generate Summary for specified ContentObject.
|
abstract 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.
|
static ContextTable[] |
getContextTables(S_LibrarySession sess)
Called by search.
|
abstract Reader |
getFilteredContent(S_ContentObject co)
Gets the filtered content for specified ContentObject.
|
abstract String |
getFullTextIndexName()
Gets the name of the full text index.
|
static String |
getIndexName() |
Date |
getLastAccessDate(Long coId)
Gets the last access date for the specified ContentObject.
|
Long |
getNewContentID()
get's a new id from the master sequence
|
protected String |
getOracleCharacterSet(String ianaCharset)
Gets the Oracle character set corresponding to specified
value of the IANA Character set, stored in the ContentObejct.CHARACTERSET attribute.
|
S_LibrarySession |
getSession()
Gets the session context.
|
abstract Reader |
getSummary(S_ContentObject co,
String pointOfView)
Gets the summary for specified ContentObject and point of view.
|
abstract ContextTheme[] |
getThemes(S_ContentObject co)
Gets the generate Themes for specified ContentObject.
|
abstract 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 (or schedules an insert of) a row in the context router table.
|
abstract void |
invalidateFilteredContent(S_ContentObject co)
Invalidates any Filtered Content that was generated for specified ContentObject.
|
abstract void |
invalidateSummaries(S_ContentObject co)
Invalidates any Summary that was generated for specified ContentObject.
|
abstract void |
invalidateThemes(S_ContentObject co)
Invalidates any Themes that have been generated for specified ContentObject.
|
abstract boolean |
isFullTextIndexingEnabled()
Gets whether full-text indexing is enabled.
|
abstract 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)
retrieveSerializedObject - retrieve serializable object in the
default "Search" 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 to other on-disk structures.
|
Long |
storeSerializedObject(Serializable obj)
storeSerializedObject - store serializable object in the
default "Search" Media instance.
|
abstract void |
syncIndex()
Sync's the index.
|
abstract 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.
|
protected void |
updateLastAccessDate(Long coId)
Updates a row in the last access date table, best efforts, inserting
the row if it does not exist.
|
S_Media |
validateMedia(S_ContentObject co,
S_LibraryObjectDefinition def)
Selects the media to use for 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
manuallyInsertIntoContextRouter
public static final String CONTEXTROUTERTABLE_TABLENAME
protected static final Long INDEXINGSTATE_AWAITING_EXTRACTION
protected static final Long INDEXINGSTATE_COMPLETE
protected S_LibrarySessionContentStorageManager(S_LibrarySession session) throws IfsException
session
- the sesion to which this CSM belongs; requiredIfsException
- if the operation failspublic S_LibrarySession getSession()
public void dispose()
dispose
in interface ContentStorageManager
public InputStream getContentStream(S_ContentObject co) throws IfsException
getContentStream
in interface ContentStorageManager
co
- the ContentObject; requiredIfsException
- if the operation failspublic Reader getContentReader(S_ContentObject co) throws IfsException
getContentReader
in interface ContentStorageManager
co
- the ContentObject; requiredIfsException
- if the operation failspublic void 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.)
validateMediaAndSetContent
in interface ContentStorageManager
co
- the ContentObject; requireddef
- the ContentObject definition; requiredIfsException
- if the operation failspublic 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.
validateMedia
in interface ContentStorageManager
co
- the ContentObject; requireddef
- the ContentObject definition; requiredIfsException
- if the operation failspublic S_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 verified that it is writable.
selectMedia
in interface ContentStorageManager
co
- the ContentObject; requireddef
- the ContentObject definition; requiredIfsException
- if the operation failspublic int getByteBufferSize() throws IfsException
acquireByteBuffer
.getByteBufferSize
in interface ContentStorageManager
IfsException
- if the operation failspublic byte[] acquireByteBuffer() throws IfsException
releaseByteBuffer
must be called to release the byte buffer
when it is no longer needed.
acquireByteBuffer
in interface ContentStorageManager
IfsException
- if the operation failspublic void releaseByteBuffer(byte[] buffer) throws IfsException
acquireByteBuffer
.releaseByteBuffer
in interface ContentStorageManager
buffer
- the bufferIfsException
- if the operation failspublic Long getNewContentID() throws IfsException
getNewContentID
in interface ContentStorageManager
IfsException
- if the operation failspublic void setContentProperties(S_LibraryObjectDefinition sdef, S_ContentObject sco) throws IfsException
setContentProperties
in interface ContentStorageManager
sdef
- definitionsco
- the existing ContentObjectIfsException
- if the operation failspublic S_RandomAccessorImpl getContentByRandomAccess(S_Document doc, S_ContentObject co) throws IfsException
getContentByRandomAccess
in interface ContentStorageManager
doc
- the documentco
- the ContentObject of the documentIfsException
- if the operation failspublic S_RandomAccessorImpl updateContentByRandomAccess(S_Document doc, S_ContentObject co, S_LibraryObjectDefinition sdocdef, Long expirationPeriod) throws IfsException
updateContentByRandomAccess
in interface ContentStorageManager
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 failspublic void registerRandomAccessor(S_RandomAccessorImpl ra) throws IfsException
registerRandomAccessor
in interface ContentStorageManager
ra
- the random acccessorIfsException
- if the operation failspublic void unregisterRandomAccessor(S_RandomAccessorImpl ra) throws IfsException
unregisterRandomAccessor
in interface ContentStorageManager
ra
- the random accessorIfsException
- if the operation failspublic void destroyContent(S_Media media, Long cid, Long coId, S_LibraryObjectDefinition sdef) throws IfsException
destroyContent
in interface ContentStorageManager
media
- the mediacid
- the content idcoId
- the ContentObject idsdef
- the ContentObject definitionIfsException
- if the operation failspublic void verifyCanDestroyContent(S_Media media, Long cid) throws IfsException
ContentStorageManager
verifyCanDestroyContent
in interface ContentStorageManager
media
- the Media to checkcid
- the content IDIfsException
- if the operation failspublic Long storeSerializedObject(Serializable obj) throws IfsException
storeSerializedObject
in interface ContentStorageManager
obj
- the object to storeif
- operation failsIfsException
- if the operation failspublic Serializable retrieveSerializedObject(Long contentRef) throws IfsException
retrieveSerializedObject
in interface ContentStorageManager
contentRef
- the content referenceif
- operation failsIfsException
- if the operation failspublic abstract void registerBfile(Object bfile) throws IfsException
registerBfile
in interface ContentStorageManager
bfile
- the BFILEIfsException
- if the operation failspublic abstract void unregisterBfile(Object bfile) throws IfsException
unregisterBfile
in interface ContentStorageManager
bfile
- the BFILEIfsException
- if the operation failsprotected void updateLastAccessDate(Long coId) throws IfsException
coId
- the ContentObject id; requiredIfsException
- if the operation failspublic Date getLastAccessDate(Long coId) throws IfsException
getLastAccessDate
in interface ContentStorageManager
coId
- the ContentObject id; requiredIfsException
- if the operation failspublic abstract boolean 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.
isFullTextIndexingEnabled
in interface ContentStorageManager
IfsException
- if the operation failspublic abstract String getFullTextIndexName()
getFullTextIndexName
in interface ContentStorageManager
public static String getIndexName()
public static ContextTable[] getContextTables(S_LibrarySession sess) throws IfsException
IfsException
public abstract void syncIndex() throws IfsException
syncIndex
in interface ContentStorageManager
IfsException
- if the operation failspublic abstract void 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
insertIntoContextRouter
in interface ContentStorageManager
coId
- the ContentObject id; requiredcoClassId
- the ContentObject class id; requiredcid
- the content id; requiredmedia
- the Media where the content is stored; requiredcontentSize
- the content size; requiredcve
- the ContentVaultEntry (can be null)oracleCharacterSet
- 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 failspublic void deleteFromContextRouter(Long coId) throws IfsException
deleteFromContextRouter
in interface ContentStorageManager
coId
- the ContentObject id; requiredIfsException
- if the operation failspublic Long extractContentForIndexing(Long previousContentObjectId, 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.
extractContentForIndexing
in interface ContentStorageManager
previousContentObjectId
- 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 failsprotected abstract void extractContentForIndexing(S_ContentObject co) throws IfsException
co
- the ContentObjectIfsException
- if the operation failspublic abstract void generateThemes(S_ContentObject co, boolean fullThemes) throws IfsException
generateThemes
in interface ContentStorageManager
co
- the ContentObjectfullThemes
- whether full themes are desiredIfsException
- if the operation failspublic abstract ContextTheme[] getThemes(S_ContentObject co) throws IfsException
getThemes
in interface ContentStorageManager
co
- the ContentObjectIfsException
- if the operation failspublic abstract void invalidateThemes(S_ContentObject co) throws IfsException
invalidateThemes
in interface ContentStorageManager
co
- the ContentObjectIfsException
- if the operation failspublic abstract void generateSummary(S_ContentObject co, String pointOfView, long sizeAsPercent, long sizeAsNumParagraphs, String summaryLevel) throws IfsException
generateSummary
in interface ContentStorageManager
co
- the ContentObjectpointOfView
- the point Of viewsizeAsPercent
- the size As PercentsizeAsNumParagraphs
- the size As number of paragraphssummaryLevel
- the summary levelIfsException
- if the operation failspublic abstract Reader getSummary(S_ContentObject co, String pointOfView) throws IfsException
getSummary
in interface ContentStorageManager
co
- the ContentObjectpointOfView
- the point Of viewIfsException
- if the operation failspublic abstract void invalidateSummaries(S_ContentObject co) throws IfsException
invalidateSummaries
in interface ContentStorageManager
co
- the ContentObjectIfsException
- if the operation failspublic abstract void filterContent(S_ContentObject co, boolean plaintext) throws IfsException
filterContent
in interface ContentStorageManager
co
- the ContentObjectplaintext
- whether to use plain textIfsException
- if the operation failspublic abstract Reader getFilteredContent(S_ContentObject co) throws IfsException
getFilteredContent
in interface ContentStorageManager
co
- the ContentObjectIfsException
- if the operation failspublic abstract void invalidateFilteredContent(S_ContentObject co) throws IfsException
invalidateFilteredContent
in interface ContentStorageManager
co
- the ContentObjectIfsException
- if the operation failspublic abstract void destroyTextRenditions(S_ContentObject co) throws IfsException
destroyTextRenditions
in interface ContentStorageManager
co
- the ContentObjectIfsException
- if the operation failspublic abstract int deleteOldFilteredContent(S_LibrarySession session, long age) throws IfsException
deleteOldFilteredContent
in interface ContentStorageManager
session
- the S_LibrarySessionage
- the number of seconds that constitutes
an "old" entryIfsException
- if the operation failspublic String 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.
resolveCharacterSet
in interface ContentStorageManager
def
- the ContentObject definitionIfsException
- if the operation failsprotected String getOracleCharacterSet(String ianaCharset)
The CHARACTERSET attribute of a ContentObject, if set, should be either an IANA charset (preferred) or the canonical name or alias of a Java charset. In contrast, the CHARACTERSET column of the odmz_context_router table must be an Oracle character set.
ianaCharset
- the IANA character setCopyright © 2023. All rights reserved.