Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.server
Class CustomMediaDriver

All Known Implementing Classes:
  CenteraMediaDriver, CmsdkMediaDriver, MediaOperations.TestMediaDriver, SnapLockMediaDriver

    public interface class CustomMediaDriver

CustomMediaDriver defines an SPI for storing content in custom media.

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.

(Published)

Method Summary
`void` | `destroyContent(S_MediaCustom media, java.lang.String address, java.lang.Long cid, AttributeValue[] mediaOptions)` Destroys content with the specified content address.
`java.io.InputStream` | `getContent(S_MediaCustom media, java.lang.String address)` Gets the content for the specified content address.
`long` | `getContentSize(S_MediaCustom media, java.lang.String address)` Gets the content size, in bytes, for the specified content address.
`RandomAccessDriver` | `getRandomAccessorDriver(S_MediaCustom media, java.lang.String address)` Gets a RandomAccessDriver for the specified content address.
`void` | `initialize(S_CustomMediaDriverSpecification cmds)` Initializes this CustomMediaDriver.
`java.lang.String` | `setContent(S_MediaCustom media, java.lang.Long cid, java.io.InputStream is, AttributeValue[] mediaOptions)` Stores content from the supplied InputStream.
`java.lang.String` | `setContentReference(S_MediaCustom media, java.lang.Long cid, java.lang.String contentReference, AttributeValue[] mediaOptions)` Stores content determined from a specified content reference.

Method Detail

### initialize

    void initialize(S_CustomMediaDriverSpecification cmds)
                    throws IfsException

  Description copied from interface: `CustomMediaDriver`
  Initializes this CustomMediaDriver.

  Parameters:
    `cmds` - the CustomMediaDriver specification
  Throws:
    `IfsException` - 13800: if the operation fails
  (Published)

### getContent

    java.io.InputStream getContent(S_MediaCustom media,
                                   java.lang.String address)
                                   throws IfsException

  Description copied from interface: `CustomMediaDriver`
  Gets the content for the specified content address.

  Parameters:
    `media` - the MediaCustom instance
    `address` - the content address
  Returns:
    the content
  Throws:
    `IfsException` - 13801: if the operation fails
  (Published)

### getContentSize

    long getContentSize(S_MediaCustom media,
                        java.lang.String address)
                        throws IfsException

  Description copied from interface: `CustomMediaDriver`
  Gets the content size, in bytes, for the specified content address.

  Parameters:
    `media` - the MediaCustom instance
    `address` - the content address
  Returns:
    the size
  Throws:
    `IfsException` - 13802: if the operation fails
  (Published)

### setContent

    java.lang.String setContent(S_MediaCustom media,
                                java.lang.Long cid,
                                java.io.InputStream is,
                                AttributeValue[] mediaOptions)
                                throws IfsException

  Description copied from interface: `CustomMediaDriver`
  Stores content from the supplied InputStream.

  Parameters:
    `media` - the MediaCustom instance
    `cid` - the content id
    `is` - the content
    `mediaOptions` - a set of name/value pairs whose semantics are determined by the CustomMediaDriver implementation, or null for no media options
  Returns:
    the content address
  Throws:
    `IfsException` - 13803: if the operation fails
  (Published)

### setContentReference

    java.lang.String setContentReference(S_MediaCustom media,
                                         java.lang.Long cid,
                                         java.lang.String contentReference,
                                         AttributeValue[] mediaOptions)
                                         throws IfsException

  Description copied from interface: `CustomMediaDriver`
  Stores content determined from a specified content reference.

  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.

  Parameters:
    `media` - the MediaCustom instance
    `cid` - the content id
    `contentReference` - the content reference
    `mediaOptions` - a set of name/value pairs whose semantics are determined by the CustomMediaDriver implementation, or null for no media options
  Returns:
    the content address
  Throws:
    `IfsException` - 13804: if the operation fails
  (Published)

### getRandomAccessorDriver

    RandomAccessDriver getRandomAccessorDriver(S_MediaCustom media,
                                               java.lang.String address)
                                               throws IfsException

  Description copied from interface: `CustomMediaDriver`
  Gets a RandomAccessDriver for the specified content address.

  Parameters:
    `media` - the MediaCustom instance
    `address` - the content address
  Returns:
    the RandomAccessDriver
  Throws:
    `IfsException` - 13805: if the operation fails
  (Published)

### destroyContent

    void destroyContent(S_MediaCustom media,
                        java.lang.String address,
                        java.lang.Long cid,
                        AttributeValue[] mediaOptions)
                        throws IfsException

  Description copied from interface: `CustomMediaDriver`
  Destroys content with the specified content address.

  Parameters:
    `media` - the MediaCustom instance
    `address` - the content address
    `cid` - the content id
    `mediaOptions` - a set of name/value pairs whose semantics are determined by the CustomMediaDriver implementation, or null for no media options
  Throws:
    `IfsException` - 13806: if the operation fails
  (Published)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD