Tabnine Logo
Status.isError
Code IndexAdd Tabnine to your IDE (free)

How to use
isError
method
in
org.restlet.data.Status

Best Java code snippets using org.restlet.data.Status.isError (Showing top 20 results out of 315)

origin: org.sonatype.nexus/nexus-test-utils

@Override
protected boolean matchesSafely( Status item )
{
  return item.isError();
}
origin: org.sonatype.nexus/nexus-test-harness-launcher

@Override
protected boolean matchesSafely(Status item) {
 return item.isError();
}
origin: org.restlet.osgi/org.restlet

/**
 * Indicates if the status is an error (client or server) status.
 * 
 * @return True if the status is an error (client or server) status.
 */
public boolean isError() {
  return isError(getCode());
}
origin: org.sonatype.nexus/nexus-test-utils

@Override
protected boolean matchesSafely( Response resp )
{
  return resp.getStatus().isError();
}
origin: org.restlet/org.restlet

/**
 * Indicates if the status is an error (client or server) status.
 * 
 * @return True if the status is an error (client or server) status.
 */
public boolean isError() {
  return isError(getCode());
}
origin: DeviceConnect/DeviceConnect-Android

/**
 * Indicates if the status is an error (client or server) status.
 * 
 * @return True if the status is an error (client or server) status.
 */
public boolean isError() {
  return isError(getCode());
}
origin: org.sonatype.nexus/nexus-test-harness-launcher

@Override
protected boolean matchesSafely(Response resp) {
 return resp.getStatus().isError();
}
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.jee/org.restlet.ext.apispark

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.osgi/org.restlet.ext.oauth

@Override
public Representation handleInbound(Response response) {
  Representation result = null;
  // Verify that the request was synchronous
  if (response.getRequest().isSynchronous()) {
    if (response.getStatus().isError()) {
      doError(response.getStatus());
      // DO NOT DISPOSE THE RESPONSE.
    }/* else { */
    result = (response == null) ? null : response.getEntity();
    /* } */
  }
  return result;
}
origin: org.restlet.osgi/org.restlet

/**
 * Handles the inbound call. Note that only synchronous calls are processed.
 * 
 * @param response
 * @return The response's entity, if any.
 */
public Representation handleInbound(Response response) {
  if (response == null) {
    return null;
  }
  // Verify that the request was synchronous
  if (response.getRequest().isSynchronous()) {
    if (response.getStatus().isError()) {
      doError(response.getStatus());
      return null;
    }
    return response.getEntity();
  }
  return null;
}
origin: org.sonatype.nexus/nexus-test-harness-launcher

protected Metadata downloadMetadataFromRepository(Gav gav, String repoId)
  throws IOException, XmlPullParserException
{
 String url = String.format("%s%s%s/%s/%s/maven-metadata.xml",
   getBaseNexusUrl(),
   REPOSITORY_RELATIVE_URL,
   repoId,
   gav.getGroupId(),
   gav.getArtifactId());
 Response response = null;
 try {
  response = RequestFacade.sendMessage(new URL(url), Method.GET, null);
  if (response.getStatus().isError()) {
   return null;
  }
  try (InputStream stream = response.getEntity().getStream()) {
   MetadataXpp3Reader metadataReader = new MetadataXpp3Reader();
   return metadataReader.read(stream);
  }
 }
 finally {
  RequestFacade.releaseResponse(response);
 }
}
origin: org.restlet.osgi/org.restlet

if (response.getStatus().isError()
    && ((response.getEntity() == null) || isOverwriting())) {
  response.setEntity(getStatusService().toRepresentation(
origin: org.restlet/org.restlet.ext.jetty

  @Override
  public void sendResponse(Response response) throws IOException {
    // Add call headers
    Parameter header;
    for (final Iterator<Parameter> iter = getResponseHeaders().iterator(); iter
        .hasNext();) {
      header = iter.next();
      getConnection().getResponse().addHeader(header.getName(),
          header.getValue());
    }

    // Set the status code in the response. We do this after adding the
    // headers because when we have to rely on the 'sendError' method,
    // the Servlet containers are expected to commit their response.
    if (Status.isError(getStatusCode()) && (response.getEntity() == null)) {
      try {
        getConnection().getResponse().sendError(getStatusCode(),
            getReasonPhrase());
      } catch (IOException ioe) {
        getLogger().log(Level.WARNING,
            "Unable to set the response error status", ioe);
      }
    } else {
      // Send the response entity
      getConnection().getResponse().setStatus(getStatusCode());
      super.sendResponse(response);
    }

  }
}
origin: org.restlet.jee/org.restlet.ext.jetty

  @Override
  public void sendResponse(Response response) throws IOException {
    // Add call headers
    Parameter header;
    for (final Iterator<Parameter> iter = getResponseHeaders().iterator(); iter
        .hasNext();) {
      header = iter.next();
      getConnection().getResponse().addHeader(header.getName(),
          header.getValue());
    }

    // Set the status code in the response. We do this after adding the
    // headers because when we have to rely on the 'sendError' method,
    // the Servlet containers are expected to commit their response.
    if (Status.isError(getStatusCode()) && (response.getEntity() == null)) {
      try {
        getConnection().getResponse().sendError(getStatusCode(),
            getReasonPhrase());
      } catch (IOException ioe) {
        getLogger().log(Level.WARNING,
            "Unable to set the response error status", ioe);
      }
    } else {
      // Send the response entity
      getConnection().getResponse().setStatus(getStatusCode());
      super.sendResponse(response);
    }

  }
}
origin: org.restlet.jee/org.restlet.ext.jaxrs

  @SuppressWarnings("unchecked")
  public void handle(Request request, Response response) {
    if (response.getStatus().isError()) {
      rCallback.onFailure(new ResourceException(response.getStatus()));
    } else {
      if (actualType != null) {
        Object result = null;
        try {
          result = getClientResource().toObject(response.getEntity(), actualType);
          rCallback.onSuccess(result);
        } catch (Exception e) {
          rCallback.onFailure(new ResourceException(e));
        }
      } else {
        rCallback.onSuccess(null);
      }
    }
  }
};
origin: org.restlet.osgi/org.restlet

@SuppressWarnings("unchecked")
public void handle(Request request,
    Response response) {
  if (response.getStatus().isError()) {
    rCallback
        .onFailure(new ResourceException(
org.restlet.dataStatusisError

Javadoc

Indicates if the status is an error (client or server) status.

Popular methods of Status

  • getCode
    Returns the corresponding code (HTTP or WebDAV or custom code).
  • isSuccess
    Indicates if the status is a success status, meaning "The action was successfully received, understo
  • equals
    Indicates if the status is equal to a given one.
  • getDescription
    Returns the description. This value is typically used by the org.restlet.service.StatusService to bu
  • <init>
    Constructor.
  • isClientError
    Indicates if the status is a client error status, meaning "The request contains bad syntax or cannot
  • valueOf
    Returns the status associated to a code. If an existing constant exists then it is returned, otherwi
  • getThrowable
    Returns the related error or exception.
  • toString
    Returns the reason phrase of the status followed by its HTTP code.
  • getReasonPhrase
    Returns the reason phrase of this status. When supported by the HTTP server connector, this is retur
  • isConnectorError
    Indicates if the status is a connector error status, meaning "The connector failed to send or receiv
  • getName
    Returns the name of this status.
  • isConnectorError,
  • getName,
  • isRedirection,
  • isServerError,
  • isInformational,
  • getUri,
  • checkReasonPhrase,
  • isGlobalError,
  • checkDescription

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Notification (javax.management)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top PhpStorm plugins
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