Tabnine Logo
ServiceResponse$ResponseType.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
org.kie.server.api.model.ServiceResponse$ResponseType

Best Java code snippets using org.kie.server.api.model.ServiceResponse$ResponseType.equals (Showing top 3 results out of 315)

origin: mswiderski/jbpm-examples

  @Override
  public void messageReceived( IoSession session, Object message ) throws Exception {
    String completeMessage = message.toString();
    logger.debug("Received message '{}'", completeMessage);
    if( completeMessage.trim().equalsIgnoreCase("quit") || completeMessage.trim().equalsIgnoreCase("exit") ) {
      session.close(false);
      return;
    }

    String[] elements = completeMessage.split("\\|");
    logger.debug("Container id {}", elements[0]);
    try {
      ServiceResponse<String> result = batchCommandService.callContainer(elements[0], elements[1], MarshallingFormat.JSON, null);
      
      if (result.getType().equals(ServiceResponse.ResponseType.SUCCESS)) {
        session.write(result.getResult());
        logger.debug("Successful message written with content '{}'", result.getResult());
      } else {
        session.write(result.getMsg());
        logger.debug("Failure message written with content '{}'", result.getMsg()); 
      }
    } catch (Exception e) {
      
    }
  }
}
origin: org.kie/kie-server-services

private ServiceResponse<KieScannerResource> startScanner(String id, KieScannerResource resource, KieContainerInstance kci) {
  if (kci.getScanner() == null) {
    ServiceResponse<KieScannerResource> response = createScanner(id, kci);
    if (ResponseType.FAILURE.equals(response.getType())) {
      return response;
    }
  }
  if (KieScannerStatus.STOPPED.equals(mapStatus(kci.getScanner().getStatus())) &&
      resource.getPollInterval() != null) {
    kci.getScanner().start(resource.getPollInterval());
    return new ServiceResponse<KieScannerResource>(ServiceResponse.ResponseType.SUCCESS,
        "Kie scanner successfully created.",
        getScannerResource(kci));
  } else if (!KieScannerStatus.STOPPED.equals(mapStatus(kci.getScanner().getStatus()))) {
    return new ServiceResponse<KieScannerResource>(ServiceResponse.ResponseType.FAILURE,
        "Invalid kie scanner status: " + mapStatus(kci.getScanner().getStatus()),
        getScannerResource(kci));
  } else if (resource.getPollInterval() == null) {
    return new ServiceResponse<KieScannerResource>(ServiceResponse.ResponseType.FAILURE,
        "Invalid polling interval: " + resource.getPollInterval(),
        getScannerResource(kci));
  }
  return new ServiceResponse<KieScannerResource>(ServiceResponse.ResponseType.FAILURE,
      "Unknown error starting scanner. Scanner was not started." + resource,
      getScannerResource(kci));
}
origin: org.kie/kie-server-services

private ServiceResponse<KieScannerResource> disposeScanner(String id, KieScannerResource resource, KieContainerInstance kci) {
  if (kci.getScanner() == null) {
    return new ServiceResponse<KieScannerResource>(ServiceResponse.ResponseType.SUCCESS,
        "Invalid call. Scanner already disposed. ",
        getScannerResource(kci));
  }
  if (KieScannerStatus.STARTED.equals(mapStatus(kci.getScanner().getStatus())) ||
      KieScannerStatus.SCANNING.equals(mapStatus(kci.getScanner().getStatus()))) {
    ServiceResponse<KieScannerResource> response = stopScanner(id, resource, kci);
    if (ResponseType.FAILURE.equals(response.getType())) {
      return response;
    }
  }
  kci.getScanner().shutdown();
  kci.setScanner(null);
  return new ServiceResponse<KieScannerResource>(ServiceResponse.ResponseType.SUCCESS,
      "Kie scanner successfully shutdown.",
      getScannerResource(kci));
}
org.kie.server.api.modelServiceResponse$ResponseTypeequals

Popular methods of ServiceResponse$ResponseType

    Popular in Java

    • Making http requests using okhttp
    • putExtra (Intent)
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • notifyDataSetChanged (ArrayAdapter)
    • Pointer (com.sun.jna)
      An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
    • Iterator (java.util)
      An iterator over a sequence of objects, such as a collection.If a collection has been changed since
    • Stack (java.util)
      Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
    • SSLHandshakeException (javax.net.ssl)
      The exception that is thrown when a handshake could not be completed successfully.
    • DataSource (javax.sql)
      An interface for the creation of Connection objects which represent a connection to a database. This
    • DateTimeFormat (org.joda.time.format)
      Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
    • Top plugins for Android Studio
    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