directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-core git commit: + fortress console enable/disable role constraints
Date Mon, 22 Oct 2018 15:26:42 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 510d6f257 -> ab30e6371


+ fortress console enable/disable role constraints


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/ab30e637
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/ab30e637
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/ab30e637

Branch: refs/heads/master
Commit: ab30e63715082960adef682d6436af18616382a0
Parents: 510d6f2
Author: Shawn McKinney <smckinney@apache.org>
Authored: Fri Oct 19 05:53:49 2018 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Fri Oct 19 05:53:49 2018 -0500

----------------------------------------------------------------------
 .../fortress/core/AdminMgrConsole.java          | 48 ++++++++++++++++++++
 .../fortress/core/ProcessMenuCommand.java       | 20 ++++++--
 2 files changed, 63 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ab30e637/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java b/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
index 34fb579..77b3d69 100755
--- a/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
+++ b/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
@@ -194,6 +194,54 @@ class AdminMgrConsole
     }
 
 
+    void enableRoleConstraint()
+    {
+        Role role = new Role();
+        RoleConstraint roleConstraint = new RoleConstraint();
+        try
+        {
+            ReaderUtil.clearScreen();
+            System.out.println("Enter role name:");
+            role.setName( ReaderUtil.readLn() );
+            System.out.println("Enter constraint name:");
+            roleConstraint.setKey( ReaderUtil.readLn() );
+            am.enableRoleConstraint( role, roleConstraint );
+            System.out.println( "constraint name [" + roleConstraint.getKey() + "]" );
+            System.out.println("has been added");
+            System.out.println("ENTER to continue");
+        }
+        catch (SecurityException e)
+        {
+            LOG.error("enableRoleConstraint caught SecurityException rc=" + e.getErrorId()
+ ", msg=" + e.getMessage(), e);
+        }
+        ReaderUtil.readChar();
+    }
+
+
+    void disableRoleConstraint()
+    {
+        Role role = new Role();
+        RoleConstraint roleConstraint = new RoleConstraint();
+        try
+        {
+            ReaderUtil.clearScreen();
+            System.out.println("Enter role name:");
+            role.setName( ReaderUtil.readLn() );
+            System.out.println("Enter constraint name:");
+            roleConstraint.setKey( ReaderUtil.readLn() );
+            am.disableRoleConstraint( role, roleConstraint );
+            System.out.println( "constraint name [" + roleConstraint.getKey() + "]" );
+            System.out.println("has been removed");
+            System.out.println("ENTER to continue");
+        }
+        catch (SecurityException e)
+        {
+            LOG.error("disableRoleConstraint caught SecurityException rc=" + e.getErrorId()
+ ", msg=" + e.getMessage(), e);
+        }
+        ReaderUtil.readChar();
+    }
+
+
     void deleteRole()
     {
         Role re = new Role();

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ab30e637/src/test/java/org/apache/directory/fortress/core/ProcessMenuCommand.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/ProcessMenuCommand.java b/src/test/java/org/apache/directory/fortress/core/ProcessMenuCommand.java
index 9f5c021..a94f8a6 100755
--- a/src/test/java/org/apache/directory/fortress/core/ProcessMenuCommand.java
+++ b/src/test/java/org/apache/directory/fortress/core/ProcessMenuCommand.java
@@ -431,9 +431,11 @@ class ProcessMenuCommand
         System.out.println( "O.  Add Role Descendant" );
         System.out.println( "P.  Add SSD Data Set" );
         System.out.println( "R.  Add DSD Data Set" );
-        System.out.println( "S.  Test Annotation" );
-        System.out.println( "T.  Add Example" );
-        System.out.println( "U.  Test Config" );
+        System.out.println( "S.  Enable Role Constraint" );
+        System.out.println( "T.  Disable Role Constraint" );
+        System.out.println( "U.  Test Annotation" );
+        System.out.println( "V.  Add Example" );
+        System.out.println( "W.  Test Config" );
         System.out.println( "Enter q or Q to return to previous menu" );
     }
 
@@ -558,14 +560,22 @@ class ProcessMenuCommand
                         break;
                     case 's':
                     case 'S':
-                        adminConsole.addAnnotation();
+                        adminConsole.enableRoleConstraint();
                         break;
                     case 't':
                     case 'T':
-                        adminConsole.addExample();
+                        adminConsole.disableRoleConstraint();
                         break;
                     case 'u':
                     case 'U':
+                        adminConsole.addAnnotation();
+                        break;
+                    case 'v':
+                    case 'V':
+                        adminConsole.addExample();
+                        break;
+                    case 'w':
+                    case 'W':
                         adminConsole.testConfig();
                         break;
                     case 'q':


Mime
View raw message