Package eu.mosaic_cloud.interoperability.core

Examples of eu.mosaic_cloud.interoperability.core.Message


    this.transcript.traceDebugging ("Listing `%s` (with request token `%s`)...", path, token.getMessageId ());
   
    final DFSPayloads.ListDir.Builder listDirBuilder = DFSPayloads.ListDir.newBuilder();
    listDirBuilder.setToken(token);
    listDirBuilder.setFullPath(path);
    final Message message = new Message(DFSMessage.LIST, listDirBuilder.build());
   
    return ((CallbackCompletion<List<LsElement>>) ((CallbackCompletion<?>)this.sendRequest(message, token, List.class)));
   
  }
View Full Code Here


    final DFSPayloads.OpenFile.Builder openFileBuilder = DFSPayloads.OpenFile.newBuilder();
    openFileBuilder.setToken(token);
    openFileBuilder.setFullPath(path);
    openFileBuilder.setMode(translateOpenMode(mode));
    final Message message = new Message(DFSMessage.OPEN, openFileBuilder.build());
   
    return (this.sendRequest(message, token, connectorClass));
  }
View Full Code Here

   
    final DFSPayloads.WriteFile.Builder writeFileBuilder = DFSPayloads.WriteFile.newBuilder();
    writeFileBuilder.setToken(token);
    writeFileBuilder.setFileHandler(fileHandlerUUID);
    writeFileBuilder.setData(ByteString.copyFrom(data));
    final Message message = new Message(DFSHandlerMessage.WRITE, writeFileBuilder.build());
   
    return (this.sendRequest(message, token, Void.class));
  }
View Full Code Here

    final DFSPayloads.ReadFile.Builder readFileBuilder = DFSPayloads.ReadFile.newBuilder();
    readFileBuilder.setToken(token);
    readFileBuilder.setFileHandler(fileHandlerUUID);
    readFileBuilder.setNumBytes(numOfBytes);
   
    final Message message = new Message(DFSHandlerMessage.READ, readFileBuilder.build());
   
    return (this.sendRequest(message, token, byte[].class)); //TODO check if this is okay
  }
View Full Code Here

    final DFSPayloads.CloseFile.Builder closeFileBuilder = DFSPayloads.CloseFile.newBuilder();
    closeFileBuilder.setToken(token);
    closeFileBuilder.setFileHandler(fileHandlerUUID);
   
    final Message message = new Message(DFSHandlerMessage.CLOSE, closeFileBuilder.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 (DFSSession.CONNECTOR, new Message (DFSMessage.ACCESS, null)));
  }
View Full Code Here

    this.transcript.traceDebugging ("acknowledging the message `%l` (with multiple `%b`) (with request token `%s`)...", Long.valueOf (delivery), Boolean.valueOf (multiple), token.getMessageId ());
    final AmqpPayloads.Ack.Builder requestBuilder = AmqpPayloads.Ack.newBuilder ();
    requestBuilder.setToken (token);
    requestBuilder.setDelivery (delivery);
    requestBuilder.setMultiple (multiple);
    final Message message = new Message (AmqpMessage.ACK, requestBuilder.build ());
    return (this.sendRequest (message, token, Void.class));
  }
View Full Code Here

    final AmqpPayloads.BindQueueRequest.Builder requestBuilder = AmqpPayloads.BindQueueRequest.newBuilder ();
    requestBuilder.setToken (token);
    requestBuilder.setExchange (exchange);
    requestBuilder.setQueue (queue);
    requestBuilder.setRoutingKey (routingKey);
    final Message message = new Message (AmqpMessage.BIND_QUEUE_REQUEST, requestBuilder.build ());
    return (this.sendRequest (message, token, Void.class));
  }
View Full Code Here

    final CompletionToken token = this.generateToken ();
    this.transcript.traceDebugging ("canceling the consumer `%s` (with request token `%s`)...", consumer, token.getMessageId ());
    final AmqpPayloads.CancelRequest.Builder requestBuilder = AmqpPayloads.CancelRequest.newBuilder ();
    requestBuilder.setToken (token);
    requestBuilder.setConsumer (consumer);
    final Message message = new Message (AmqpMessage.CANCEL_REQUEST, requestBuilder.build ());
    final CallbackCompletionDeferredFuture<Void> consumeFuture = CallbackCompletionDeferredFuture.create (Void.class);
    this.pendingRequests.register (consumer + "//cancel", consumeFuture);
    this.sendRequest (message, token, Void.class);
    return (consumeFuture.completion);
  }
View Full Code Here

    requestBuilder.setQueue (queue);
    requestBuilder.setConsumer (consumer);
    requestBuilder.setExclusive (exclusive);
    requestBuilder.setAutoAck (autoAck);
    requestBuilder.setExtra (ByteString.EMPTY);
    final Message message = new Message (AmqpMessage.CONSUME_REQUEST, requestBuilder.build ());
    this.pendingConsumers.put (consumer, consumerCallback);
    final CallbackCompletionDeferredFuture<Void> consumeFuture = CallbackCompletionDeferredFuture.create (Void.class);
    this.pendingRequests.register (consumer + "//consume", consumeFuture);
    // FIXME: how should we handle the next completion?
    this.sendRequest (message, token, Void.class);
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.