org.deegree.metadata.persistence.ebrim.eo
Class EbrimEOMDStore

java.lang.Object
  extended by org.deegree.metadata.persistence.ebrim.eo.EbrimEOMDStore
All Implemented Interfaces:
Resource, MetadataStore<RegistryObject>

public class EbrimEOMDStore
extends Object
implements MetadataStore<RegistryObject>

MetadataStore implementation for accessing EbrimEOMDRecords stored in spatial SQL databases (currently only PostgreSQL / PostGIS is supported).

Version:
$Revision: $, $Date: $
Author:
Lyn Goltz, last edited by: $Author: lyn $

Field Summary
static int DEFAULT_FETCH_SIZE
          Used to limit the fetch size for SELECT statements that potentially return a lot of rows.
 
Constructor Summary
EbrimEOMDStore(String connId, File queriesDir, RegistryPackage profile, Date lastModified, long queryTimeout)
          Creates a new EbrimEOMDStore instance.
 
Method Summary
 MetadataStoreTransaction acquireTransaction()
          Acquires transactional access to this MetadataStore.
 void destroy()
          Usually called by the ResourceManager upon workspace shutdown.
 String getConnId()
          Returns the JDBC connection id.
 MetadataResultSet<RegistryObject> getRecordById(List<String> idList, QName[] recordTypeNames)
          Looks up the given MetadataRecord identifiers and provides access to matching MetadataRecords.
 int getRecordCount(MetadataQuery query)
          Returns the number of MetadataRecords that match the given MetadataQuery.
 MetadataResultSet<RegistryObject> getRecords(MetadataQuery query)
          Performs the given MetadataQuery and provides access to the MetadataRecords that match it.
 String getType()
           
 void init(DeegreeWorkspace workspace)
          Usually called by the ResourceManager upon workspace startup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FETCH_SIZE

public static final int DEFAULT_FETCH_SIZE
Used to limit the fetch size for SELECT statements that potentially return a lot of rows.

See Also:
Constant Field Values
Constructor Detail

EbrimEOMDStore

public EbrimEOMDStore(String connId,
                      File queriesDir,
                      RegistryPackage profile,
                      Date lastModified,
                      long queryTimeout)
               throws ResourceInitException
Creates a new EbrimEOMDStore instance.

Parameters:
connId - id of the JDBC connection to use, must not be null
queriesDir - directory containing individual AdhocQuery files (*.xml), can be null
profile - RegistryPackage containing the profile informations, can be null
queryTimeout - number of milliseconds to allow for queries, or 0 (unlimited)
Throws:
ResourceInitException
Method Detail

init

public void init(DeegreeWorkspace workspace)
          throws ResourceInitException
Description copied from interface: Resource
Usually called by the ResourceManager upon workspace startup.

Specified by:
init in interface Resource
Parameters:
workspace - the workspace the resource belongs to, may be null
Throws:
ResourceInitException

destroy

public void destroy()
Description copied from interface: Resource
Usually called by the ResourceManager upon workspace shutdown.

Specified by:
destroy in interface Resource

getRecords

public MetadataResultSet<RegistryObject> getRecords(MetadataQuery query)
                                             throws MetadataStoreException
Description copied from interface: MetadataStore
Performs the given MetadataQuery and provides access to the MetadataRecords that match it.

NOTE: A caller must ensure to call MetadataResultSet.close() after working with the result set. Otherwise, DB resources may be left open.

Specified by:
getRecords in interface MetadataStore<RegistryObject>
Parameters:
query - query that selects the records, must not be null
Returns:
result set for accessing the matching records, never null
Throws:
MetadataStoreException

getRecordCount

public int getRecordCount(MetadataQuery query)
                   throws MetadataStoreException
Description copied from interface: MetadataStore
Returns the number of MetadataRecords that match the given MetadataQuery.

Specified by:
getRecordCount in interface MetadataStore<RegistryObject>
Parameters:
query - query that selects the records, must not be null
Returns:
number of matching records
Throws:
MetadataStoreException

getRecordById

public MetadataResultSet<RegistryObject> getRecordById(List<String> idList,
                                                       QName[] recordTypeNames)
                                                throws MetadataStoreException
Description copied from interface: MetadataStore
Looks up the given MetadataRecord identifiers and provides access to matching MetadataRecords.

NOTE: A caller must ensure to call MetadataResultSet.close() after working with the result set. Otherwise, DB resources may be left open.

Specified by:
getRecordById in interface MetadataStore<RegistryObject>
Parameters:
idList - list of the requested record identifiers, can be empty, but must not be null
recordTypeNames - requested record type names, can be empty or null
Throws:
MetadataStoreException

acquireTransaction

public MetadataStoreTransaction acquireTransaction()
                                            throws MetadataStoreException
Description copied from interface: MetadataStore
Acquires transactional access to this MetadataStore.

Specified by:
acquireTransaction in interface MetadataStore<RegistryObject>
Returns:
transaction object that allows to perform transaction operations on this store, never null
Throws:
MetadataStoreException - if the transactional access could not be acquired or is not available for this implementation

getConnId

public String getConnId()
Description copied from interface: MetadataStore
Returns the JDBC connection id.

Specified by:
getConnId in interface MetadataStore<RegistryObject>
Returns:
the JDBC connection id, never null

getType

public String getType()
Specified by:
getType in interface MetadataStore<RegistryObject>
Returns:
the type of the store


Copyright © 2011. All Rights Reserved.