Codota Logo
RESTServices$ResponseStatus.isExpected
Code IndexAdd Codota to your IDE (free)

How to use
isExpected
method
in
com.marklogic.client.impl.RESTServices$ResponseStatus

Best Java code snippets using com.marklogic.client.impl.RESTServices$ResponseStatus.isExpected (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: marklogic/java-client-api

private void checkStatus(Response response, int status, String operation, String entityType,
             String path, ResponseStatus expected)
{
 if (!expected.isExpected(status)) {
  FailedRequest failure = extractErrorFields(response);
  if (status == STATUS_NOT_FOUND) {
   throw new ResourceNotFoundException("Could not " + operation
    + " " + entityType + " at " + path,
    failure);
  }
  if ("RESTAPI-CONTENTNOVERSION".equals(failure.getMessageCode())) {
   throw new FailedRequestException("Content version required to " +
    operation + " " + entityType + " at " + path, failure);
  } else if (status == STATUS_FORBIDDEN) {
   throw new ForbiddenUserException("User is not allowed to "
    + operation + " " + entityType + " at " + path,
    failure);
  }
  throw new FailedRequestException("failed to " + operation + " "
   + entityType + " at " + path + ": "
   + getReasonPhrase(response), failure);
 }
}
origin: com.marklogic/client-api-java

private void checkStatus(ClientResponse response,
    ClientResponse.Status status, String operation, String entityType,
    String path, ResponseStatus expected) {
  if (!expected.isExpected(status)) {
    if (status == ClientResponse.Status.NOT_FOUND) {
      throw new ResourceNotFoundException("Could not " + operation
          + " " + entityType + " at " + path,
          extractErrorFields(response));
    }
    if (status == ClientResponse.Status.FORBIDDEN) {
      throw new ForbiddenUserException("User is not allowed to "
          + operation + " " + entityType + " at " + path,
          extractErrorFields(response));
    }
    throw new FailedRequestException("failed to " + operation + " "
        + entityType + " at " + path + ": "
        + status.getReasonPhrase(), extractErrorFields(response));
  }
}
com.marklogic.client.implRESTServices$ResponseStatusisExpected

Popular methods of RESTServices$ResponseStatus

    Popular in Java

    • Reactive rest calls using spring rest template
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • findViewById (Activity)
    • notifyDataSetChanged (ArrayAdapter)
    • FileOutputStream (java.io)
      A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
    • PrintWriter (java.io)
      Prints formatted representations of objects to a text-output stream. This class implements all of th
    • DecimalFormat (java.text)
      DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
    • Hashtable (java.util)
      Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
    • JLabel (javax.swing)
    • JPanel (javax.swing)
    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