示例#1
0
  @Override
  public void onResponse(CloudConnection clientConnection, ExportContext context)
      throws IOException, FrameworkException {

    context.progress();
    clientConnection.send(ack());
  }
示例#2
0
  @Override
  public void onRequest(CloudConnection serverConnection, ExportContext context)
      throws IOException, FrameworkException {

    final Object value = serverConnection.getValue(key + "Nodes");
    if (value instanceof List) {

      final List<NodeInterface> nodes = (List<NodeInterface>) value;
      final NodeInterface node = nodes.get(nodeIndex);

      if (node instanceof File) {

        PushTransmission.sendFile(serverConnection, (File) node, CloudService.CHUNK_SIZE);

      } else {

        serverConnection.send(new NodeDataContainer(node, nodeIndex));
      }

      context.progress();
    }
  }