public static enum Outcome.Status extends Enum<Outcome.Status>
Outcome
status codes.
This enumeration lists the possible status codes for Outcome
objects. A status code
is identified by an URI (see getURI()
), is briefly explained through a comment
string (see getComment()
) and may be mapped to an HTTP status code (see
getHTTPStatus()
). Methods isOK()
, isError()
determine,
respectively, if the status code denotes a success or error situation. Lookup of status
codes based on URI is supported by method valueOf(URI)
.
Enum Constant and Description |
---|
ERROR_BULK
Error status specifying that a bulk operation invocation failed for one or more of the
involved objects.
|
ERROR_DEPENDENCY_NOT_FOUND
Error status specifying that an object indirectly referenced by the operation
invocation does not exist.
|
ERROR_FORBIDDEN
Error status specifying that the invoked operation has not been executed because the
requester has not enough privileges.
|
ERROR_INTERRUPTED
Error status specifying that the invoked operation was forcedly interrupted by the
client, server or due to a connectivity problem.
|
ERROR_INVALID_INPUT
Error status specifying that input arguments are missing or wrong.
|
ERROR_NOT_ACCEPTABLE
Error status specifying that an operation invocation failed as its result would not be
acceptable to the client.
|
ERROR_OBJECT_ALREADY_EXISTS
Error status specifying that the referenced object already exists.
|
ERROR_OBJECT_NOT_FOUND
Error status specifying that the referenced object does not exist.
|
ERROR_UNEXPECTED
Error status specifying that the invocation failed due to an unexpected error.
|
OK_BULK
Success status specifying successful completion of a bulk operation invocation for all
the objects involved.
|
OK_CREATED
Success status specifying that an object has been created.
|
OK_DELETED
Success status specifying that an object has been deleted.
|
OK_MODIFIED
Success status specifying that an object has been modified.
|
OK_UNMODIFIED
Success status specifying that it was not necessary to modify an object.
|
UNKNOWN
Error status specifying that the outcome of the invoked operation is unknown.
|
Modifier and Type | Method and Description |
---|---|
String |
getComment()
Returns a constant comment string describing this status code.
|
int |
getHTTPStatus()
Returns the HTTP status code corresponding to this
Outcome status code. |
org.openrdf.model.URI |
getURI()
Returns the URI univocally identifying this status code.
|
boolean |
isError()
Helper method to determine whether the status code denotes error.
|
boolean |
isOK()
Helper method to determine whether the status code denotes success.
|
static Outcome.Status |
valueOf(int httpStatus)
Return the
Status that more closely matches the HTTP status code specified. |
static Outcome.Status |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Outcome.Status |
valueOf(org.openrdf.model.URI uri)
Lookups the status code with the URI specified.
|
static Outcome.Status[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Outcome.Status OK_BULK
KSR.OK_BULK
public static final Outcome.Status OK_CREATED
KSR.OK_CREATED
public static final Outcome.Status OK_MODIFIED
KSR.OK_MODIFIED
public static final Outcome.Status OK_UNMODIFIED
KSR.OK_UNMODIFIED
public static final Outcome.Status OK_DELETED
KSR.OK_DELETED
public static final Outcome.Status ERROR_BULK
KSR.ERROR_BULK
public static final Outcome.Status ERROR_NOT_ACCEPTABLE
KSR#ERROR_PRECONDITION_FAILED
public static final Outcome.Status ERROR_OBJECT_NOT_FOUND
KSR.ERROR_OBJECT_NOT_FOUND
public static final Outcome.Status ERROR_OBJECT_ALREADY_EXISTS
KSR.ERROR_OBJECT_ALREADY_EXISTS
public static final Outcome.Status ERROR_DEPENDENCY_NOT_FOUND
KSR.ERROR_DEPENDENCY_NOT_FOUND
public static final Outcome.Status ERROR_INVALID_INPUT
KSR.ERROR_INVALID_INPUT
public static final Outcome.Status ERROR_FORBIDDEN
KSR.ERROR_FORBIDDEN
public static final Outcome.Status ERROR_INTERRUPTED
KSR.ERROR_INTERRUPTED
public static final Outcome.Status ERROR_UNEXPECTED
KSR.ERROR_UNEXPECTED
public static final Outcome.Status UNKNOWN
KSR.UNKNOWN
public static Outcome.Status[] values()
for (Outcome.Status c : Outcome.Status.values()) System.out.println(c);
public static Outcome.Status valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic org.openrdf.model.URI getURI()
Status
object.public String getComment()
public int getHTTPStatus()
Outcome
status code. Note
that multiple Outcome
status codes may map to the same HTTP status code.public boolean isOK()
public boolean isError()
public static Outcome.Status valueOf(org.openrdf.model.URI uri) throws IllegalArgumentException
uri
- the URI of the status code to lookupIllegalArgumentException
- if there is no status for the URI specifiedpublic static Outcome.Status valueOf(int httpStatus)
Status
that more closely matches the HTTP status code specified.
Note that only part of the statuses of this enuemration are returned, as the mapping
from Status
to HTTP statuses is N:1.httpStatus
- the HTTP statusStatus
, defaulting to ERROR_UNEXPECTED
Copyright © 2015–2016 FBK-irst. All rights reserved.