Package org.restlet.data
Class Method
java.lang.Object
org.restlet.data.Method
- All Implemented Interfaces:
Comparable<Method>
Method to execute when handling a call.
- Author:
- Jerome Louvel
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MethodPseudo-method use to match all methods.static final MethodUsed with a proxy that can dynamically switch to being a tunnel.static final MethodRequests that the origin server deletes the resource identified by the request URI.static final MethodRetrieves whatever information (in the form of an entity) that is identified by the request URI.static final MethodIdentical to GET except that the server must not return a message body in the response but only the message header.static final MethodRequests for information about the communication options available on the request/response chain identified by the URI.static final MethodRequests that the origin server applies partial modifications contained in the entity enclosed in the request to the resource identified by the request URI.static final MethodRequests that the origin server accepts the entity enclosed in the request as a new subordinate of the resource identified by the request URI.static final MethodRequests that the enclosed entity be stored under the supplied request URI.static final MethodUsed to invoke a remote, application-layer loop-back of the request message. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for unsafe and non idempotent methods.Constructor for unsafe and non idempotent methods.Constructor for unsafe and non idempotent methods.Constructor for methods that reply to requests with responses.Method(String name, String description, String uri, boolean safe, boolean idempotent, boolean replying) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintCompares this method to another.booleanReturns the description.getName()Returns the name.getUri()Returns the URI of the specification describing the method.inthashCode()booleanIndicates if the side-effects of several requests is the same as a single request.booleanIndicates if the method replies with a response.booleanisSafe()Indicates if it should have the significance of taking an action other than retrieval.static voidAdds a new Method to the list of registered methods.static voidSorts the given list of methods by name.toString()Returns the name.static MethodReturns the method associated to a given method name.
-
Field Details
-
ALL
Pseudo-method use to match all methods. -
CONNECT
Used with a proxy that can dynamically switch to being a tunnel.- See Also:
-
DELETE
Requests that the origin server deletes the resource identified by the request URI.- See Also:
-
GET
Retrieves whatever information (in the form of an entity) that is identified by the request URI.- See Also:
-
HEAD
Identical to GET except that the server must not return a message body in the response but only the message header.- See Also:
-
OPTIONS
Requests for information about the communication options available on the request/response chain identified by the URI.- See Also:
-
PATCH
Requests that the origin server applies partial modifications contained in the entity enclosed in the request to the resource identified by the request URI.- See Also:
-
POST
Requests that the origin server accepts the entity enclosed in the request as a new subordinate of the resource identified by the request URI.- See Also:
-
PUT
Requests that the enclosed entity be stored under the supplied request URI.- See Also:
-
- invalid input: '<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6" HTTP RFC - 9.6 PUT</a>'
-
TRACE
Used to invoke a remote, application-layer loop-back of the request message.- See Also:
-
-
Constructor Details
-
Method
Constructor for unsafe and non idempotent methods.- Parameters:
name- The technical name of the method.- See Also:
-
Method
Constructor for unsafe and non idempotent methods.- Parameters:
name- The technical name of the method.description- The description.- See Also:
-
Method
Constructor for unsafe and non idempotent methods.- Parameters:
name- The technical name.description- The description.uri- The URI of the specification describing the method.- See Also:
-
Method
Constructor for methods that reply to requests with responses.- Parameters:
name- The technical name.description- The description.uri- The URI of the specification describing the method.safe- Indicates if the method is safe.idempotent- Indicates if the method is idempotent.- See Also:
-
Method
public Method(String name, String description, String uri, boolean safe, boolean idempotent, boolean replying) Constructor.- Parameters:
name- The technical name.description- The description.uri- The URI of the specification describing the method.safe- Indicates if the method is safe.idempotent- Indicates if the method is idempotent.replying- Indicates if the method replies with a response.- See Also:
-
-
Method Details
-
register
Adds a new Method to the list of registered methods.- Parameters:
method- The method to register.
-
sort
Sorts the given list of methods by name.- Parameters:
methods- The methods to sort.
-
valueOf
Returns the method associated to a given method name. If an existing constant exists then it is returned, otherwise a new instance is created.- Parameters:
name- The method name.- Returns:
- The associated method.
-
compareTo
Compares this method to another. Based on the method name.- Specified by:
compareToin interfaceComparable<Method>- Parameters:
o- The other method.
-
equals
-
getDescription
Returns the description.- Returns:
- The description.
-
getName
Returns the name.- Returns:
- The name.
-
getUri
Returns the URI of the specification describing the method.- Returns:
- The URI of the specification describing the method.
-
hashCode
public int hashCode() -
isIdempotent
public boolean isIdempotent()Indicates if the side-effects of several requests is the same as a single request.- Returns:
- True if the method is idempotent.
-
isReplying
public boolean isReplying()Indicates if the method replies with a response.- Returns:
- True if the method replies with a response.
-
isSafe
public boolean isSafe()Indicates if it should have the significance of taking an action other than retrieval.- Returns:
- True if the method is safe.
-
toString
Returns the name.
-