DEPRECATED

# com.bea.p13n.content.document.spi
DocumentProvider Interface

public interface DocumentProvider

A object which can provide documents and document information.

In the case of statefull connections to DMS, this should represent a single connection to the DMS (pooling will be handled by the infrastructure).

DocumentProvider can support transaction isolation levels very similar to java.sql.Connections. If the DocumentProvider doesn't support transaction isolation levels, it should always report TRANSACTION_NONE (i.e. it shouldn't thrown an exception).

All Known Implementing Classes
  `com.bea.p13n.content.document.ref.DefaultDocumentProvider`

## Field Summary

`public static final int` | `TRANSACTION_NONE` Isolation level for no transaction support.
`public static final int` | `TRANSACTION_READ_COMMITTED` Isolation level for dirty reads are prevented; non-repeatable reads and phantom reads can occur.
`public static final int` | `TRANSACTION_READ_UNCOMMITTED` Isolation level for dirty reads, non-repeatable reads and phantom reads can occur.
`public static final int` | `TRANSACTION_REPEATABLE_READ` Isolation level for dirty reads and non-repeatable reads are prevented; phantom reads can occur.
`public static final int` | `TRANSACTION_SERIALIZABLE` Isolation level for dirty reads, non-repeatable reads and phantom reads are prevented.

## Method Summary

`public void` | `close`() Close the provider down.
`public `DocumentIterator`` | `findDocumentIds`(`Search` params) Return the set of String document ids of documents which match the given search parameters.
`public `DocumentIterator`` | `findDocumentMetadata`(`Search` params) Return the set of DocumentMetadataDefs which match the given search parameters object.
`public `DocumentIterator`` | `findDocuments`(`Search` params) Return the set of DocumentDefs which match the given search parameters object.
`public `DocumentDef`` | `getDocument`(`String` id) Return the DocumentDef with the given String document id.
`public `DocumentMetadataDef`` | `getDocumentMetadata`(`String` id) Return the DocumentMetadataDef with the given String document id.
`public `Timestamp`` | `getDocumentModifiedDate`(`String` id) Get the last modified timestamp for the given document id.
`public `DocumentSchemaDef`` | `getSchema`(`String` schemaName) Return the named document schema def (null if does not exist).
`public `DocumentIterator`` | `getSchemaNames`() Return the list of schema names supported in this DMS.
`public `Map`` | `getSchemas`() Return the map (name to DocumentSchemaDef) of all the schemas supported in the system.
`public int` | `getTransactionIsolation`() Get the document provider's current transaction isolation level.
`public void` | `init`(`Properties` properties) Initialize the DocumentProvider based upon the specified configuration properties.
`public void` | `reset`() Reset the connection internally to a fresh state.
`public void` | `setTransactionIsolation`(int level) Set the document provider's transaction isolation level.

## Field Detail

### TRANSACTION_NONE

    public static final int TRANSACTION_NONE

  Isolation level for no transaction support.

Related Topics

``Connection.TRANSACTION_NONE``

### TRANSACTION_READ_COMMITTED

    public static final int TRANSACTION_READ_COMMITTED

  Isolation level for dirty reads are prevented; non-repeatable reads and phantom reads can occur.

Related Topics

``Connection.TRANSACTION_READ_COMMITTED``

### TRANSACTION_READ_UNCOMMITTED

    public static final int TRANSACTION_READ_UNCOMMITTED

  Isolation level for dirty reads, non-repeatable reads and phantom reads can occur.

Related Topics

``Connection.TRANSACTION_READ_UNCOMMITTED``

### TRANSACTION_REPEATABLE_READ

    public static final int TRANSACTION_REPEATABLE_READ

  Isolation level for dirty reads and non-repeatable reads are prevented; phantom reads can occur.

Related Topics

``Connection.TRANSACTION_REPEATABLE_READ``

### TRANSACTION_SERIALIZABLE

    public static final int TRANSACTION_SERIALIZABLE

  Isolation level for dirty reads, non-repeatable reads and phantom reads are prevented.

Related Topics

``Connection.TRANSACTION_SERIALIZABLE``

## Method Detail

### close() Method

    public void close()
         throws DocumentException

