@Reference(name="namespaceMapper",
referenceInterface=NamespaceMapper.class,
cardinality=OPTIONAL_MULTIPLE,
policy=DYNAMIC)
public class OakSlingRepositoryManager
extends AbstractSlingRepositoryManager
| Modifier and Type | Field and Description |
|---|---|
static String |
ANONYMOUS_READ_PROP |
static String |
DEFAULT_ADMIN_USER |
static boolean |
DEFAULT_LOGIN_ADMIN_ENABLED |
static String |
PROPERTY_ADMIN_USER |
static String |
PROPERTY_DEFAULT_WORKSPACE |
static String |
PROPERTY_LOGIN_ADMIN_ENABLED |
| Constructor and Description |
|---|
OakSlingRepositoryManager() |
| Modifier and Type | Method and Description |
|---|---|
protected javax.jcr.Repository |
acquireRepository()
Creates the backing JCR repository instances.
|
protected AbstractSlingRepository2 |
create(org.osgi.framework.Bundle usingBundle)
Creates an instance of the
AbstractSlingRepository2
implementation for use by the given usingBundle. |
protected void |
destroy(AbstractSlingRepository2 repositoryServiceInstance)
Cleans up the given
AbstractSlingRepository2 instance previously
created by the AbstractSlingRepositoryManager.create(Bundle) method. |
protected void |
disposeRepository(javax.jcr.Repository repository)
Disposes off the given
repository. |
protected NamespaceMapper[] |
getNamespaceMapperServices()
Returns the
NamespaceMapper services used by the
NamespaceMappingSupport.getNamespaceAwareSession(Session) method to define custom
namespaces on sessions. |
protected Dictionary<String,Object> |
getServiceRegistrationProperties()
Return the service registration properties to be used to register the
repository service in
AbstractSlingRepositoryManager.registerService(). |
protected ServiceUserMapper |
getServiceUserMapper()
Returns the
ServiceUserMapper service to map the service name to
a service user name. |
protected void |
setup(org.osgi.framework.BundleContext bundleContext,
SlingRepository repository)
Sets up the namespace mapping support.
|
getDefaultWorkspace, getRepository, getServiceRegistrationInterfaces, isDisableLoginAdministrative, registerService, start, stop, unregisterServicegetNamespaceAwareSession, tearDownpublic static final boolean DEFAULT_LOGIN_ADMIN_ENABLED
@Property(label="Default Workspace",
description="Name of the workspace to use by default if not is given in any of the login methods. This name is used to implement the SlingRepository.getDefaultWorkspace() method. If this name is empty, a null value is used in JCR calls so that the default workspace provided by the JCR repository is used.")
public static final String PROPERTY_DEFAULT_WORKSPACE
@Property(boolValue=true,
label="Enable Administrator Login",
description="Whether to enable or disable the SlingRepository.loginAdministrative method. The default is \'true\'. See http://sling.apache.org/documentation/the-sling-engine/service-authentication.html for information on deprecating and disabling the loginAdministrative method.")
public static final String PROPERTY_LOGIN_ADMIN_ENABLED
public static final String DEFAULT_ADMIN_USER
@Property(value="admin",
label="Administrator",
description="The user name of the administrative user. This username is used to implement the SlingRepository.loginAdministrative(String)method. It is intended for this user to provide full read/write access to repository.")
public static final String PROPERTY_ADMIN_USER
@Property(boolValue=true,
label="Allow anonymous reads",
description="If true, the anonymous user has read access to the whole repository (for backwards compatibility)")
public static final String ANONYMOUS_READ_PROP
protected ServiceUserMapper getServiceUserMapper()
AbstractSlingRepositoryManagerServiceUserMapper service to map the service name to
a service user name.
The ServiceUserMapper is used to implement the
AbstractSlingRepository2.loginService(String, String) method used
to replace the
AbstractSlingRepository2.loginAdministrative(String) method. If
this method returns null and hence the
ServiceUserMapperService is not available, the
loginService method is not able to login.
getServiceUserMapper in class AbstractSlingRepositoryManagerServiceUserMapper service or null if not
available.AbstractSlingRepository2.loginService(String, String)protected NamespaceMapper[] getNamespaceMapperServices()
NamespaceMappingSupportNamespaceMapper services used by the
NamespaceMappingSupport.getNamespaceAwareSession(Session) method to define custom
namespaces on sessions.getNamespaceMapperServices in class NamespaceMappingSupportNamespaceMapper services or null if there are
none.protected javax.jcr.Repository acquireRepository()
AbstractSlingRepositoryManager
This method does not throw any Throwable but instead just
returns null if not repository is available. Any problems
trying to acquire the repository must be caught and logged as
appropriate.
acquireRepository in class AbstractSlingRepositoryManagerRepository or null if
not repository can be acquired.AbstractSlingRepositoryManager.start(BundleContext, String, boolean)protected void setup(org.osgi.framework.BundleContext bundleContext,
SlingRepository repository)
NamespaceMappingSupportThis method may be overwritten but must be called from overwriting methods.
setup in class NamespaceMappingSupportbundleContext - The OSGi BundleContext to access the
framework for namespacing setuprepository - The SlingRepository to register namespaces onprotected Dictionary<String,Object> getServiceRegistrationProperties()
AbstractSlingRepositoryManagerAbstractSlingRepositoryManager.registerService().getServiceRegistrationProperties in class AbstractSlingRepositoryManagerAbstractSlingRepositoryManager.registerService()AbstractSlingRepositoryManager.registerService()protected AbstractSlingRepository2 create(org.osgi.framework.Bundle usingBundle)
AbstractSlingRepositoryManagerAbstractSlingRepository2
implementation for use by the given usingBundle.
This method is called when the repository service is requested from within the using bundle for the first time.
This method is expected to return a new instance on every call.
create in class AbstractSlingRepositoryManagerusingBundle - The bundle providing from which the repository is
requested.AbstractSlingRepository2 implementation instance to
be used by the usingBundle.AbstractSlingRepositoryManager.registerService()protected void destroy(AbstractSlingRepository2 repositoryServiceInstance)
AbstractSlingRepositoryManagerAbstractSlingRepository2 instance previously
created by the AbstractSlingRepositoryManager.create(Bundle) method.destroy in class AbstractSlingRepositoryManagerrepositoryServiceInstance - The AbstractSlingRepository2
istance to cleanup.AbstractSlingRepositoryManager.registerService()protected void disposeRepository(javax.jcr.Repository repository)
AbstractSlingRepositoryManagerrepository.disposeRepository in class AbstractSlingRepositoryManagerrepository - The repository to be disposed off which is the same as
the one returned from AbstractSlingRepositoryManager.acquireRepository().Copyright © 2015 The Apache Software Foundation. All rights reserved.