You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2014/10/22 17:45:01 UTC
[42/51] [partial] Rename packages from org.openldap.fortress to
org.apache.directory.fortress.core. Change default suffix to org.apache.
Switch default ldap api from unbound to apache ldap.
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/687ee1ad/src/main/java/org/apache/directory/fortress/core/ant/Delsuffix.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/Delsuffix.java b/src/main/java/org/apache/directory/fortress/core/ant/Delsuffix.java
new file mode 100755
index 0000000..5918882
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/ant/Delsuffix.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.fortress.core.ant;
+
+import org.apache.directory.fortress.core.ldap.suffix.Suffix;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * The class is used by {@link FortressAntTask} to create new {@link org.apache.directory.fortress.core.ldap.suffix.Suffix} used to drive {@link org.apache.directory.fortress.core.ldap.suffix.SuffixP#delete(org.apache.directory.fortress.core.ldap.suffix.Suffix)}.
+ * 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, 'Delsuffix', is used for the xml tag in the load script.</p>
+ * <pre>
+ * {@code
+ * <delsuffix>
+ * ...
+ * </delsuffix>
+ * }
+ * </pre>
+ * <font size="3" color="red">
+ * This class is destructive as it will remove all nodes below the suffix using recursive delete function.<BR>
+ * Extreme care should be taken during execution to ensure target dn is correct and permanent removal of data is intended. There is no
+ * 'undo' for this operation.
+ * </font>
+ * <p/>
+ *
+ * @author Shawn McKinney
+ */
+public class Delsuffix
+{
+ final private List<Suffix> suffixes = new ArrayList<>();
+
+ /**
+ * All Ant data entities must have a default constructor.
+ */
+ public Delsuffix()
+ {
+ }
+
+ /**
+ * <p>This method name, 'addSuffix', is used for derived xml tag 'suffix' in the load script.</p>
+ * <pre>
+ * {@code
+ * <target name="all">
+ * <FortressAdmin>
+ * <delsuffix>
+ * ...
+ * </delsuffix>
+ * </FortressAdmin>
+ * </target>
+ * }
+ * </pre>
+ * <p/>
+ * <font size="2" color="red">
+ * This method is destructive and will remove all nodes below.<BR>
+ * Extreme care should be taken during execution to ensure target dn is correct and permanent removal of data is intended. There is no
+ * 'undo' for this operation.
+ * </font>
+ *
+ * @param suffix contains reference to data element targeted for removal..
+ */
+ public void addSuffix( Suffix suffix)
+ {
+ this.suffixes.add(suffix);
+ }
+
+ /**
+ * Used by {@link FortressAntTask#deleteSuffixes()} to retrieve list of Suffixes as defined in input xml file.
+ *
+ * @return collection containing {@link org.apache.directory.fortress.core.ldap.suffix.Suffix}s targeted for removal.
+ */
+ public List<Suffix> getSuffixes()
+ {
+ return this.suffixes;
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/687ee1ad/src/main/java/org/apache/directory/fortress/core/ant/Deluser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/Deluser.java b/src/main/java/org/apache/directory/fortress/core/ant/Deluser.java
new file mode 100755
index 0000000..ee8a721
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/ant/Deluser.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.fortress.core.ant;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * The class is used by {@link FortressAntTask} to load {@link UserAnt}s used to drive {@link org.apache.directory.fortress.core.AdminMgr#disableUser(org.apache.directory.fortress.core.rbac.User)}.
+ * 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, 'Deluser', is used for the xml tag in the load script.</p>
+ * <pre>
+ * {@code
+ * <target name="all">
+ * <FortressAdmin>
+ * <deluser>
+ * ...
+ * </deluser>
+ * </FortressAdmin>
+ * </target>
+ * }
+ * </pre>
+ *
+ * @author Shawn McKinney
+ */
+public class Deluser
+{
+ final private List<UserAnt> users = new ArrayList<>();
+
+ /**
+ * All Ant data entities must have a default constructor.
+ */
+ public Deluser()
+ {
+ }
+
+ /**
+ * <p>This method name, 'addUser', is used for derived xml tag 'user' in the load script.</p>
+ * <pre>
+ * {@code
+ * <deluser>
+ * <user userId="demoUser1"/>
+ * <user userId="demoUser3"/>
+ * <user userId="demoUser4"/>
+ * <user userId="demoUser5"/>
+ * <user userId="demoUser7"/>
+ * <user userId="demoUser9"/>
+ * </deluser>
+ * }
+ * </pre>
+ *
+ * @param user contains reference to data element targeted for removal.
+ */
+ public void addUser(UserAnt user)
+ {
+ this.users.add(user);
+ }
+
+ /**
+ * Used by {@link FortressAntTask#deleteUsers()} to retrieve list of Users as defined in input xml file.
+ *
+ * @return collection containing {@link UserAnt}s targeted for removal.
+ */
+ public List<UserAnt> getUsers()
+ {
+ return this.users;
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/687ee1ad/src/main/java/org/apache/directory/fortress/core/ant/Deluseradminrole.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/Deluseradminrole.java b/src/main/java/org/apache/directory/fortress/core/ant/Deluseradminrole.java
new file mode 100755
index 0000000..d0191bc
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/ant/Deluseradminrole.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.fortress.core.ant;
+
+import org.apache.directory.fortress.core.rbac.UserAdminRole;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The class is used by {@link org.apache.directory.fortress.core.ant.FortressAntTask} to load {@link org.apache.directory.fortress.core.rbac.UserAdminRole}s used to drive {@link org.apache.directory.fortress.core.DelAdminMgr#deassignUser(org.apache.directory.fortress.core.rbac.UserAdminRole)}.
+ * 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, 'Deluseradminrole', is used for the xml tag in the load script.</p>
+ * <pre>
+ * {@code
+ * <target name="all">
+ * <FortressAdmin>
+ * <deluseradminrole>
+ * ...
+ * </deluseradminrole>
+ * </FortressAdmin>
+ * </target>
+ * }
+ * </pre>
+ *
+ * @author Shawn McKinney
+ */
+public class Deluseradminrole
+{
+ final private List<UserAdminRole> userroles = new ArrayList<>();
+
+ /**
+ * All Ant data entities must have a default constructor.
+ */
+ public Deluseradminrole()
+ {
+ }
+
+ /**
+ * <p>This method name, 'addUserRole', is used for derived xml tag 'userrole' in the load script.</p>
+ * <pre>
+ * {@code
+ * <deluseradminrole>
+ * <userrole userId="demouser4" name="DemoAdminUsers"/>
+ * </deluseradminrole>
+ * }
+ * </pre>
+ *
+ * @param userRole contains reference to data element targeted for removal.
+ */
+ public void addUserRole(UserAdminRole userRole)
+ {
+ this.userroles.add(userRole);
+ }
+
+ /**
+ * Used by {@link org.apache.directory.fortress.core.ant.FortressAntTask#delUserAdminRoles()} to retrieve list of UserAdminRoles as defined in input xml file.
+ *
+ * @return collection containing {@link org.apache.directory.fortress.core.rbac.UserAdminRole}s targeted for removal.
+ */
+ public List<UserAdminRole> getUserRoles()
+ {
+ return this.userroles;
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/687ee1ad/src/main/java/org/apache/directory/fortress/core/ant/Deluserorgunitinheritance.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/Deluserorgunitinheritance.java b/src/main/java/org/apache/directory/fortress/core/ant/Deluserorgunitinheritance.java
new file mode 100755
index 0000000..176738c
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/ant/Deluserorgunitinheritance.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.fortress.core.ant;
+
+import org.apache.directory.fortress.core.rbac.Relationship;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * The class is used by {@link org.apache.directory.fortress.core.ant.FortressAntTask} to load {@link Relationship}s used to drive {@link org.apache.directory.fortress.core.DelAdminMgr#deleteInheritance(org.apache.directory.fortress.core.rbac.OrgUnit, org.apache.directory.fortress.core.rbac.OrgUnit)}.
+ * 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, 'Deluserorgunitinheritance', is used for the xml tag in the load script.</p>
+ * <pre>
+ * {@code
+ * <target name="all">
+ * <FortressAdmin>
+ * <deluserorgunitinheritance>
+ * ...
+ * </deluserorgunitinheritance>
+ * </FortressAdmin>
+ * </target>
+ * }
+ * </pre>
+ *
+ *
+ * @author Shawn McKinney
+ */
+public class Deluserorgunitinheritance
+{
+ final private List<Relationship> relationships = new ArrayList<>();
+
+ /**
+ * All Ant data entities must have a default constructor.
+ */
+ public Deluserorgunitinheritance()
+ {
+ }
+
+ /**
+ * <p>This method name, 'addRelationship', is used for derived xml tag 'relationship' in the load script.</p>
+ * <pre>
+ * {@code
+ * <deluserorgunitinheritance>
+ * <relationship child="ou2" parent="ou1"/>
+ * <relationship child="ou3" parent="ou1"/>
+ * <relationship child="ou4" parent="ou1"/>
+ * </deluserorgunitinheritance>
+ * }
+ * </pre>
+ *
+ * @param relationship contains reference to data element targeted for removal.
+ */
+ public void addRelationship(Relationship relationship)
+ {
+ this.relationships.add(relationship);
+ }
+
+ /**
+ * Used by {@link org.apache.directory.fortress.core.ant.FortressAntTask#deleteUserOrgunitInheritances()} to retrieve list of User OrgUnit relationships as defined in input xml file.
+ *
+ * @return collection containing {@link Relationship}s targeted for removal.
+ */
+ public List<Relationship> getRelationships()
+ {
+ return this.relationships;
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/687ee1ad/src/main/java/org/apache/directory/fortress/core/ant/Deluserrole.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/Deluserrole.java b/src/main/java/org/apache/directory/fortress/core/ant/Deluserrole.java
new file mode 100755
index 0000000..15522ca
--- /dev/null
+++ b/src/main/java/org/apache/directory/fortress/core/ant/Deluserrole.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.fortress.core.ant;
+
+import org.apache.directory.fortress.core.rbac.UserRole;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The class is used by {@link FortressAntTask} to load {@link org.apache.directory.fortress.core.rbac.UserRole}s used to drive {@link org.apache.directory.fortress.core.AdminMgr#deassignUser(org.apache.directory.fortress.core.rbac.UserRole)}.
+ * 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, 'Deluserrole', is used for the xml tag in the load script.</p>
+ * <pre>
+ * {@code
+ * <target name="all">
+ * <FortressAdmin>
+ * <deluserrole>
+ * ...
+ * </deluserrole>
+ * </FortressAdmin>
+ * </target>
+ * }
+ * </pre>
+ *
+ * @author Shawn McKinney
+ */
+public class Deluserrole
+{
+ final private List<UserRole> userroles = new ArrayList<>();
+
+ /**
+ * All Ant data entities must have a default constructor.
+ */
+ public Deluserrole()
+ {
+ }
+
+ /**
+ * <p>This method name, 'addUserRole', is used for derived xml tag 'userrole' in the load script.</p>
+ * <pre>
+ * {@code
+ * <deluserrole>
+ * <userrole userId="demoUser1" name="role1"/>
+ * <userrole userId="demoUser5" name="role1"/>
+ * <userrole userId="demoUser7" name="role1"/>
+ * <userrole userId="demoUser9" name="role1"/>
+ * </deluserrole>
+ * }
+ * </pre>
+ *
+ * @param userRole contains reference to data element targeted for removal..
+ */
+ public void addUserRole(UserRole userRole)
+ {
+ this.userroles.add(userRole);
+ }
+
+ /**
+ * Used by {@link FortressAntTask#delUserRoles()} to retrieve list of UserRoles as defined in input xml file.
+ *
+ * @return collection containing {@link org.apache.directory.fortress.core.rbac.UserRole}s targeted for removal.
+ */
+ public List<UserRole> getUserRoles()
+ {
+ return this.userroles;
+ }
+}
\ No newline at end of file