/** * This default implementation does: * <ul> * <li>calls {@link #checkCredentials(Credentials, String)}</li> * <li>calls {@link #checkWorkspace(String)}</li> * <li>calls {@link #createSessionInfo(Credentials, String)}</li> * </ul> * @param credentials the credentials for the login. * @param workspaceName the name of the workspace to log in. * @return the session info. * @throws LoginException if the credentials are invalid. * @throws NoSuchWorkspaceException if <code>workspaceName</code> is unknown. * @throws RepositoryException if another error occurs. */ public SessionInfo obtain(Credentials credentials, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException { checkCredentials(credentials, workspaceName); checkWorkspace(workspaceName); return createSessionInfo(credentials, workspaceName); }
public String[] getSupportedQueryLanguages(SessionInfo sessionInfo) throws RepositoryException { checkSessionInfo(sessionInfo); return new String[0]; }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then lazily initializes {@link #rootNodeDefinition} * if <code>nodeId</code> denotes the root node; otherwise throws a * {@link UnsupportedRepositoryOperationException}. */ public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException { checkSessionInfo(sessionInfo); if (nodeId.getUniqueID() == null && nodeId.getPath().denotesRoot()) { synchronized (this) { if (rootNodeDefinition == null) { rootNodeDefinition = createRootNodeDefinition(sessionInfo); } return rootNodeDefinition; } } throw new UnsupportedRepositoryOperationException(); }
@Override protected SessionInfo createSessionInfo(Credentials credentials, String workspaceName) throws RepositoryException { return super.createSessionInfo(credentials, workspaceName == null? defaulWsp : workspaceName); }
/** * This default implementation returns the session info returned by the call * to {@link #obtain(Credentials, String)} with the workspaceName taken from * the passed <code>sessionInfo</code>. */ public SessionInfo impersonate(SessionInfo sessionInfo, Credentials credentials) throws LoginException, RepositoryException { return obtain(credentials, sessionInfo.getWorkspaceName()); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then lazily initializes {@link #rootNodeDefinition} * if <code>nodeId</code> denotes the root node; otherwise throws a * {@link UnsupportedRepositoryOperationException}. */ public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException { checkSessionInfo(sessionInfo); if (nodeId.getUniqueID() == null && nodeId.getPath().denotesRoot()) { synchronized (this) { if (rootNodeDefinition == null) { rootNodeDefinition = createRootNodeDefinition(sessionInfo); } return rootNodeDefinition; } } throw new UnsupportedRepositoryOperationException(); }
@Override protected SessionInfo createSessionInfo(Credentials credentials, String workspaceName) throws RepositoryException { return super.createSessionInfo(credentials, workspaceName == null? defaulWsp : workspaceName); }
/** * This default implementation returns the session info returned by the call * to {@link #obtain(Credentials, String)} with the workspaceName taken from * the passed <code>sessionInfo</code>. */ public SessionInfo impersonate(SessionInfo sessionInfo, Credentials credentials) throws LoginException, RepositoryException { return obtain(credentials, sessionInfo.getWorkspaceName()); }
/** * This default implementation does: * <ul> * <li>calls {@link #checkCredentials(Credentials, String)}</li> * <li>calls {@link #checkWorkspace(String)}</li> * <li>calls {@link #createSessionInfo(Credentials, String)}</li> * </ul> * @param credentials the credentials for the login. * @param workspaceName the name of the workspace to log in. * @return the session info. * @throws LoginException if the credentials are invalid. * @throws NoSuchWorkspaceException if <code>workspaceName</code> is unknown. * @throws RepositoryException if another error occurs. */ public SessionInfo obtain(Credentials credentials, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException { checkCredentials(credentials, workspaceName); checkWorkspace(workspaceName); return createSessionInfo(credentials, workspaceName); }
public String[] getSupportedQueryLanguages(SessionInfo sessionInfo) throws RepositoryException { checkSessionInfo(sessionInfo); return new String[0]; }
/** * This default implementation returns the session info returned by the call * to {@link #createSessionInfo(SessionInfo, String)}. */ public SessionInfo obtain(SessionInfo sessionInfo, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException { return createSessionInfo(sessionInfo, workspaceName); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, */ public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException { checkSessionInfo(sessionInfo); return nodeTypeDefs.getAllDefinitions(); }
/** * This default implementation returns the session info returned by the call * to {@link #createSessionInfo(SessionInfo, String)}. */ public SessionInfo obtain(SessionInfo sessionInfo, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException { return createSessionInfo(sessionInfo, workspaceName); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then returns the prefix to namespace * URL mapping that was provided in the constructor of this repository * service. */ public Map<String, String> getRegisteredNamespaces(SessionInfo sessionInfo) throws RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getPrefixToURIMapping(); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then returns the prefix to namespace * URL mapping that was provided in the constructor of this repository * service. */ public Map<String, String> getRegisteredNamespaces(SessionInfo sessionInfo) throws RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getPrefixToURIMapping(); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then return the namespace prefix for * the given <code>uri</code>. */ public String getNamespacePrefix(SessionInfo sessionInfo, String uri) throws NamespaceException, RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getPrefix(uri); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, */ public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException { checkSessionInfo(sessionInfo); return nodeTypeDefs.getAllDefinitions(); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then gathers the {@link QNodeTypeDefinition}s * with the given <code>nodetypeNames</code>. If one of the nodetypeNames * is not a valid node type definition then a {@link RepositoryException} * is thrown. */ public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException { checkSessionInfo(sessionInfo); return nodeTypeDefs.getDefinitions(nodetypeNames); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then return the namespace prefix for * the given <code>uri</code>. */ public String getNamespacePrefix(SessionInfo sessionInfo, String uri) throws NamespaceException, RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getPrefix(uri); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then returns the namespace URI for the * given <code>prefix</code>. */ public String getNamespaceURI(SessionInfo sessionInfo, String prefix) throws NamespaceException, RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getURI(prefix); }