Package org.jdesktop.wonderland.server.security

Examples of org.jdesktop.wonderland.server.security.ActionMap


            CellResourceManager crm = AppContext.getManager(CellResourceManager.class);
            Resource resource = crm.getCellResource(cell.getCellID());
            if (resource != null) {
                // add the resource to the security check
                Resource r = new CellIDResource(cell.getCellID(), resource);
                rm.put(r.getId(), new ActionMap(r, new ViewAction()));
            }
        }
View Full Code Here


        WonderlandIdentity id = cim.getClientID();
        if (id != null && owners != null && !owners.isEmpty()) {
            // make a request to set the permissions if this is an owner
            Resource ownerRsrc = new OwnerResource(cellRef.get().getCellID().toString(),
                                                   owners);
            ActionMap am = new ActionMap(ownerRsrc, new OwnerAction());
            ResourceMap rm = new ResourceMap();
            rm.put(ownerRsrc.getId(), am);

            SecurityManager sec = AppContext.getManager(SecurityManager.class);
            SecureTask sst = new SetStateTask(id.getUsername(), ownerRsrc.getId(),
View Full Code Here

        }

        // construct a request for this user's permissions
        ResourceMap rm = new ResourceMap();
        Action[] actions = crmi.getActions(requestCellID).toArray(new Action[0]);
        ActionMap am = new ActionMap(rsrc, actions);
        rm.put(rsrc.getId(), am);

        // construct a new task to send the message
        SecurityManager sm = AppContext.getManager(SecurityManager.class);
        SecureTask sendTask = new SendPermissionsTask(rsrc.getId(), sender,
View Full Code Here

            this.componentRef = AppContext.getDataManager().createReference(sc);
            this.permissions = perms;
        }

        public void run(ResourceMap granted) {
            ActionMap grantedActions = granted.get(resourceID);
            if (grantedActions.size() == 1) {
                componentRef.get().setCellPermissions(permissions);
            } else {
                logger.log(Level.WARNING, "Attempt to set state by non-owner " +
                           username);
            }
View Full Code Here

            sessionRef = AppContext.getDataManager().createReference(clientID.getSession());
        }

        public void run(ResourceMap granted) {
            // find the permissions for this user
            ActionMap am = granted.get(resourceID);
            Set<ActionDTO> actions = new LinkedHashSet<ActionDTO>();
            for (Action a : am.values()) {
                actions.add(new ActionDTO(a));
            }

            // create the message
            PermissionsResponseMessage prm =
View Full Code Here

            // get the resource this set pertains to
            Resource resource = set.getResource();

            // create a response set that we will append the granted
            // permissions to
            ActionMap grantSet = new ActionMap(resource);
            grant.put(resource.getId(), grantSet);

            // create a set of requests to schedule.  We do not add the
            // set immediately -- it will be added at the end if it
            // is not empty
            ActionMap scheduleSet = new ActionMap(resource);

            // go through each action, and decider whether to grant or deny
            // access, or if necessary, schedule for later
            for (Action action : set.values()) {
                // query the resource about this permission, and handle the
                // result
                switch (resource.request(id.getIdentity(), action)) {
                    case GRANT:
                        // access is granted, add to the response list
                        grantSet.put(action.getName(), action);
                        break;
                    case DENY:
                        // access is denied -- nothing to do
                        break;
                    case SCHEDULE:
                        // add to the set to schedule
                        scheduleSet.put(action.getName(), action);
                        break;
                }
            }

            // if the schedule set is not empty, add it for scheduling
            if (!scheduleSet.isEmpty()) {
                schedule.put(resource.getId(), scheduleSet);
            }
        }

        // determine if we can respond immediately
View Full Code Here

    {
        // get the security manager
        SecurityManager security = AppContext.getManager(SecurityManager.class);

        // create a request
        ActionMap am = new ActionMap(resource, actions.toArray(new Action[0]));
        ResourceMap request = new ResourceMap();
        request.put(resource.getId(), am);

        // perform the security check
        security.doSecure(request, new ReceiveSecureTask(resource.getId(),
View Full Code Here

    {
        // get the security manager
        SecurityManager security = AppContext.getManager(SecurityManager.class);

        // create a request
        ActionMap am = new ActionMap(resource, ConnectAction.getInstance());
        ResourceMap request = new ResourceMap();
        request.put(resource.getId(), am);

        // perform the security check
        security.doSecure(request, new AttachSecureTask(resource.getId(),
View Full Code Here

            this.message = message;
            this.bindingName = bindingName;
        }

        public void run(ResourceMap granted) {
            ActionMap am = granted.get(resourceID);

            // make sure all actions were granted
            Set<Action> grantedActions = new HashSet<Action>(am.values());

            // get the binding for the session listener
            WonderlandSessionListener listener = (WonderlandSessionListener)
                    AppContext.getDataManager().getBinding(bindingName);
View Full Code Here

            this.ref = ref;
            this.bindingName = bindingName;
        }

        public void run(ResourceMap granted) {
            ActionMap am = granted.get(resourceID);

            // get the binding for the session listener
            WonderlandSessionListener listener = (WonderlandSessionListener)
                    AppContext.getDataManager().getBinding(bindingName);

            if (am.containsKey(ConnectAction.getInstance().getName())) {
                // request was accepted -- continue processing
                listener.finishAttach(messageID, type, properties, ref);
            } else {
                logger.fine("Session " + listener.getSession().getName() +
                        " permission denied for client type " + type);
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.server.security.ActionMap

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.