public Object call() throws RepositoryException { return service.obtain(credentials, workspaceName); } }, "obtain(Credentials, String)", new Object[]{credentials, workspaceName});
public Object call() throws RepositoryException { return service.obtain(unwrap(sessionInfo), workspaceName); } }, "obtain(SessionInfo, String)", new Object[]{unwrap(sessionInfo), workspaceName});
public Object call() throws RepositoryException { return service.obtain(unwrap(sessionInfo), workspaceName); } }, "obtain(SessionInfo, String)", new Object[]{unwrap(sessionInfo), workspaceName});
public Object call() throws RepositoryException { return service.obtain(credentials, workspaceName); } }, "obtain(Credentials, String)", new Object[]{credentials, workspaceName});
public SessionInfo obtain(Credentials credentials, String workspaceName) throws RepositoryException { return repositoryService.obtain(credentials, workspaceName); }
public SessionInfo obtain(SessionInfo sessionInfo, String workspaceName) throws RepositoryException { return repositoryService.obtain(sessionInfo, workspaceName); }
SessionImpl switchWorkspace(String workspaceName) throws AccessDeniedException, NoSuchWorkspaceException, RepositoryException { checkAccessibleWorkspace(workspaceName); SessionInfo info = config.getRepositoryService().obtain(sessionInfo, workspaceName); if (info instanceof XASessionInfo) { return new XASessionImpl((XASessionInfo) info, repository, config); } else { return new SessionImpl(info, repository, config); } }
SessionImpl switchWorkspace(String workspaceName) throws AccessDeniedException, NoSuchWorkspaceException, RepositoryException { checkAccessibleWorkspace(workspaceName); SessionInfo info = config.getRepositoryService().obtain(sessionInfo, workspaceName); if (info instanceof XASessionInfo) { return new XASessionImpl((XASessionInfo) info, repository, config); } else { return new SessionImpl(info, repository, config); } }
/** * @see Repository#login(javax.jcr.Credentials, String) */ public Session login(Credentials credentials, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException { SessionInfo info = config.getRepositoryService().obtain(credentials, workspaceName); try { if (info instanceof XASessionInfo) { return new XASessionImpl((XASessionInfo) info, this, config); } else { return new SessionImpl(info, this, config); } } catch (RepositoryException ex) { config.getRepositoryService().dispose(info); throw ex; } }
/** * @see Repository#login(javax.jcr.Credentials, String) */ public Session login(Credentials credentials, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException { SessionInfo info = config.getRepositoryService().obtain(credentials, workspaceName); try { if (info instanceof XASessionInfo) { return new XASessionImpl((XASessionInfo) info, this, config); } else { return new SessionImpl(info, this, config); } } catch (RepositoryException ex) { config.getRepositoryService().dispose(info); throw ex; } }
public void testObtainWithNullWorkspaceName() throws RepositoryException, LoginException { SessionInfo sInfo = rs.obtain(new SimpleCredentials("admin", "admin".toCharArray()), null); try { assertEquals("default",sInfo.getWorkspaceName()); } finally { rs.dispose(sInfo); } } }
public SessionInfo getAdminSessionInfo() throws RepositoryException { // force assignment of repoStub getRepositoryService(); String propName = RepositoryServiceStub.PROP_PREFIX + "." + RepositoryServiceStub.PROP_WORKSPACE; String wspName = repoServiceStub.getProperty(propName); return getRepositoryService().obtain(getAdminCredentials(), wspName); }
protected void setUp() throws Exception { super.setUp(); workspaceName = getProperty(RepositoryServiceStub.PROP_WORKSPACE); sessionInfo = helper.getRepositoryService().obtain(helper.getAdminCredentials(), workspaceName); }
public SessionInfo getReadOnlySessionInfo() throws RepositoryException { // force assignment of repoStub getRepositoryService(); String propName = RepositoryServiceStub.PROP_PREFIX + "." + RepositoryServiceStub.PROP_WORKSPACE; String wspName = repoServiceStub.getProperty(propName); return getRepositoryService().obtain(getReadOnlyCredentials(), wspName); } }
public void testNullWorkspaceName() throws RepositoryException { SessionInfo sInfo = service.obtain(helper.getAdminCredentials(), null); try { assertNotNull(sInfo.getWorkspaceName()); } finally { service.dispose(sInfo); } }
public void testCopyAcrossWorkspaces() throws RepositoryException { // todo: retrieve second wsp-name from config sInfo = rs.obtain(si, "test"); NodeId srcId = getNodeId(testPath); NodeId destParentId = getNodeId("/"); rs.copy(sInfo, si.getWorkspaceName(), srcId, destParentId, resolver.getQName("destname")); copiedId = getNodeId("/destname"); NodeInfo nInfo = rs.getNodeInfo(sInfo, copiedId); Iterator<? extends ItemInfo> it = rs.getItemInfos(sInfo, copiedId); assertTrue(it.hasNext()); NodeInfo nInfo2 = (NodeInfo) it.next(); assertEquals(nInfo.getId(), nInfo2.getId()); assertEquals(nInfo.getNodetype(), nInfo2.getNodetype()); } }
@Override protected void setUp() throws Exception { super.setUp(); rs = helper.getRepositoryService(); si = helper.getAdminSessionInfo(); NamespaceResolver nsResolver = new AbstractNamespaceResolver() { public String getURI(String prefix) throws NamespaceException { return ("jcr".equals(prefix)) ? "http://www.jcp.org/jcr/1.0" : prefix; } public String getPrefix(String uri) throws NamespaceException { return ("http://www.jcp.org/jcr/1.0".equals(uri)) ? "jcr" : uri; } }; resolver = new DefaultNamePathResolver(nsResolver); try { rs.getNodeInfo(si, getNodeId(testPath)); } catch (RepositoryException e) { Batch b = rs.createBatch(si, getNodeId("/")); b.addNode(getNodeId("/"), resolver.getQName("test"), NameConstants.NT_UNSTRUCTURED, null); rs.submit(b); } // todo: retrieve second wsp-name from config sInfo = rs.obtain(si, "test"); }