org.jboss.dna.web.jcr.rest.spi
Interface RepositoryProvider

All Known Implementing Classes:
DnaJcrRepositoryProvider

public interface RepositoryProvider

Interface for any class that provides access to one or more local JCR repositories.

Repository providers must provide a public, no-argument constructor and be thread-safe.


Method Summary
 Set<String> getJcrRepositoryNames()
          Returns the available repository names JCR implementations that do not support multiple repositories on the same server should provide a singleton set containing some default repository name.
 javax.jcr.Session getSession(HttpServletRequest request, String repositoryName, String workspaceName)
          Returns an active session for the given workspace name in the named repository.
 void shutdown()
          Signals the repository provider that it should complete any pending transactions, shutdown, and release any external resource held.
 void startup(ServletContext context)
          Signals the repository provider that it should initialize itself based on the provided servlet context and begin accepting connections.
 

Method Detail

getSession

javax.jcr.Session getSession(HttpServletRequest request,
                             String repositoryName,
                             String workspaceName)
                             throws javax.jcr.RepositoryException
Returns an active session for the given workspace name in the named repository.

JCR implementations that do not support multiple repositories on the same server can ignore the repositoryName parameter.

Parameters:
request - the servlet request; may not be null or unauthenticated
repositoryName - the name of the repository in which the session is created
workspaceName - the name of the workspace to which the session should be connected
Returns:
an active session with the given workspace in the named repository
Throws:
javax.jcr.RepositoryException - if any other error occurs

getJcrRepositoryNames

Set<String> getJcrRepositoryNames()
Returns the available repository names

JCR implementations that do not support multiple repositories on the same server should provide a singleton set containing some default repository name.

Returns:
the available repository names; may not be null or empty

startup

void startup(ServletContext context)
Signals the repository provider that it should initialize itself based on the provided servlet context and begin accepting connections.

Parameters:
context - the servlet context for the REST servlet

shutdown

void shutdown()
Signals the repository provider that it should complete any pending transactions, shutdown, and release any external resource held.



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