public class MethodOutcome extends Object
| Constructor and Description |
|---|
MethodOutcome()
Constructor
|
MethodOutcome(IBaseOperationOutcome theOperationOutcome)
Constructor
|
MethodOutcome(IIdType theId)
Constructor
|
MethodOutcome(IIdType theId,
Boolean theCreated)
Constructor
|
MethodOutcome(IIdType theId,
IBaseOperationOutcome theBaseOperationOutcome)
Constructor
|
MethodOutcome(IIdType theId,
IBaseOperationOutcome theBaseOperationOutcome,
Boolean theCreated)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
fireResourceViewCallbacks()
Fires callbacks registered to
registerResourceViewCallback(Runnable) and then
clears the list of registered callbacks. |
Boolean |
getCreated()
This will be set to
Boolean.TRUE for instance of MethodOutcome which are
returned to client instances, if the server has responded with an HTTP 201 Created. |
IIdType |
getId() |
IBaseOperationOutcome |
getOperationOutcome()
Returns the
IBaseOperationOutcome resource to return to the client or null if none. |
IBaseResource |
getResource()
From a client response: If the method returned an actual resource body (e.g.
|
Map<String,List<String>> |
getResponseHeaders()
Gets the headers for the HTTP response
|
void |
registerResourceViewCallback(Runnable theCallback)
Registers a callback to be invoked before the resource in this object gets
returned to the client.
|
MethodOutcome |
setCreated(Boolean theCreated)
If not null, indicates whether the resource was created (as opposed to being updated).
|
void |
setCreatedUsingStatusCode(int theResponseStatusCode) |
MethodOutcome |
setId(IIdType theId) |
MethodOutcome |
setOperationOutcome(IBaseOperationOutcome theBaseOperationOutcome)
Sets the
IBaseOperationOutcome resource to return to the client. |
MethodOutcome |
setResource(IBaseResource theResource)
In a server response: This field may be populated in server code with the final resource for operations
where a resource body is being created/updated.
|
void |
setResponseHeaders(Map<String,List<String>> theResponseHeaders)
Sets the headers for the HTTP response
|
public MethodOutcome()
public MethodOutcome(IIdType theId, Boolean theCreated)
theId - The ID of the created/updated resourcetheCreated - If not null, indicates whether the resource was created (as opposed to being updated). This is generally not needed, since the server can assume based on the method being called
whether the result was a creation or an update. However, it can be useful if you are implementing an update method that does a create if the ID doesn't already exist.public MethodOutcome(IIdType theId, IBaseOperationOutcome theBaseOperationOutcome)
theId - The ID of the created/updated resourcetheBaseOperationOutcome - The operation outcome to return with the response (or null for none)public MethodOutcome(IIdType theId, IBaseOperationOutcome theBaseOperationOutcome, Boolean theCreated)
theId - The ID of the created/updated resourcetheBaseOperationOutcome - The operation outcome to return with the response (or null for none)theCreated - If not null, indicates whether the resource was created (as opposed to being updated). This is generally not needed, since the server can assume based on the method being called
whether the result was a creation or an update. However, it can be useful if you are implementing an update method that does a create if the ID doesn't already exist.public MethodOutcome(IIdType theId)
theId - The ID of the created/updated resourcepublic MethodOutcome(IBaseOperationOutcome theOperationOutcome)
theOperationOutcome - The operation outcome resource to returnpublic Boolean getCreated()
Boolean.TRUE for instance of MethodOutcome which are
returned to client instances, if the server has responded with an HTTP 201 Created.public MethodOutcome setCreated(Boolean theCreated)
Users of HAPI should only interact with this method in Server applications
theCreated - If not null, indicates whether the resource was created (as opposed to being updated). This is generally not needed, since the server can assume based on the method being called
whether the result was a creation or an update. However, it can be useful if you are implementing an update method that does a create if the ID doesn't already exist.this for easy method chainingpublic MethodOutcome setId(IIdType theId)
theId - The ID of the created/updated resourcethis for easy method chainingpublic IBaseOperationOutcome getOperationOutcome()
IBaseOperationOutcome resource to return to the client or null if none.public MethodOutcome setOperationOutcome(IBaseOperationOutcome theBaseOperationOutcome)
IBaseOperationOutcome resource to return to the client. Set to null (which is the default) if none.this for easy method chainingpublic IBaseResource getResource()
public MethodOutcome setResource(IBaseResource theResource)
This field is optional, but if it is populated the server will return the resource body if requested to do so via the HTTP Prefer header.
this for easy method chainingto register a callback that should be invoked by the framework before the resource is shown/returned to a clientpublic Map<String,List<String>> getResponseHeaders()
public void setResponseHeaders(Map<String,List<String>> theResponseHeaders)
public void registerResourceViewCallback(Runnable theCallback)
theCallback - The callbackpublic void fireResourceViewCallbacks()
registerResourceViewCallback(Runnable) and then
clears the list of registered callbacks.public void setCreatedUsingStatusCode(int theResponseStatusCode)
Copyright © 2014–2019 University Health Network. All rights reserved.