public class CredentialsStrategySessionFactory extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.extensions.jcr.SessionFactory
JcrSessionFactory
except that this implementation delegates to a CredentialsStrategy
implementation for getting a Credentials
instance. Also has fixes from SEJCR-18. Also getBareSession changed to getAdminSession
and runs as Jackrabbit admin.Modifier and Type | Class and Description |
---|---|
static class |
CredentialsStrategySessionFactory.LogoutSuppressingInvocationHandler |
Modifier and Type | Field and Description |
---|---|
protected PentahoJcrSessionFactory |
sessionFactory |
Constructor and Description |
---|
CredentialsStrategySessionFactory(javax.jcr.Repository repository,
CredentialsStrategy credentialsStrategy)
Constructor with all the required fields.
|
CredentialsStrategySessionFactory(javax.jcr.Repository repository,
CredentialsStrategy credentialsStrategy,
CredentialsStrategy adminCredentialsStrategy)
Constructor with all the required fields.
|
CredentialsStrategySessionFactory(javax.jcr.Repository repository,
String workspaceName,
CredentialsStrategy credentialsStrategy,
CredentialsStrategy adminCredentialsStrategy)
Constructor with all the required fields.
|
CredentialsStrategySessionFactory(javax.jcr.Repository repository,
String workspaceName,
CredentialsStrategy credentialsStrategy,
CredentialsStrategy adminCredentialsStrategy,
org.springframework.extensions.jcr.SessionHolderProviderManager sessionHolderProviderManager)
Constructor containing all the fields available.
|
Modifier and Type | Method and Description |
---|---|
protected javax.jcr.Session |
addListeners(javax.jcr.Session session)
Hook for adding listeners to the newly returned session.
|
void |
afterPropertiesSet() |
javax.jcr.Session |
createSessionProxy(javax.jcr.Session session)
We create a proxy wraper around the actualy session to prevent it from being closed.
|
void |
destroy() |
boolean |
equals(Object obj) |
javax.jcr.Session |
getAdminSession() |
org.springframework.extensions.jcr.EventListenerDefinition[] |
getEventListeners() |
Properties |
getNamespaces() |
javax.jcr.Repository |
getRepository() |
javax.jcr.Session |
getSession() |
PentahoJcrSessionFactory |
getSessionFactory() |
org.springframework.extensions.jcr.SessionHolder |
getSessionHolder(javax.jcr.Session session) |
protected org.springframework.extensions.jcr.SessionHolderProvider |
getSessionHolderProvider()
Used internally.
|
org.springframework.extensions.jcr.SessionHolderProviderManager |
getSessionHolderProviderManager() |
String |
getWorkspaceName() |
int |
hashCode() |
boolean |
isForceNamespacesRegistration() |
boolean |
isKeepNewNamespaces() |
boolean |
isSkipExistingNamespaces() |
protected void |
registerNamespaces()
Register the namespaces.
|
protected void |
registerNodeTypes() |
void |
setEventListeners(org.springframework.extensions.jcr.EventListenerDefinition[] eventListenerDefinitions) |
void |
setForceNamespacesRegistration(boolean forceNamespacesRegistration)
Indicate if the given namespace registrations will override the namespace already registered in the repository
under the same prefix.
|
void |
setKeepNewNamespaces(boolean keepNamespaces)
Indicate if the given namespace registrations will be kept (the default) when the application context closes down
or if they will be unregistered.
|
void |
setNamespaces(Properties namespaces) |
void |
setNodeTypeDefinitionProviders(List<NodeTypeDefinitionProvider> nodeTypeDefinitionProviders) |
void |
setRepository(javax.jcr.Repository repository) |
void |
setSessionFactory(PentahoJcrSessionFactory sessionFactory) |
protected void |
setSessionHolderProvider(org.springframework.extensions.jcr.SessionHolderProvider sessionHolderProvider)
Used internally.
|
void |
setSessionHolderProviderManager(org.springframework.extensions.jcr.SessionHolderProviderManager sessionHolderProviderManager) |
void |
setSkipExistingNamespaces(boolean skipRegisteredNamespace)
Indicate if the given namespace registrations will skip already registered namespaces or not.
|
void |
setWorkspaceName(String workspaceName) |
String |
toString() |
protected void |
unregisterNamespaces()
Removes the namespaces.
|
protected void |
unregisterNodeTypes()
Hook for un-registering node types on the underlying repository.
|
protected PentahoJcrSessionFactory sessionFactory
public CredentialsStrategySessionFactory(javax.jcr.Repository repository, CredentialsStrategy credentialsStrategy)
repository
- workspaceName
- credentials
- public CredentialsStrategySessionFactory(javax.jcr.Repository repository, CredentialsStrategy credentialsStrategy, CredentialsStrategy adminCredentialsStrategy)
repository
- workspaceName
- credentials
- public CredentialsStrategySessionFactory(javax.jcr.Repository repository, String workspaceName, CredentialsStrategy credentialsStrategy, CredentialsStrategy adminCredentialsStrategy)
repository
- workspaceName
- credentials
- public CredentialsStrategySessionFactory(javax.jcr.Repository repository, String workspaceName, CredentialsStrategy credentialsStrategy, CredentialsStrategy adminCredentialsStrategy, org.springframework.extensions.jcr.SessionHolderProviderManager sessionHolderProviderManager)
repository
- workspaceName
- credentials
- sessionHolderProviderManager
- public PentahoJcrSessionFactory getSessionFactory()
public void setSessionFactory(PentahoJcrSessionFactory sessionFactory)
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void setNodeTypeDefinitionProviders(List<NodeTypeDefinitionProvider> nodeTypeDefinitionProviders)
protected void unregisterNodeTypes() throws Exception
Exception
protected void registerNamespaces() throws Exception
javax.jcr.RepositoryException
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
DisposableBean.destroy()
protected void unregisterNamespaces() throws Exception
Exception
public javax.jcr.Session getAdminSession() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public javax.jcr.Session getSession() throws javax.jcr.RepositoryException
getSession
in interface org.springframework.extensions.jcr.SessionFactory
javax.jcr.RepositoryException
SessionFactory.getSession()
public javax.jcr.Session createSessionProxy(javax.jcr.Session session)
session
- public org.springframework.extensions.jcr.SessionHolder getSessionHolder(javax.jcr.Session session)
getSessionHolder
in interface org.springframework.extensions.jcr.SessionFactory
SessionFactory.getSessionHolder(javax.jcr.Session)
protected javax.jcr.Session addListeners(javax.jcr.Session session) throws javax.jcr.RepositoryException
session
- JCR sessionjavax.jcr.RepositoryException
public javax.jcr.Repository getRepository()
public void setRepository(javax.jcr.Repository repository)
repository
- The repository to set.public void setWorkspaceName(String workspaceName)
workspaceName
- The workspaceName to set.public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public String toString()
toString
in class Object
Object.toString()
public org.springframework.extensions.jcr.EventListenerDefinition[] getEventListeners()
public void setEventListeners(org.springframework.extensions.jcr.EventListenerDefinition[] eventListenerDefinitions)
eventListenerDefinitions
- The eventListenerDefinitions to set.public Properties getNamespaces()
public void setNamespaces(Properties namespaces)
namespaces
- The namespaces to set.protected org.springframework.extensions.jcr.SessionHolderProvider getSessionHolderProvider()
protected void setSessionHolderProvider(org.springframework.extensions.jcr.SessionHolderProvider sessionHolderProvider)
sessionHolderProvider
- The sessionHolderProvider to set.public org.springframework.extensions.jcr.SessionHolderProviderManager getSessionHolderProviderManager()
public void setSessionHolderProviderManager(org.springframework.extensions.jcr.SessionHolderProviderManager sessionHolderProviderManager)
sessionHolderProviderManager
- The sessionHolderProviderManager to set.public void setKeepNewNamespaces(boolean keepNamespaces)
keepNamespaces
- The keepNamespaces to set.forceNamespacesRegistration
public void setForceNamespacesRegistration(boolean forceNamespacesRegistration)
setKeepNewNamespaces(boolean)
setting, the old namespaces can be registered back
once the application context is destroyed. False by default.forceNamespacesRegistration
- The forceNamespacesRegistration to set.public void setSkipExistingNamespaces(boolean skipRegisteredNamespace)
setForceNamespacesRegistration(boolean)
method useless (as namespace registration cannot be forced).skipRegisteredNamespace
- The skipRegisteredNamespace to set.public boolean isForceNamespacesRegistration()
public boolean isKeepNewNamespaces()
public boolean isSkipExistingNamespaces()
public String getWorkspaceName()
Copyright © 2017 Hitachi Vantara. All rights reserved.