Package org.jahia.services.usermanager.jcr

Examples of org.jahia.services.usermanager.jcr.JCRUser


            synchronized (args) {
                @SuppressWarnings("unchecked")
                final List<File> files = (List<File>) args;
                if (!files.isEmpty()) {
                    try {
                        JCRUser user = JCRUserManagerProvider.getInstance().lookupRootUser();
                        JCRSessionFactory.getInstance().setCurrentUser(user);
                        JCRTemplate.getInstance().doExecuteWithSystemSession(user.getUsername(), new JCRCallback<Object>() {
                            public Object doInJCR(JCRSessionWrapper session) throws RepositoryException {
                                JCRNodeWrapper dest = session.getNode("/imports");
                                for (File file : files) {
                                    try {
                                        InputStream is = new BufferedInputStream(new FileInputStream(file));
View Full Code Here


    public int hashCode() {
        return getUserKey().hashCode();
    }

    protected UserProperties initializeMergedProperties() {
        JCRUser jcrUser = lookupExternalUser();
        return jcrUser != null ? jcrUser.getUserProperties() : null;
    }
View Full Code Here

    }

    protected abstract boolean removePropertyExternal(String key);

    protected boolean removePropertyInternal(String key) {
        JCRUser jcrUser = lookupExternalUser();
        return jcrUser != null && jcrUser.removeProperty(key);
    }
View Full Code Here

    }

    protected abstract boolean setPropertyExternal(String key, String value);

    protected boolean setPropertyInternal(String key, String value) {
        JCRUser jcrUser = lookupExternalUser();
        if (jcrUser == null) {
            // deploy
            try {
                long timer = System.currentTimeMillis();
                JCRStoreService.getInstance().deployExternalUser(this);
                JahiaUserManagerService.LOGGER.info(
                        "Created internal user node for user {} in {} ms", userKey,
                        (System.currentTimeMillis() - timer));
                jcrUser = lookupExternalUser();
            } catch (RepositoryException e) {
                JahiaUserManagerService.LOGGER.error("Error deploying external user '" + getName()
                        + "' for provider '" + getProviderName() + "' into JCR repository. Cause: "
                        + e.getMessage(), e);
            }
        }

        return jcrUser != null && jcrUser.setProperty(key, value);
    }
View Full Code Here

TOP

Related Classes of org.jahia.services.usermanager.jcr.JCRUser

Copyright © 2018 www.massapicom. 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.