public interface ContentRepository
All access to the repository happens through authenticated
ContentSession
instances acquired through the
login(Credentials, String)
method, which is why that is the only
method of this interface.
Starting and stopping ContentRepository instances is the responsibility of each particular deployment and not covered by this interface. Repository clients should use a deployment-specific mechanism (JNDI, OSGi service, etc.) to acquire references to ContentRepository instances.
This interface is thread-safe.
Modifier and Type | Method and Description |
---|---|
Descriptors |
getDescriptors()
Returns the repository descriptors which contain all or a subset of the descriptors defined in
javax.jcr.Repository . |
ContentSession |
login(Credentials credentials,
java.lang.String workspaceName)
Authenticates a user based on the given credentials or available
out-of-band information and, if successful, returns a
ContentSession instance for accessing repository content
inside the specified workspace as the authenticated user. |
ContentSession login(Credentials credentials, java.lang.String workspaceName) throws javax.security.auth.login.LoginException, NoSuchWorkspaceException
ContentSession
instance for accessing repository content
inside the specified workspace as the authenticated user.
TODO clarify workspace handling once multiple workspaces are supported. See OAK-118.
The exact type of access credentials is undefined, as this method simply acts as a generic messenger between clients and pluggable login modules that take care of the actual authentication. See the documentation of relevant login modules for the kind of access credentials they expect.
The client must explicitly Closeable.close()
the
returned session once it is no longer used. The recommended access
pattern is:
ContentRepository repository = ...; ContentSession session = repository.login(...); try { ...; // Use the session } finally { session.close(); }
credentials
- access credentials, or null
workspaceName
- The workspace name or null
if the default
workspace should be used.javax.security.auth.login.LoginException
- if authentication failedNoSuchWorkspaceException
- if the specified workspace name is invalid.Descriptors getDescriptors()
javax.jcr.Repository
."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"