public Response<Integer> unsubscribeParam(GraphName parameterName) {
   return Response.fromListChecked(
       rpcEndpoint.unsubscribeParam(
           nodeName,
           nodeIdentifier.getUri().getHostName(),
           String.valueOf(nodeIdentifier.getUri().getPort()),
           parameterName.toString()),
       new IntegerResultFactory());
 }
 public Response<GraphName> searchParam(GraphName parameterName) {
   Response<String> response =
       Response.fromListCheckedFailure(
           rpcEndpoint.searchParam(nodeName, parameterName.toString()), new StringResultFactory());
   return new Response<GraphName>(
       response.getStatusCode(),
       response.getStatusMessage(),
       GraphName.of((String) response.getResult()));
 }
 public Response<Boolean> hasParam(GraphName parameterName) {
   if (DEBUG)
     log.debug(
         "ParameterClient.hasParam name:"
             + parameterName
             + " node "
             + nodeName
             + " for RPC endpoint:"
             + rpcEndpoint);
   return Response.fromListChecked(
       rpcEndpoint.hasParam(nodeName, parameterName.toString()), new BooleanResultFactory());
 }
 private DefaultServiceClient(
     GraphName nodeName,
     ServiceDeclaration serviceDeclaration,
     MessageFactory messageFactory,
     ScheduledExecutorService executorService)
     throws IOException {
   this.serviceDeclaration = serviceDeclaration;
   this.messageFactory = messageFactory;
   messageBufferPool = new MessageBufferPool();
   responseListeners = new LinkedList<ServiceResponseListener<S>>();
   connectionHeader = new ConnectionHeader();
   connectionHeader.addField(ConnectionHeaderFields.CALLER_ID, nodeName.toString());
   // TODO(damonkohler): Support non-persistent connections.
   connectionHeader.addField(ConnectionHeaderFields.PERSISTENT, "1");
   connectionHeader.merge(serviceDeclaration.toConnectionHeader());
   tcpClientManager = TcpClientManager.getInstance(executorService);
   ServiceClientHandshakeHandler<T, S> serviceClientHandshakeHandler =
       new ServiceClientHandshakeHandler<T, S>(
           connectionHeader, responseListeners, executorService);
   handshakeLatch = new HandshakeLatch();
   serviceClientHandshakeHandler.addListener(handshakeLatch);
   tcpClientManager.addNamedChannelHandler(serviceClientHandshakeHandler);
 }
 public Response<Void> setParam(GraphName parameterName, Object parameterValue) {
   return Response.fromListChecked(
       rpcEndpoint.setParam(nodeName, parameterName.toString(), parameterValue),
       new VoidResultFactory());
 }
 public Response<Object> getParam(GraphName parameterName) {
   return Response.fromListCheckedFailure(
       rpcEndpoint.getParam(nodeName, parameterName.toString()), new ObjectResultFactory());
 }
 public Response<Void> deleteParam(GraphName parameterName) {
   return Response.fromListChecked(
       rpcEndpoint.deleteParam(nodeName, parameterName.toString()), new VoidResultFactory());
 }