Package javax.jcr

Examples of javax.jcr.Session.logout()


        try {
            return contentLoaderService.getRepository().loginAdministrative(workspace);
        } catch (NoSuchWorkspaceException e) {
            Session temp = contentLoaderService.getRepository().loginAdministrative(null);
            temp.getWorkspace().createWorkspace(workspace);
            temp.logout();
            return contentLoaderService.getRepository().loginAdministrative(workspace);
        }
    }

}
View Full Code Here


                    s.save();
                } catch (RepositoryException re) {
                    log.error("TODO: Failed setting up anonymous access", re);
                } finally {
                    if (s != null) {
                        s.logout();
                    }
                }
            } else {
                log.warn("TODO: should disable anonymous access when {} becomes false", ANONYMOUS_READ_PROP);
            }
View Full Code Here

            } catch (final RepositoryException re) {
                throw failure("connect", re.toString(), re);
            } finally {
                if ( session != null ) {
                    session.logout();
                }
            }
        }
    }
View Full Code Here

            } catch (RepositoryException e) {
                pw.println("Unable to output namespace mappings.");
                e.printStackTrace(pw);
            } finally {
                if (session != null) {
                    session.logout();
                }
            }
        } else {
            pw.println("SlingRepository is not available.");
        }
View Full Code Here

            } catch (RepositoryException e) {
                pw.println("Unable to output namespace mappings.");
                e.printStackTrace(pw);
            } finally {
                if (session != null) {
                    session.logout();
                }
            }
        } else {
            pw.println("SlingRepository is not available.");
        }
View Full Code Here

                            session = tmpSession.impersonate(new SimpleCredentials(
                                session.getUserID(), new char[0]));
                        }
                    } finally {
                        if (tmpSession != null) {
                            tmpSession.logout();
                        }
                    }

                } else {
View Full Code Here

            final String propValue = "PV_" + name;
            final Node child = nodeType == null ? root.addNode(name) : root.addNode(name, nodeType);
            child.setProperty(propName, propValue);
            child.setProperty("foo", child.getPath());
            s.save();
            s.logout();
            s = repository.loginAdministrative(null);
            final Node n = s.getNode("/" + name);
            assertNotNull(n);
            assertEquals(propValue, n.getProperty(propName).getString());
            return n.getPath();
View Full Code Here

            final Node n = s.getNode("/" + name);
            assertNotNull(n);
            assertEquals(propValue, n.getProperty(propName).getString());
            return n.getPath();
        } finally {
            s.logout();
        }
    }

    protected String uniqueName(String hint) {
        return hint + "_" + uniqueNameCounter.incrementAndGet() + "_" + System.currentTimeMillis();
View Full Code Here

                }
            }
            s.save();
            toDelete.clear();
        } finally {
            s.logout();
        }
    }
   
    @Test
    public void testRepositoryPresent() {
View Full Code Here

    @Test
    public void testLoginAdministrative() throws RepositoryException {
        final Session s = repository.loginAdministrative(null);
        assertNotNull(s);
        s.logout();
    }

    @Test
    public void testExplicitAdminLogin() throws RepositoryException {
        final Credentials creds = new SimpleCredentials("admin", "admin".toCharArray());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.