Codota Logo
ServiceRequest
Code IndexAdd Codota to your IDE (free)

How to use
ServiceRequest
in
edu.wpi.rail.jrosbridge.services

Best Java code snippets using edu.wpi.rail.jrosbridge.services.ServiceRequest (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: rctoris/jrosbridge

  /**
   * Create a clone of this ServiceRequest.
   */
  @Override
  public ServiceRequest clone() {
    return new ServiceRequest(this.toJsonObject(), this.serviceRequestType);
  }
}
origin: rctoris/jrosbridge

ServiceRequest request = new ServiceRequest(args);
request.setId(id);
cb.handleServiceCall(request);
origin: de.dfki.cos.basys.common/de.dfki.cos.basys.common.jrosbridge

/**
 * Create a new Empty ServiceRequest based on the given JSON string. Any
 * missing values will be set to their defaults.
 * 
 * @param jsonString
 *            The JSON string to parse.
 * @return A Empty ServiceRequest based on the given JSON string.
 */
public static Request fromJsonString(String jsonString) {
  // convert to a ServiceRequest
  return Empty.Request.fromServiceRequest(new ServiceRequest(
      jsonString));
}
origin: de.dfki.cos.basys.common/de.dfki.cos.basys.common.jrosbridge

/**
 * Create a new Empty ServiceRequest based on the given ServiceRequest.
 * Any missing values will be set to their defaults.
 *
 * @param req the req
 * @return A Empty ServiceRequest based on the given Message.
 */
public static Request fromServiceRequest(ServiceRequest req) {
  // get it from the JSON object
  return Empty.Request.fromJsonObject(req.toJsonObject());
}
origin: de.dfki.cos.basys.common/de.dfki.cos.basys.common.jrosbridge

ServiceRequest request = new ServiceRequest(args);
request.setId(id);
cb.handleServiceCall(request);
origin: rctoris/jrosbridge

/**
 * Create a new Empty ServiceRequest based on the given JSON string. Any
 * missing values will be set to their defaults.
 * 
 * @param jsonString
 *            The JSON string to parse.
 * @return A Empty ServiceRequest based on the given JSON string.
 */
public static Request fromJsonString(String jsonString) {
  // convert to a ServiceRequest
  return Empty.Request.fromServiceRequest(new ServiceRequest(
      jsonString));
}
origin: rctoris/jrosbridge

/**
 * Create a new Empty ServiceRequest based on the given ServiceRequest.
 * Any missing values will be set to their defaults.
 * 
 * @param m
 *            The ServiceRequest to parse.
 * @return A Empty ServiceRequest based on the given Message.
 */
public static Request fromServiceRequest(ServiceRequest req) {
  // get it from the JSON object
  return Empty.Request.fromJsonObject(req.toJsonObject());
}
origin: de.dfki.cos.basys.common/de.dfki.cos.basys.common.jrosbridge

  /**
   * Create a clone of this ServiceRequest.
   */
  @Override
  public ServiceRequest clone() {
    return new ServiceRequest(this.toJsonObject(), this.serviceRequestType);
  }
}
origin: streampipes/streampipes-ce

private String getMethodType(Ros ros, String topic) {
  Service addTwoInts = new Service(ros, "/rosapi/topic_type", "rosapi/TopicType");
  ServiceRequest request = new ServiceRequest("{\"topic\": \""+ topic +"\"}");
  ServiceResponse response = addTwoInts.callServiceAndWait(request);
  JSONObject ob = new JSONObject(response.toString());
  return ob.getString("type");
}
origin: rctoris/jrosbridge

/**
 * Call this service. The callback function will be called with the
 * associated service response.
 * 
 * @param request
 *            The service request to send.
 * @param cb
 *            The callback used when the associated response comes back.
 */
public void callService(ServiceRequest request, ServiceCallback cb) {
  // construct the unique ID
  String callServceId = "call_service:" + this.name + ":"
      + this.ros.nextId();
  // register the callback function
  this.ros.registerServiceCallback(callServceId, cb);
  // build and send the rosbridge call
  JsonObject call = Json.createObjectBuilder()
      .add(JRosbridge.FIELD_OP, JRosbridge.OP_CODE_CALL_SERVICE)
      .add(JRosbridge.FIELD_ID, callServceId)
      .add(JRosbridge.FIELD_TYPE, this.type)
      .add(JRosbridge.FIELD_SERVICE, this.name)
      .add(JRosbridge.FIELD_ARGS, request.toJsonObject()).build();
  this.ros.send(call);
}
origin: de.dfki.cos.basys.common/de.dfki.cos.basys.common.jrosbridge

/**
 * Call this service. The callback function will be called with the
 * associated service response.
 * 
 * @param request
 *            The service request to send.
 * @param cb
 *            The callback used when the associated response comes back.
 */
public void callService(ServiceRequest request, ServiceCallback cb) {
  // construct the unique ID
  String callServceId = "call_service:" + this.name + ":"
      + this.ros.nextId();
  // register the callback function
  this.ros.registerServiceCallback(callServceId, cb);
  // build and send the rosbridge call
  JsonObject call = Json.createObjectBuilder()
      .add(JRosbridge.FIELD_OP, JRosbridge.OP_CODE_CALL_SERVICE)
      .add(JRosbridge.FIELD_ID, callServceId)
      .add(JRosbridge.FIELD_TYPE, this.type)
      .add(JRosbridge.FIELD_SERVICE, this.name)
      .add(JRosbridge.FIELD_ARGS, request.toJsonObject()).build();
  this.ros.send(call);
}
edu.wpi.rail.jrosbridge.servicesServiceRequest

Javadoc

ServiceRequest objects are used for making a request to a service. These service requests act as wrappers around JSON objects. Service request data is immutable.

Most used methods

  • <init>
    Create a ServiceRequest based on the given JSON object.
  • setId
    Set the ID of the service request.
  • toJsonObject

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • putExtra (Intent)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now