Codota Logo
Registration.getLifeTimeInSec
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
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

  • Parsing JSON documents to java classes using gson
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Reference (javax.naming)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
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