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

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

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

origin: eclipse/leshan

  @Override
  public void onError(Exception e) {
    handlerError(destination.getEndpoint(), ticket, e);
  }
});
origin: eclipse/leshan

  @Override
  public void onResponse(LwM2mResponse response) {
    handleResponse(destination.getEndpoint(), ticket, response);
  }
}, new ErrorCallback() {
origin: org.eclipse.leshan/leshan-server-cluster

  @Override
  public void onResponse(LwM2mResponse response) {
    handleResponse(destination.getEndpoint(), ticket, response);
  }
}, new ErrorCallback() {
origin: eclipse/leshan

@Override
public void unregistered(Registration registration, Collection<Observation> observations, boolean expired,
    Registration newReg) {
  String jReg = EventServlet.this.gson.toJson(registration);
  sendEvent(EVENT_DEREGISTRATION, jReg, registration.getEndpoint());
}
origin: eclipse/leshan

/**
 * Returns the {@link PresenceStatus} object associated with the given endpoint name.
 * 
 * @param reg The client's registration object.
 * @return The {@link PresenceStatus} object.
 */
private PresenceStatus getPresenceStatusObject(Registration reg) {
  return clientStatusList.get(reg.getEndpoint());
}
origin: eclipse/leshan

@Override
public void updated(RegistrationUpdate update, Registration updatedRegistration,
    Registration previousRegistration) {
  String jReg = EventServlet.this.gson.toJson(updatedRegistration);
  sendEvent(EVENT_UPDATED, jReg, updatedRegistration.getEndpoint());
}
origin: eclipse/leshan

@Override
public void registered(Registration registration, Registration previousReg,
    Collection<Observation> previousObsersations) {
  String jReg = EventServlet.this.gson.toJson(registration);
  sendEvent(EVENT_REGISTRATION, jReg, registration.getEndpoint());
}
origin: eclipse/leshan

/**
 * Removes the {@link PresenceStatus} object associated with the client from the list.
 * 
 * @param reg the client's registration object.
 */
public void removePresenceStatusObject(Registration reg) {
  clientStatusList.remove(reg.getEndpoint());
}
origin: eclipse/leshan

/**
 * Computes a hash code for this client.
 * 
 * @return the hash code based on the <em>endpoint</em> property
 */
@Override
public int hashCode() {
  return getEndpoint().hashCode();
}
origin: eclipse/leshan

@Override
public void onSleeping(Registration registration) {
  String data = new StringBuilder("{\"ep\":\"").append(registration.getEndpoint()).append("\"}").toString();
  sendEvent(EVENT_SLEEPING, data, registration.getEndpoint());
}
origin: eclipse/leshan

  @Override
  public void onAwake(Registration registration) {
    String data = new StringBuilder("{\"ep\":\"").append(registration.getEndpoint()).append("\"}").toString();
    sendEvent(EVENT_AWAKE, data, registration.getEndpoint());
  }
};
origin: eclipse/leshan

@Override
public void unregistered(Registration registration, Collection<Observation> observations, boolean expired,
    Registration newReg) {
  try (Jedis j = pool.getResource()) {
    // create registration entry
    j.del((EP_UID + registration.getEndpoint()).getBytes());
  }
}
origin: eclipse/leshan

@Override
public boolean isClientAwake(Registration registration) {
  PresenceStatus presenceStatus = clientStatusList.get(registration.getEndpoint());
  if (presenceStatus == null) {
    return false;
  }
  return presenceStatus.isClientAwake();
}
origin: eclipse/leshan

  @Override
  public Registration isAuthorized(UplinkRequest<?> request, Registration registration, Identity senderIdentity) {

    // do we have security information for this client?
    SecurityInfo expectedSecurityInfo = null;
    if (securityStore != null)
      expectedSecurityInfo = securityStore.getByEndpoint(registration.getEndpoint());
    if (securityChecker.checkSecurityInfo(registration.getEndpoint(), senderIdentity, expectedSecurityInfo)) {
      return registration;
    } else {
      return null;
    }
  }
}
origin: eclipse/leshan

private void removeAddrIndex(Jedis j, Registration registration) {
  byte[] regAddrKey = toRegAddrKey(registration.getSocketAddress());
  byte[] epFromAddr = j.get(regAddrKey);
  if (Arrays.equals(epFromAddr, registration.getEndpoint().getBytes(UTF_8))) {
    j.del(regAddrKey);
  }
}
origin: org.eclipse.leshan/leshan-server-cluster

private void removeAddrIndex(Jedis j, Registration registration) {
  byte[] regAddrKey = toRegAddrKey(registration.getSocketAddress());
  byte[] epFromAddr = j.get(regAddrKey);
  if (Arrays.equals(epFromAddr, registration.getEndpoint().getBytes(UTF_8))) {
    j.del(regAddrKey);
  }
}
origin: eclipse/leshan

@Override
public void onResponse(Observation observation, Registration registration, ObserveResponse response) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Received notification from [{}] containing value [{}]", observation.getPath(),
        response.getContent().toString());
  }
  if (registration != null) {
    String data = new StringBuilder("{\"ep\":\"").append(registration.getEndpoint()).append("\",\"res\":\"")
        .append(observation.getPath().toString()).append("\",\"val\":")
        .append(gson.toJson(response.getContent())).append("}").toString();
    sendEvent(EVENT_NOTIFICATION, data, registration.getEndpoint());
  }
}
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: eclipse/leshan

@Override
public void visit(WriteRequest request) {
  if (coapResponse.isError()) {
    // handle error response:
    lwM2mresponse = new WriteResponse(toLwM2mResponseCode(coapResponse.getCode()),
        coapResponse.getPayloadString(), coapResponse);
  } else if (coapResponse.getCode() == org.eclipse.californium.core.coap.CoAP.ResponseCode.CHANGED) {
    // handle success response:
    lwM2mresponse = new WriteResponse(ResponseCode.CHANGED, null, coapResponse);
  } else {
    // handle unexpected response:
    handleUnexpectedResponseCode(registration.getEndpoint(), request, coapResponse);
  }
}
org.eclipse.leshan.server.registrationRegistrationgetEndpoint

Javadoc

Gets the unique name the client has registered with.

Popular methods of Registration

  • getId
  • getIdentity
  • getAdditionalRegistrationAttributes
  • getBindingMode
  • getLifeTimeInSec
  • 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
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • 14 Best Plugins for Eclipse
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