public class JdbcMetadataConnector extends ReadOnlyConnector
Connector.ExtraProperties
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_NAME_OF_DEFAULT_CATALOG |
protected static String |
DEFAULT_NAME_OF_DEFAULT_SCHEMA |
Constructor and Description |
---|
JdbcMetadataConnector() |
Modifier and Type | Method and Description |
---|---|
protected String |
getDefaultCatalogName() |
protected String |
getDefaultSchemaName() |
Document |
getDocumentById(String id)
Returns a
Document instance representing the document with a given id. |
String |
getDocumentId(String externalPath)
Returns the id of an external node located at the given external path within the connector's exposed tree of content.
|
Collection<String> |
getDocumentPathsById(String id)
Return the path(s) of the external node with the given identifier.
|
protected MetadataCollector |
getMetadataCollector() |
boolean |
hasDocument(String id)
Checks if a document with the given id exists in the end-source.
|
void |
initialize(NamespaceRegistry registry,
NodeTypeManager nodeTypeManager)
Initialize the connector.
|
protected void |
setDefaultCatalogName(String defaultCatalogName) |
protected void |
setDefaultSchemaName(String defaultSchemaName) |
protected void |
setIdleTimeInSecondsBeforeTestingConnections(Integer idleTimeInSecondsBeforeTestingConnections) |
protected void |
setMaximumConnectionIdleTimeInSeconds(Integer maximumConnectionIdleTimeInSeconds) |
protected void |
setMaximumConnectionsInPool(Integer maximumConnectionsInPool) |
protected void |
setMaximumSizeOfStatementCache(Integer maximumSizeOfStatementCache) |
protected void |
setMetadataCollectorClassName(String metadataCollectorClassName) |
protected void |
setMinimumConnectionsInPool(Integer minimumConnectionsInPool) |
protected void |
setNumberOfConnectionsToAcquireAsNeeded(Integer numberOfConnectionsToAcquireAsNeeded) |
protected void |
setRetryLimit(Integer retryLimit) |
void |
shutdown()
Shutdown the connector by releasing all resources.
|
isReadonly, newDocumentId, removeDocument, storeDocument, updateDocument
checkFieldNotNull, extraPropertiesFor, extraPropertiesStore, factories, getBinaryValue, getCacheTtlSeconds, getChildReference, getContext, getEnvironment, getLogger, getMimeTypeDetector, getRepositoryName, getSourceName, getTransactionManager, isQueryable, log, nameFrom, nameFrom, nameFrom, newChildReference, newConnectorChangedSet, newDocument, newPageDocument, pathFactory, pathFrom, pathFrom, propertyFactory, readDocument, setExtraPropertiesStore, translator, writeDocument
protected static final String DEFAULT_NAME_OF_DEFAULT_CATALOG
protected static final String DEFAULT_NAME_OF_DEFAULT_SCHEMA
public void initialize(NamespaceRegistry registry, NodeTypeManager nodeTypeManager) throws RepositoryException, IOException
Connector
Connector.context
,
Connector.logger
, Connector.name
, and Connector.repositoryName
plus any fields that match configuration properties for the
connector.
By default this method does nothing, so it should be overridden by implementations to do a one-time initialization of any
internal components. For example, connectors can use the supplied registry
and nodeTypeManager
objects to register custom namesapces and node types required by the external content.
This is an excellent place for connector to validate the connector-specific fields set by ModeShape via reflection during instantiation.
initialize
in class Connector
registry
- the namespace registry that can be used to register custom namespaces; never nullnodeTypeManager
- the node type manager that can be used to register custom node types; never nullRepositoryException
- if operations on the NamespaceRegistry
or NodeTypeManager
failIOException
- if any stream based operations fail (like importing cnd files)public Document getDocumentById(String id)
Connector
Document
instance representing the document with a given id. The document should have a "proper"
structure for it to be usable by ModeShape.getDocumentById
in class Connector
id
- a non-null
stringDocument
instance or null
public String getDocumentId(String externalPath)
Connector
getDocumentId
in class Connector
externalPath
- a non-null
string representing an external path, or "/" for the top-level node exposed by the
connectornull
public Collection<String> getDocumentPathsById(String id)
Connector
getDocumentPathsById
in class Connector
id
- a non-null
stringpublic boolean hasDocument(String id)
Connector
hasDocument
in class Connector
id
- a non-null
string.true
if such a document exists, false
otherwise.public void shutdown()
Connector
protected MetadataCollector getMetadataCollector()
protected String getDefaultCatalogName()
protected String getDefaultSchemaName()
protected void setRetryLimit(Integer retryLimit)
protected void setMaximumConnectionsInPool(Integer maximumConnectionsInPool)
protected void setMinimumConnectionsInPool(Integer minimumConnectionsInPool)
protected void setMaximumConnectionIdleTimeInSeconds(Integer maximumConnectionIdleTimeInSeconds)
protected void setMaximumSizeOfStatementCache(Integer maximumSizeOfStatementCache)
protected void setNumberOfConnectionsToAcquireAsNeeded(Integer numberOfConnectionsToAcquireAsNeeded)
protected void setIdleTimeInSecondsBeforeTestingConnections(Integer idleTimeInSecondsBeforeTestingConnections)
protected void setDefaultCatalogName(String defaultCatalogName)
protected void setDefaultSchemaName(String defaultSchemaName)
protected void setMetadataCollectorClassName(String metadataCollectorClassName)
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.