Package sk.iway.iwcm.system.multidomain
Class DomainIdScopeResolver
java.lang.Object
sk.iway.iwcm.system.multidomain.DomainIdScopeResolver
Resolves the effective domain ID declared by an entity class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intReturns the configured common domain ID.static booleanChecks whether an entity class uses the common domain.static booleanChecks whether an entity class name resolves to a common-domain entity.static intResolves the effective domain ID for an entity class.static intResolves the effective domain ID for an entity class name.
-
Method Details
-
resolve
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
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
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
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
-