org.modeshape.connector.meta.jdbc

## Class JdbcMetadataConnector

- java.lang.Object
- - org.modeshape.jcr.federation.spi.Connector
  - - org.modeshape.jcr.federation.spi.ReadOnlyConnector
    - - org.modeshape.connector.meta.jdbc.JdbcMetadataConnector

-     public class JdbcMetadataConnector
      extends ReadOnlyConnector

  Readonly connector which exposes JDBC metadata.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.modeshape.jcr.federation.spi.Connector

      `Connector.ExtraProperties`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `DEFAULT_NAME_OF_DEFAULT_CATALOG`
    `protected static String` | `DEFAULT_NAME_OF_DEFAULT_SCHEMA`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JdbcMetadataConnector()`

  - ### Method Summary

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

    - ### Methods inherited from class org.modeshape.jcr.federation.spi.ReadOnlyConnector

      `isReadonly, newDocumentId, removeDocument, storeDocument, updateDocument`

    - ### Methods inherited from class org.modeshape.jcr.federation.spi.Connector

      `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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_NAME_OF_DEFAULT_CATALOG

          protected static final String DEFAULT_NAME_OF_DEFAULT_CATALOG

      See Also:
        Constant Field Values

    - #### DEFAULT_NAME_OF_DEFAULT_SCHEMA

          protected static final String DEFAULT_NAME_OF_DEFAULT_SCHEMA

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JdbcMetadataConnector

          public JdbcMetadataConnector()

  - ### Method Detail

    - #### initialize

          public void initialize(NamespaceRegistry registry,
                        NodeTypeManager nodeTypeManager)
                          throws RepositoryException,
                                 IOException

      Description copied from class: `Connector`
      Initialize the connector. This is called automatically by ModeShape once for each Connector instance, and should not be called by the connector. By the time this method is called, ModeShape will hav already set the `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.

      Overrides:
        `initialize` in class `Connector`
      Parameters:
        `registry` - the namespace registry that can be used to register custom namespaces; never null
        `nodeTypeManager` - the node type manager that can be used to register custom node types; never null
      Throws:
        `RepositoryException` - if operations on the `NamespaceRegistry` or `NodeTypeManager` fail
        `IOException` - if any stream based operations fail (like importing cnd files)

    - #### getDocumentById

          public Document getDocumentById(String id)

      Description copied from class: `Connector`
      Returns a `Document` instance representing the document with a given id. The document should have a "proper" structure for it to be usable by ModeShape.
      Specified by:
        `getDocumentById` in class `Connector`
      Parameters:
        `id` - a `non-null` string
      Returns:
        either an `Document` instance or `null`

    - #### getDocumentId

          public String getDocumentId(String externalPath)

      Description copied from class: `Connector`
      Returns the id of an external node located at the given external path within the connector's exposed tree of content.
      Specified by:
        `getDocumentId` in class `Connector`
      Parameters:
        `externalPath` - a `non-null` string representing an external path, or "/" for the top-level node exposed by the connector
      Returns:
        either the id of the document or `null`

    - #### getDocumentPathsById

          public Collection<String> getDocumentPathsById(String id)

      Description copied from class: `Connector`
      Return the path(s) of the external node with the given identifier. The resulting paths are from the point of view of the connector. For example, the "root" node exposed by the connector wil have a path of "/".
      Specified by:
        `getDocumentPathsById` in class `Connector`
      Parameters:
        `id` - a `non-null` string
      Returns:
        the connector-specific path(s) of the node, or an empty document if there is no such document; never null

    - #### hasDocument

          public boolean hasDocument(String id)

      Description copied from class: `Connector`
      Checks if a document with the given id exists in the end-source.
      Specified by:
        `hasDocument` in class `Connector`
      Parameters:
        `id` - a `non-null` string.
      Returns:
        `true` if such a document exists, `false` otherwise.

    - #### shutdown

          public void shutdown()

      Description copied from class: `Connector`
      Shutdown the connector by releasing all resources. This is called automatically by ModeShape when this Connector instance is no longer needed, and should never be called by the connector.
      Overrides:
        `shutdown` in class `Connector`

    - #### getMetadataCollector

          protected MetadataCollector getMetadataCollector()

    - #### getDefaultCatalogName

          protected String getDefaultCatalogName()

    - #### getDefaultSchemaName

          protected String getDefaultSchemaName()

    - #### setRetryLimit

          protected void setRetryLimit(Integer retryLimit)

    - #### setMaximumConnectionsInPool

          protected void setMaximumConnectionsInPool(Integer maximumConnectionsInPool)

    - #### setMinimumConnectionsInPool

          protected void setMinimumConnectionsInPool(Integer minimumConnectionsInPool)

    - #### setMaximumConnectionIdleTimeInSeconds

          protected void setMaximumConnectionIdleTimeInSeconds(Integer maximumConnectionIdleTimeInSeconds)

    - #### setMaximumSizeOfStatementCache

          protected void setMaximumSizeOfStatementCache(Integer maximumSizeOfStatementCache)

    - #### setNumberOfConnectionsToAcquireAsNeeded

          protected void setNumberOfConnectionsToAcquireAsNeeded(Integer numberOfConnectionsToAcquireAsNeeded)

    - #### setIdleTimeInSecondsBeforeTestingConnections

          protected void setIdleTimeInSecondsBeforeTestingConnections(Integer idleTimeInSecondsBeforeTestingConnections)

    - #### setDefaultCatalogName

          protected void setDefaultCatalogName(String defaultCatalogName)

    - #### setDefaultSchemaName

          protected void setDefaultSchemaName(String defaultSchemaName)

    - #### setMetadataCollectorClassName

          protected void setMetadataCollectorClassName(String metadataCollectorClassName)

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.