|
Oracle Beehive Java Content Repository Java API Reference Release 1 (1.3) E11993-02 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface OracleRepository
This interface is the entry point into the content repository. The repository as a whole is represented by a OracleRepository object, which is acquired by RepositoryFactory. OracleRepository objects are both Serializable and Referenceable, allowing them to be stored in a JNDI directory instead of being created and initialized each time. A client connects to the repository by calling OracleRepository.login()
by passing Credentials object as shown in the sample code below. The client gets a Session object tied to the specified workspace. Following piece of code shows the code snippet.
// Create new Hashtable, to pass connection attributes
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"oracle.j2ee.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
env.put(Context.SECURITY_CREDENTIALS, "Welcome1");
env.put(Context.PROVIDER_URL,
"opmn:ormi://stbcr04-2.us.oracle.com:6003:BEEAPP/jcr-service");
BeehiveRepositoryConfiguration config = new BeehiveRepositoryConfiguration(env);
// Get the repository with the given beehive repository configuration
Repository rep = (Repository) RepositoryFactory.createRepository(config);
//Create javax.jcr.SimpleCredentials object by giving username/password
SimpleCredentials cred =
new SimpleCredentials(java.lang.String userID, char[] password);
// Now login to Repository using credentials
Session session = rep.login(cred);
| Field Summary | |
|---|---|
static java.lang.String |
INITIAL_CONTEXT_FACTORYThe Initial Context Factory value that we set to this attribute will be used during Java Naming and Directory Interface (JNDI) lookup of the JCR service. |
static java.lang.String |
JCR_SERVICEConstant that stores the value of the JCR service name. |
static java.lang.String |
PROVIDER_URLConstant specifying the name of the URL, where the JCR service is deployed. |
static java.lang.String |
SECURITY_CREDENTIALSConstant specifying the credentials of the principal used in authenticating during JNDI lookup. |
static java.lang.String |
SECURITY_PRINCIPALConstant specifying the name of the principal used in authenticating during JNDI lookup. |
| Fields inherited from interface javax.jcr.Repository |
|---|
LEVEL_1_SUPPORTED, LEVEL_2_SUPPORTED, OPTION_LOCKING_SUPPORTED, OPTION_OBSERVATION_SUPPORTED, OPTION_QUERY_SQL_SUPPORTED, OPTION_TRANSACTIONS_SUPPORTED, OPTION_VERSIONING_SUPPORTED, QUERY_XPATH_DOC_ORDER, QUERY_XPATH_POS_INDEX, REP_NAME_DESC, REP_VENDOR_DESC, REP_VENDOR_URL_DESC, REP_VERSION_DESC, SPEC_NAME_DESC, SPEC_VERSION_DESC |
| Method Summary | |
|---|---|
java.lang.String |
getDescriptor(java.lang.String key)Returns the descriptor for the specified key. |
java.lang.String[] |
getDescriptorKeys()Returns a string array holding all descriptor keys available for this implementation. |
javax.jcr.Session |
login()Authenticates the user without credentials. |
javax.jcr.Session |
login(javax.jcr.Credentials credentials)Authenticates the user using the supplied credentials to the default workspace. |
javax.jcr.Session |
login(javax.jcr.Credentials credentials, java.lang.String workspaceName)Authenticates the user using the supplied credentials. |
javax.jcr.Session |
login(java.lang.String workspaceName)Authenticates the user without credentials. |
| Methods inherited from interface javax.naming.Referenceable |
|---|
getReference |
| Field Detail |
|---|
static final java.lang.String INITIAL_CONTEXT_FACTORY
static final java.lang.String SECURITY_PRINCIPAL
static final java.lang.String SECURITY_CREDENTIALS
static final java.lang.String PROVIDER_URL
static final java.lang.String JCR_SERVICE
| Method Detail |
|---|
java.lang.String[] getDescriptorKeys()
getDescriptor(String name) to query information about this repository implementation.getDescriptorKeys in interface javax.jcr.Repositoryjava.lang.String getDescriptor(java.lang.String key)
getDescriptorKeys(). If the specified key is not found, null is returned.getDescriptor in interface javax.jcr.Repositorykey - a string corresponding to a descriptor for this repository implementation.
javax.jcr.Session login(javax.jcr.Credentials credentials,
java.lang.String workspaceName)
throws javax.jcr.LoginException,
javax.jcr.NoSuchWorkspaceException,
javax.jcr.RepositoryException
credentials. The credentials object should contain user name and password. Along with these, it should contain following attributes, which are used in ejb lookup of jcr service.INITIAL_CONTEXT_FACTORYSECURITY_PRINCIPALSECURITY_CREDENTIALSPROVIDER_URLworkspaceName is null since multiple workspaces are not supported
Since workspaceName is null, a default workspace is automatically selected by the repository implementation. This is the "home workspace" of the user whose credentials were passed.
If authentication or authorization for the specified workspace fails, a LoginException is thrown.
If workspaceName is not recognized, a NoSuchWorkspaceException is thrown.
login in interface javax.jcr.Repositorycredentials - The credentials of the userworkspaceName - the name of a workspace.javax.jcr.LoginException - If the login fails.javax.jcr.NoSuchWorkspaceException - If the specified workspaceName is not recognized.javax.jcr.RepositoryException - if another error occurs.
javax.jcr.Session login(javax.jcr.Credentials credentials)
throws javax.jcr.LoginException,
javax.jcr.RepositoryException
login in interface javax.jcr.Repositorycredentials - The credentials of the userjavax.jcr.LoginException - If the login authentication fails.javax.jcr.RepositoryException - if another error occurs.
javax.jcr.Session login(java.lang.String workspaceName)
throws javax.jcr.LoginException,
javax.jcr.NoSuchWorkspaceException,
javax.jcr.RepositoryException
login in interface javax.jcr.Repositoryjavax.jcr.LoginException - If the login authentication fails.javax.jcr.NoSuchWorkspaceException - If the specified workspaceName is not recognized.javax.jcr.RepositoryException - if another error occurs.
javax.jcr.Session login()
throws javax.jcr.LoginException,
javax.jcr.RepositoryException
login in interface javax.jcr.Repositoryjavax.jcr.LoginException - If the login authentication fails.javax.jcr.RepositoryException - if another error occurs.
|
Oracle Beehive Java Content Repository Java API Reference Release 1 (1.3) E11993-02 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||