Class DomainIdScopeResolver

java.lang.Object
sk.iway.iwcm.system.multidomain.DomainIdScopeResolver

public final class DomainIdScopeResolver extends Object
Resolves the effective domain ID declared by an entity class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    Returns the configured common domain ID.
    static boolean
    isCommon(Class<?> entityClass)
    Checks whether an entity class uses the common domain.
    static boolean
    isCommon(String entityClassName)
    Checks whether an entity class name resolves to a common-domain entity.
    static int
    resolve(Class<?> entityClass)
    Resolves the effective domain ID for an entity class.
    static int
    resolve(String entityClassName)
    Resolves the effective domain ID for an entity class name.

    Methods inherited from class java.lang.Object

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

    • resolve

      public static int resolve(Class<?> entityClass)
      Resolves the effective domain ID for an entity class.
      Parameters:
      entityClass - entity class carrying the optional common-domain marker
      Returns:
      common domain ID for common entities, otherwise the current domain ID
    • resolve

      public static int resolve(String entityClassName)
      Resolves the effective domain ID for an entity class name.
      Parameters:
      entityClassName - fully qualified entity class name
      Returns:
      resolved domain ID, or the current domain ID when the class cannot be resolved
    • isCommon

      public static boolean isCommon(Class<?> entityClass)
      Checks whether an entity class uses the common domain.
      Parameters:
      entityClass - entity class to inspect
      Returns:
      true when the class carries the common-domain marker
    • isCommon

      public static boolean isCommon(String entityClassName)
      Checks whether an entity class name resolves to a common-domain entity.
      Parameters:
      entityClassName - fully qualified entity class name
      Returns:
      true when the resolved class carries the common-domain marker
    • getCommonDomainId

      public static int getCommonDomainId()
      Returns the configured common domain ID.
      Returns:
      configured common domain ID, or 1 when it is not configured