public interface CustomMediaDriver
A MediaCustom instance references a CustomMediaDriverSpecification, which identifies a CustomMediaDriver by fully-qualified class name. More than one CustomMediaDriverSpecification instance can specify the same CustomMediaDriver class name, and the same CustomMediaDriverSpecification instance can be referenced by more than one MediaCustom instance.
An S_CustomMediaDriverSpecification object lazily constructs an instance of
the CustomMediaDriver implementation for the CustomMediaDriverSpecification.
A CustomMediaDriver implementation must provide a default (zero-argument)
constructor. Once constructed, the initialize
method is called.
The S_CustomMediaDriverSpecification holds a reference to the initialized CustomMediaDriver object for the life of the S_CustomMediaDriverSpecification object, or until the CustomMediaDriverSpecification is changed.
Like any subclass of S_LibraryObject, an S_CustomMediaDriverSpecification is bound to a specific session, and for a session there can be more than one instance of this class for a particular CustomMediaDriverSpecification over that session's lifetime as objects enter and exit the CMSDK cache. Since each S_CustomMediaDriverSpecification object constructs and holds its own CustomMediaDriver, a CustomMediaDriver implementation should generally be stateless. In particular, a CustomMediaDriver implementation should not assume only one instance is constructed per session, service, or virtual machine. For example, each CustomMediaDriver should not hold a pool of sockets to an external storage device, expecting that pool to be shared across sessions.
Content is identified by a string content address generated and returned by a CustomMediaDriver when content is stored. The content address must fit in a VARCHAR(2000) column and be unique across the content managed by the MediaCustom instance.
Modifier and Type | Method and Description |
---|---|
void |
destroyContent(S_MediaCustom media,
String address,
Long cid,
AttributeValue[] mediaOptions)
Destroys content with the specified content address.
|
InputStream |
getContent(S_MediaCustom media,
String address)
Gets the content for the specified content address.
|
long |
getContentSize(S_MediaCustom media,
String address)
Gets the content size, in bytes, for the specified content address.
|
RandomAccessDriver |
getRandomAccessorDriver(S_MediaCustom media,
String address)
Gets a RandomAccessDriver for the specified content address.
|
void |
initialize(S_CustomMediaDriverSpecification cmds)
Initializes this CustomMediaDriver.
|
String |
setContent(S_MediaCustom media,
Long cid,
InputStream is,
AttributeValue[] mediaOptions)
Stores content from the supplied InputStream.
|
String |
setContentReference(S_MediaCustom media,
Long cid,
String contentReference,
AttributeValue[] mediaOptions)
Stores content determined from a specified content reference.
|
void initialize(S_CustomMediaDriverSpecification cmds) throws IfsException
cmds
- the CustomMediaDriver specificationIfsException
- 13800: if the operation failsInputStream getContent(S_MediaCustom media, String address) throws IfsException
media
- the MediaCustom instanceaddress
- the content addressIfsException
- 13801: if the operation failslong getContentSize(S_MediaCustom media, String address) throws IfsException
media
- the MediaCustom instanceaddress
- the content addressIfsException
- 13802: if the operation failsString setContent(S_MediaCustom media, Long cid, InputStream is, AttributeValue[] mediaOptions) throws IfsException
media
- the MediaCustom instancecid
- the content idis
- the contentmediaOptions
- a set of name/value pairs whose semantics are
determined by the CustomMediaDriver implementation,
or null for no media optionsIfsException
- 13803: if the operation failsString setContentReference(S_MediaCustom media, Long cid, String contentReference, AttributeValue[] mediaOptions) throws IfsException
The interpretation of contentReference
is determined by
the CustomMediaDriver implementation. Some implementations may store
its value, while others may resolve its value (in a implementation
determined fashion) to other content and store that content instead.
media
- the MediaCustom instancecid
- the content idcontentReference
- the content referencemediaOptions
- a set of name/value pairs whose semantics are
determined by the CustomMediaDriver
implementation, or null for no media optionsIfsException
- 13804: if the operation failsRandomAccessDriver getRandomAccessorDriver(S_MediaCustom media, String address) throws IfsException
media
- the MediaCustom instanceaddress
- the content addressIfsException
- 13805: if the operation failsvoid destroyContent(S_MediaCustom media, String address, Long cid, AttributeValue[] mediaOptions) throws IfsException
media
- the MediaCustom instanceaddress
- the content addresscid
- the content idmediaOptions
- a set of name/value pairs whose semantics are
determined by the CustomMediaDriver implementation,
or null for no media optionsIfsException
- 13806: if the operation failsCopyright © 2023. All rights reserved.