Package be.business.connector.recipe
Class AbstractRecipeClient
- java.lang.Object
-
- be.business.connector.recipe.AbstractRecipeClient
-
- Direct Known Subclasses:
RecipeExecutorClient,RecipePatientClient,RecipePrescriberClient
public class AbstractRecipeClient extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringaddressprotected StringaddressKeyjava8.util.function.Consumer<String>captureTraceIdprotected be.recipe.api.crypto.Message.Ciphercipherprotected PropertyHandlerpropertiesprotected be.recipe.api.crypto.Message.Cipher.KeyresponseKeyprotected SecretKeysymmKeyprotected be.recipe.api.crypto.Message.Cipher.KeysystemKeyjava8.util.function.Supplier<String>traceId
-
Constructor Summary
Constructors Constructor Description AbstractRecipeClient(String addressKey)AbstractRecipeClient(String addressKey, PropertyHandler properties)AbstractRecipeClient(String addressKey, be.recipe.api.crypto.Message.Cipher.Key.DB<be.recipe.api.Prescription.OnContent> keyRegistry, be.recipe.api.crypto.Message.Cipher cipher, PropertyHandler properties)AbstractRecipeClient(String addressKey, be.recipe.api.crypto.Message.Cipher.Key.DB<be.recipe.api.Prescription.OnContent> keyRegistry, be.recipe.api.crypto.Message.Cipher cipher, java8.util.function.Supplier<String> traceId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SecuredContentTypecontent(byte[] encryptedBytes)protected <T> Tdecrypt(byte[] bytes, Class<T> type)protected <T> byte[]encrypt(T it)voidinitEncryption(EncryptionUtils encryptionUtils)static Propertiesmetadata()protected StringprogramId()static StringprogramId(String defaultPrefix)voidraise(RuntimeException e)voidrefresh(PropertyHandler properties)protected booleanrejected(StatusType status)protected static org.threeten.bp.LocalDatetoLocalDate(Calendar calendar)protected static org.threeten.bp.LocalDateTimetoLocalDateTime(Calendar calendar)protected static java8.util.function.Function<String,String>toLowerCase()protected static java8.util.function.Function<Enum,String>toName()protected static java8.util.function.Function<Object,String>toText()protected <T> TwithExceptionHandling(String code, java8.util.function.Supplier<T> task)
-
-
-
Field Detail
-
addressKey
protected final String addressKey
-
responseKey
protected be.recipe.api.crypto.Message.Cipher.Key responseKey
-
systemKey
protected be.recipe.api.crypto.Message.Cipher.Key systemKey
-
properties
protected PropertyHandler properties
-
cipher
protected be.recipe.api.crypto.Message.Cipher cipher
-
symmKey
protected SecretKey symmKey
-
address
protected String address
-
traceId
public java8.util.function.Supplier<String> traceId
-
captureTraceId
public java8.util.function.Consumer<String> captureTraceId
-
-
Constructor Detail
-
AbstractRecipeClient
public AbstractRecipeClient(String addressKey)
-
AbstractRecipeClient
public AbstractRecipeClient(String addressKey, be.recipe.api.crypto.Message.Cipher.Key.DB<be.recipe.api.Prescription.OnContent> keyRegistry, be.recipe.api.crypto.Message.Cipher cipher, java8.util.function.Supplier<String> traceId)
-
AbstractRecipeClient
public AbstractRecipeClient(String addressKey, PropertyHandler properties)
-
AbstractRecipeClient
public AbstractRecipeClient(String addressKey, be.recipe.api.crypto.Message.Cipher.Key.DB<be.recipe.api.Prescription.OnContent> keyRegistry, be.recipe.api.crypto.Message.Cipher cipher, PropertyHandler properties)
-
-
Method Detail
-
toLocalDateTime
protected static org.threeten.bp.LocalDateTime toLocalDateTime(Calendar calendar)
-
toLocalDate
protected static org.threeten.bp.LocalDate toLocalDate(Calendar calendar)
-
refresh
public void refresh(PropertyHandler properties)
-
initEncryption
public void initEncryption(EncryptionUtils encryptionUtils)
-
encrypt
protected <T> byte[] encrypt(T it)
-
decrypt
protected <T> T decrypt(byte[] bytes, Class<T> type)
-
rejected
protected boolean rejected(StatusType status)
-
content
protected SecuredContentType content(byte[] encryptedBytes)
-
programId
protected String programId()
-
metadata
public static Properties metadata()
-
raise
public void raise(RuntimeException e)
-
withExceptionHandling
protected <T> T withExceptionHandling(String code, java8.util.function.Supplier<T> task)
-
-