|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.ocm.nodemanagement.impl.RepositoryUtil
public class RepositoryUtil
Utility class for managing JCR repositories. Note: most of the utility methods in this class can be used only with Jackrabbit.
Field Summary | |
---|---|
static String |
OCM_NAMESPACE
namespace constant |
static String |
OCM_NAMESPACE_PREFIX
namespace prefix constant |
static String |
PATH_SEPARATOR
Item path separator |
Constructor Summary | |
---|---|
RepositoryUtil()
|
Method Summary | |
---|---|
static String |
encodePath(String path)
Encode a path |
static Repository |
getRepository(String repositoryName)
Get a repository |
static Session |
login(Repository repository,
String user,
String password)
Connect to a JCR repository |
static void |
registerRepository(String repositoryName,
String configFile,
String homeDir)
Register a new repository |
static void |
setupSession(Session session)
Setup the session. |
static void |
unRegisterRepository(String repositoryName)
Unregister a repository |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String OCM_NAMESPACE_PREFIX
public static final String OCM_NAMESPACE
public static final String PATH_SEPARATOR
Constructor Detail |
---|
public RepositoryUtil()
Method Detail |
---|
public static void registerRepository(String repositoryName, String configFile, String homeDir)
repositoryName
- The repository unique nameconfigFile
- The JCR config filehomeDir
- The directory containing the complete repository settings (workspace, node types, ...)
RepositoryException
- when it is not possible to register the repositorypublic static void unRegisterRepository(String repositoryName) throws RepositoryException
repositoryName
- The repository unique name
RepositoryException
- when it is not possible to unregister the repositorypublic static Repository getRepository(String repositoryName) throws RepositoryException
repositoryName
- The repository name
RepositoryException
- when it is not possible to get the repository.
Before calling this method, the repository has to be registered (@see RepositoryUtil#registerRepository(String, String, String)public static Session login(Repository repository, String user, String password) throws RepositoryException
repository
- The JCR repositoryuser
- The user namepassword
- The password
RepositoryException
- when it is not possible to connect to the JCR repositorypublic static void setupSession(Session session) throws RepositoryException
RepositoryException
public static String encodePath(String path)
path
- the path to encode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |