BEA Systems, Inc.

com.beasys.commerce.axiom.document.spi
Interface DocumentProvider

All Known Implementing Classes:
DefaultDocumentProvider

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).


Field Summary
static int TRANSACTION_NONE
          Isolation level for no transaction support.
static int TRANSACTION_READ_COMMITTED
          Isolation level for dirty reads are prevented; non-repeatable reads and phantom reads can occur.
static int TRANSACTION_READ_UNCOMMITTED
          Isolation level for dirty reads, non-repeatable reads and phantom reads can occur.
static int TRANSACTION_REPEATABLE_READ
          Isolation level for dirty reads and non-repeatable reads are prevented; phantom reads can occur.
static int TRANSACTION_SERIALIZABLE
          Isolation level for dirty reads, non-repeatable reads and phantom reads are prevented.
 
Method Summary
 void close()
          Close the provider down.
 DocumentIterator findDocumentIds(Search params)
          Return the set of String document ids of documents which match the given search parameters.
 DocumentIterator findDocumentMetadata(Search params)
          Return the set of DocumentMetadataDefs which match the given search parameters object.
 DocumentIterator findDocuments(Search params)
          Return the set of DocumentDefs which match the given search parameters object.
 DocumentDef getDocument(java.lang.String id)
          Return the DocumentDef with the given String document id.
 DocumentMetadataDef getDocumentMetadata(java.lang.String id)
          Return the DocumentMetadataDef with the given String document id.
 java.sql.Timestamp getDocumentModifiedDate(java.lang.String id)
          Get the last modified timestamp for the given document id.
 DocumentSchemaDef getSchema(java.lang.String schemaName)
          Return the named document schema def (null if does not exist).
 DocumentIterator getSchemaNames()
          Return the list of schema names supported in this DMS.
 java.util.Map getSchemas()
          Return the map (name to DocumentSchemaDef) of all the schemas supported in the system.
 int getTransactionIsolation()
          Get the document provider's current transaction isolation level.
 void init(java.util.Properties properties)
          Initialize the DocumentProvider based upon the specified configuration properties.
 void reset()
          Reset the connection internally to a fresh state.
 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.
See Also:
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.
See Also:
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.
See Also:
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.
See Also:
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.
See Also:
Connection.TRANSACTION_SERIALIZABLE
Method Detail

init

public void init(java.util.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
Throws:
DocumentException - thrown on an error.

reset

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.

Throws:
DocumentException - thrown on an error.

close

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.

Throws:
DocumentException - thrown on an error.

getTransactionIsolation

public int getTransactionIsolation()
                            throws DocumentException
Get the document provider's current transaction isolation level.

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws DocumentException
Set the document provider's transaction isolation level.

findDocumentIds

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.
Throws:
DocumentException - thrown on an error.

findDocuments

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.
Throws:
DocumentException - thrown on an error.

getDocumentMetadata

public DocumentMetadataDef getDocumentMetadata(java.lang.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.
Throws:
DocumentException - thrown on an error.

getDocument

public DocumentDef getDocument(java.lang.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.
Throws:
DocumentException - thrown on an error.

getDocumentModifiedDate

public java.sql.Timestamp getDocumentModifiedDate(java.lang.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.

findDocumentMetadata

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.
Throws:
DocumentException - thrown on an error.

getSchemaNames

public DocumentIterator getSchemaNames()
                                throws DocumentException
Return the list of schema names supported in this DMS.
Returns:
the iterator the String schema names.
Throws:
DocumentException - thrown on an error.

getSchema

public DocumentSchemaDef getSchema(java.lang.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.
Throws:
DocumentException - thrown on an error

getSchemas

public java.util.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.
Throws:
DocumentException - thrown on an errorj

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved