blob: 52827c3e7d6eb4d63027571b2e49be6c993f29a2 [file] [log] [blame]
/*
* Copyright (c) 2009-2013, JoshuaTree. All Rights Reserved.
*/
package us.jts.fortress.ant;
import us.jts.fortress.rbac.Relationship;
import java.util.ArrayList;
import java.util.List;
/**
* The class is used by {@link FortressAntTask} to load {@link Relationship}s used to drive {@link us.jts.fortress.AdminMgr#addInheritance(us.jts.fortress.rbac.Role, us.jts.fortress.rbac.Role)}.
* It is not intended to be callable by programs outside of the Ant load utility. The class name itself maps to the xml tag used by load utility.
* <p>This class name, 'Addadminroleinheritance', is used for the xml tag in the load script.</p>
* <pre>
* {@code
* <target name="all">
* <FortressAdmin>
* <addadminroleinheritance>
* ...
* </addadminroleinheritance>
* </FortressAdmin>
* </target>
* }
* </pre>
*
* @author Shawn McKinney
*/
public class Addadminroleinheritance
{
final private List<Relationship> relationships = new ArrayList<>();
/**
* All Ant data entities must have a default constructor.
*/
public Addadminroleinheritance()
{
}
/**
* <p>This method name, 'addRelationship', is used for derived xml tag 'relationship' in the load script.</p>
* <pre>
* {@code
* <addadminroleinheritance>
* <relationship child="ar2" parent="ar1"/>
* <relationship child="ar3" parent="ar1"/>
* <relationship child="ar4" parent="ar1"/>
* </addadminroleinheritance>
* }
* </pre>
*
* @param relationship contains reference to data element targeted for insertion..
*/
public void addRelationship(Relationship relationship)
{
this.relationships.add(relationship);
}
/**
* Used by {@link FortressAntTask#addAddadminrole(Addadminrole)} to retrieve list of Roles as defined in input xml file.
*
* @return collection containing {@link Relationship}s targeted for insertion.
*/
public List<Relationship> getRelationships()
{
return this.relationships;
}
}