6.2.2 Workspace Read Methods

In a level 1 repository the Workspace object serves only to encapsulate a number of methods for accessing either information about the Workspace or classes that provide further repository functions. The following are the level 1 methods of Workspace. Workspace has other methods as well, though in a level 1-only implementation these will either do nothing or throw an exception.

javax.jcr.
Workspace

Session

getSession()

Returns the Session object through which this Workspace object was acquired.

String

getName()

Returns the name of the actual persistent workspace represented by this Workspace object. This is the name used in Repository.login.

QueryManager

getQueryManager()

Returns the QueryManager, through which search methods are accessed. See 6.6 Searching Repository Content.

A RepositoryException is thrown if an error occurs.

NamespaceRegistry

getNamespaceRegistry()

Returns the NamespaceRegistry object, which can be used to access the mapping between prefixes and namespaces. See 6.3 Namespaces.

A RepositoryException is thrown if an error occurs.

NodeTypeManager

getNodeTypeManager()

Returns the NodeTypeManager, which is used to access information about which node types are available in the repository. There is one node type registry per repository, therefore the NodeTypeManager is not workspace-specific; it provides introspection methods for the global, repository-wide set of available node types. See 6.7 Node Types.

A RepositoryException is thrown if an error occurs.

String[]

getAccessibleWorkspaceNames()

Returns an string array containing the names of all workspaces in this repository that are accessible to this user, given the Credentials that were used to get the Session to which this Workspace is tied.

In order to access one of the listed workspaces, the user performs another Repository.login, specifying the name of the desired workspace, and receives a new Session object.

A RepositoryException is thrown if an error occurs.