Examples of UserRecord


Examples of org.jdesktop.wonderland.modules.securitysession.weblib.UserRecord

    }

    public String getUserId(String token) {
        String out = null;

        UserRecord rec = getByToken(token);
        if (rec != null) {
            out = rec.getUserId();
        }

        return out;
    }
View Full Code Here

Examples of org.jdesktop.wonderland.modules.securitysession.weblib.UserRecord

        return out;
    }

    public synchronized UserRecord logout(String token) {
        UserRecord rec = byToken.remove(token);
        if (rec != null) {
            byUserId.remove(rec.getUserId());
        }

        return rec;
    }
View Full Code Here

Examples of org.jdesktop.wonderland.modules.securitysession.weblib.UserRecord

    @POST
    @Consumes("application/x-www-form-urlencoded")
    public Response post(@FormParam("attribute_names") List<String> attrNames,
                         @FormParam("subjectid") String subjectId)
    {
        UserRecord rec = sm.getByToken(subjectId);
        if (rec == null) {
            throw new NotFoundException("No such token " + subjectId);
        }

        StringBuffer res = new StringBuffer(PREFIX + "token.id=" + subjectId + "\n");

        Attributes attrs = rec.getAttributes();
       
        logger.fine("Found " + attrs.size() +
                    " attributes for " + rec.getUserId());

        NamingEnumeration attrEnum = attrs.getAll();
        try {
            while (attrEnum.hasMore()) {
                Attribute attr = (Attribute) attrEnum.next();
View Full Code Here

Examples of org.jdesktop.wonderland.modules.securitysession.weblib.UserRecord

    @Consumes("application/x-www-form-urlencoded")
    public Response post(@FormParam("name") String name,
                         @FormParam("attribute_names") List<String> attrNames,
                         @FormParam("admin") String adminId)
    {
        UserRecord admin = sm.getByToken(adminId);
        if (admin == null) {
            throw new NotFoundException("Invalid token " + adminId);
        }

        // check that the admin user is actually in the admin group
        if (!isAdmin(admin.getUserId())) {
            return Response.status(Response.Status.FORBIDDEN)
                           .entity("Only administrators can read")
                           .type("text/plain").build();
        }

        // now look up the user
        UserRecord rec = sm.get(name);
        if (rec == null) {
            throw new NotFoundException("Unknown name " + name);
        }

        StringBuffer res = new StringBuffer(PREFIX + "name=" + name + "\n");
        res.append(PREFIX + "type=user\n");
        res.append(PREFIX + "attribute=\n");

        Attributes attrs = rec.getAttributes();

        logger.fine("Found " + attrs.size() +
                    " attributes for " + rec.getUserId());

        NamingEnumeration attrEnum = attrs.getAll();
        try {
            while (attrEnum.hasMore()) {
                Attribute attr = (Attribute) attrEnum.next();
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.