Class EntityManagerCheckUtils
java.lang.Object
com.priint.pubserver.plugin.entitymanager.EntityManagerCheckUtils
Provides methods to do checks in
EntityManager.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckConnector(String conConnector, com.priint.pubserver.plugin.interfaces.PluginControl connector, String methodName) Asserts that conConnector and connector plugin are not null.static voidcheckEntity(com.priint.pubserver.entity.Entity entity, String methodName, Class<? extends com.priint.pubserver.entity.Entity> clazz, String entityIdentifier, String entityModelIdentifier) Asserts that entity is not null and check Otherwise throws EntityManagerException.static voidcheckEntityModel(String entityModelIdentifier, com.priint.pubserver.entity.EntityModel entityModel, String methodName) static voidcheckEntityParent(com.priint.pubserver.entity.Entity parent, String methodName, Class<? extends com.priint.pubserver.entity.Entity> clazzParent, String entityIdentifier, String entityModelIdentifier) static voidcheckEntityRoots(List<com.priint.pubserver.entity.EntityBucket> roots, String methodName, String entityModelIdentifier) static voidcheckRequiredParameter(String parameterName, String parameter, String methodName) Asserts that a string collection parameter is not empty and throws exception if necessary.static voidcheckRequiredParameter(String parameterName, Collection<?> parameter, String methodName) Asserts that a collection parameter is not empty and throws exception if necessary.
-
Method Details
-
checkEntityModel
public static void checkEntityModel(String entityModelIdentifier, com.priint.pubserver.entity.EntityModel entityModel, String methodName) throws com.priint.pubserver.plugin.exception.EntityManagerException - Throws:
com.priint.pubserver.plugin.exception.EntityManagerException
-
checkEntityParent
public static void checkEntityParent(com.priint.pubserver.entity.Entity parent, String methodName, Class<? extends com.priint.pubserver.entity.Entity> clazzParent, String entityIdentifier, String entityModelIdentifier) throws com.priint.pubserver.plugin.exception.EntityManagerException - Throws:
com.priint.pubserver.plugin.exception.EntityManagerException
-
checkEntity
public static void checkEntity(com.priint.pubserver.entity.Entity entity, String methodName, Class<? extends com.priint.pubserver.entity.Entity> clazz, String entityIdentifier, String entityModelIdentifier) throws com.priint.pubserver.plugin.exception.EntityManagerException Asserts that entity is not null and check Otherwise throws EntityManagerException. Asserts that connector entity identifier is not empty (Only for PublishingHubDBConnector and MuaConnector ). Otherwise throws EntityManagerException.- Parameters:
entity- Name of the connector.methodName- The name of the method for logging, tracing or exceptions.clazz- The entity class.entityIdentifier- The identifier of the entityentityModelIdentifier- The identifier of the model- Throws:
com.priint.pubserver.plugin.exception.EntityManagerException
-
checkEntityRoots
public static void checkEntityRoots(List<com.priint.pubserver.entity.EntityBucket> roots, String methodName, String entityModelIdentifier) throws com.priint.pubserver.plugin.exception.EntityManagerException - Throws:
com.priint.pubserver.plugin.exception.EntityManagerException
-
checkConnector
public static void checkConnector(String conConnector, com.priint.pubserver.plugin.interfaces.PluginControl connector, String methodName) throws com.priint.pubserver.plugin.exception.EntityManagerException Asserts that conConnector and connector plugin are not null. Otherwise throws EntityManagerException.- Parameters:
conConnector- Name of the connector.connector- connector plugin or nullmethodName- The name of the method for logging, tracing or exceptions.- Throws:
com.priint.pubserver.plugin.exception.EntityManagerException
-
checkRequiredParameter
public static void checkRequiredParameter(String parameterName, Collection<?> parameter, String methodName) throws com.priint.pubserver.plugin.exception.EntityManagerException Asserts that a collection parameter is not empty and throws exception if necessary.- Parameters:
parameterName-parameter-methodName-- Throws:
com.priint.pubserver.plugin.exception.EntityManagerException
-
checkRequiredParameter
public static void checkRequiredParameter(String parameterName, String parameter, String methodName) throws com.priint.pubserver.plugin.exception.EntityManagerException Asserts that a string collection parameter is not empty and throws exception if necessary.- Parameters:
parameterName-parameter-methodName-- Throws:
com.priint.pubserver.plugin.exception.EntityManagerException
-