Close the provider down.

This will be called before the provider is dereferenced; it should close any resources opened by init() or internally. The provider instance should not be used after this method has been invoked.

#### Exceptions

``DocumentException``
  thrown on an error.

### findDocumentIds(Search) Method

    public DocumentIterator findDocumentIds(Search params)
         throws DocumentException

Return the set of String document ids of documents which match the given search parameters.

#### Parameters

params
  the search parameters.

#### Returns

the iterator of String document ids that match.

#### Exceptions

``DocumentException``
  thrown on an error.

### findDocumentMetadata(Search) Method

    public DocumentIterator findDocumentMetadata(Search params)
         throws DocumentException

Return the set of DocumentMetadataDefs which match the given search parameters object.

The implementor of DocumentProvider will need to map the parameters into the native search mechanism.

#### Parameters

params
  the search parameters.

#### Returns

the iterator of DocumentMetadataDefs that match the search.

#### Exceptions

``DocumentException``
  thrown on an error.

### findDocuments(Search) Method

    public DocumentIterator findDocuments(Search params)
         throws DocumentException

Return the set of DocumentDefs which match the given search parameters object.

The implementor of DocumentProvider will need to map the parameters into the native search mechanism.

#### Parameters

params
  the search parameters.

#### Returns

the iterator of DocumentDefs that match the search.

#### Exceptions

``DocumentException``
  thrown on an error.

### getDocument(String) Method

    public DocumentDef getDocument(String id)
         throws DocumentException

Return the DocumentDef with the given String document id.

#### Parameters

id
  the document id.

#### Returns

the DocumentDef with the given id, or null on unknown document id.

#### Exceptions

``DocumentException``
  thrown on an error.

### getDocumentMetadata(String) Method

    public DocumentMetadataDef getDocumentMetadata(String id)
         throws DocumentException

Return the DocumentMetadataDef with the given String document id.

#### Parameters

id
  the document id.

#### Returns

the DocumentMetadataDef of the document with the given id, or null on unknown document id.

#### Exceptions

``DocumentException``
  thrown on an error.

### getDocumentModifiedDate(String) Method

    public Timestamp getDocumentModifiedDate(String id)
         throws DocumentException

Get the last modified timestamp for the given document id.

#### Parameters

id
  the document id.

#### Returns

the timestamp when the doc was last modified, or null if unknown or doesn't exist.

#### Exceptions

``DocumentException``

### getSchema(String) Method

    public DocumentSchemaDef getSchema(String schemaName)
         throws DocumentException

Return the named document schema def (null if does not exist).

#### Parameters

schemaName
  the name of the schema to find.

#### Returns

the DocumentSchemaDef or null if not found.

#### Exceptions

``DocumentException``
  thrown on an error

### getSchemaNames() Method

    public DocumentIterator getSchemaNames()
         throws DocumentException

Return the list of schema names supported in this DMS.

#### Returns

the iterator the String schema names.

#### Exceptions

``DocumentException``
  thrown on an error.

### getSchemas() Method

    public Map getSchemas()
         throws DocumentException

Return the map (name to DocumentSchemaDef) of all the schemas supported in the system.

This operation could be time expensive.

#### Returns

the map of String schema name of DocumentSchemaDef.

#### Exceptions

``DocumentException``
  thrown on an errorj

### getTransactionIsolation() Method

    public int getTransactionIsolation()
         throws DocumentException

Get the document provider's current transaction isolation level.

#### Exceptions

``DocumentException``

### init(Properties) Method

    public void init(Properties properties)
         throws DocumentException

Initialize the DocumentProvider based upon the specified configuration properties.

This will be called after the DocumentProvider has been instantiated.

#### Parameters

properties
  the configuration properties

#### Exceptions

``DocumentException``
  thrown on an error.

### reset() Method

    public void reset()
         throws DocumentException

Reset the connection internally to a fresh state.

This might include rolling back a transaction and clearing out any internal state.

#### Exceptions

``DocumentException``
  thrown on an error.

### setTransactionIsolation(int) Method

    public void setTransactionIsolation(int level)
         throws DocumentException

Set the document provider's transaction isolation level.

#### Exceptions

``DocumentException``