Tabnine Logo
RESTServices$ResponseStatus.isExpected
Code IndexAdd Tabnine 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)

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

    • Finding current android device location
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • setScale (BigDecimal)
    • getContentResolver (Context)
    • FileReader (java.io)
      A specialized Reader that reads from a file in the file system. All read requests made by calling me
    • FileWriter (java.io)
      A specialized Writer that writes to a file in the file system. All write requests made by calling me
    • ArrayList (java.util)
      ArrayList is an implementation of List, backed by an array. All optional operations including adding
    • Response (javax.ws.rs.core)
      Defines the contract between a returned instance and the runtime when an application needs to provid
    • XPath (javax.xml.xpath)
      XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
    • Project (org.apache.tools.ant)
      Central representation of an Ant project. This class defines an Ant project with all of its targets,
    • 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