Skip navigation links

Oracle Beehive Java Content Repository Java API Reference
Release 1 (1.4)

E13801-01


oracle.ocs.jcr
Interface OracleNamespaceRegistry

All Superinterfaces:
javax.jcr.NamespaceRegistry

public interface OracleNamespaceRegistry
extends javax.jcr.NamespaceRegistry

OracleNamespaceRegistry represents the global persistent namespace registry of the JCR Repository. Each repository has a single, persistent namespace registry represented by the OracleNamespaceRegistry object, accessed via OracleWorkspace.getNamespaceRegistry(). The following describes the methods of OracleNamespaceRegistry supported.

See Also:
OracleWorkspace.getNamespaceRegistry()

Method Summary
 java.lang.String getPrefix(java.lang.String uri)
          Returns the prefix to which the given URI is mapped
 java.lang.String[] getPrefixes()
          Returns an array holding all currently registered prefixes.
 java.lang.String getURI(java.lang.String prefix)
          Returns the URI to which the given prefix is mapped.
 java.lang.String[] getURIs()
          Returns an array holding all currently registered URIs.
 void registerNamespace(java.lang.String prefix, java.lang.String uri)
          Sets a one-to-one mapping between prefix and URI in the namespace registry of this repository in the associated session.
 void unregisterNamespace(java.lang.String prefix)
          Removes a namespace mapping from the registry in the associated Session.

 

Method Detail

registerNamespace

void registerNamespace(java.lang.String prefix,
                       java.lang.String uri)
                       throws javax.jcr.NamespaceException,
                              javax.jcr.UnsupportedRepositoryOperationException,
                              javax.jcr.AccessDeniedException,
                              javax.jcr.RepositoryException
Sets a one-to-one mapping between prefix and URI in the namespace registry of this repository in the associated session. Assigning a new prefix to a URI that already exists in the namespace registry erases the old prefix. In general this can almost always be done, though to prevent particular remappings NamespaceException is thrown.

On the other hand, taking a prefix that is already assigned to a URI and re-assigning it to a new URI in effect unregisters that URI. Therefore, the same restrictions apply to this operation as to NamespaceRegistry.unregisterNamespace: