Package javax.jcr

Interface Repository

    • Field Detail

      • SPEC_VERSION_DESC

        static final java.lang.String SPEC_VERSION_DESC
        The descriptor key for the version of the specification that this repository implements. For JCR 2.0 the value of this descriptor is the String "2.0".
        See Also:
        Constant Field Values
      • SPEC_NAME_DESC

        static final java.lang.String SPEC_NAME_DESC
        The descriptor key for the name of the specification that this repository implements. For JCR 2.0 the value of this descriptor is the String "Content Repository for Java Technology API".
        See Also:
        Constant Field Values
      • REP_VENDOR_DESC

        static final java.lang.String REP_VENDOR_DESC
        The descriptor key for the name of the repository vendor. The descriptor returned for this key is a String.
        See Also:
        Constant Field Values
      • REP_VENDOR_URL_DESC

        static final java.lang.String REP_VENDOR_URL_DESC
        The descriptor key for the URL of the repository vendor. The descriptor returned for this key is a String.
        See Also:
        Constant Field Values
      • REP_NAME_DESC

        static final java.lang.String REP_NAME_DESC
        The descriptor key for the name of this repository implementation. The descriptor returned for this key is a String.
        See Also:
        Constant Field Values
      • REP_VERSION_DESC

        static final java.lang.String REP_VERSION_DESC
        The descriptor key for the version of this repository implementation. The descriptor returned for this key is a String.
        See Also:
        Constant Field Values
      • WRITE_SUPPORTED

        static final java.lang.String WRITE_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if repository content can be updated through the JCR API (as opposed to having read-only access).
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • IDENTIFIER_STABILITY

        static final java.lang.String IDENTIFIER_STABILITY
        Key to a String descriptor. Returns one of the following javax.jcr.Repository constants indicating the stability of identifiers:

        IDENTIFIER_STABILITY_METHOD_DURATION
        Identifiers may change between method calls.

        IDENTIFIER_STABILITY_SAVE_DURATION
        Identifiers are guaranteed stable within a single save/refresh cycle.

        IDENTIFIER_STABILITY_SESSION_DURATION
        Identifiers are guaranteed stable within a single session.

        IDENTIFIER_STABILITY_INDEFINITE_DURATION
        Identifiers are guaranteed to be stable forever.

        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • IDENTIFIER_STABILITY_METHOD_DURATION

        static final java.lang.String IDENTIFIER_STABILITY_METHOD_DURATION
        One of four possible values for the descriptor IDENTIFIER_STABILITY. Indicates that identifiers may change between method calls.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • IDENTIFIER_STABILITY_SAVE_DURATION

        static final java.lang.String IDENTIFIER_STABILITY_SAVE_DURATION
        One of four possible values for the descriptor IDENTIFIER_STABILITY. Indicates that identifiers are guaranteed stable within a single save/refresh cycle.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • IDENTIFIER_STABILITY_SESSION_DURATION

        static final java.lang.String IDENTIFIER_STABILITY_SESSION_DURATION
        One of four possible values for the descriptor IDENTIFIER_STABILITY. Indicates that identifiers are guaranteed stable within a single session.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • IDENTIFIER_STABILITY_INDEFINITE_DURATION

        static final java.lang.String IDENTIFIER_STABILITY_INDEFINITE_DURATION
        One of four possible values for the descriptor IDENTIFIER_STABILITY. Indicates that identifiers are guaranteed to be stable forever.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_XML_EXPORT_SUPPORTED

        static final java.lang.String OPTION_XML_EXPORT_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if XML export is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_XML_IMPORT_SUPPORTED

        static final java.lang.String OPTION_XML_IMPORT_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if XML import is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_UNFILED_CONTENT_SUPPORTED

        static final java.lang.String OPTION_UNFILED_CONTENT_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if unfiled content is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_VERSIONING_SUPPORTED

        static final java.lang.String OPTION_VERSIONING_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if full versioning is supported.
        See Also:
        Constant Field Values
      • OPTION_SIMPLE_VERSIONING_SUPPORTED

        static final java.lang.String OPTION_SIMPLE_VERSIONING_SUPPORTED
        See Also:
        Constant Field Values
      • OPTION_ACTIVITIES_SUPPORTED

        static final java.lang.String OPTION_ACTIVITIES_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if activities are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_BASELINES_SUPPORTED

        static final java.lang.String OPTION_BASELINES_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if configurations and baselines are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_ACCESS_CONTROL_SUPPORTED

        static final java.lang.String OPTION_ACCESS_CONTROL_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if access control is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_LOCKING_SUPPORTED

        static final java.lang.String OPTION_LOCKING_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if locking is supported.
        See Also:
        Constant Field Values
      • OPTION_OBSERVATION_SUPPORTED

        static final java.lang.String OPTION_OBSERVATION_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if asynchronous observation is supported.
        See Also:
        Constant Field Values
      • OPTION_JOURNALED_OBSERVATION_SUPPORTED

        static final java.lang.String OPTION_JOURNALED_OBSERVATION_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if journaled observation is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_RETENTION_SUPPORTED

        static final java.lang.String OPTION_RETENTION_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if retention and hold are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_LIFECYCLE_SUPPORTED

        static final java.lang.String OPTION_LIFECYCLE_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if lifecycles are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_TRANSACTIONS_SUPPORTED

        static final java.lang.String OPTION_TRANSACTIONS_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if transactions are supported.
        See Also:
        Constant Field Values
      • OPTION_WORKSPACE_MANAGEMENT_SUPPORTED

        static final java.lang.String OPTION_WORKSPACE_MANAGEMENT_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if workspace management is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_UPDATE_PRIMARY_NODE_TYPE_SUPPORTED

        static final java.lang.String OPTION_UPDATE_PRIMARY_NODE_TYPE_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if the primary node type of an existing node can be updated.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_UPDATE_MIXIN_NODE_TYPES_SUPPORTED

        static final java.lang.String OPTION_UPDATE_MIXIN_NODE_TYPES_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if the mixin node types of an existing node can be added and removed.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_SHAREABLE_NODES_SUPPORTED

        static final java.lang.String OPTION_SHAREABLE_NODES_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if the creation of shareable nodes is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_NODE_TYPE_MANAGEMENT_SUPPORTED

        static final java.lang.String OPTION_NODE_TYPE_MANAGEMENT_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if node type management is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • OPTION_NODE_AND_PROPERTY_WITH_SAME_NAME_SUPPORTED

        static final java.lang.String OPTION_NODE_AND_PROPERTY_WITH_SAME_NAME_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if node and property with same name is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_INHERITANCE

        static final java.lang.String NODE_TYPE_MANAGEMENT_INHERITANCE
        Key to String descriptor. Returns one of the following javax.jcr.Repository constants indicating the level of support for node type inheritance:
        NODE_TYPE_MANAGEMENT_INHERITANCE_MINIMAL
        Registration of primary node types is limited to those which have only nt:base as supertype. Registration of mixin node types is limited to those without any supertypes.
        NODE_TYPE_MANAGEMENT_INHERITANCE_SINGLE
        Registration of primary node types is limited to those with exactly one supertype. Registration of mixin node types is limited to those with at most one supertype.
        NODE_TYPE_MANAGEMENT_INHERITANCE_MULTIPLE
        Primary node types can be registered with one or more supertypes. Mixin node types can be registered with zero or more supertypes.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_INHERITANCE_MINIMAL

        static final java.lang.String NODE_TYPE_MANAGEMENT_INHERITANCE_MINIMAL
        One of three possible values for the descriptor NODE_TYPE_MANAGEMENT_INHERITANCE. Indicates that registration of primary node types is limited to those which have only nt:base as supertype. Registration of mixin node types is limited to those without any supertypes.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_INHERITANCE_SINGLE

        static final java.lang.String NODE_TYPE_MANAGEMENT_INHERITANCE_SINGLE
        One of three possible values for the descriptor NODE_TYPE_MANAGEMENT_INHERITANCE. Indicates that registration of primary node types is limited to those with exactly one supertype. Registration of mixin node types is limited to those with at most one supertype.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_INHERITANCE_MULTIPLE

        static final java.lang.String NODE_TYPE_MANAGEMENT_INHERITANCE_MULTIPLE
        One of three possible values for the descriptor NODE_TYPE_MANAGEMENT_INHERITANCE. Indicates that primary node types can be registered with one or more supertypes. Mixin node types can be registered with zero or more supertypes.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_OVERRIDES_SUPPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_OVERRIDES_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if override of inherited property or child node definitions is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_PRIMARY_ITEM_NAME_SUPPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_PRIMARY_ITEM_NAME_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if primary items are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_ORDERABLE_CHILD_NODES_SUPPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_ORDERABLE_CHILD_NODES_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if preservation of child node ordering is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_RESIDUAL_DEFINITIONS_SUPPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_RESIDUAL_DEFINITIONS_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if residual property and child node definitions are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_AUTOCREATED_DEFINITIONS_SUPPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_AUTOCREATED_DEFINITIONS_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if autocreated properties and child nodes are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_SAME_NAME_SIBLINGS_SUPPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_SAME_NAME_SIBLINGS_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if same-name sibling child nodes are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_PROPERTY_TYPES

        static final java.lang.String NODE_TYPE_MANAGEMENT_PROPERTY_TYPES
        Key to a long[] descriptor. Returns an array holding the javax.jcr.PropertyType constants for the property types (including UNDEFINED, if supported) that a registered node type can specify, or a zero-length array if registered node types cannot specify property definitions.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_MULTIVALUED_PROPERTIES_SUPPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_MULTIVALUED_PROPERTIES_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if multivalue properties are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_MULTIPLE_BINARY_PROPERTIES_SUPPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_MULTIPLE_BINARY_PROPERTIES_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if registration of a node types with more than one BINARY property is permitted.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_VALUE_CONSTRAINTS_SUPPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_VALUE_CONSTRAINTS_SUPPORTED
        Key to a boolean descriptor. Returns true if and only value-constraints are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • NODE_TYPE_MANAGEMENT_UPDATE_IN_USE_SUPORTED

        static final java.lang.String NODE_TYPE_MANAGEMENT_UPDATE_IN_USE_SUPORTED
        Key to a boolean descriptor. Returns true if and only the update of node types is supported for node types currently in use as the type of an existing node in the repository.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • QUERY_LANGUAGES

        static final java.lang.String QUERY_LANGUAGES
        Key to a String[] descriptor. Returns an array holding the constants representing the supported query languages, or a zero-length if query is not supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • QUERY_STORED_QUERIES_SUPPORTED

        static final java.lang.String QUERY_STORED_QUERIES_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if stored queries are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • QUERY_FULL_TEXT_SEARCH_SUPPORTED

        static final java.lang.String QUERY_FULL_TEXT_SEARCH_SUPPORTED
        Key to a boolean descriptor. Returns true if and only if full-text search is supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • QUERY_JOINS

        static final java.lang.String QUERY_JOINS
        Key to String descriptor. Returns one of the following javax.jcr.Repository constants indicating the level of support for joins in queries:
        QUERY_JOINS_NONE
        Joins are not supported. Queries are limited to a single selector.
        QUERY_JOINS_INNER
        Inner joins are supported.
        QUERY_JOINS_INNER_OUTER
        Inner and outer joins are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • QUERY_JOINS_NONE

        static final java.lang.String QUERY_JOINS_NONE
        One of three possible values for the descriptor QUERY_JOINS . Indicates that joins are not supported. Queries are limited to a single selector.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • QUERY_JOINS_INNER

        static final java.lang.String QUERY_JOINS_INNER
        One of three possible values for the descriptor QUERY_JOINS . Indicates that inner joins are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • QUERY_JOINS_INNER_OUTER

        static final java.lang.String QUERY_JOINS_INNER_OUTER
        One of three possible values for the descriptor QUERY_JOINS . Indicates that inner and outer joins are supported.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • LEVEL_1_SUPPORTED

        static final java.lang.String LEVEL_1_SUPPORTED
        Deprecated.
        As of JCR 2.0.
        Key to a boolean descriptor. Returns true if and only if
        • OPTION_XML_EXPORT_SUPPORTED = true and
        • QUERY_LANGUAGES is of non-zero length.
        These semantics are identical to those in JCR 1.0. This constant is deprecated.
        See Also:
        Constant Field Values
      • LEVEL_2_SUPPORTED

        static final java.lang.String LEVEL_2_SUPPORTED
        Deprecated.
        As of JCR 2.0.
        Key to a boolean descriptor. Returns true if and only if
        • LEVEL_1_SUPPORTED = true,
        • WRITE_SUPPORTED = true and
        • OPTION_XML_IMPORT_SUPPORTED = true.
        These semantics are identical to those in JCR 1.0. This constant is deprecated.
        See Also:
        Constant Field Values
      • OPTION_QUERY_SQL_SUPPORTED

        static final java.lang.String OPTION_QUERY_SQL_SUPPORTED
        Deprecated.
        As of JCR 2.0.
        Key to a boolean descriptor. Returns true if and only if the (deprecated) JCR 1.0 XPath query language is supported. This constant is deprecated.
        See Also:
        Constant Field Values
      • QUERY_XPATH_POS_INDEX

        static final java.lang.String QUERY_XPATH_POS_INDEX
        Deprecated.
        As of JCR 2.0.
        Key to a boolean descriptor. Returns false unless the (deprecated) JCR 1.0 XPath query language is supported. If JCR 1.0 XPath is supported then this descriptor has the same semantics as in JCR 1.0. This constant is deprecated.
        See Also:
        Constant Field Values
      • QUERY_XPATH_DOC_ORDER

        static final java.lang.String QUERY_XPATH_DOC_ORDER
        Deprecated.
        As of JCR 2.0.
        Key to a boolean descriptor. Returns false unless the (deprecated) JCR 1.0 XPath query language is supported. If JCR 1.0 XPath is supported then this descriptor has the same semantics as in JCR 1.0. This constant is deprecated.
        See Also:
        Constant Field Values
    • Method Detail

      • getDescriptorKeys

        java.lang.String[] getDescriptorKeys()
        Returns a string array holding all descriptor keys available for this implementation, both the standard descriptors defined by the string constants in this interface and any implementation-specific descriptors. Used in conjunction with getDescriptorValue(String key) and getDescriptorValues(String key) to query information about this repository implementation.
        Returns:
        a string array holding all descriptor keys.
      • isStandardDescriptor

        boolean isStandardDescriptor​(java.lang.String key)
        Returns true if key is a standard descriptor defined by the string constants in this interface and false if it is either a valid implementation-specific key or not a valid key.
        Parameters:
        key - a descriptor key.
        Returns:
        whether key is a standard descriptor.
        Since:
        JCR 2.0
      • isSingleValueDescriptor

        boolean isSingleValueDescriptor​(java.lang.String key)
        Returns true if key is a valid single-value descriptor; otherwise returns false.
        Parameters:
        key - a descriptor key.
        Returns:
        whether the specified desdfriptor is multi-valued.
        Since:
        JCR 2.0
      • getDescriptorValue

        Value getDescriptorValue​(java.lang.String key)
        The value of a single-value descriptor is found by passing the key for that descriptor to this method. If key is the key of a multi-value descriptor or not a valid key this method returns null.
        Parameters:
        key - a descriptor key.
        Returns:
        The value of the indicated descriptor
        Since:
        JCR 2.0
      • getDescriptorValues

        Value[] getDescriptorValues​(java.lang.String key)
        The value array of a multi-value descriptor is found by passing the key for that descriptor to this method. If key is the key of a single-value descriptor then this method returns that value as an array of size one. If key is not a valid key this method returns null.
        Parameters:
        key - a descriptor key.
        Returns:
        the value array for the indicated descriptor
        Since:
        JCR 2.0
      • getDescriptor

        java.lang.String getDescriptor​(java.lang.String key)

        A convenience method. The call

        String s = repository.getDescriptor(key);

        is equivalent to

        Value v = repository.getDescriptorValue(key);
        String s = (v == null) ? null : v.getString();

        Parameters:
        key - a descriptor key.
        Returns:
        a descriptor value in string form.
      • login

        Session login​(Credentials credentials,
                      java.lang.String workspaceName)
               throws LoginException,
                      NoSuchWorkspaceException,
                      RepositoryException
        Authenticates the user using the supplied credentials. If workspaceName is recognized as the name of an existing workspace in the repository and authorization to access that workspace is granted, then a new Session object is returned. The format of the string workspaceName depends upon the implementation.

        If credentials is null, it is assumed that authentication is handled by a mechanism external to the repository itself (for example, through the JAAS framework) and that the repository implementation exists within a context (for example, an application server) that allows it to handle authorization of the request for access to the specified workspace.

        If workspaceName is null, a default workspace is automatically selected by the repository implementation. This may, for example, be the "home workspace" of the user whose credentials were passed, though this is entirely up to the configuration and implementation of the repository. Alternatively, it may be a "null workspace" that serves only to provide the method Workspace.getAccessibleWorkspaceNames(), allowing the client to select from among available "real" workspaces.

        Parameters:
        credentials - The credentials of the user
        workspaceName - the name of a workspace.
        Returns:
        a valid session for the user to access the repository.
        Throws:
        LoginException - if authentication or authorization for the specified workspace fails.
        NoSuchWorkspaceException - if the specified workspaceName is not recognized.
        RepositoryException - if another error occurs.