Tabnine Logo
Registration.getRegistrationDate
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.eclipse.leshan.server.registration.Registration.getRegistrationDate (Showing top 4 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: eclipse/leshan

public static JsonObject jSerialize(Registration r) {
  JsonObject o = Json.object();
  o.add("regDate", r.getRegistrationDate().getTime());
  o.add("identity", IdentitySerDes.serialize(r.getIdentity()));
  o.add("regAddr", r.getRegistrationEndpointAddress().getHostString());
origin: org.eclipse.leshan/leshan-server-cluster

public static JsonObject jSerialize(Registration r) {
  JsonObject o = Json.object();
  o.add("regDate", r.getRegistrationDate().getTime());
  o.add("identity", IdentitySerDes.serialize(r.getIdentity()));
  o.add("regAddr", r.getRegistrationEndpointAddress().getHostString());
origin: eclipse/leshan

/**
 * Returns an updated version of the registration.
 * 
 * @param registration the registration to update
 * @return the updated registration
 */
public Registration update(Registration registration) {
  Identity identity = this.identity != null ? this.identity : registration.getIdentity();
  Link[] linkObject = this.objectLinks != null ? this.objectLinks : registration.getObjectLinks();
  long lifeTimeInSec = this.lifeTimeInSec != null ? this.lifeTimeInSec : registration.getLifeTimeInSec();
  BindingMode bindingMode = this.bindingMode != null ? this.bindingMode : registration.getBindingMode();
  String smsNumber = this.smsNumber != null ? this.smsNumber : registration.getSmsNumber();
  Map<String, String> additionalAttributes = this.additionalAttributes.isEmpty()
      ? registration.getAdditionalRegistrationAttributes()
      : updateAdditionalAttributes(registration.getAdditionalRegistrationAttributes());
  // this needs to be done in any case, even if no properties have changed, in order
  // to extend the client registration time-to-live period ...
  Date lastUpdate = new Date();
  Registration.Builder builder = new Registration.Builder(registration.getId(), registration.getEndpoint(),
      identity, registration.getRegistrationEndpointAddress());
  builder.lwM2mVersion(registration.getLwM2mVersion()).lifeTimeInSec(lifeTimeInSec).smsNumber(smsNumber)
      .bindingMode(bindingMode).objectLinks(linkObject).registrationDate(registration.getRegistrationDate())
      .lastUpdate(lastUpdate).additionalRegistrationAttributes(additionalAttributes);
  return builder.build();
}
org.eclipse.leshan.server.registrationRegistrationgetRegistrationDate

Popular methods of Registration

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • JComboBox (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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