Class FHIROperationContext
- java.lang.Object
-
- org.linuxforhealth.fhir.server.spi.operation.FHIROperationContext
-
public class FHIROperationContext extends java.lang.ObjectThis class holds context information for custom operation invocations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFHIROperationContext.Type
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPNAME_FHIR_VERSIONThe FHIRVersionParam for this invocationstatic java.lang.StringPROPNAME_HTTP_HEADERSThis property is of type javax.ws.rs.core.HttpHeaders and contains the set of HTTP headers associated with the REST API request.static java.lang.StringPROPNAME_HTTP_REQUESTThe property is of the Http Request objectstatic java.lang.StringPROPNAME_LOCATION_URIThis property is of type String and represents the value of the Location header.static java.lang.StringPROPNAME_METHOD_TYPEThis property is of type HttpMethodstatic java.lang.StringPROPNAME_PERSISTENCE_IMPLThis property is of type FHIRPersistence and is the handle to the persistence layer implementation being used by the FHIR Server while processing the current request.static java.lang.StringPROPNAME_REQUEST_BASE_URIThis property is of type String and represents the base URI string (e.g.static java.lang.StringPROPNAME_REQUEST_PARAMETERSThe request parameters for this invocationstatic java.lang.StringPROPNAME_RESPONSEThe property is of the Responsestatic java.lang.StringPROPNAME_RESPONSE_PARAMETERSThe response parameters for this invocationstatic java.lang.StringPROPNAME_SECURITY_CONTEXTThis property is of type javax.ws.rs.core.SecurityContext and contains security-related information associated with the REST API request for which the interceptor is being invoked.static java.lang.StringPROPNAME_STATUS_TYPEThe property is of Response.Status.static java.lang.StringPROPNAME_URI_INFOThis property is of type javax.ws.rs.core.UriInfo and contains Application and Request URI information associated with the REST API request for which the interceptor is being invoked.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FHIROperationContextcreateInstanceOperationContext(java.lang.String operationCode)static FHIROperationContextcreateResourceTypeOperationContext(java.lang.String operationCode)static FHIROperationContextcreateSystemOperationContext(java.lang.String operationCode)java.lang.StringgetHeaderString(java.lang.String headerName)Retrieves the specified header from the list of request headers.javax.ws.rs.core.HttpHeadersgetHttpHeaders()Returns the HttpHeaders instance associated with the request that triggered the operation.java.lang.StringgetOperationCode()java.lang.ObjectgetProperty(java.lang.String name)FHIROperationContext.TypegetType()voidsetProperty(java.lang.String name, java.lang.Object value)java.lang.StringtoString()
-
-
-
Field Detail
-
PROPNAME_REQUEST_BASE_URI
public static final java.lang.String PROPNAME_REQUEST_BASE_URI
This property is of type String and represents the base URI string (e.g. "https://localhost:9443/fhir-server/api/v4") associated with the request.- See Also:
- Constant Field Values
-
PROPNAME_LOCATION_URI
public static final java.lang.String PROPNAME_LOCATION_URI
This property is of type String and represents the value of the Location header.- See Also:
- Constant Field Values
-
PROPNAME_PERSISTENCE_IMPL
public static final java.lang.String PROPNAME_PERSISTENCE_IMPL
This property is of type FHIRPersistence and is the handle to the persistence layer implementation being used by the FHIR Server while processing the current request. It is recommended that custom operation implementors use the RESOURCE_HELPER property instead of this property unless you have been advised otherwise.- See Also:
- Constant Field Values
-
PROPNAME_URI_INFO
public static final java.lang.String PROPNAME_URI_INFO
This property is of type javax.ws.rs.core.UriInfo and contains Application and Request URI information associated with the REST API request for which the interceptor is being invoked.- See Also:
- Constant Field Values
-
PROPNAME_HTTP_HEADERS
public static final java.lang.String PROPNAME_HTTP_HEADERS
This property is of type javax.ws.rs.core.HttpHeaders and contains the set of HTTP headers associated with the REST API request.- See Also:
- Constant Field Values
-
PROPNAME_SECURITY_CONTEXT
public static final java.lang.String PROPNAME_SECURITY_CONTEXT
This property is of type javax.ws.rs.core.SecurityContext and contains security-related information associated with the REST API request for which the interceptor is being invoked.- See Also:
- Constant Field Values
-
PROPNAME_METHOD_TYPE
public static final java.lang.String PROPNAME_METHOD_TYPE
This property is of type HttpMethod- See Also:
- Constant Field Values
-
PROPNAME_STATUS_TYPE
public static final java.lang.String PROPNAME_STATUS_TYPE
The property is of Response.Status.- See Also:
- Constant Field Values
-
PROPNAME_RESPONSE
public static final java.lang.String PROPNAME_RESPONSE
The property is of the Response- See Also:
- Constant Field Values
-
PROPNAME_HTTP_REQUEST
public static final java.lang.String PROPNAME_HTTP_REQUEST
The property is of the Http Request object- See Also:
- Constant Field Values
-
PROPNAME_REQUEST_PARAMETERS
public static final java.lang.String PROPNAME_REQUEST_PARAMETERS
The request parameters for this invocation- See Also:
- Constant Field Values
-
PROPNAME_RESPONSE_PARAMETERS
public static final java.lang.String PROPNAME_RESPONSE_PARAMETERS
The response parameters for this invocation- See Also:
- Constant Field Values
-
PROPNAME_FHIR_VERSION
public static final java.lang.String PROPNAME_FHIR_VERSION
The FHIRVersionParam for this invocation- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public FHIROperationContext.Type getType()
-
getOperationCode
public java.lang.String getOperationCode()
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object value)
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
-
getHttpHeaders
public javax.ws.rs.core.HttpHeaders getHttpHeaders()
Returns the HttpHeaders instance associated with the request that triggered the operation. Note that this HttpHeaders instance is only valid within the scope of a single request.
-
createSystemOperationContext
public static FHIROperationContext createSystemOperationContext(java.lang.String operationCode)
-
createResourceTypeOperationContext
public static FHIROperationContext createResourceTypeOperationContext(java.lang.String operationCode)
-
createInstanceOperationContext
public static FHIROperationContext createInstanceOperationContext(java.lang.String operationCode)
-
getHeaderString
public java.lang.String getHeaderString(java.lang.String headerName)
Retrieves the specified header from the list of request headers.- Parameters:
headerName- the name of the header to retrieve- Returns:
- the value of the request header or null if not present
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-