Class CommonUtil
- java.lang.Object
-
- org.linuxforhealth.fhir.operation.bulkdata.util.CommonUtil
-
public class CommonUtil extends java.lang.Object
Common Util captures common methods
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CommonUtil.Type
Type of Operation Call
-
Constructor Summary
Constructors Constructor Description CommonUtil(CommonUtil.Type opType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FHIROperationException
buildExceptionWithIssue(java.lang.String msg, java.lang.Throwable cause, IssueType issueType)
Construct a FHIROperationException with the passedmsg
, caused by (@code cause}, and a single OperationOutcome.Issue of typeissueType
static FHIROperationException
buildExceptionWithIssue(java.lang.String msg, IssueType issueType)
Construct a FHIROperationException with the passedmsg
and a single OperationOutcome.Issue of typeissueType
void
checkAllowed(FHIROperationContext operationContext, boolean isImport)
void
checkEnabled()
checks that bulkdata operation is enabledstatic java.lang.String
decodeJobId(java.lang.String encodedJobId)
decode the job id back into the string representation of its numeric job idstatic java.lang.String
encodeJobId(long jobId)
encode the job id as a short string for use in URLsvoid
verifyAllowedType(java.lang.String storageType)
checks the storage type is allowed.
-
-
-
Constructor Detail
-
CommonUtil
public CommonUtil(CommonUtil.Type opType)
- Parameters:
type
- the type of the Export
-
-
Method Detail
-
checkEnabled
public void checkEnabled() throws FHIROperationException
checks that bulkdata operation is enabled- Throws:
FHIROperationException
-
checkAllowed
public void checkAllowed(FHIROperationContext operationContext, boolean isImport) throws FHIROperationException
- Parameters:
operationContext
-isImport
-- Throws:
FHIROperationException
-
verifyAllowedType
public void verifyAllowedType(java.lang.String storageType) throws FHIROperationException
checks the storage type is allowed.- Parameters:
storageType
-- Throws:
FHIROperationException
-
encodeJobId
public static java.lang.String encodeJobId(long jobId)
encode the job id as a short string for use in URLs- Parameters:
jobId
- the numeric job id to encode- Returns:
-
decodeJobId
public static java.lang.String decodeJobId(java.lang.String encodedJobId)
decode the job id back into the string representation of its numeric job id- Parameters:
encodedJobId
- a job id encoded via#encodeJobId(long, String, String)
- Returns:
- Throws:
java.lang.IllegalArgumentException
- if the passed encodedJobId could not be decoded
-
buildExceptionWithIssue
public static FHIROperationException buildExceptionWithIssue(java.lang.String msg, IssueType issueType)
Construct a FHIROperationException with the passedmsg
and a single OperationOutcome.Issue of typeissueType
- Parameters:
msg
-issueType
-- Returns:
- Throws:
FHIROperationException
-
buildExceptionWithIssue
public static FHIROperationException buildExceptionWithIssue(java.lang.String msg, java.lang.Throwable cause, IssueType issueType)
Construct a FHIROperationException with the passedmsg
, caused by (@code cause}, and a single OperationOutcome.Issue of typeissueType
- Parameters:
msg
-cause
-issueType
-- Returns:
- Throws:
FHIROperationException
-
-