Class FortressAntTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.apache.directory.fortress.core.ant.FortressAntTask
-
- All Implemented Interfaces:
Cloneable
,org.apache.tools.ant.input.InputHandler
public class FortressAntTask extends org.apache.tools.ant.Task implements org.apache.tools.ant.input.InputHandler
This class implements Apache Ant custom task and is used to drive the Fortress Administrative APIs using XML files. The methods in this class are not intended to be callable by outside programs. The following APIs are supported:using the custom Ant task that is implemented in this class. The format of the XML is flat and consists of entity names along with their attributes.
This class will process xml formatted requests with the following tags:
<target name="all"> <FortressAdmin> <adduser> ...</adduser> <deluser> ...</deluser> <adduserrole> ...</adduserrole> <deluserrole> ...</deluserrole> <addrole> ...</addrole>* <delrole> ...</delrole> <addroleinheritance>...</addroleinheritance> <delroleinheritance>...</delroleinheritance> <addsdset>STATIC or DYNAMIC</addsdset> <delsdset>STATIC or DYNAMIC</delsdset> <delpwpolicy> ...</delpwpolicy> <addpwpolicy> ...</addpwpolicy> <addpermobj> RBAC or ARBAC permission objects</addpermobj> <delpermobj> RBAC or ARBAC permission objects</delpermobj> <addpermop> RBAC or ARBAC permission operations</addpermop> <delpermop> RBAC or ARBAC permission operations</delpermop> <addpermgrant> RBAC or ARBAC permission grants </addpermgrant> <delpermgrant> RBAC or ARBAC permission revokes </delpermgrant> <addorgunit> User OUs or Perm OUs </addorgunit> <delorgunit> User OUs or Perm OUs </delorgunit> <adduserorgunitinheritance> ...</adduserorgunitinheritance> <deluserorgunitinheritance> ...</deluserorgunitinheritance> <addpermorgunitinheritance> ...</addpermorgunitinheritance> <delpermorgunitinheritance> ...</delpermorgunitinheritance> <adduser> ... </adduser> <deluser> ...</deluser> <addadminrole> ... </addadminrole> <deladminrole> ... </deladminrole> <addadminroleinheritance>...</addadminroleinheritance> <deladminroleinheritance>...</deladminroleinheritance> <adduseradminrole> ... </adduseradminrole> <deluseradminrole> ... </deluseradminrole> </FortressAdmin> </target>
Order of Precedence
The order of operations in the XML does not effect the order or precedence which has been "hard-wired" by the processing order within this class.-
Delete User Role Assignments
AdminMgr.deassignUser( org.apache.directory.fortress.core.model.UserRole)
- Delete User AdminRole Assignments
DelAdminMgr.deassignUser(UserAdminRole)
-
Revoke Permission Assignments Delete
AdminMgr.revokePermission( org.apache.directory.fortress.core.model.Permission, org.apache.directory.fortress.core.model.Role)
-
Delete Users
AdminMgr.disableUser( org.apache.directory.fortress.core.model.User)
-
Delete Password Policies
PwPolicyMgr.delete( org.apache.directory.fortress.core.model.PwPolicy)
-
Delete Permission Operations
AdminMgr.deletePermission( org.apache.directory.fortress.core.model.Permission)
-
Delete Permission Objects
AdminMgr.deletePermObj( org.apache.directory.fortress.core.model.PermObj)
-
Delete SSD and DSD Sets
AdminMgr.deleteDsdSet( org.apache.directory.fortress.core.model.SDSet)
andAdminMgr.deleteSsdSet(org.apache.directory.fortress.core.model.SDSet)
-
Delete RBAC Roles Inheritances
AdminMgr.deleteInheritance( org.apache.directory.fortress.core.model.Role, org.apache.directory.fortress.core.model.Role)
-
Delete RBAC Roles
AdminMgr.deleteRole( org.apache.directory.fortress.core.model.Role)
-
Delete ARBAC Role Inheritances
DelAdminMgr.deleteInheritance( org.apache.directory.fortress.core.model.AdminRole,org.apache.directory.fortress.core.model.AdminRole)
-
Delete ARBAC Roles
DelAdminMgr.deleteRole( org.apache.directory.fortress.core.model.AdminRole)
-
Delete User and Perm OU Inheritances
DelAdminMgr.deleteInheritance( org.apache.directory.fortress.core.model.OrgUnit, org.apache.directory.fortress.core.model.OrgUnit)
USER and PERM -
Delete User and Perm OUs
DelAdminMgr.delete( org.apache.directory.fortress.core.model.OrgUnit)
USER and PERM -
Delete Configuration Entries
ConfigMgr.delete(String, java.util.Properties)
- Delete Containers
OrganizationalUnitP.delete(OrganizationalUnit)
-
Delete Suffix
SuffixP.delete( org.apache.directory.fortress.core.model.Suffix)
} - Add Suffix
SuffixP.add(Suffix)
} - Add Containers
OrganizationalUnitP.add(OrganizationalUnit)
- Add Configuration Parameters
ConfigMgr.add(Configuration)
-
Add User and Perm OUs
DelAdminMgr.add( org.apache.directory.fortress.core.model.OrgUnit)
USER and PERM -
Add User and Perm OU Inheritances
DelAdminMgr.addInheritance(org.apache.directory.fortress.core.model.OrgUnit, org.apache.directory.fortress.core.model.OrgUnit)
USER and PERM -
Add ARBAC Roles
DelAdminMgr.addRole( org.apache.directory.fortress.core.model.AdminRole)
-
Add ARBAC Role Inheritances
DelAdminMgr.addInheritance( org.apache.directory.fortress.core.model.AdminRole, org.apache.directory.fortress.core.model.AdminRole)
-
Add RBAC Roles
AdminMgr.addRole( org.apache.directory.fortress.core.model.Role)
-
Add RBAC Role Inheritances
AdminMgr.addInheritance( org.apache.directory.fortress.core.model.Role, org.apache.directory.fortress.core.model.Role)
-
Add DSD and SSD Sets
AdminMgr.createDsdSet( org.apache.directory.fortress.core.model.SDSet)
andAdminMgr.createSsdSet(org.apache.directory.fortress.core.model.SDSet)
-
Add Permission Objects
AdminMgr.addPermObj( org.apache.directory.fortress.core.model.PermObj)
-
Add Permission Operations
AdminMgr.addPermission( org.apache.directory.fortress.core.model.Permission)
-
Add Password Policies
PwPolicyMgr.add( org.apache.directory.fortress.core.model.PwPolicy)
-
Add Users
AdminMgr.addUser(org.apache.directory.fortress.core.model.User)
-
Grant RBAC Permissions
AdminMgr.grantPermission( org.apache.directory.fortress.core.model.Permission, org.apache.directory.fortress.core.model.Role)
-
Assign ARBAC Roles
DelAdminMgr.assignUser( org.apache.directory.fortress.core.model.UserAdminRole)
-
Assign RBAC Roles
AdminMgr.assignUser( org.apache.directory.fortress.core.model.UserRole)
- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description FortressAntTask()
Default constructor initializes he Manager APIs.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAddadminrole(Addadminrole addrole)
Load the entity with data.void
addAddadminroleinheritance(Addadminroleinheritance addadminroleinheritance)
Load the entity with data.void
addAddconfig(Addconfig addcfg)
Load the entity with data.void
addAddcontainer(Addcontainer addcontainer)
Load the entity with data.void
addAddcontext(Addcontext addcontext)
Load the entity with data.void
addAddgroup(Addgroup addgroup)
Load the entity with data.void
addAddgroupmember(Addgroupmember addgroupmember)
Load the entity with data.void
addAddgroupproperty(Addgroupproperty addgroupproperty)
Load the entity with data.void
addAddorgunit(Addorgunit addorgunit)
Load the entity with data.void
addAddpermGrant(AddpermGrant addpermGrant)
Load the entity with data.void
addAddpermObj(AddpermObj addpermObj)
Load the entity with data.void
addAddpermOp(AddpermOp addpermOp)
Load the entity with data.void
addAddpermorgunitinheritance(Addpermorgunitinheritance addinheritance)
Load the entity with data.void
addAddpwpolicy(Addpwpolicy addpwpolicy)
Load the entity with data.void
addAddrole(Addrole addrole)
Load the entity with data.void
addAddroleconstraint(Addroleconstraint addroleconstraint)
Load the entity with data.void
addAddroleinheritance(Addroleinheritance addroleinheritance)
Load the entity with data.void
addAddsdset(Addsdset addsd)
Load the entity with data.void
addAddsuffix(Addsuffix addsuffix)
Load the entity with data.void
addAdduser(Adduser adduser)
Load the entity with data.void
addAdduseradminrole(Adduseradminrole adduserrole)
Load the entity with data.void
addAdduserorgunitinheritance(Adduserorgunitinheritance addinheritance)
Load the entity with data.void
addAdduserrole(Adduserrole adduserrole)
Load the entity with data.void
addDeladminrole(Deladminrole delrole)
Load the entity with data.void
addDeladminroleinheritance(Deladminroleinheritance deladminroleinheritance)
Load the entity with data.void
addDelconfig(Delconfig delcfg)
Load the entity with data.void
addDelcontainer(Delcontainer delcontainer)
Load the entity with data.void
addDelgroup(Delgroup delgroup)
Load the entity with data.void
addDelgroupmember(Delgroupmember delgroupmember)
Load the entity with data.void
addDelgroupproperty(Delgroupproperty delgroupproperty)
Load the entity with data.void
addDelorgunit(Delorgunit delorgunit)
Load the entity with data.void
addDelpermGrant(DelpermGrant delpermGrant)
Load the entity with data.void
addDelpermObj(DelpermObj delpermObj)
Load the entity with data.void
addDelpermOp(DelpermOp delpermOp)
Load the entity with data.void
addDelpermorgunitinheritance(Delpermorgunitinheritance delinheritance)
Load the entity with data.void
addDelpwpolicy(Delpwpolicy delpwpolicy)
Load the entity with data.void
addDelrole(Delrole delrole)
Load the entity with data.void
addDelroleconstraint(Delroleconstraint delroleconstraint)
Load the entity with data.void
addDelroleinheritance(Delroleinheritance delroleinheritance)
Load the entity with data.void
addDelsdset(Delsdset delsd)
Load the entity with data.void
addDelsuffix(Delsuffix delsuffix)
Load the entity with data.void
addDeluser(Deluser deluser)
Load the entity with data.void
addDeluseradminrole(Deluseradminrole deluserrole)
Load the entity with data.void
addDeluserorgunitinheritance(Deluserorgunitinheritance delinheritance)
Load the entity with data.void
addDeluserrole(Deluserrole deluserrole)
Load the entity with data.void
addUpdconfig(Updconfig updcfg)
Load the entity with data.void
execute()
List<Addgroup>
getAddgroups()
List<AddpermGrant>
getAddpermGrants()
List<AddpermObj>
getAddpermObjs()
List<AddpermOp>
getAddpermOps()
List<Addroleinheritance>
getAddroleinheritances()
List<Addrole>
getAddroles()
List<Addsdset>
getAddsdsets()
List<Adduserrole>
getAdduserroles()
List<Adduser>
getAddusers()
static Properties
getProperties(String inputString)
String
getTenant()
void
handleInput(org.apache.tools.ant.input.InputRequest request)
Used by Apache Ant to load data from xml into entities.void
setContext(Context context)
This method is used as an alternative way to set tenant id.-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
getTenant
public String getTenant()
-
addAddcontext
public void addAddcontext(Addcontext addcontext)
Load the entity with data.- Parameters:
addcontext
- contains the ant initialized data entities to be handed off for further processing.
-
setContext
public void setContext(Context context)
This method is used as an alternative way to set tenant id. By setting this element in xml file:- Parameters:
context
- contains the tenant info.
-
handleInput
public void handleInput(org.apache.tools.ant.input.InputRequest request)
Used by Apache Ant to load data from xml into entities.- Specified by:
handleInput
in interfaceorg.apache.tools.ant.input.InputHandler
- Parameters:
request
- The input request
-
addAddconfig
public void addAddconfig(Addconfig addcfg)
Load the entity with data.- Parameters:
addcfg
- contains the ant initialized data entities to be handed off for further processing.
-
addUpdconfig
public void addUpdconfig(Updconfig updcfg)
Load the entity with data.- Parameters:
updcfg
- contains the ant initialized data entities to be handed off for further processing.
-
addDelconfig
public void addDelconfig(Delconfig delcfg)
Load the entity with data.- Parameters:
delcfg
- contains the ant initialized data entities to be handed off for further processing.
-
addAdduser
public void addAdduser(Adduser adduser)
Load the entity with data.- Parameters:
adduser
- contains the ant initialized data entities to be handed off for further processing.
-
addDeluser
public void addDeluser(Deluser deluser)
Load the entity with data.- Parameters:
deluser
- contains the ant initialized data entities to be handed off for further processing.
-
addAdduserrole
public void addAdduserrole(Adduserrole adduserrole)
Load the entity with data.- Parameters:
adduserrole
- contains the ant initialized data entities to be handed off for further processing.
-
addDeluserrole
public void addDeluserrole(Deluserrole deluserrole)
Load the entity with data.- Parameters:
deluserrole
- contains the ant initialized data entities to be handed off for further processing.
-
addAddrole
public void addAddrole(Addrole addrole)
Load the entity with data.- Parameters:
addrole
- contains the ant initialized data entities to be handed off for further processing.
-
addDelrole
public void addDelrole(Delrole delrole)
Load the entity with data.- Parameters:
delrole
- contains the ant initialized data entities to be handed off for further processing.
-
addAddroleinheritance
public void addAddroleinheritance(Addroleinheritance addroleinheritance)
Load the entity with data.- Parameters:
addroleinheritance
- contains the ant initialized data entities to be handed off for further processing.
-
addDelroleinheritance
public void addDelroleinheritance(Delroleinheritance delroleinheritance)
Load the entity with data.- Parameters:
delroleinheritance
- contains the ant initialized data entities to be handed off for further processing.
-
addAddsdset
public void addAddsdset(Addsdset addsd)
Load the entity with data.- Parameters:
addsd
- contains the ant initialized data entities to be handed off for further processing.
-
addDelsdset
public void addDelsdset(Delsdset delsd)
Load the entity with data.- Parameters:
delsd
- contains the ant initialized data entities to be handed off for further processing.
-
addAddpermOp
public void addAddpermOp(AddpermOp addpermOp)
Load the entity with data.- Parameters:
addpermOp
- contains the ant initialized data entities to be handed off for further processing.
-
addDelpermOp
public void addDelpermOp(DelpermOp delpermOp)
Load the entity with data.- Parameters:
delpermOp
- contains the ant initialized data entities to be handed off for further processing.
-
addAddpermObj
public void addAddpermObj(AddpermObj addpermObj)
Load the entity with data.- Parameters:
addpermObj
- contains the ant initialized data entities to be handed off for further processing.
-
addDelpermObj
public void addDelpermObj(DelpermObj delpermObj)
Load the entity with data.- Parameters:
delpermObj
- contains the ant initialized data entities to be handed off for further processing.
-
addAddpermGrant
public void addAddpermGrant(AddpermGrant addpermGrant)
Load the entity with data.- Parameters:
addpermGrant
- contains the ant initialized data entities to be handed off for further processing.
-
addDelpermGrant
public void addDelpermGrant(DelpermGrant delpermGrant)
Load the entity with data.- Parameters:
delpermGrant
- contains the ant initialized data entities to be handed off for further processing.
-
addAddpwpolicy
public void addAddpwpolicy(Addpwpolicy addpwpolicy)
Load the entity with data.- Parameters:
addpwpolicy
- contains the ant initialized data entities to be handed off for further processing.
-
addDelpwpolicy
public void addDelpwpolicy(Delpwpolicy delpwpolicy)
Load the entity with data.- Parameters:
delpwpolicy
- contains the ant initialized data entities to be handed off for further processing.
-
addAddcontainer
public void addAddcontainer(Addcontainer addcontainer)
Load the entity with data.- Parameters:
addcontainer
- contains the ant initialized data entities to be handed off for further processing.
-
addDelcontainer
public void addDelcontainer(Delcontainer delcontainer)
Load the entity with data.- Parameters:
delcontainer
- contains the ant initialized data entities to be handed off for further processing.
-
addAddsuffix
public void addAddsuffix(Addsuffix addsuffix)
Load the entity with data.- Parameters:
addsuffix
- contains the ant initialized data entities to be handed off for further processing.
-
addDelsuffix
public void addDelsuffix(Delsuffix delsuffix)
Load the entity with data.- Parameters:
delsuffix
- contains the ant initialized data entities to be handed off for further processing.
-
addAddorgunit
public void addAddorgunit(Addorgunit addorgunit)
Load the entity with data.- Parameters:
addorgunit
- contains the ant initialized data entities to be handed off for further processing.
-
addDelorgunit
public void addDelorgunit(Delorgunit delorgunit)
Load the entity with data.- Parameters:
delorgunit
- contains the ant initialized data entities to be handed off for further processing.
-
addAdduserorgunitinheritance
public void addAdduserorgunitinheritance(Adduserorgunitinheritance addinheritance)
Load the entity with data.- Parameters:
addinheritance
- contains the ant initialized data entities to be handed off for further processing.
-
addDeluserorgunitinheritance
public void addDeluserorgunitinheritance(Deluserorgunitinheritance delinheritance)
Load the entity with data.- Parameters:
delinheritance
- contains the ant initialized data entities to be handed off for further processing.
-
addAddpermorgunitinheritance
public void addAddpermorgunitinheritance(Addpermorgunitinheritance addinheritance)
Load the entity with data.- Parameters:
addinheritance
- contains the ant initialized data entities to be handed off for further processing.
-
addDelpermorgunitinheritance
public void addDelpermorgunitinheritance(Delpermorgunitinheritance delinheritance)
Load the entity with data.- Parameters:
delinheritance
- contains the ant initialized data entities to be handed off for further processing.
-
addAddadminrole
public void addAddadminrole(Addadminrole addrole)
Load the entity with data.- Parameters:
addrole
- contains the ant initialized data entities to be handed off for further processing.
-
addDeladminrole
public void addDeladminrole(Deladminrole delrole)
Load the entity with data.- Parameters:
delrole
- contains the ant initialized data entities to be handed off for further processing.
-
addAddadminroleinheritance
public void addAddadminroleinheritance(Addadminroleinheritance addadminroleinheritance)
Load the entity with data.- Parameters:
addadminroleinheritance
- contains the ant initialized data entities to be handed off for further processing.
-
addDeladminroleinheritance
public void addDeladminroleinheritance(Deladminroleinheritance deladminroleinheritance)
Load the entity with data.- Parameters:
deladminroleinheritance
- contains the ant initialized data entities to be handed off for further processing.
-
addAdduseradminrole
public void addAdduseradminrole(Adduseradminrole adduserrole)
Load the entity with data.- Parameters:
adduserrole
- contains the ant initialized data entities to be handed off for further processing.
-
addDeluseradminrole
public void addDeluseradminrole(Deluseradminrole deluserrole)
Load the entity with data.- Parameters:
deluserrole
- contains the ant initialized data entities to be handed off for further processing.
-
addAddgroup
public void addAddgroup(Addgroup addgroup)
Load the entity with data.- Parameters:
addgroup
- contains the ant initialized data entities to be handed off for further processing.
-
addDelgroup
public void addDelgroup(Delgroup delgroup)
Load the entity with data.- Parameters:
delgroup
- contains the ant initialized data entities to be handed off for further processing.
-
addAddgroupmember
public void addAddgroupmember(Addgroupmember addgroupmember)
Load the entity with data.- Parameters:
addgroupmember
- contains the ant initialized data entities to be handed off for further processing.
-
addDelgroupmember
public void addDelgroupmember(Delgroupmember delgroupmember)
Load the entity with data.- Parameters:
delgroupmember
- contains the ant initialized data entities to be handed off for further processing.
-
addAddgroupproperty
public void addAddgroupproperty(Addgroupproperty addgroupproperty)
Load the entity with data.- Parameters:
addgroupproperty
- contains the ant initialized data entities to be handed off for further processing.
-
addDelgroupproperty
public void addDelgroupproperty(Delgroupproperty delgroupproperty)
Load the entity with data.- Parameters:
delgroupproperty
- contains the ant initialized data entities to be handed off for further processing.
-
addAddroleconstraint
public void addAddroleconstraint(Addroleconstraint addroleconstraint)
Load the entity with data.- Parameters:
addroleconstraint
- contains the ant initialized data entities to be handed off for further processing.
-
addDelroleconstraint
public void addDelroleconstraint(Delroleconstraint delroleconstraint)
Load the entity with data.- Parameters:
delroleconstraint
- contains the ant initialized data entities to be handed off for further processing.
-
execute
public void execute() throws org.apache.tools.ant.BuildException
- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
- An error occurred while building
-
getProperties
public static Properties getProperties(String inputString)
-
getAddpermObjs
public List<AddpermObj> getAddpermObjs()
-
getAdduserroles
public List<Adduserrole> getAdduserroles()
-
getAddroleinheritances
public List<Addroleinheritance> getAddroleinheritances()
-
getAddpermGrants
public List<AddpermGrant> getAddpermGrants()
-
-