public abstract class AbstractRolesResolver extends Object implements ParametricRolesResolver
The algorithm of the resolve(RoleUnit, Collection)
template
method does the following steps:
doResolve(com.whitestein.lsps.orgstructure.model.RoleUnit, java.util.Collection<com.whitestein.lsps.os.dto.RoleUnitParameter>)
method
addRole(com.whitestein.lsps.orgstructure.model.Role, java.util.Collection<com.whitestein.lsps.os.dto.RoleUnitParameter>)
method can be called...Constructor and Description |
---|
AbstractRolesResolver() |
Modifier and Type | Method and Description |
---|---|
protected void |
addRole(Role role,
Collection<RoleUnitParameter> parameters)
Adds given role into the set of resolved roles.
|
protected abstract void |
doResolve(RoleUnit roleUnit,
Collection<RoleUnitParameter> parameters)
Runs actual roles resolving algorithm applied to given
roleUnit . |
Set<RoleUnitName> |
resolve(RoleUnit roleUnit)
Runs a resolving algorithm and returns a set of names of roles that were
resolved from given
roleUnit . |
Set<RoleUnitName> |
resolve(RoleUnit roleUnit,
Collection<RoleUnitParameter> parameters)
Runs a resolving algorithm and returns a set of names of roles that were
resolved from given
roleUnit . |
public final Set<RoleUnitName> resolve(RoleUnit roleUnit)
RolesResolver
roleUnit
.resolve
in interface RolesResolver
roleUnit
- The role or the organization unit to resolve.roleUnit
.public final Set<RoleUnitName> resolve(RoleUnit roleUnit, Collection<RoleUnitParameter> parameters)
ParametricRolesResolver
roleUnit
.resolve
in interface ParametricRolesResolver
roleUnit
- The role or the organization unit to resolve.parameters
- The set of parameters to bind to each role or organization
unit that is visited during resolution process.roleUnit
.protected final void addRole(Role role, Collection<RoleUnitParameter> parameters)
It is best to call this method from within the overridden
doResolve(RoleUnit, Collection)
method body.
role
- The role to add into the set.parameters
- The set of parameters to bind to each role or organization
unit that is visited during resolution process.NullPointerException
- (unchecked)
If role
is null
.IllegalStateException
- (unchecked)
If the internal set of roles is not initialized, probably
because of calling this method from outside of the
doResolve(RoleUnit, Collection)
method.protected abstract void doResolve(RoleUnit roleUnit, Collection<RoleUnitParameter> parameters)
roleUnit
.roleUnit
- The role or organization unit to resolve.parameters
- The set of parameters to bind to each role or organization
unit that is visited during resolution process.Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.