congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Registration.getRootPath
Code IndexAdd Tabnine to your IDE (free)

How to use
getRootPath
method
in
org.eclipse.leshan.server.registration.Registration

Best Java code snippets using org.eclipse.leshan.server.registration.Registration.getRootPath (Showing top 5 results out of 315)

origin: eclipse/leshan

  @Override
  public JsonElement serialize(Registration src, Type typeOfSrc, JsonSerializationContext context) {
    JsonObject element = new JsonObject();

    element.addProperty("endpoint", src.getEndpoint());
    element.addProperty("registrationId", src.getId());
    element.add("registrationDate", context.serialize(src.getRegistrationDate()));
    element.add("lastUpdate", context.serialize(src.getLastUpdate()));
    element.addProperty("address", src.getAddress().getHostAddress() + ":" + src.getPort());
    element.addProperty("smsNumber", src.getSmsNumber());
    element.addProperty("lwM2mVersion", src.getLwM2mVersion());
    element.addProperty("lifetime", src.getLifeTimeInSec());
    element.addProperty("bindingMode", src.getBindingMode().toString());
    element.add("rootPath", context.serialize(src.getRootPath()));
    element.add("objectLinks", context.serialize(src.getSortedObjectLinks()));
    element.add("secure", context.serialize(src.getIdentity().isSecure()));
    element.add("additionalRegistrationAttributes", context.serialize(src.getAdditionalRegistrationAttributes()));

    if (src.usesQueueMode()) {
      element.add("sleeping", context.serialize(!presenceService.isClientAwake(src)));
    }

    return element;
  }
}
origin: org.eclipse.leshan/leshan-server-cluster

o.add("root", r.getRootPath());
o.add("lastUp", r.getLastUpdate().getTime());
return o;
origin: eclipse/leshan

o.add("root", r.getRootPath());
o.add("lastUp", r.getLastUpdate().getTime());
return o;
origin: eclipse/leshan

@Override
public <T extends LwM2mResponse> void send(final Registration destination, final DownlinkRequest<T> request,
    long timeout, ResponseCallback<T> responseCallback, ErrorCallback errorCallback) {
  // Retrieve the objects definition
  final LwM2mModel model = modelProvider.getObjectModel(destination);
  // Create the CoAP request from LwM2m request
  CoapRequestBuilder coapRequestBuilder = new CoapRequestBuilder(destination.getIdentity(),
      destination.getRootPath(), destination.getId(), destination.getEndpoint(), model, encoder);
  request.accept(coapRequestBuilder);
  final Request coapRequest = coapRequestBuilder.getRequest();
  // Add CoAP request callback
  MessageObserver obs = new AsyncRequestObserver<T>(coapRequest, responseCallback, errorCallback, timeout) {
    @Override
    public T buildResponse(Response coapResponse) {
      // Build LwM2m response
      LwM2mResponseBuilder<T> lwm2mResponseBuilder = new LwM2mResponseBuilder<>(coapRequest, coapResponse,
          destination, model, observationService, decoder);
      request.accept(lwm2mResponseBuilder);
      return lwm2mResponseBuilder.getResponse();
    }
  };
  coapRequest.addMessageObserver(obs);
  // Store pending request to cancel it on de-registration
  addPendingRequest(destination.getId(), coapRequest);
  // Send CoAP request asynchronously
  Endpoint endpoint = getEndpointForClient(destination);
  endpoint.sendRequest(coapRequest);
}
origin: eclipse/leshan

@Override
public <T extends LwM2mResponse> T send(final Registration destination, final DownlinkRequest<T> request,
    long timeout) throws InterruptedException {
  // Retrieve the objects definition
  final LwM2mModel model = modelProvider.getObjectModel(destination);
  // Create the CoAP request from LwM2m request
  CoapRequestBuilder coapRequestBuilder = new CoapRequestBuilder(destination.getIdentity(),
      destination.getRootPath(), destination.getId(), destination.getEndpoint(), model, encoder);
  request.accept(coapRequestBuilder);
  final Request coapRequest = coapRequestBuilder.getRequest();
  // Send CoAP request synchronously
  SyncRequestObserver<T> syncMessageObserver = new SyncRequestObserver<T>(coapRequest, timeout) {
    @Override
    public T buildResponse(Response coapResponse) {
      // Build LwM2m response
      LwM2mResponseBuilder<T> lwm2mResponseBuilder = new LwM2mResponseBuilder<>(coapRequest, coapResponse,
          destination, model, observationService, decoder);
      request.accept(lwm2mResponseBuilder);
      return lwm2mResponseBuilder.getResponse();
    }
  };
  coapRequest.addMessageObserver(syncMessageObserver);
  // Store pending request to cancel it on de-registration
  addPendingRequest(destination.getId(), coapRequest);
  // Send CoAP request asynchronously
  Endpoint endpoint = getEndpointForClient(destination);
  endpoint.sendRequest(coapRequest);
  // Wait for response, then return it
  return syncMessageObserver.waitForResponse();
}
org.eclipse.leshan.server.registrationRegistrationgetRootPath

Popular methods of Registration

  • getEndpoint
  • getId
  • getIdentity
  • getAdditionalRegistrationAttributes
  • getBindingMode
  • getLifeTimeInSec
  • getLwM2mVersion
  • getRegistrationDate
  • getRegistrationEndpointAddress
  • getSmsNumber
  • isAlive
  • usesQueueMode
  • isAlive,
  • usesQueueMode,
  • getExpirationTimeStamp,
  • getLastUpdate,
  • getObjectLinks,
  • getSocketAddress,
  • <init>,
  • getAddress,
  • getPort

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now