Codota Logo
SendableResponse.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.eclipse.leshan.core.response.SendableResponse
constructor

Best Java code snippets using org.eclipse.leshan.core.response.SendableResponse.<init> (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: eclipse/leshan

public synchronized SendableResponse<BootstrapFinishResponse> finished(ServerIdentity identity,
    BootstrapFinishRequest finishedRequest) {
  if (bootstrapping) {
    // only if the request is from the bootstrap server
    if (!isBootstrapServer(identity)) {
      return new SendableResponse<>(BootstrapFinishResponse.badRequest("not from a bootstrap server"));
    }
    // TODO delete bootstrap server (see 5.2.5.2 Bootstrap Delete)
    Runnable whenSent = new Runnable() {
      @Override
      public void run() {
        bootstrappingLatch.countDown();
      }
    };
    return new SendableResponse<>(BootstrapFinishResponse.success(), whenSent);
  } else {
    return new SendableResponse<>(BootstrapFinishResponse.badRequest("no pending bootstrap session"));
  }
}
origin: eclipse/leshan

public SendableResponse<DeregisterResponse> deregister(Identity sender, DeregisterRequest deregisterRequest) {
  // We must check if the client is using the right identity.
  Registration registration = registrationService.getById(deregisterRequest.getRegistrationId());
  if (registration == null) {
    return new SendableResponse<>(DeregisterResponse.notFound());
  }
  if (authorizer.isAuthorized(deregisterRequest, registration, sender) == null) {
    // TODO replace by Forbidden if https://github.com/OpenMobileAlliance/OMA_LwM2M_for_Developers/issues/181 is
    // closed.
    return new SendableResponse<>(DeregisterResponse.badRequest("forbidden"));
  }
  final Deregistration deregistration = registrationService.getStore()
      .removeRegistration(deregisterRequest.getRegistrationId());
  if (deregistration != null) {
    LOG.debug("Deregistered client: {}", deregistration.getRegistration());
    // Create callback to notify new de-registration
    Runnable whenSent = new Runnable() {
      @Override
      public void run() {
        registrationService.fireUnregistered(deregistration.getRegistration(),
            deregistration.getObservations(), null);
      };
    };
    return new SendableResponse<>(DeregisterResponse.success(), whenSent);
  } else {
    LOG.debug("Invalid deregistration :  registration {} not found", registration.getId());
    return new SendableResponse<>(DeregisterResponse.notFound());
  }
}
origin: eclipse/leshan

  return new SendableResponse<>(UpdateResponse.notFound());
  return new SendableResponse<>(UpdateResponse.badRequest("forbidden"));
if (updatedRegistration == null) {
  LOG.debug("Invalid update:  registration {} not found", registration.getId());
  return new SendableResponse<>(UpdateResponse.notFound());
} else {
  LOG.debug("Updated registration {} by {}", updatedRegistration, update);
    };
  };
  return new SendableResponse<>(UpdateResponse.success(), whenSent);
origin: eclipse/leshan

  return new SendableResponse<>(RegisterResponse.forbidden(null));
return new SendableResponse<>(RegisterResponse.success(registration.getId()), whenSent);
org.eclipse.leshan.core.responseSendableResponse<init>

Popular methods of SendableResponse

  • getResponse
  • sent

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Path (java.nio.file)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
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