public abstract class S_Media extends S_TieSystemObject
S_LibraryObject.MapInfo
Modifier and Type | Field and Description |
---|---|
protected static String |
CONTENTTABLE_EXPIRATIONDATE_COLUMN
Name of the EXPIRATIONDATE column in the content table.
|
protected static String |
CONTENTTABLE_MEDIAID_COLUMN
Name of the MEDIAID column in the content table.
|
protected static String |
CONTENTTABLE_PARTITIONVALUE_COLUMN
Name of the PARTITIONVALUE column in the content table.
|
static String |
CONTENTTABLE_TABLENAME_PREFIX
The prefix applied to the TABLENAME attribute of Media to form the name
of the content table.
|
CASCADE_OP_COPY_PUBLICOBJECT_TO_CATEGORY, CASCADE_OP_COPY_PUBLICOBJECT_TO_RIGHT_RELATIONSHIP, CASCADE_OP_DELETE_FAMILY_TO_VERSIONSERIES, CASCADE_OP_DELETE_PUBLICOBJECT_TO_LEFT_RELATIONSHIP, CASCADE_OP_DELETE_PUBLICOBJECT_TO_RIGHT_RELATIONSHIP, CASCADE_OP_DELETE_PUBLICOBJECT_TO_VERSIONDESCRIPTION, CASCADE_OP_DELETE_RELATIONSHIP_TO_LEFT_PUBLICOBJECT, CASCADE_OP_DELETE_RELATIONSHIP_TO_RIGHT_PUBLICOBJECT, CASCADE_OP_DELETE_VERSIONDESCRIPTION_TO_PUBLICOBJECT, CASCADE_OP_DELETE_VERSIONDESCRIPTION_TO_VERSIONSERIES, CASCADE_OP_DELETE_VERSIONSERIES_TO_FAMILY, CASCADE_OP_DELETE_VERSIONSERIES_TO_VERSIONDESCRIPTION, CASCADE_OP_FREE_CATEGORY_TO_PUBLICOBJECT, CASCADE_OP_FREE_CATEGORY_TO_SCHEMAOBJECT, CASCADE_OP_FREE_CATEGORY_TO_SYSTEMOBJECT, CASCADE_OP_FREE_FAMILY_TO_VERSIONSERIES, CASCADE_OP_FREE_PUBLICOBJECT_TO_CATEGORY, CASCADE_OP_FREE_PUBLICOBJECT_TO_LEFT_RELATIONSHIP, CASCADE_OP_FREE_PUBLICOBJECT_TO_RIGHT_RELATIONSHIP, CASCADE_OP_FREE_PUBLICOBJECT_TO_VERSIONDESCRIPTION, CASCADE_OP_FREE_RELATIONSHIP_TO_LEFT_PUBLICOBJECT, CASCADE_OP_FREE_RELATIONSHIP_TO_RIGHT_PUBLICOBJECT, CASCADE_OP_FREE_SCHEMAOBJECT_TO_CATEGORY, CASCADE_OP_FREE_SYSTEMOBJECT_TO_CATEGORY, CASCADE_OP_FREE_VERSIONDESCRIPTION_TO_PUBLICOBJECT, CASCADE_OP_FREE_VERSIONDESCRIPTION_TO_VERSIONSERIES, CASCADE_OP_FREE_VERSIONSERIES_TO_FAMILY, CASCADE_OP_FREE_VERSIONSERIES_TO_VERSIONDESCRIPTION, CASCADE_OP_UNDEFINED, CASCADE_OP_UNDELETE_FAMILY_TO_VERSIONSERIES, CASCADE_OP_UNDELETE_PUBLICOBJECT_TO_LEFT_RELATIONSHIP, CASCADE_OP_UNDELETE_PUBLICOBJECT_TO_RIGHT_RELATIONSHIP, CASCADE_OP_UNDELETE_PUBLICOBJECT_TO_VERSIONDESCRIPTION, CASCADE_OP_UNDELETE_RELATIONSHIP_TO_LEFT_PUBLICOBJECT, CASCADE_OP_UNDELETE_RELATIONSHIP_TO_RIGHT_PUBLICOBJECT, CASCADE_OP_UNDELETE_VERSIONDESCRIPTION_TO_PUBLICOBJECT, CASCADE_OP_UNDELETE_VERSIONDESCRIPTION_TO_VERSIONSERIES, CASCADE_OP_UNDELETE_VERSIONSERIES_TO_FAMILY, CASCADE_OP_UNDELETE_VERSIONSERIES_TO_VERSIONDESCRIPTION, CASCADE_OP_UPDATE_CATEGORY_TO_PUBLICOBJECT, CASCADE_OP_UPDATE_CATEGORY_TO_SCHEMAOBJECT, CASCADE_OP_UPDATE_CATEGORY_TO_SYSTEMOBJECT, CASCADE_OP_UPDATE_PUBLICOBJECT_TO_CATEGORY, CASCADE_OP_UPDATE_SCHEMAOBJECT_TO_CATEGORY, CASCADE_OP_UPDATE_SYSTEMOBJECT_TO_CATEGORY, DEFAULT_RENDERER, m_ClassId, m_Id, m_Session
Modifier | Constructor and Description |
---|---|
protected |
S_Media(S_LibrarySession session,
Long classId)
Constructs an S_Media for the case where the object has not
been created in the database yet.
|
protected |
S_Media(S_LibrarySession session,
S_LibraryObjectData data)
Constructs an S_Media.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
acquireContentTableLock(Long cid)
Acquires a row-level lock on the row in the content table with the
specified content id.
|
protected void |
copyContent(S_Media srcMedia,
Long srcCid,
Long dstCid,
Long partitionValue,
AttributeValue[] mediaOptions)
Stores a copy of existing content as the content for the specified
content id.
|
protected abstract void |
destroyContent(Long cid,
AttributeValue[] mediaOptions)
Destroys the content with the specified content id.
|
protected Long |
destroyExpiredContent(long expirationDate,
Long previousCid,
int batchSize)
Destroys expired content in this Media.
|
Serializable |
DYNDestroyExpiredContent(Serializable payload)
DYN wrapper for
destroyExpiredContent . |
protected void |
ensureContentTableExists(Connection auxconn,
S_LibraryObjectDefinition sdef)
Checks if the content table already exists, and if not, creates it.
|
protected void |
extendedPostInsert(OperationState opState,
S_LibraryObjectDefinition sdef)
Operations to be performed after creating an object.
|
protected void |
extendedPreFree(OperationState opState,
S_LibraryObjectDefinition sdef)
Operations to be performed before freeing
an object.
|
protected void |
extendedPreInsert(OperationState opState,
S_LibraryObjectDefinition sdef)
Performs pre-insert actions.
|
String |
getColumnName()
Gets the value of the COLUMNNAME attribute.
|
protected abstract InputStream |
getContent(Long cid)
Gets the content stream for the specified content id.
|
String |
getContentIndexProcedure()
Gets the name of the stored procedure called by Oracle Text to retrieve
content, or null for indirect full-text indexing.
|
protected abstract long |
getContentSize(Long cid)
Gets the size of the content stream for the specified content id.
|
String |
getContentTableName()
Gets the name of the content table.
|
protected Long |
getPartitionValue(Long cid)
Gets the value of the content table PARTITIONVALUE column for the
specified content id.
|
protected abstract RandomAccessDriver |
getRandomAccessDriver(Long cid)
Gets a RandomAccessDriver for the specified content id.
|
String |
getTableName()
Gets the value of the TABLENAME attribute.
|
boolean |
isReadOnly()
Gets the value of the READONLY attribute.
|
protected abstract void |
setContent(Long cid,
InputStream is,
Long partitionValue,
AttributeValue[] mediaOptions)
Stores content read from the specified InputStream using the specified
content id.
|
protected abstract void |
setContentReference(Long cid,
String contentReference,
Long partitionValue,
AttributeValue[] mediaOptions)
Stores content determined from a specified content reference for the
specified content id.
|
protected void |
setEmptyContent(Long cid,
Long partitionValue,
AttributeValue[] mediaOptions)
Stores zero-length content for the specified content id.
|
protected void |
setExpirationDate(Long cid,
Long expirationDate)
Updates the content table EXPIRATIONDATE column for the specified
content id.
|
protected void |
setPartitionValue(Long cid,
Long partitionValue)
Updates the content table PARTITIONVALUE column for the specified
content id.
|
addCategory, cascadeFree, createCategories, deriveDefinition, extendedPostUpdate, extendedPreUpdate, getCategories, getCategories, getCategories, handleCascade, removeCategories, updateCategories, verifyCanCreate, verifyCanFree, verifyCanUpdate
added, applyValueDefault, associatedPostFree, associatedPostInsert, associatedPreInsert, canPurge, cascadeCopy, cascadeUpdate, checkRequiredForInsert, checkSettable, clearArrayTypeAttributeValues, clearMapTypeAttributeValues, clonePublicObjectAttribute, constructIdArray, constructIdArray, copy, copy, copyVectorToLibraryObjectArray, createDefaultPolicyPropertyBundle, createDefaultPropertyBundle, createDefaultPropertyBundle, createInstance, deleteRows, deriveOwnerUniqueName, deriveOwnerUniqueName, deriveUppercasedAttribute, determineClassDomain, determinePolicy, determinePolicy, determineValueDefault, determineValueDomain, dispose, DYNInvalidateState, DYNLockRows, equals, equals, executePolicyOperation, extendedPostFree, extendedPreCopy, findPolicyFromPropertyBundleAv, free, free, getAttribute, getAttributeByUpperCaseName, getAuditCertificateName, getAuditDomainContext, getAuditEventFolderContext, getClassData, getClassId, getClassName, getClassObject, getContentStorageManager, getData, getDefinition, getEffectivePolicyActionContexts, getEffectivePolicyListElements, getEventualAttributeByUpperCaseName, getId, getLibraryConnection, getName, getObjectReferenceAttribute, getPropertyBundle, getPropertyValue, getResourceString, getResourceString, getService, getSession, getSessionInterface, getTraceLogger, handleEvent, hashCode, hasNameAttribute, insertReferenceAttributes, insertRow, insertRows, invalidateState, invokeOperation, invokePolicyMethod, isAuditCertificateSecured, isBroadcastCreateEventEnabled, isInstanceOf, isPersistent, issueCascade, isTraced, lockRows, postEvent, postEvent, postFree, postInsert, postUpdate, preFree, preInsert, preUpdate, privilegedUpdate, removed, renderAsReader, renderAsStream, setAttribute, setAttribute, setAttributes, toString, trace, update, updateRows, validateStringArray, verifyCanGetContent, verifyCanSetContent, verifyCanSetPolicy, verifyPersistent, verifyWriteableTransactionInProgress
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAttributeByUpperCaseName, getClassId, getId, getSessionInterface
getTraceLogger, isTraced, trace
public static final String CONTENTTABLE_TABLENAME_PREFIX
protected static final String CONTENTTABLE_MEDIAID_COLUMN
protected static final String CONTENTTABLE_PARTITIONVALUE_COLUMN
protected static final String CONTENTTABLE_EXPIRATIONDATE_COLUMN
protected S_Media(S_LibrarySession session, S_LibraryObjectData data) throws IfsException
session
- the session contextdata
- the data componentIfsException
- if the operation failsprotected S_Media(S_LibrarySession session, Long classId) throws IfsException
session
- the session contextclassId
- the id of the classIfsException
- if the operation failsprotected void extendedPreInsert(OperationState opState, S_LibraryObjectDefinition sdef) throws IfsException
extendedPreInsert
in class S_SystemObject
opState
- current operation statesdef
- the definition for the insert operationIfsException
- if the operation failsprotected void extendedPostInsert(OperationState opState, S_LibraryObjectDefinition sdef) throws IfsException
This is overridden by classes that need to perform operations after successfully creating the rows for the new instance.
extendedPostInsert
in class S_SystemObject
opState
- current operation statesdef
- object definitionIfsException
- if operation fails.protected void ensureContentTableExists(Connection auxconn, S_LibraryObjectDefinition sdef) throws IfsException
auxconn
- an auxiliary connection; requiredsdef
- the definition; requiredIfsException
- if the operation failsprotected void extendedPreFree(OperationState opState, S_LibraryObjectDefinition sdef) throws IfsException
extendedPreFree
in class S_LibraryObject
opState
- current operation statesdef
- object definitionIfsException
- if operation fails.public final String getTableName() throws IfsException
The name of the content table is formed by prepending "ODMM_" to this value, uppercased.
IfsException
- if the operation failspublic final String getContentTableName() throws IfsException
The name of the content table is formed by prepending "ODMM_" to the
value returned by getTableName()
, uppercased.
IfsException
- if the operation failspublic final String getColumnName() throws IfsException
The value of this attribute is the name of the content table column in which content is stored by this Media.
IfsException
- if the operation failspublic final boolean isReadOnly() throws IfsException
The value of this attribute indicates whether this Media is read-only. Content cannot be stored on or removed from a read-only Media.
IfsException
- if the operation failspublic String getContentIndexProcedure() throws IfsException
Media instances can support full-text indexing in either of two ways:
getContent
method
is used to load content into a BLOB until it is indexed, after
which that BLOB is destroyed; this method returns null.IfsException
- if the operation failsprotected abstract InputStream getContent(Long cid) throws IfsException
cid
- the content id; requiredIfsException
- if the operation failsprotected abstract long getContentSize(Long cid) throws IfsException
cid
- the content id; requiredIfsException
- if the operation failsprotected abstract void setContent(Long cid, InputStream is, Long partitionValue, AttributeValue[] mediaOptions) throws IfsException
The implementation of this method is responsible for inserting a row into
the content table whose ID column is cid
, storing content
read from the InputStream, and closing the InputStream.
cid
- the content id; requiredis
- the InputStream from which content is readpartitionValue
- the value for the PARTITIONVALUE column in the
content table, or null if nonemediaOptions
- a set of name/value pairs whose semantics are
Media determined, or null for no media optionsIfsException
- if the operation failsprotected void setEmptyContent(Long cid, Long partitionValue, AttributeValue[] mediaOptions) throws IfsException
The implementation of this method is responsible for inserting a row into
the content table whose ID column is cid
.
Althrough a concrete implementation is provided here (by calling
setContent
and immediately closing the returned
OutputStream), subclasses should override this method with a more
performant implementation, if possible.
cid
- the content id; requiredpartitionValue
- the value for the PARTITIONVALUE column in the
content table, or null if nonemediaOptions
- a set of name/value pairs whose semantics are
Media determined, or null for no media optionsIfsException
- if the operation failsprotected void copyContent(S_Media srcMedia, Long srcCid, Long dstCid, Long partitionValue, AttributeValue[] mediaOptions) throws IfsException
The implementation of this method is responsible for inserting a row into
the content table whose ID column is dstCid
.
Although a concrete implementation is provided here (by copying the
InputStream returned by srcMedia.getContent(srcCid)
to the
OutputStream returned by setContent
), subclasses should
override this method with a more performant implementation, if possible.
srcMedia
- the source media; requiredsrcCid
- the source content id; requireddstCid
- the destination content id; requiredpartitionValue
- the value for the PARTITIONVALUE column in the
content table, or null if nonemediaOptions
- a set of name/value pairs whose semantics are
Media determined, or null for no media optionsIfsException
- if the operation failsprotected abstract void setContentReference(Long cid, String contentReference, Long partitionValue, AttributeValue[] mediaOptions) throws IfsException
The implementation of this method is responsible for inserting a row into
the content table whose ID column is cid
.
The interpretation of contentReference
varies by subtype.
Some Media subtypes may store its value, while others may resolve its
value (in a subtype-determined fashion) to other content and store that
content instead.
cid
- the content id; requiredcontentReference
- the content reference; requiredpartitionValue
- the value for the PARTITIONVALUE column in the
content table, or null if nonemediaOptions
- a set of name/value pairs whose semantics are
Media determined, or null for no media optionsIfsException
- if the operation failsprotected abstract RandomAccessDriver getRandomAccessDriver(Long cid) throws IfsException
cid
- the content idIfsException
- 13623: if the operation failsprotected abstract void destroyContent(Long cid, AttributeValue[] mediaOptions) throws IfsException
The implementation of this method is responsible for deleting the
content table row whose ID column is cid
.
cid
- the content id; requiredmediaOptions
- a set of name/value pairs whose semantics are
Media determined, or null for no media optionsIfsException
- if the operation failsprotected final Long getPartitionValue(Long cid) throws IfsException
cid
- the content id; requiredIfsException
- if the operation failsprotected final void setPartitionValue(Long cid, Long partitionValue) throws IfsException
cid
- the content id; requiredpartitionValue
- the new partition value, or null for noneIfsException
- if the operation failsprotected final void setExpirationDate(Long cid, Long expirationDate) throws IfsException
cid
- the content id; requiredexpirationDate
- the new expiration date, or null for noneIfsException
- if the operation failspublic Serializable DYNDestroyExpiredContent(Serializable payload) throws IfsException
destroyExpiredContent
.
The payload
must be Vector with three items:
expirationDate
: Long; non-nullpreviousCid
: LongbatchSize
: Integer; non-nullpayload
- see method descriptiondestroyExpiredContent
IfsException
- if the operation failsprotected final Long destroyExpiredContent(long expirationDate, Long previousCid, int batchSize) throws IfsException
Content is "expired" if its expiration date is before the point in time
specified by expirationDate
and no row-level lock is held
on its content table row.
To avoid long-running transactions, this method is repeatedly called to
expire content in batches. Only content whose content id is greater
than previousCid
is considered. Each invocation expires
no more than batchSize
items of content.
Content eligible for expiration must have no artifacts except those known to the Media. For example, the content must not have a ContentObject or rows in either odmz_context_router or odmz_last_access_date.
expirationDate
- the threshold expiration datepreviousCid
- the last content id processed in the previous
batch, or null if this is the first batchbatchSize
- the maximum number of content items to expire
in this batchIfsException
- if the operation failsprotected final boolean acquireContentTableLock(Long cid) throws IfsException
cid
- the content id; requiredIfsException
- if the operation failsCopyright © 2023. All rights reserved.