Class CommonUtil
- java.lang.Object
-
- org.linuxforhealth.fhir.operation.bulkdata.util.CommonUtil
-
public class CommonUtil extends java.lang.ObjectCommon Util captures common methods
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommonUtil.TypeType 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 FHIROperationExceptionbuildExceptionWithIssue(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 typeissueTypestatic FHIROperationExceptionbuildExceptionWithIssue(java.lang.String msg, IssueType issueType)Construct a FHIROperationException with the passedmsgand a single OperationOutcome.Issue of typeissueTypevoidcheckAllowed(FHIROperationContext operationContext, boolean isImport)voidcheckEnabled()checks that bulkdata operation is enabledstatic java.lang.StringdecodeJobId(java.lang.String encodedJobId)decode the job id back into the string representation of its numeric job idstatic java.lang.StringencodeJobId(long jobId)encode the job id as a short string for use in URLsvoidverifyAllowedType(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 FHIROperationExceptionchecks 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 FHIROperationExceptionchecks 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 passedmsgand 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
-
-