Class EntityManagerCheckUtils


  • public class EntityManagerCheckUtils
    extends java.lang.Object
    Provides methods to do checks in EntityManager.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void checkConnector​(java.lang.String conConnector, com.priint.pubserver.plugin.interfaces.PluginControl connector, java.lang.String methodName)
      Asserts that conConnector and connector plugin are not null.
      static void checkEntity​(com.priint.pubserver.entity.Entity entity, java.lang.String methodName, java.lang.Class<? extends com.priint.pubserver.entity.Entity> clazz, java.lang.String entityIdentifier, java.lang.String entityModelIdentifier)
      Asserts that entity is not null and check Otherwise throws EntityManagerException.
      static void checkEntityModel​(java.lang.String entityModelIdentifier, com.priint.pubserver.entity.EntityModel entityModel, java.lang.String methodName)  
      static void checkEntityParent​(com.priint.pubserver.entity.Entity parent, java.lang.String methodName, java.lang.Class<? extends com.priint.pubserver.entity.Entity> clazzParent, java.lang.String entityIdentifier, java.lang.String entityModelIdentifier)  
      static void checkEntityRoots​(java.util.List<com.priint.pubserver.entity.EntityBucket> roots, java.lang.String methodName, java.lang.String entityModelIdentifier)  
      static void checkRequiredParameter​(java.lang.String parameterName, java.lang.String parameter, java.lang.String methodName)
      Asserts that a string collection parameter is not empty and throws exception if necessary.
      static void checkRequiredParameter​(java.lang.String parameterName, java.util.Collection<?> parameter, java.lang.String methodName)
      Asserts that a collection parameter is not empty and throws exception if necessary.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • checkEntityModel

        public static void checkEntityModel​(java.lang.String entityModelIdentifier,
                                            com.priint.pubserver.entity.EntityModel entityModel,
                                            java.lang.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,
                                             java.lang.String methodName,
                                             java.lang.Class<? extends com.priint.pubserver.entity.Entity> clazzParent,
                                             java.lang.String entityIdentifier,
                                             java.lang.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,
                                       java.lang.String methodName,
                                       java.lang.Class<? extends com.priint.pubserver.entity.Entity> clazz,
                                       java.lang.String entityIdentifier,
                                       java.lang.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 entity
        entityModelIdentifier - The identifier of the model
        Throws:
        com.priint.pubserver.plugin.exception.EntityManagerException
      • checkEntityRoots

        public static void checkEntityRoots​(java.util.List<com.priint.pubserver.entity.EntityBucket> roots,
                                            java.lang.String methodName,
                                            java.lang.String entityModelIdentifier)
                                     throws com.priint.pubserver.plugin.exception.EntityManagerException
        Throws:
        com.priint.pubserver.plugin.exception.EntityManagerException
      • checkConnector

        public static void checkConnector​(java.lang.String conConnector,
                                          com.priint.pubserver.plugin.interfaces.PluginControl connector,
                                          java.lang.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 null
        methodName - The name of the method for logging, tracing or exceptions.
        Throws:
        com.priint.pubserver.plugin.exception.EntityManagerException
      • checkRequiredParameter

        public static void checkRequiredParameter​(java.lang.String parameterName,
                                                  java.util.Collection<?> parameter,
                                                  java.lang.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​(java.lang.String parameterName,
                                                  java.lang.String parameter,
                                                  java.lang.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