Package org.apache.marmotta.platform.user.model

Examples of org.apache.marmotta.platform.user.model.UserAccount


                webid = userService.getUser(login);
            }
        }

        if(webid instanceof KiWiUriResource) {
            UserAccount account = new UserAccount(login, webid.stringValue());

            save(account);

            return account;
        } else {
View Full Code Here


    }

    @Override
    public UserAccount getAccount(String login) {
        if (StringUtils.isBlank(login)) return null;
        UserAccount account = null;
        if (userCache != null && userCache.get(login) != null) {
            account = (UserAccount) userCache.get(login).getObjectValue();
        } else {
            if (configurationService.isConfigurationSet("user."+login+".webid")) {
                account = new UserAccount();

                account.setLogin(login);
                account.setPasswdHash(configurationService.getStringConfiguration("user."+login+".pwhash"));
                account.setRoles(new HashSet<String>(configurationService.getListConfiguration("user."+login+".roles")));
                account.setWebId(configurationService.getStringConfiguration("user."+login+".webid"));

                userCache.put(new Element(account.getLogin(), account));
                userCache.put(new Element(account.getWebId(), account));
            } else {
                log.info("UserAccount {} not found", login);
            }
        }
        return account;
View Full Code Here

    @Override
    public UserAccount getAccount(URI resource) {
        Preconditions.checkArgument(resource != null);

        UserAccount account = null;
        if (userCache != null && userCache.get(resource) != null) {
            account = (UserAccount) userCache.get(resource).getObjectValue();
        } else {
            for(UserAccount a : listAccounts()) {
                if(a.getWebId().equals(resource.stringValue())) {
                    account = a;
                    break;
                }
            }
            if (account != null) {
                userCache.put(new Element(account.getLogin(), account));
                userCache.put(new Element(account.getWebId(), account));
            } else {
                log.warn("UserAccount {} not found", resource);
            }
        }
        return account;
View Full Code Here

TOP

Related Classes of org.apache.marmotta.platform.user.model.UserAccount

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.