org.deegree.metadata.iso.persistence
Class ISOMetadataStore

java.lang.Object
  extended by org.deegree.metadata.iso.persistence.ISOMetadataStore
All Implemented Interfaces:
Resource, MetadataStore<ISORecord>

public class ISOMetadataStore
extends Object
implements MetadataStore<ISORecord>

MetadataStore implementation for accessing ISO 19115 records stored in spatial SQL databases (currently only supports PostgreSQL / PostGIS).

Version:
$Revision: 30992 $, $Date: 2011-05-31 16:09:20 +0200 (Di, 31. Mai 2011) $
Author:
Steffen Thomas, last edited by: $Author: lbuesching $

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
ISOMetadataStore(ISOMetadataStoreConfig config)
          Creates a new ISOMetadataStore instance from the given JAXB configuration object.
 
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.
 ConnectionManager.Type getDBType()
           
 MetadataResultSet<ISORecord> getRecordById(List<String> idList, QName[] recordTypeNames)
          Looks up the given MetadataRecord identifiers and provides access to matching MetadataRecords.
 int getRecordCount(MetadataQuery query)
          The mandatory "resultType" attribute in the GetRecords operation is set to "hits".
 MetadataResultSet<ISORecord> 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

ISOMetadataStore

public ISOMetadataStore(ISOMetadataStoreConfig config)
                 throws ResourceInitException
Creates a new ISOMetadataStore instance from the given JAXB configuration object.

Parameters:
config -
Throws:
ResourceInitException
Method Detail

getDBType

public ConnectionManager.Type getDBType()
Returns:
the db type, null, if unknown

destroy

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

Specified by:
destroy in interface Resource

getConnId

public String getConnId()
Returns the JDBC connection id.

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

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

getRecords

public MetadataResultSet<ISORecord> 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<ISORecord>
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
The mandatory "resultType" attribute in the GetRecords operation is set to "hits".

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

getRecordById

public MetadataResultSet<ISORecord> 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<ISORecord>
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<ISORecord>
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

getType

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


Copyright © 2011. All Rights Reserved.