Package eu.mosaic_cloud.interoperability.core

Examples of eu.mosaic_cloud.interoperability.core.Message


    requestBuilder.setExchange (name);
    requestBuilder.setType (eType);
    requestBuilder.setDurable (durable);
    requestBuilder.setAutoDelete (autoDelete);
    requestBuilder.setPassive (passive);
    final Message message = new Message (AmqpMessage.DECL_EXCHANGE_REQUEST, requestBuilder.build ());
    return (this.sendRequest (message, token, Void.class));
  }
View Full Code Here


    requestBuilder.setQueue (queue);
    requestBuilder.setExclusive (exclusive);
    requestBuilder.setDurable (durable);
    requestBuilder.setAutoDelete (autoDelete);
    requestBuilder.setPassive (passive);
    final Message message = new Message (AmqpMessage.DECL_QUEUE_REQUEST, requestBuilder.build ());
    return (this.sendRequest (message, token, Void.class));
  }
View Full Code Here

    this.transcript.traceDebugging ("pulling one message from the queue `%s` (with auto-acknowledge `%b`) (with request token `%s`)...", queue, Boolean.valueOf (autoAck), token.getMessageId ());
    final AmqpPayloads.GetRequest.Builder requestBuilder = AmqpPayloads.GetRequest.newBuilder ();
    requestBuilder.setToken (token);
    requestBuilder.setQueue (queue);
    requestBuilder.setAutoAck (autoAck);
    final Message message = new Message (AmqpMessage.GET_REQUEST, requestBuilder.build ());
    return (this.sendRequest (message, token, Void.class));
  }
View Full Code Here

 
  @Override
  public CallbackCompletion<Void> initialize ()
  {
    this.transcript.traceDebugging ("initializing the proxy...");
    return (this.connect (AmqpSession.CONNECTOR, new Message (AmqpMessage.ACCESS, null)));
  }
View Full Code Here

      requestBuilder.setCorrelationId (correlation);
    }
    if (callback != null) {
      requestBuilder.setReplyTo (callback);
    }
    final Message mssg = new Message (AmqpMessage.PUBLISH_REQUEST, requestBuilder.build ());
    return (this.sendRequest (mssg, token, Void.class));
  }
View Full Code Here

        this.logger.info ("get requested [{}]: {}", request.sequence, request.key);
        final String value = this.bucket.get (request.key);
        session.continueDispatch ();
        Threading.sleep ((this.maxDelay / 5) * 1);
        this.logger.info ("get replied [{}]: {}", request.sequence, value);
        session.send (new Message (KvMessage.GetReply, new KvPayloads.GetReply (request.sequence, value)));
        Threading.sleep ((this.maxDelay / 5) * 3);
        this.logger.info ("get finished [{}]", request.sequence);
      }
        break;
      case PutRequest : {
        final KvPayloads.PutRequest request = (KvPayloads.PutRequest) message.payload;
        this.logger.info ("put requested [{}]: {} -> {}", new Object[] {request.sequence, request.key, request.value});
        this.bucket.put (request.key, request.value);
        session.continueDispatch ();
        Threading.sleep ((this.maxDelay / 5) * 1);
        this.logger.info ("put replied [{}]", request.sequence);
        session.send (new Message (KvMessage.Ok, new KvPayloads.Ok (request.sequence)));
        Threading.sleep ((this.maxDelay / 5) * 3);
        this.logger.info ("put finished: [{}]", request.sequence);
      }
        break;
      default: {
        this.logger.error ("unexpected message: {}", message.specification);
        session.send (new Message (KvMessage.Aborted, null));
      }
        break;
    }
    return (null);
  }
View Full Code Here

  {
    Preconditions.checkState (this.session != null);
    final long sequence = this.sequence.incrementAndGet ();
    final DeferredFuture<String> future = DeferredFuture.create (String.class);
    this.futures.put (Long.valueOf (sequence), future);
    this.session.send (new Message (KvMessage.GetRequest, new KvPayloads.GetRequest (sequence, key)));
    return (future);
  }
View Full Code Here

  {
    Preconditions.checkState (this.session == null);
    Preconditions.checkState (this.sequence.get () == 0);
    final DeferredFuture<Boolean> future = DeferredFuture.create (Boolean.class);
    this.futures.put (Long.valueOf (0), future);
    channel.connect (serverIdentifier, KvSession.Client, new Message (KvMessage.Access, null), this);
    return (future);
  }
View Full Code Here

  {
    Preconditions.checkState (this.session != null);
    final long sequence = this.sequence.incrementAndGet ();
    final DeferredFuture<Boolean> future = DeferredFuture.create (Boolean.class);
    this.futures.put (Long.valueOf (sequence), future);
    this.session.send (new Message (KvMessage.PutRequest, new KvPayloads.PutRequest (sequence, key, value)));
    return (future);
  }
View Full Code Here

          future.trigger.triggerSucceeded (Boolean.FALSE);
      }
        break;
      default: {
        this.logger.error ("unexpected message: {}", message.specification);
        session.send (new Message (KvMessage.Aborted, null));
      }
        break;
    }
    return (null);
  }
View Full Code Here

TOP

Related Classes of eu.mosaic_cloud.interoperability.core.Message

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.