Package ch.tocco.nice2.businessunit.api
Class BusinessUnitHolder
java.lang.Object
ch.tocco.nice2.businessunit.api.BusinessUnitHolder
A holder for a business unit. Use this with
ExecutionContext
to
store a business unit on the current thread.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getSecurityContext
(Callable<SecurityContext> callable) Returns aSecurityContext
that is cached for the current business unit.boolean
boolean
withBusinessUnit
(BusinessUnit businessUnit) Returns a new holder with the given business-unit.allows the setting and removal of business unit relations with typeBusinessUnitType.SINGLE
orBusinessUnitType.OPTIONAL
forbids the setting and removal of business unit relations with typeBusinessUnitType.SINGLE
orBusinessUnitType.OPTIONAL
-
Constructor Details
-
BusinessUnitHolder
-
-
Method Details
-
getBusinessUnit
-
withBusinessUnit
Returns a new holder with the given business-unit. -
getSecurityContext
Returns aSecurityContext
that is cached for the current business unit. If this results in a miss, the cache is updated by applying the given loader function to the given username. The function then usually performs a login.- Throws:
Exception
-
withResettingAllowed
allows the setting and removal of business unit relations with typeBusinessUnitType.SINGLE
orBusinessUnitType.OPTIONAL
- Returns:
- copy of this with resettingAllowed set to false
-
withResettingForbidden
forbids the setting and removal of business unit relations with typeBusinessUnitType.SINGLE
orBusinessUnitType.OPTIONAL
- Returns:
- copy of this with resettingAllowed set to false
-
withQueryInterceptorDisabled
-
isResettingAllowed
public boolean isResettingAllowed()- Returns:
- whether the setting and removal of business unit relations with type
BusinessUnitType.SINGLE
orBusinessUnitType.OPTIONAL
should be allowed
-
isQueryInterceptorDisabled
public boolean isQueryInterceptorDisabled() -
clearCache
public void clearCache()
-