Package org.jdesktop.wonderland.common.messages

Examples of org.jdesktop.wonderland.common.messages.ResponseMessage


   
    public CellTransform getCellTransform(CellID cellID) {
        Message request = new CellTransformRequestMessage(cellID);

        try {
            ResponseMessage rm = sendAndWait(request);
            if (rm instanceof CellTransformResponseMessage) {
                return ((CellTransformResponseMessage) rm).getTransform();
            } else if (rm instanceof ErrorMessage) {
                logger.log(Level.WARNING, "Error getting transform of " +
                        cellID + ": " + ((ErrorMessage) rm).getErrorMessage());
View Full Code Here


        @Override
        public void messageReceived(WonderlandClientSender sender,
                                    WonderlandClientID clientID,
                                    CellMessage message)
        {
            ResponseMessage response;

            logger.fine("[SharedStateComponentMO]: Received message: " +
                        message.getClass().getSimpleName());

            if (message instanceof MapRequestMessage) {
View Full Code Here

    {
        Set<Action> out = new LinkedHashSet<Action>();

        // request the permissions from the server
        PermissionsRequestMessage prm = new PermissionsRequestMessage(cellID);
        ResponseMessage rm = channel.sendAndWait(new PermissionsRequestMessage());
        if (rm instanceof PermissionsResponseMessage) {
            for (ActionDTO a : ((PermissionsResponseMessage) rm).getGranted()) {
                out.add(a.getAction());
            }
        }
View Full Code Here

        WonderlandSession session = manager.getPrimarySession();
        CellEditChannelConnection connection = (CellEditChannelConnection)
                session.getConnection(CellEditConnectionType.CLIENT_TYPE);
        CellCreateMessage msg = new CellCreateMessage(parentCellID, state);
//        connection.send(msg);
        ResponseMessage response = null;
        try {
            response = connection.sendAndWait(msg);
        } catch (InterruptedException ex) {
            Logger.getLogger(CellUtils.class.getName()).log(Level.SEVERE, null, ex);
        }
View Full Code Here

     * @param cellID the id of the client cell to request the secret for
     * @return the secret key for the given client, or null if the client
     * is not authorized to access the given cell
     */
    public SecretKey getSecret(BigInteger clientID, CellID cellID) {
        ResponseMessage rm;
        try {
            rm = sendAndWait(new SecretRequestMessage(clientID, cellID));
        } catch (InterruptedException ie) {
            AppXrw.logger.log(Level.WARNING, "Get key interruped", ie);
            return null;
View Full Code Here

     * @param clientID the id of the client to check control permissions for.
     * @param cellID the id of the cell to check permissions for
     * @return true if the client has permission, or false if not
     */
    public boolean checkTakeControl(BigInteger clientID, CellID cellID) {
        ResponseMessage rm;
        try {
            rm = sendAndWait(new TakeControlRequestMessage(clientID, cellID));
        } catch (InterruptedException ie) {
            AppXrw.logger.log(Level.WARNING, "Check take control interruped", ie);
            return false;
View Full Code Here

     * Initialize the map by reading in all the keys. This method blocks
     * until the server has sent us the keys for this map.
     */
    private void doInit() {
        try {
            ResponseMessage rm = channel.sendAndWait(new MapRequestMessage(getName()));
            if (rm instanceof MapResponseMessage) {
                MapResponseMessage mrm = (MapResponseMessage) rm;
                backing.initialize(mrm.getVersion(), mrm.getKeys());
            } else {
                throw new IllegalStateException("Bad response to map request: " +
                                                rm.getClass().getName());
            }

        } catch (InterruptedException ie) {
            // oh well
        } finally {
View Full Code Here

            this.propName = propName;
        }

        public VersionedValue call() throws InterruptedException {
            CellMessage m = new GetRequestMessage(getName(), propName);
            ResponseMessage rm = channel.sendAndWait(m);
            if (rm instanceof GetResponseMessage) {
                GetResponseMessage grm = (GetResponseMessage) rm;
                return new ImmediateVersionedValue(VersionType.REMOTE,
                                                   grm.getVersion(), grm.getData());
            } else {
                throw new IllegalStateException("Invalid response to value " +
                        "request: " + rm.getClass());
            }
        }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.common.messages.ResponseMessage

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.