congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Registration.getLifeTimeInSec
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: eclipse/leshan

@Override
public void updated(RegistrationUpdate update, Registration updatedRegistration,
    Registration previousRegistration) {
  try (Jedis j = pool.getResource()) {
    // create registration entry
    byte[] k = (EP_UID + updatedRegistration.getEndpoint()).getBytes();
    j.set(k, instanceUID.getBytes());
    j.expire(k, updatedRegistration.getLifeTimeInSec().intValue());
  }
}
origin: eclipse/leshan

@Override
public void registered(Registration registration, Registration previousReg,
    Collection<Observation> previousObsersations) {
  try (Jedis j = pool.getResource()) {
    // create registration entry
    byte[] k = (EP_UID + registration.getEndpoint()).getBytes();
    j.set(k, instanceUID.getBytes());
    j.expire(k, registration.getLifeTimeInSec().intValue());
  }
}
origin: org.eclipse.leshan/leshan-server-cluster

@Override
public void registered(Registration registration, Registration previousReg,
    Collection<Observation> previousObsersations) {
  try (Jedis j = pool.getResource()) {
    // create registration entry
    byte[] k = (EP_UID + registration.getEndpoint()).getBytes();
    j.set(k, instanceUID.getBytes());
    j.expire(k, registration.getLifeTimeInSec().intValue());
  }
}
origin: org.eclipse.leshan/leshan-server-cluster

@Override
public void updated(RegistrationUpdate update, Registration updatedRegistration,
    Registration previousRegistration) {
  try (Jedis j = pool.getResource()) {
    // create registration entry
    byte[] k = (EP_UID + updatedRegistration.getEndpoint()).getBytes();
    j.set(k, instanceUID.getBytes());
    j.expire(k, updatedRegistration.getLifeTimeInSec().intValue());
  }
}
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

o.add("regAddr", r.getRegistrationEndpointAddress().getHostString());
o.add("regPort", r.getRegistrationEndpointAddress().getPort());
o.add("lt", r.getLifeTimeInSec());
if (r.getSmsNumber() != null) {
  o.add("sms", r.getSmsNumber());
origin: org.eclipse.leshan/leshan-server-cluster

o.add("regAddr", r.getRegistrationEndpointAddress().getHostString());
o.add("regPort", r.getRegistrationEndpointAddress().getPort());
o.add("lt", r.getLifeTimeInSec());
if (r.getSmsNumber() != null) {
  o.add("sms", r.getSmsNumber());
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.registrationRegistrationgetLifeTimeInSec

Popular methods of Registration

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

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • CodeWhisperer alternatives
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