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

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

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

origin: eclipse/leshan

  /**
   * Gets the CoAP endpoint that should be used to communicate with a given client.
   *
   * @param registration the client
   * @return the CoAP endpoint bound to the same network address and port that the client connected to during
   *         registration. If no such CoAP endpoint is available, the first CoAP endpoint from the list of registered
   *         endpoints is returned
   */
  private Endpoint getEndpointForClient(Registration registration) {
    for (Endpoint ep : endpoints) {
      InetSocketAddress endpointAddress = ep.getAddress();
      if (endpointAddress.equals(registration.getRegistrationEndpointAddress())) {
        return ep;
      }
    }
    throw new IllegalStateException(
        "can't find the client endpoint for address : " + registration.getRegistrationEndpointAddress());
  }
}
origin: eclipse/leshan

o.add("regDate", r.getRegistrationDate().getTime());
o.add("identity", IdentitySerDes.serialize(r.getIdentity()));
o.add("regAddr", r.getRegistrationEndpointAddress().getHostString());
o.add("regPort", r.getRegistrationEndpointAddress().getPort());
o.add("lt", r.getLifeTimeInSec());
if (r.getSmsNumber() != null) {
origin: org.eclipse.leshan/leshan-server-cluster

o.add("regDate", r.getRegistrationDate().getTime());
o.add("identity", IdentitySerDes.serialize(r.getIdentity()));
o.add("regAddr", r.getRegistrationEndpointAddress().getHostString());
o.add("regPort", r.getRegistrationEndpointAddress().getPort());
o.add("lt", r.getLifeTimeInSec());
if (r.getSmsNumber() != null) {
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.registrationRegistrationgetRegistrationEndpointAddress

Javadoc

Gets the network address and port number of LWM2M Server's CoAP endpoint the client originally registered at. A LWM2M Server may listen on multiple CoAP end points, e.g. a non-secure and a secure one. Clients are often behind a firewall which will only let incoming UDP packets pass if they originate from the same address:port that the client has initiated communication with, e.g. by means of registering with the LWM2M Server. It is therefore important to know, which of the server's CoAP end points the client contacted for registration. This information can be used to uniquely identify the CoAP endpoint that should be used to access resources on the client.

Popular methods of Registration

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

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Path (java.nio.file)
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Top Sublime Text plugins
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