Class AbstractReadableRepositoryService

  • All Implemented Interfaces:
    org.apache.jackrabbit.spi.RepositoryService

    public abstract class AbstractReadableRepositoryService
    extends AbstractRepositoryService
    AbstractReadableRepositoryService provides an abstract base class where all methods that attempt to write throw an UnsupportedRepositoryOperationException. This class useful for repository service implementation that only provide read access to the underlying content.
    • Field Detail

      • WRITE_ACTIONS

        protected static final Set<String> WRITE_ACTIONS
      • wspNames

        protected final List<String> wspNames
        The list of workspaces that this repository service exposes.
      • defaulWsp

        protected final String defaulWsp
        The name of the default workspace
    • Constructor Detail

      • AbstractReadableRepositoryService

        public AbstractReadableRepositoryService​(Map<String,​org.apache.jackrabbit.spi.QValue[]> descriptors,
                                                 Map<String,​String> namespaces,
                                                 Reader cnd,
                                                 List<String> wspNames,
                                                 String defaultWsp)
                                          throws RepositoryException,
                                                 org.apache.jackrabbit.commons.cnd.ParseException,
                                                 IllegalArgumentException
        Creates a new AbstractReadableRepositoryService.
        Parameters:
        descriptors - the repository descriptors. Maps descriptor keys to descriptor values.
        namespaces - the namespaces. Maps namespace prefixes to namespace URIs.
        cnd - a reader on the compact node type definition.
        wspNames - a list of workspace names.
        defaultWsp - name of the default workspace
        Throws:
        RepositoryException - if the namespace mappings are invalid.
        org.apache.jackrabbit.commons.cnd.ParseException - if an error occurs while parsing the CND.
        IllegalArgumentException - if defaultWsp is null
    • Method Detail

      • createSessionInfo

        protected org.apache.jackrabbit.spi.SessionInfo createSessionInfo​(Credentials credentials,
                                                                          String workspaceName)
                                                                   throws RepositoryException
        Description copied from class: AbstractRepositoryService
        Creates a session info instance for the given credentials and workspaceName. This default implementation creates a SessionInfoImpl instance and sets the userId and workspaceName. The user userId is null or the userId from credentials if it is of type SimpleCredentials.
        Overrides:
        createSessionInfo in class AbstractRepositoryService
        Parameters:
        credentials - the credentials.
        workspaceName - the name of the workspace to access or null for the default workspace.
        Returns:
        a session info instance for the given credentials and workspaceName.
        Throws:
        RepositoryException
      • getItemInfoCache

        public org.apache.jackrabbit.spi.ItemInfoCache getItemInfoCache​(org.apache.jackrabbit.spi.SessionInfo sessionInfo)
        Parameters:
        sessionInfo -
        Returns:
        a new instance of ItemInfoCacheImpl
      • getNodeInfo

        public org.apache.jackrabbit.spi.NodeInfo getNodeInfo​(org.apache.jackrabbit.spi.SessionInfo sessionInfo,
                                                              org.apache.jackrabbit.spi.NodeId nodeId)
                                                       throws ItemNotFoundException,
                                                              RepositoryException
        This default implementation returns the first item returned by the call to RepositoryService.getItemInfos(SessionInfo, ItemId). The underlying assumption here is that the implementation and the persistence layer are optimized for batch reading. That is, a call to getItemInfos is no more expensive than retrieving the single NodeInfo only. If this assumption does not hold, subclasses should override this method.
        Throws:
        ItemNotFoundException
        RepositoryException