org.modeshape.jdbc.delegate

## Class LocalRepositoryDelegate

- java.lang.Object
- - org.modeshape.jdbc.delegate.AbstractRepositoryDelegate
  - - org.modeshape.jdbc.delegate.LocalRepositoryDelegate

- All Implemented Interfaces:
    RepositoryDelegate

      public class LocalRepositoryDelegate
      extends AbstractRepositoryDelegate

  The LocalRepositoryDelegate provides a local Repository implementation to access the Jcr layer via JNDI Lookup.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static RepositoryDelegateFactory` | `FACTORY`
    `protected static Set<LocalSession>` | `TRANSACTION_IDS`

    - ### Fields inherited from class org.modeshape.jdbc.delegate.AbstractRepositoryDelegate

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalRepositoryDelegate(String url, Properties info, LocalJcrDriver.JcrContextFactory contextFactory)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Call to close the delegate connection and any outstanding transactions will be closed.
    `void` | `closeStatement()` Called when the `Statement` the is closed.
    `protected ConnectionInfo` | `createConnectionInfo(String url, Properties info)` Returns a `ConnectionInfo` object which represents the information of a specific connection, from a given url format and some `Properties`
    `QueryResult` | `execute(String query, String language)` This execute method is used for redirection so that the JNDI implementation can control calling execute.
    `String` | `explain(String query, String language)` Generate the plan for the `query` based on the specified JCR language.
    `String` | `getDescriptor(String descriptorKey)` Returns the value for the requested `descriptorKey`
    `protected LocalJcrDriver.JcrContextFactory` | `getJcrContext()`
    `boolean` | `isValid(int timeout)`
    `NodeType` | `nodeType(String name)` Call to get `NodeType` based on specified name
    `List<NodeType>` | `nodeTypes()` Call to get all the `NodeType`s defined.
    `protected void` | `retrieveRepository()` Implementor is responsible for creating the repository.
    `void` | `rollback()`
    `<T> T` | `unwrap(Class<T> iface)`

    - ### Methods inherited from class org.modeshape.jdbc.delegate.AbstractRepositoryDelegate

      `commit, createConnection, getConnectionInfo, getRepository, getRepositoryName, getRepositoryNames, isWrapperFor, setRepository, setRepositoryName, setRepositoryNames`

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

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

- - ### Field Detail

    - #### FACTORY

          public static final RepositoryDelegateFactory FACTORY

    - #### TRANSACTION_IDS

          protected static final Set<LocalSession> TRANSACTION_IDS

  - ### Constructor Detail

    - #### LocalRepositoryDelegate

          public LocalRepositoryDelegate(String url,
                                 Properties info,
                                 LocalJcrDriver.JcrContextFactory contextFactory)

  - ### Method Detail

    - #### createConnectionInfo

          protected ConnectionInfo createConnectionInfo(String url,
                                            Properties info)

      Description copied from class: `AbstractRepositoryDelegate`
      Returns a `ConnectionInfo` object which represents the information of a specific connection, from a given url format and some `Properties`
      Parameters:
        `url` - a `non-null` string which represents a jdbc url
        `info` - a `non-null` `Properties` instance which may contain extra information needed by the connection
      Returns:
        `ConnectionInfo` instance, never `null`

    - #### getJcrContext

          protected LocalJcrDriver.JcrContextFactory getJcrContext()

    - #### getDescriptor

          public String getDescriptor(String descriptorKey)

      Returns the value for the requested `descriptorKey`
      Returns:
        String descriptor value
      See Also:
        `RepositoryDelegate.getDescriptor(java.lang.String)`

    - #### nodeType

          public NodeType nodeType(String name)
                            throws RepositoryException

      Description copied from interface: `RepositoryDelegate`
      Call to get `NodeType` based on specified name
      Returns:
        NodeType
      Throws:
        `RepositoryException`

    - #### nodeTypes

          public List<NodeType> nodeTypes()
                                   throws RepositoryException

      Description copied from interface: `RepositoryDelegate`
      Call to get all the `NodeType`s defined.
      Returns:
        List of all the node types.
      Throws:
        `RepositoryException`

    - #### execute

          public QueryResult execute(String query,
                            String language)
                              throws RepositoryException

      This execute method is used for redirection so that the JNDI implementation can control calling execute.
      Parameters:
        `query` - is the query expression to execute
        `language` - is the JCR language the `query` should be executed based on.
      Returns:
        QueryResult is the JCR query result
      Throws:
        `RepositoryException`
      See Also:
        `Statement.execute(java.lang.String)`

    - #### explain

          public String explain(String query,
                       String language)
                         throws RepositoryException

      Description copied from interface: `RepositoryDelegate`
      Generate the plan for the `query` based on the specified JCR language.
      Parameters:
        `query` - is the query expression to execute
        `language` - is the JCR language the `query` should be executed based on.
      Returns:
        the string representation of the query plan
      Throws:
        `RepositoryException`

    - #### retrieveRepository

          protected void retrieveRepository()
                                     throws SQLException

      Description copied from class: `AbstractRepositoryDelegate`
      Implementor is responsible for creating the repository.
      Throws:
        `SQLException`

    - #### isValid

          public boolean isValid(int timeout)
                          throws RepositoryException

      Returns:
        boolean indicating if timeout is valid
      Throws:
        `RepositoryException`
      See Also:
        `Connection.isValid(int)`

    - #### closeStatement

          public void closeStatement()

      Called when the `Statement` the is closed. This enables the underlying connection to the JcrRepository remain open until the statement is finished using it.
      Specified by:
        `closeStatement` in interface `RepositoryDelegate`
      Overrides:
        `closeStatement` in class `AbstractRepositoryDelegate`
      See Also:
        `RepositoryDelegate.closeStatement()`

    - #### close

          public void close()

      Call to close the delegate connection and any outstanding transactions will be closed.
      Specified by:
        `close` in interface `RepositoryDelegate`
      Overrides:
        `close` in class `AbstractRepositoryDelegate`
      See Also:
        `Connection.close()`

    - #### rollback

          public void rollback()
                        throws RepositoryException

      Specified by:
        `rollback` in interface `RepositoryDelegate`
      Overrides:
        `rollback` in class `AbstractRepositoryDelegate`
      Throws:
        `RepositoryException`
      See Also:
        `Connection.rollback()`

    - #### unwrap

          public <T> T unwrap(Class<T> iface)
                   throws SQLException

      Description copied from class: `AbstractRepositoryDelegate`
      Specified by:
        `unwrap` in interface `RepositoryDelegate`
      Overrides:
        `unwrap` in class `AbstractRepositoryDelegate`
      Type Parameters:
        `T` -
      Parameters:
        `iface` -
      Returns:
        T
      Throws:
        `SQLException`
      See Also:
        `Wrapper.unwrap(java.lang.Class)`

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