Class FHIROperationContext
- java.lang.Object
-
- com.ibm.fhir.server.operation.spi.FHIROperationContext
-
public class FHIROperationContext extends Object
This 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 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 StringPROPNAME_LOCATION_URIThis property is of type String and represents the value of the Location header.static StringPROPNAME_METHOD_TYPEThis property is of type HttpMethodstatic 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 StringPROPNAME_REQUEST_BASE_URIThis property is of type String and represents the base URI string (e.g.static StringPROPNAME_REQUEST_PROPERTIESThis property is of typeMapand contains the set of additional request properties associated with the REST API request.static StringPROPNAME_RESPONSEThe property is of the Responsestatic 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 StringPROPNAME_STATUS_TYPEThe property is of Response.Status.static 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()static FHIROperationContextcreateResourceTypeOperationContext()static FHIROperationContextcreateSystemOperationContext()StringgetHeaderString(String headerName)Retrieves the specified header from the combined list of request headers and additional request properties associated with the request.javax.ws.rs.core.HttpHeadersgetHttpHeaders()Returns the HttpHeaders instance associated with the request that triggered the operation.ObjectgetProperty(String name)Map<String,String>getRequestProperties()Returns the Map containing additional request properties associated with the FHIR REST API request that triggered the interceptor invocation.FHIROperationContext.TypegetType()voidsetProperty(String name, Object value)StringtoString()
-
-
-
Field Detail
-
PROPNAME_REQUEST_BASE_URI
public static final 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 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 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 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 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_REQUEST_PROPERTIES
public static final String PROPNAME_REQUEST_PROPERTIES
This property is of typeMapand contains the set of additional request properties associated with the REST API request.- See Also:
- Constant Field Values
-
PROPNAME_SECURITY_CONTEXT
public static final 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 String PROPNAME_METHOD_TYPE
This property is of type HttpMethod- See Also:
- Constant Field Values
-
PROPNAME_STATUS_TYPE
public static final String PROPNAME_STATUS_TYPE
The property is of Response.Status.- See Also:
- Constant Field Values
-
PROPNAME_RESPONSE
public static final String PROPNAME_RESPONSE
The property is of the Response- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public FHIROperationContext.Type getType()
-
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.
-
getRequestProperties
public Map<String,String> getRequestProperties()
Returns the Map containing additional request properties associated with the FHIR REST API request that triggered the interceptor invocation.
-
createSystemOperationContext
public static FHIROperationContext createSystemOperationContext()
-
createResourceTypeOperationContext
public static FHIROperationContext createResourceTypeOperationContext()
-
createInstanceOperationContext
public static FHIROperationContext createInstanceOperationContext()
-
getHeaderString
public String getHeaderString(String headerName)
Retrieves the specified header from the combined list of request headers and additional request properties associated with the request.- Parameters:
headerName- the name of the header to retrieve- Returns:
- the value of the request header or null if not present
-
-