Package ch.cern.eam.wshub.core.tools
Class Tools
java.lang.Object
ch.cern.eam.wshub.core.tools.Tools
-
Constructor Summary
ConstructorsConstructorDescriptionTools(ApplicationData applicationData, net.datastream.wsdls.eamws.EAMWebServicesPT eamWebServicesToolkitClient, ExecutorService executorService, DataSource dataSource, jakarta.persistence.EntityManagerFactory entityManagerFactory, Logger logger) -
Method Summary
Modifier and TypeMethodDescription<A,R> BatchResponse <R> batchOperation(EAMContext context, WSHubOperation<A, R> operation, List<A> arguments) <A,R, T> Map <T, R> batchOperationToMap(List<A> arguments, BatchResponse<R> results, Map<T, A> map) voidcloseConnection(Connection connection, Statement statement, ResultSet resultSet) Close the connection with the databasenet.datastream.schemas.mp_functions.SessionTypecreateEAMSession(EAMContext context) net.datastream.schemas.mp_functions.MessageConfigTypeGenerates MessageConfig element that can be added to the request to tell the server to omit the InformationAlert and WarningAlert elements from the response.org.xmlsoap.schemas.ws._2002._04.secext.SecuritycreateSecurityHeader(EAMContext context) voidstatic StringextractEntityCode(String code) static EntityOrganizationCodePairstatic Stringstatic EAMExceptiongenerateFault(String reason) static EAMExceptiongenerateFault(String reason, ExceptionInfo[] errors) getEAMContext(Credentials credentials) getEAMContext(Credentials credentials, String sessionID) getEAMContext(String username, String password) jakarta.persistence.EntityManagernet.datastream.schemas.mp_fields.ORGANIZATIONID_TypegetOrganization(EAMContext eamContext) net.datastream.schemas.mp_fields.ORGANIZATIONID_TypegetOrganization(EAMContext eamContext, String organizationCode) getOrganizationCode(EAMContext eamContext) getOrganizationCode(EAMContext context, String organizationCode) getTenant(EAMContext eamContext) booleanvoid<A,R> R performEAMOperation(EAMContext context, EAMOperation<A, R> operation, A argument) <T> BatchResponse<T> processCallables(List<Callable<T>> mylist) voidprocessRunnables(Runnable... runnables) voidprocessRunnables(List<Runnable> mylist)
-
Constructor Details
-
Tools
public Tools(ApplicationData applicationData, net.datastream.wsdls.eamws.EAMWebServicesPT eamWebServicesToolkitClient, ExecutorService executorService, DataSource dataSource, jakarta.persistence.EntityManagerFactory entityManagerFactory, Logger logger)
-
-
Method Details
-
getEntityManager
public jakarta.persistence.EntityManager getEntityManager() -
getDataSource
-
getCustomFieldsTools
-
getDataTypeTools
-
getFieldDescriptionsTools
-
getGridTools
-
getEAMFieldTools
-
log
-
createSecurityHeader
public org.xmlsoap.schemas.ws._2002._04.secext.Security createSecurityHeader(EAMContext context) throws EAMException - Throws:
EAMException
-
createEAMSession
-
createMessageConfig
public net.datastream.schemas.mp_functions.MessageConfigType createMessageConfig()Generates MessageConfig element that can be added to the request to tell the server to omit the InformationAlert and WarningAlert elements from the response.- Returns:
- MessageConfig
-
getOrganization
-
getOrganization
public net.datastream.schemas.mp_fields.ORGANIZATIONID_Type getOrganization(EAMContext eamContext, String organizationCode) -
getOrganizationCode
-
getOrganizationCode
-
extractEntityCode
-
extractOrganizationCode
-
extractEntityOrganizationCodePair
-
getTenant
-
generateFault
-
generateFault
-
processCallables
-
processRunnables
- Throws:
EAMException
-
processRunnables
- Throws:
EAMException
-
getEAMContext
-
getEAMContext
-
getEAMContext
-
closeConnection
Close the connection with the database- Parameters:
connection- Connection to be closedstatement- statement to be closedresultSet- Resultset to be closed
-
demandDatabaseConnection
- Throws:
EAMException
-
isDatabaseConnectionConfigured
public boolean isDatabaseConnectionConfigured() -
batchOperation
public <A,R> BatchResponse<R> batchOperation(EAMContext context, WSHubOperation<A, R> operation, List<A> arguments) -
batchOperationToMap
public <A,R, Map<T,T> R> batchOperationToMap(List<A> arguments, BatchResponse<R> results, Map<T, A> map) -
performEAMOperation
public <A,R> R performEAMOperation(EAMContext context, EAMOperation<A, R> operation, A argument) throws EAMException- Throws:
EAMException
-