Class BusinessUnitChange

java.lang.Object
ch.tocco.nice2.businessunit.api.BusinessUnitChange

public final class BusinessUnitChange extends Object
Describes changing the business unit. The business unit is changed using BusinessUnitManager.withBusinessUnit(BusinessUnitChange). The code executed by the invoker is running in the given business unit. By default, the principal is logged into the new business unit since now the policy may have changed. If the code is known to be executed in privileged mode, this is not necessary and can be skipped (the policy of the current user does not matter when running privileged). This is possible to specify using noLogin(). If this is used with persistence related code, consider using PersistTasks, see TaskModes.BUSINESS_UNIT which detects automatically when in privileged mode and uses the invoker accordingly.