You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2014/10/29 17:10:25 UTC

[1/6] git commit: Added a toString() method

Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 5cd9cbd17 -> 08ea401b3


Added a toString() method

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/0de1fcea
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/0de1fcea
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/0de1fcea

Branch: refs/heads/master
Commit: 0de1fcea03077f5ec6768373c15da7b8b531107b
Parents: 5cd9cbd
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Wed Oct 29 06:39:38 2014 +0100
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Wed Oct 29 06:39:38 2014 +0100

----------------------------------------------------------------------
 .../directory/fortress/core/rbac/AdminRole.java | 85 ++++++++++++++++++++
 1 file changed, 85 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0de1fcea/src/main/java/org/apache/directory/fortress/core/rbac/AdminRole.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/AdminRole.java b/src/main/java/org/apache/directory/fortress/core/rbac/AdminRole.java
index 07a35ee..a0154ef 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/AdminRole.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/AdminRole.java
@@ -473,14 +473,99 @@ public class AdminRole extends Role implements Administrator
     public boolean equals( Object thatObj )
     {
         if ( this == thatObj )
+        {
             return true;
+        }
+        
         if ( this.getName() == null )
+        {
             return false;
+        }
+        
         if ( !( thatObj instanceof AdminRole ) )
+        {
             return false;
+        }
+        
         Role thatRole = ( Role ) thatObj;
+        
         if ( thatRole.getName() == null )
+        {
             return false;
+        }
+        
         return thatRole.getName().equalsIgnoreCase( this.getName() );
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "AdminRole object: \n" );
+
+        if ( beginRange != null )
+        {
+            sb.append( "    beginRange :" ).append( beginRange ).append( '\n' );
+        }
+
+        if ( endRange != null )
+        {
+            sb.append( "    endRange :" ).append( endRange ).append( '\n' );
+        }
+
+        sb.append( "    beginInclusive :" ).append( beginInclusive ).append( '\n' );
+        sb.append( "    endInclusive :" ).append( endInclusive ).append( '\n' );
+
+        if ( osPs != null )
+        {
+            sb.append( "    osPs : " );
+
+            boolean isFirst = true;
+
+            for ( String osP : osPs )
+            {
+                if ( isFirst )
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    sb.append( ", " );
+                }
+
+                sb.append( osP );
+            }
+
+            sb.append( '\n' );
+        }
+
+        if ( osUs != null )
+        {
+            sb.append( "    osUs : " );
+
+            boolean isFirst = true;
+
+            for ( String osU : osUs )
+            {
+                if ( isFirst )
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    sb.append( ", " );
+                }
+
+                sb.append( osU );
+            }
+
+            sb.append( '\n' );
+        }
+
+        return sb.toString();
+    }
 }


[6/6] git commit: o Added a toString() metjod

Posted by el...@apache.org.
o Added a toString() metjod


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/08ea401b
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/08ea401b
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/08ea401b

Branch: refs/heads/master
Commit: 08ea401b3ca8549c5a2442f484c51fbb4a4540c7
Parents: 2ae4129
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Wed Oct 29 15:50:19 2014 +0100
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Wed Oct 29 17:09:42 2014 +0100

----------------------------------------------------------------------
 .../fortress/core/ldap/suffix/Suffix.java       |  45 +++++-
 .../directory/fortress/core/rbac/PermObj.java   |   8 +-
 .../directory/fortress/core/rbac/PwPolicy.java  | 125 +++++++++++++---
 .../fortress/core/rbac/Relationship.java        |  57 ++++++--
 .../directory/fortress/core/rbac/RolePerm.java  |  26 +++-
 .../fortress/core/rbac/RoleRelationship.java    |  25 +++-
 .../directory/fortress/core/rbac/Session.java   | 146 +++++++++++++++----
 .../directory/fortress/core/rbac/UserRole.java  |  27 ++--
 .../directory/fortress/core/rbac/Warning.java   |  46 +++++-
 9 files changed, 410 insertions(+), 95 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/08ea401b/src/main/java/org/apache/directory/fortress/core/ldap/suffix/Suffix.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/suffix/Suffix.java b/src/main/java/org/apache/directory/fortress/core/ldap/suffix/Suffix.java
index 08876da..025ec86 100755
--- a/src/main/java/org/apache/directory/fortress/core/ldap/suffix/Suffix.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/suffix/Suffix.java
@@ -20,11 +20,21 @@
 package org.apache.directory.fortress.core.ldap.suffix;
 
 
+/**
+ * A class storing the suffix information
+ */
 public class Suffix
 {
+    /** Top level domain component */
     private String dc;
+    
+    /** top level domain component specifier */
     private String dc2;
+    
+    /** Second level domain component name */
     private String name;
+    
+    /** The suffix description */
     private String description;
 
 
@@ -35,12 +45,13 @@ public class Suffix
      * @param name        second level domain component name maps to attribute in 'dcObject' object class.
      * @param description maps to 'o' attribute in 'dcObject' object class.
      */
-    public Suffix(String dc, String name, String description)
+    public Suffix( String dc, String name, String description )
     {
         this.dc = dc;
         this.name = name;
         this.description = description;
     }
+    
 
     /**
      * Default constructor used by {@link org.apache.directory.fortress.core.ant.FortressAntTask}
@@ -48,6 +59,7 @@ public class Suffix
     public Suffix()
     {
     }
+    
 
     /**
      * Get the second level qualifier on the domain component.  This attribute is required.
@@ -58,16 +70,18 @@ public class Suffix
     {
         return name;
     }
+    
 
     /**
      * Set the second level qualifier on the domain component.  This attribute is required.
      *
      * @param name maps to 'dcObject' object class.
      */
-    public void setName(String name)
+    public void setName( String name )
     {
         this.name = name;
     }
+    
 
     /**
      * Get the description for the domain component.  This value is not required or constrained
@@ -79,6 +93,7 @@ public class Suffix
     {
         return description;
     }
+    
 
     /**
      * Set the description for the domain component.  This value is not required or constrained
@@ -86,10 +101,11 @@ public class Suffix
      *
      * @param description maps to 'o' attribute on 'dcObject'.
      */
-    public void setDescription(String description)
+    public void setDescription( String description )
     {
         this.description = description;
     }
+    
 
     /**
      * Get top level domain component specifier, i.e. dc=com.  This attribute is required.
@@ -100,16 +116,18 @@ public class Suffix
     {
         return dc;
     }
+    
 
     /**
      * Set top level domain component specifier, i.e. dc=com.  This attribute is required.
      *
      * @param dc maps to 'dc' in 'dcObject' object class.
      */
-    public void setDc(String dc)
+    public void setDc( String dc )
     {
         this.dc = dc;
     }
+    
 
     /**
      * Get top level domain component specifier, i.e. dc=com for a three part dc structure.  This attribute is optional.
@@ -120,6 +138,7 @@ public class Suffix
     {
         return dc2;
     }
+    
 
     /**
      * Get top level domain component specifier, i.e. dc=com for three part dc structure.  This attribute is optional.
@@ -130,5 +149,23 @@ public class Suffix
     {
         this.dc2 = dc2;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "Suffix object: \n" );
+
+        sb.append( "    dc :" ).append( dc ).append( '\n' );
+        sb.append( "    dc2 :" ).append( dc2 ).append( '\n' );
+        sb.append( "    name :" ).append( name ).append( '\n' );
+        sb.append( "    description :" ).append( description ).append( '\n' );
+
+        return sb.toString();
+    }
 }
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/08ea401b/src/main/java/org/apache/directory/fortress/core/rbac/PermObj.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/PermObj.java b/src/main/java/org/apache/directory/fortress/core/rbac/PermObj.java
index af60b80..b26565f 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/PermObj.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/PermObj.java
@@ -20,6 +20,7 @@
 package org.apache.directory.fortress.core.rbac;
 
 
+import java.io.Serializable;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Properties;
@@ -135,9 +136,10 @@ import javax.xml.bind.annotation.XmlType;
         "props",
         "admin"
 })
-public class PermObj extends FortEntity
-    implements java.io.Serializable
+public class PermObj extends FortEntity implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+    
     private boolean admin;
     private String internalId;
     private String objName;
@@ -373,7 +375,7 @@ public class PermObj extends FortEntity
     {
         if ( props != null )
         {
-            for ( Enumeration e = props.propertyNames(); e.hasMoreElements(); )
+            for ( Enumeration<?> e = props.propertyNames(); e.hasMoreElements(); )
             {
                 // This LDAP attr is stored as a name-value pair separated by a ':'.
                 String key = ( String ) e.nextElement();

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/08ea401b/src/main/java/org/apache/directory/fortress/core/rbac/PwPolicy.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/PwPolicy.java b/src/main/java/org/apache/directory/fortress/core/rbac/PwPolicy.java
index 759661d..055dc29 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/PwPolicy.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/PwPolicy.java
@@ -20,6 +20,8 @@
 package org.apache.directory.fortress.core.rbac;
 
 
+import java.io.Serializable;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -129,9 +131,10 @@ import javax.xml.bind.annotation.XmlType;
     "allowUserChange",
     "safeModify"
 })
-public class PwPolicy extends FortEntity
-    implements java.io.Serializable
+public class PwPolicy extends FortEntity implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     /**
      * Maps to name attribute of pwdPolicy object class.
      */
@@ -330,6 +333,7 @@ public class PwPolicy extends FortEntity
     public PwPolicy()
     {
     }
+    
 
     /**
      * Create instance given a policy name.
@@ -347,8 +351,9 @@ public class PwPolicy extends FortEntity
      */
     public String getName()
     {
-        return this.name;
+        return name;
     }
+    
 
     /**
      * Set the required attribute policy name on this entity.
@@ -358,6 +363,7 @@ public class PwPolicy extends FortEntity
     {
         this.name = name;
     }
+    
 
     /**
      * This optional attribute holds the number of seconds that must elapse between
@@ -368,8 +374,9 @@ public class PwPolicy extends FortEntity
      */
     public Integer getMinAge()
     {
-        return this.minAge;
+        return minAge;
     }
+    
 
     /**
      * This optional attribute holds the number of seconds that must elapse between
@@ -382,6 +389,7 @@ public class PwPolicy extends FortEntity
     {
         this.minAge = minAge;
     }
+    
 
     /**
      * This optional attribute holds the number of seconds after which a modified
@@ -394,8 +402,9 @@ public class PwPolicy extends FortEntity
      */
     public Long getMaxAge()
     {
-        return this.maxAge;
+        return maxAge;
     }
+    
 
     /**
      * This optional attribute holds the number of seconds after which a modified
@@ -410,6 +419,7 @@ public class PwPolicy extends FortEntity
     {
         this.maxAge = maxAge;
     }
+    
 
     /**
      * This optional attribute specifies the maximum number of used passwords stored
@@ -422,8 +432,9 @@ public class PwPolicy extends FortEntity
      */
     public Short getInHistory()
     {
-        return this.inHistory;
+        return inHistory;
     }
+    
 
     /**
      * This optional attribute specifies the maximum number of used passwords stored
@@ -438,6 +449,7 @@ public class PwPolicy extends FortEntity
     {
         this.inHistory = inHistory;
     }
+    
 
     /**
      * This optional attribute is not currently supported by Fortress.
@@ -454,8 +466,9 @@ public class PwPolicy extends FortEntity
      */
     public Short getCheckQuality()
     {
-        return this.checkQuality;
+        return checkQuality;
     }
+    
 
     /**
      * This optional attribute is not currently supported by Fortress.
@@ -474,6 +487,7 @@ public class PwPolicy extends FortEntity
     {
         this.checkQuality = checkQuality;
     }
+    
 
     /**
      * When quality checking is enabled, this optional attribute holds the minimum
@@ -488,8 +502,9 @@ public class PwPolicy extends FortEntity
      */
     public Short getMinLength()
     {
-        return this.minLength;
+        return minLength;
     }
+    
 
     /**
      * When quality checking is enabled, this optional attribute holds the minimum
@@ -506,6 +521,7 @@ public class PwPolicy extends FortEntity
     {
         this.minLength = minLength;
     }
+    
 
     /**
      * This optional attribute specifies the maximum number of seconds before a
@@ -519,8 +535,9 @@ public class PwPolicy extends FortEntity
      */
     public Long getExpireWarning()
     {
-        return this.expireWarning;
+        return expireWarning;
     }
+    
 
     /**
      * This optional attribute specifies the maximum number of seconds before a
@@ -536,6 +553,7 @@ public class PwPolicy extends FortEntity
     {
         this.expireWarning = expireWarning;
     }
+    
 
     /**
      * This optional attribute specifies the number of times an expired password can
@@ -546,8 +564,9 @@ public class PwPolicy extends FortEntity
      */
     public Short getGraceLoginLimit()
     {
-        return this.graceLoginLimit;
+        return graceLoginLimit;
     }
+    
 
     /**
      * This optional attribute specifies the number of times an expired password can
@@ -560,6 +579,7 @@ public class PwPolicy extends FortEntity
     {
         this.graceLoginLimit = graceLoginLimit;
     }
+    
 
     /**
      * This optional attribute indicates, when its value is "TRUE", that the password
@@ -574,8 +594,9 @@ public class PwPolicy extends FortEntity
      */
     public Boolean getLockout()
     {
-        return this.lockout;
+        return lockout;
     }
+    
 
     /**
      * This optional attribute indicates, when its value is "TRUE", that the password
@@ -592,6 +613,7 @@ public class PwPolicy extends FortEntity
     {
         this.lockout = lockout;
     }
+    
 
     /**
      * This optional attribute holds the number of seconds that the password cannot
@@ -604,8 +626,9 @@ public class PwPolicy extends FortEntity
      */
     public Integer getLockoutDuration()
     {
-        return this.lockoutDuration;
+        return lockoutDuration;
     }
+    
 
     /**
      * This optional attribute holds the number of seconds that the password cannot
@@ -620,6 +643,7 @@ public class PwPolicy extends FortEntity
     {
         this.lockoutDuration = lockoutDuration;
     }
+    
 
     /**
      * This optional attribute specifies the number of consecutive failed bind
@@ -631,8 +655,9 @@ public class PwPolicy extends FortEntity
      */
     public Short getMaxFailure()
     {
-        return this.maxFailure;
+        return maxFailure;
     }
+    
 
     /**
      * This optional attribute specifies the number of consecutive failed bind
@@ -646,6 +671,7 @@ public class PwPolicy extends FortEntity
     {
         this.maxFailure = maxFailure;
     }
+    
 
     /**
      * This optional attribute holds the number of seconds after which the password
@@ -658,8 +684,9 @@ public class PwPolicy extends FortEntity
      */
     public Short getFailureCountInterval()
     {
-        return this.failureCountInterval;
+        return failureCountInterval;
     }
+    
 
     /**
      * This optional attribute holds the number of seconds after which the password
@@ -674,6 +701,7 @@ public class PwPolicy extends FortEntity
     {
         this.failureCountInterval = failureCountInterval;
     }
+    
 
     /**
      * This optional attribute specifies with a value of "TRUE" that users must
@@ -689,8 +717,9 @@ public class PwPolicy extends FortEntity
      */
     public Boolean getMustChange()
     {
-        return this.mustChange;
+        return mustChange;
     }
+    
 
     /**
      * This optional attribute specifies with a value of "TRUE" that users must
@@ -708,6 +737,7 @@ public class PwPolicy extends FortEntity
     {
         this.mustChange = mustChange;
     }
+    
 
     /**
      * This optional attribute indicates whether users can change their own
@@ -720,8 +750,9 @@ public class PwPolicy extends FortEntity
      */
     public Boolean getAllowUserChange()
     {
-        return this.allowUserChange;
+        return allowUserChange;
     }
+    
 
     /**
      * This optional attribute indicates whether users can change their own
@@ -736,6 +767,7 @@ public class PwPolicy extends FortEntity
     {
         this.allowUserChange = allowUserChange;
     }
+    
 
     /**
      * This optional attribute specifies whether or not the existing password must be
@@ -746,8 +778,9 @@ public class PwPolicy extends FortEntity
      */
     public Boolean getSafeModify()
     {
-        return this.safeModify;
+        return safeModify;
     }
+    
 
     /**
      * This optional attribute specifies whether or not the existing password must be
@@ -760,6 +793,7 @@ public class PwPolicy extends FortEntity
     {
         this.safeModify = safeModify;
     }
+    
 
     /**
      * Matches the name from two PwPolicy entities.
@@ -769,11 +803,58 @@ public class PwPolicy extends FortEntity
      */
     public boolean equals(Object thatObj)
     {
-        if (this == thatObj) return true;
-        if (this.getName() == null) return false;
-        if (!(thatObj instanceof PwPolicy)) return false;
+        if ( this == thatObj )
+        {
+            return true;
+        }
+        
+        if ( this.getName() == null )
+        {
+            return false;
+        }
+        
+        if ( !( thatObj instanceof PwPolicy ) )
+        {
+            return false;
+        }
+        
         PwPolicy thatPolicy = (PwPolicy) thatObj;
-        if (thatPolicy.getName() == null) return false;
-        return thatPolicy.getName().equalsIgnoreCase(this.getName());
+        
+        if ( thatPolicy.getName() == null )
+        {
+            return false;
+        }
+        
+        return thatPolicy.getName().equalsIgnoreCase( this.getName() );
+    }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "PwPolicy object: \n" );
+
+        sb.append( "    attribute :" ).append( attribute ).append( '\n' );
+        sb.append( "    maxAge :" ).append( maxAge ).append( '\n' );
+        sb.append( "    minAge :" ).append( minAge ).append( '\n' );
+        sb.append( "    allowUserChange :" ).append( allowUserChange ).append( '\n' );
+        sb.append( "    checkQuality :" ).append( checkQuality ).append( '\n' );
+        sb.append( "    expireWarning :" ).append( expireWarning ).append( '\n' );
+        sb.append( "    failureCountInterval :" ).append( failureCountInterval ).append( '\n' );
+        sb.append( "    graceLoginLimit :" ).append( graceLoginLimit ).append( '\n' );
+        sb.append( "    inHistory :" ).append( inHistory ).append( '\n' );
+        sb.append( "    lockout :" ).append( lockout ).append( '\n' );
+        sb.append( "    lockoutDuration :" ).append( lockoutDuration ).append( '\n' );
+        sb.append( "    maxFailure :" ).append( maxFailure ).append( '\n' );
+        sb.append( "    minLength :" ).append( minLength ).append( '\n' );
+        sb.append( "    mustChange :" ).append( mustChange ).append( '\n' );
+        sb.append( "    name :" ).append( name ).append( '\n' );
+        sb.append( "    safeModify :" ).append( safeModify ).append( '\n' );
+
+        return sb.toString();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/08ea401b/src/main/java/org/apache/directory/fortress/core/rbac/Relationship.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/Relationship.java b/src/main/java/org/apache/directory/fortress/core/rbac/Relationship.java
index 4849458..cb6cdc7 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/Relationship.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/Relationship.java
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.fortress.core.rbac;
 
+import java.io.Serializable;
 import java.lang.String;
 
 /**
@@ -28,10 +29,14 @@ import java.lang.String;
  *
  * @author Shawn McKinney
  */
-public class Relationship
-    implements java.io.Serializable
+public class Relationship implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+    
+    /** The child */
     private String child;
+    
+    /** The parent */
     private String parent;
 
     /**
@@ -41,17 +46,20 @@ public class Relationship
     public Relationship()
     {
     }
+    
+    
     /**
      * Construct a new relationship given a child and parent name.
      *
      * @param child  contains the name of child.
      * @param parent contains the name of parent.
      */
-    public Relationship(String child, String parent)
+    public Relationship( String child, String parent )
     {
         this.child = child;
         this.parent = parent;
     }
+    
 
     /**
      * Return the child name.
@@ -62,16 +70,18 @@ public class Relationship
     {
         return child;
     }
+    
 
     /**
      * Set the child name.
      *
      * @param child contains the name of child.
      */
-    public void setChild(String child)
+    public void setChild( String child )
     {
         this.child = child;
     }
+    
 
     /**
      * Return the parent name.
@@ -82,16 +92,18 @@ public class Relationship
     {
         return parent;
     }
+    
 
     /**
      * Set the parent name.
      *
      * @param parent contains the name of parent.
      */
-    public void setParent(String parent)
+    public void setParent( String parent )
     {
         this.parent = parent;
     }
+    
 
     /**
      * Compute the hashcode on the parent and child values.  This is used for list processing.
@@ -102,6 +114,7 @@ public class Relationship
     {
         return child.hashCode() + parent.hashCode();
     }
+    
 
     /**
      * Matches the parent and child values from two Relationship entities.
@@ -109,25 +122,47 @@ public class Relationship
      * @param thatObj contains a Relationship entity.
      * @return boolean indicating both objects contain matching parent and child names.
      */
-    public boolean equals(Object thatObj)
+    public boolean equals (Object thatObj )
     {
-        if (this == thatObj)
+        if ( this == thatObj )
         {
             return true;
         }
-        if (this.getChild() == null || this.getParent() == null)
+        
+        if ( ( this.getChild() == null ) || ( this.getParent() == null ) )
         {
             return false;
         }
-        if (!(thatObj instanceof Relationship))
+        
+        if ( !( thatObj instanceof Relationship ) )
         {
             return false;
         }
+        
         Relationship thatKey = (Relationship) thatObj;
-        if (thatKey.getChild() == null || thatKey.getParent() == null)
+        
+        if ( ( thatKey.getChild() == null ) || ( thatKey.getParent() == null ) )
         {
             return false;
         }
-        return ((thatKey.getChild().equalsIgnoreCase(this.getChild()) && thatKey.getParent().equalsIgnoreCase(this.getParent())));
+        
+        return ( thatKey.getChild().equalsIgnoreCase( this.getChild() ) 
+                 && thatKey.getParent().equalsIgnoreCase( this.getParent() ) );
+    }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "Relationship object: \n" );
+
+        sb.append( "    parent :" ).append( parent ).append( '\n' );
+        sb.append( "    child :" ).append( child ).append( '\n' );
+
+        return sb.toString();
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/08ea401b/src/main/java/org/apache/directory/fortress/core/rbac/RolePerm.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/RolePerm.java b/src/main/java/org/apache/directory/fortress/core/rbac/RolePerm.java
index ecb7de3..28f8f15 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/RolePerm.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/RolePerm.java
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.fortress.core.rbac;
 
+import java.io.Serializable;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -35,9 +37,10 @@ import javax.xml.bind.annotation.XmlType;
     "role",
     "perm"
 })
-public class RolePerm extends FortEntity
-    implements java.io.Serializable
+public class RolePerm extends FortEntity implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+    
     private Role role;
     private Permission perm;
 
@@ -46,18 +49,37 @@ public class RolePerm extends FortEntity
         return role;
     }
 
+    
     public void setRole(Role role)
     {
         this.role = role;
     }
+    
 
     public Permission getPerm()
     {
         return perm;
     }
 
+    
     public void setPerm(Permission perm)
     {
         this.perm = perm;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "RolePerm object: \n" );
+
+        sb.append( "    role :" ).append( role ).append( '\n' );
+        sb.append( "    perm :" ).append( perm ).append( '\n' );
+
+        return sb.toString();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/08ea401b/src/main/java/org/apache/directory/fortress/core/rbac/RoleRelationship.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/RoleRelationship.java b/src/main/java/org/apache/directory/fortress/core/rbac/RoleRelationship.java
index 626beb2..d5b0b5e 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/RoleRelationship.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/RoleRelationship.java
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.fortress.core.rbac;
 
+import java.io.Serializable;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -35,9 +37,9 @@ import javax.xml.bind.annotation.XmlType;
     "child",
     "parent"
 })
-public class RoleRelationship extends FortEntity
-    implements java.io.Serializable
+public class RoleRelationship extends FortEntity implements Serializable
 {
+    private static final long serialVersionUID = 1L;
     private Role parent;
     private Role child;
 
@@ -46,18 +48,37 @@ public class RoleRelationship extends FortEntity
         return parent;
     }
 
+    
     public void setParent(Role parent)
     {
         this.parent = parent;
     }
 
+    
     public Role getChild()
     {
         return child;
     }
 
+    
     public void setChild(Role child)
     {
         this.child = child;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "RoleRelationship object: \n" );
+
+        sb.append( "    parent :" ).append( parent ).append( '\n' );
+        sb.append( "    child :" ).append( child ).append( '\n' );
+
+        return sb.toString();
+    }
 }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/08ea401b/src/main/java/org/apache/directory/fortress/core/rbac/Session.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/Session.java b/src/main/java/org/apache/directory/fortress/core/rbac/Session.java
index 3e95094..1bca586 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/Session.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/Session.java
@@ -24,6 +24,8 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
+
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
@@ -160,8 +162,9 @@ import java.util.UUID;
     "warnings"
 /*    "warningId"*/
 })
-public class Session  extends FortEntity implements PwMessage, java.io.Serializable
+public class Session  extends FortEntity implements PwMessage, Serializable
 {
+    private static final long serialVersionUID = 1L;
     private User user;
     private String sessionId;
     private long lastAccess;
@@ -184,6 +187,7 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         return isAuthenticated;
     }
+    
 
     private void init()
     {
@@ -191,13 +195,14 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
         UUID uuid = UUID.randomUUID();
         this.sessionId = uuid.toString();
     }
+    
 
     /**
      * Copy values from incoming Session object.
      *
      * @param inSession contains Session values.
      */
-    public void copy(Session inSession)
+    public void copy( Session inSession )
     {
         this.user = inSession.getUser();
         // don't copy session id:
@@ -212,6 +217,7 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
         this.message = inSession.getMsg();
         this.warnings = inSession.getWarnings();
     }
+    
 
     /**
      * Default constructor for Fortress Session.
@@ -220,30 +226,33 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         init();
         // this class will not check for null on user object.
-        this.user = new User();
+        user = new User();
     }
+    
 
     /**
      * Construct a new Session instance with given User entity.
      *
      * @param user contains the User attributes that are associated with the Session.
      */
-    public Session(User user)
+    public Session( User user )
     {
         init();
         this.user = user;
     }
+    
 
     /**
      * Construct a new Session instance with given User entity.
      *
      * @param user contains the User attributes that are associated with the Session.
      */
-    public Session(User user, String sessionId)
+    public Session (User user, String sessionId )
     {
         this.sessionId = sessionId;
         this.user = user;
     }
+    
 
     /**
      * Return the unique id that is associated with User.  This attribute is generated automatically
@@ -253,7 +262,7 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      */
     public String getSessionId()
     {
-        return this.sessionId;
+        return sessionId;
     }
 
 
@@ -310,6 +319,7 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         return this.user;
     }
+    
 
     /**
      * Return the userId that is associated with this Session object.
@@ -320,6 +330,7 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         return this.user.getUserId();
     }
+    
 
     /**
      * Return the internal userId that is associated with User.  This attribute is generated automatically
@@ -331,6 +342,7 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         return this.user.getInternalId();
     }
+    
 
     /**
      * Return the list of User's RBAC Roles that have been activated into User's session.  This list will not include
@@ -342,11 +354,14 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         List<UserRole> roles = null;
 
-        if (user != null)
+        if ( user != null )
+        {
             roles = user.getRoles();
+        }
 
         return roles;
     }
+    
 
     /**
      * Return a list of User's Admin Roles  that have been activated into User's session.  This list will not include
@@ -358,8 +373,10 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         List<UserAdminRole> roles = null;
 
-        if (user != null)
+        if ( user != null )
+        {
             roles = user.getAdminRoles();
+        }
 
         return roles;
     }
@@ -373,8 +390,9 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      */
     public long getLastAccess()
     {
-        return this.lastAccess;
+        return lastAccess;
     }
+    
 
     /**
      * Gets the message that is associated with the user's last authentication attempt.
@@ -383,8 +401,9 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      */
     public String getMsg()
     {
-        return this.message;
+        return message;
     }
+    
 
     /**
      * Gets the attribute that specifies the number of times an expired password can
@@ -394,8 +413,9 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      */
     public int getGraceLogins()
     {
-        return this.graceLogins;
+        return graceLogins;
     }
+    
 
     /**
      * This attribute specifies the maximum number of seconds before a
@@ -410,8 +430,9 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      */
     public int getExpirationSeconds()
     {
-        return this.expirationSeconds;
+        return expirationSeconds;
     }
+    
 
     /**
      * Get the integer timeout that contains max time (in seconds) that User's session may remain inactive.
@@ -421,8 +442,9 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      */
     private int getTimeout()
     {
-        return this.timeout;
+        return timeout;
     }
+    
 
     /**
      * Get the value that will be set to 'true' if user has successfully authenticated with Fortress for this Session.  This value is set by
@@ -432,8 +454,9 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      */
     public boolean setAuthenticated()
     {
-        return this.isAuthenticated;
+        return isAuthenticated;
     }
+    
 
     /**
      * Return the error id that is associated with the password policy checks.  a '0' indicates no errors.
@@ -457,9 +480,10 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      */
     public int getErrorId()
     {
-        return this.errorId;
+        return errorId;
     }
 
+    
     /**
      * Set a User entity into the Session.
      * Sample User data contained in Session object:
@@ -508,10 +532,11 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      * <p/>
      * @param user Contains userId, roles and other security attributes used for access control.
      */
-    public void setUser(User user)
+    public void setUser( User user )
     {
         this.user = user;
     }
+    
 
     /**
      * Set the internal userId that is associated with User.  This method is used by DAO class and
@@ -520,10 +545,11 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      *
      * @param internalUserId maps to 'ftId' in 'ftUserAttrs' object class.
      */
-    public void setInternalUserId(String internalUserId)
+    public void setInternalUserId( String internalUserId )
     {
-        this.user.setInternalId(internalUserId);
+        this.user.setInternalId( internalUserId );
     }
+    
 
     /**
      * Set the value to 'true' indicating that user has successfully authenticated with Fortress.  This value is set by
@@ -531,19 +557,20 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      *
      * @param authenticated indicates result of authentication.
      */
-    public void setAuthenticated(boolean authenticated)
+    public void setAuthenticated( boolean authenticated )
     {
         isAuthenticated = authenticated;
     }
+    
 
     /**
      * Set the userId that is associated with User.  UserId is required attribute and must be set on add, update, delete, createSession, authenticate, etc..
      *
      * @param userId maps to 'uid' attribute in 'inNetOrgPerson' object class.
      */
-    public void setUserId(String userId)
+    public void setUserId( String userId )
     {
-        this.user.setUserId(userId);
+        user.setUserId( userId );
     }
 
 
@@ -552,20 +579,22 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      *
      * @param roles List of type UserRole that contains at minimum UserId and Role name.
      */
-    public void setRoles(List<UserRole> roles)
+    public void setRoles( List<UserRole> roles )
     {
-        this.user.setRoles(roles);
+        user.setRoles( roles );
     }
+    
 
     /**
      * Add a single user-role object to the list of UserRoles for User.
      *
      * @param role UserRole contains at least userId and role name (activation) and additional constraints (assignment)
      */
-    public void setRole(UserRole role)
+    public void setRole( UserRole role )
     {
-        user.setRole(role);
+        user.setRole( role );
     }
+    
 
     /**
      * Set the integer timeout that contains max time (in seconds) that User's session may remain inactive.
@@ -577,6 +606,7 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         this.timeout = timeout;
     }
+    
 
     /**
      * Set the last access time in milliseconds. Note that while the unit of time of the return value is a millisecond,
@@ -585,18 +615,20 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      */
     public void setLastAccess()
     {
-        this.lastAccess = System.currentTimeMillis();
+        lastAccess = System.currentTimeMillis();
     }
+    
 
     /**
      * Set the message that is associated with the user's last authentication attempt.
      *
      * @param message Contains text explaining result of user's last authentication.
      */
-    public void setMsg(String message)
+    public void setMsg( String message )
     {
         this.message = message;
     }
+    
 
     /**
      * Set the error id that is associated with the password policy checks.  a '0' indicates no errors.
@@ -618,10 +650,11 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      *
      * @param error contains the error id that was generated on the user's last authentication.
      */
-    public void setErrorId(int error)
+    public void setErrorId( int error )
     {
         this.errorId = error;
     }
+    
 
     /**
      * This attribute specifies the number of times an expired password can
@@ -629,10 +662,11 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      *
      * @param grace The number of logins the user has left before password fails.
      */
-    public void setGraceLogins(int grace)
+    public void setGraceLogins( int grace )
     {
         this.graceLogins = grace;
     }
+    
 
     /**
      * This attribute specifies the maximum number of seconds before a
@@ -645,10 +679,11 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
      *
      * @param expire attribute is computed based on last time user has changed their password.
      */
-    public void setExpirationSeconds(int expire)
+    public void setExpirationSeconds( int expire )
     {
         this.expirationSeconds = expire;
     }
+    
 
     /**
      * Get the warnings attached to this Session.  Used for processing password policy scenarios, e.g.. password expiring message.
@@ -659,6 +694,7 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         return warnings;
     }
+    
 
     /**
      * Set the warnings on this Session.  Used for processing password policy scenarios, e.g.. password expiring message.
@@ -670,6 +706,7 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         this.warnings = warnings;
     }
+    
 
     /**
      * Add a warning to the collection into Fortress Session object.  Used for processing password policy scenarios, e.g.. password expiring message.
@@ -681,8 +718,55 @@ public class Session  extends FortEntity implements PwMessage, java.io.Serializa
     {
         if ( warnings == null )
         {
-            warnings = new ArrayList<>();
+            warnings = new ArrayList<Warning>();
         }
+        
         this.warnings.add( warning );
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "Session object: \n" );
+
+        sb.append( "    sessionId :" ).append( sessionId ).append( '\n' );
+        sb.append( "    user :" ).append( user ).append( '\n' );
+        sb.append( "    isAuthenticated :" ).append( isAuthenticated ).append( '\n' );
+        sb.append( "    lastAccess :" ).append( lastAccess ).append( '\n' );
+        sb.append( "    timeout :" ).append( timeout ).append( '\n' );
+        sb.append( "    graceLogins :" ).append( graceLogins ).append( '\n' );
+        sb.append( "    expirationSeconds :" ).append( expirationSeconds ).append( '\n' );
+        sb.append( "    errorId :" ).append( errorId ).append( '\n' );
+        sb.append( "    message :" ).append( message ).append( '\n' );
+
+        if ( warnings != null )
+        {
+            sb.append( "    warnings : " );
+
+            boolean isFirst = true;
+
+            for ( Warning warning : warnings )
+            {
+                if ( isFirst )
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    sb.append( ", " );
+                }
+
+                sb.append( warning );
+            }
+
+            sb.append( '\n' );
+        }
+
+        return sb.toString();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/08ea401b/src/main/java/org/apache/directory/fortress/core/rbac/UserRole.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/UserRole.java b/src/main/java/org/apache/directory/fortress/core/rbac/UserRole.java
index bd619e0..7d7913a 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/UserRole.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/UserRole.java
@@ -20,6 +20,7 @@
 package org.apache.directory.fortress.core.rbac;
 
 
+import java.io.Serializable;
 import java.util.Set;
 
 import javax.xml.bind.annotation.XmlAccessType;
@@ -78,8 +79,10 @@ import org.apache.directory.fortress.core.util.time.Constraint;
 @XmlType( name = "userRole", propOrder = {"name", "userId", "parents", "beginDate", "beginLockDate", "beginTime",
     "dayMask", "endDate", "endLockDate", "endTime", "timeout"} )
 @XmlSeeAlso( {UserAdminRole.class} )
-public class UserRole extends FortEntity implements java.io.Serializable, Constraint
+public class UserRole extends FortEntity implements Serializable, Constraint
 {
+    private static final long serialVersionUID = 1L;
+    
     protected String userId;
     protected String name;
     private Integer timeout;
@@ -269,17 +272,6 @@ public class UserRole extends FortEntity implements java.io.Serializable, Constr
 
 
     /**
-     * Used to retrieve UserRole Role name attribute.  The Fortress UserRole name maps to 'ftRA' attribute on
-     * 'ftUserAttrs' object class.
-     */
-    @Override
-    public String toString()
-    {
-        return name;
-    }
-
-
-    /**
      * Return the userId that is associated with UserRole.  UserId is required attribute and must be set on all
      * UserRole assignment operations.
      *
@@ -615,4 +607,15 @@ public class UserRole extends FortEntity implements java.io.Serializable, Constr
 
         return ( thatRole.getName().equalsIgnoreCase( name ) );
     }
+
+
+    /**
+     * Used to retrieve UserRole Role name attribute.  The Fortress UserRole name maps to 'ftRA' attribute on
+     * 'ftUserAttrs' object class.
+     */
+    @Override
+    public String toString()
+    {
+        return name;
+    }
 }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/08ea401b/src/main/java/org/apache/directory/fortress/core/rbac/Warning.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/Warning.java b/src/main/java/org/apache/directory/fortress/core/rbac/Warning.java
index b6a8d2f..0f37245 100644
--- a/src/main/java/org/apache/directory/fortress/core/rbac/Warning.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/Warning.java
@@ -25,6 +25,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlEnum;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
+
 import java.io.Serializable;
 
 /**
@@ -34,7 +35,8 @@ import java.io.Serializable;
  * @author Shawn McKinney
  */
 /**
- * This entity is stored on {@link org.apache.directory.fortress.core.rbac.Session} and is used to pass warnings that occur during role activation and password policy validation.
+ * This entity is stored on {@link org.apache.directory.fortress.core.rbac.Session} and is used to pass warnings 
+ * that occur during role activation and password policy validation.
  * <p/>
  * Contains data from event that occurs during session initialization:
  * <p/>
@@ -60,9 +62,16 @@ import java.io.Serializable;
     })
 public class Warning implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+    private int id;
+    private String msg;
+    private String name;
+    private Type type;
+
     public Warning()
     {
     }
+    
 
     /**
      *
@@ -70,12 +79,13 @@ public class Warning implements Serializable
      * @param msg
      * @param type
      */
-    public Warning(int id, String msg, Type type)
+    public Warning( int id, String msg, Type type )
     {
         this.id = id;
         this.msg = msg;
         this.type = type;
     }
+    
 
     /**
      *
@@ -84,13 +94,14 @@ public class Warning implements Serializable
      * @param type
      * @param name
      */
-    public Warning(int id, String msg, Type type, String name)
+    public Warning( int id, String msg, Type type, String name )
     {
         this.id = id;
         this.msg = msg;
         this.name = name;
         this.type = type;
     }
+    
 
     /**
      * Type determines if warning is of type Role or Password Policy.
@@ -109,11 +120,7 @@ public class Warning implements Serializable
          */
         PASSWORD
     }
-
-    private int id;
-    private String msg;
-    private String name;
-    private Type type;
+    
 
     public int getId()
     {
@@ -124,16 +131,19 @@ public class Warning implements Serializable
     {
         this.id = id;
     }
+    
 
     public String getMsg()
     {
         return msg;
     }
+    
 
     public void setMsg( String msg )
     {
         this.msg = msg;
     }
+    
 
     public String getName()
     {
@@ -144,14 +154,34 @@ public class Warning implements Serializable
     {
         this.name = name;
     }
+    
 
     public Type getType()
     {
         return type;
     }
+    
 
     public void setType( Type type )
     {
         this.type = type;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "Warning object: \n" );
+
+        sb.append( "    id :" ).append( id ).append( '\n' );
+        sb.append( "    name :" ).append( name ).append( '\n' );
+        sb.append( "    type :" ).append( type ).append( '\n' );
+        sb.append( "    msg :" ).append( msg ).append( '\n' );
+
+        return sb.toString();
+    }
 }
\ No newline at end of file


[3/6] git commit: o Added a toString() method o used the Strings.toUpperCase() method instead of xxx.toUpperCase() to avoid potential NPE when xxx is null o Added a serialVersionUID to shut up the compiler warning o Added some javadoc

Posted by el...@apache.org.
o Added a toString() method
o used the Strings.toUpperCase() method instead of xxx.toUpperCase() to
avoid potential NPE when xxx is null
o Added a serialVersionUID to shut up the compiler warning
o Added some javadoc

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/9bb82e6c
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/9bb82e6c
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/9bb82e6c

Branch: refs/heads/master
Commit: 9bb82e6cbca536132e33f4a10e5c4c750d22a1d7
Parents: 10a597b
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Wed Oct 29 11:27:35 2014 +0100
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Wed Oct 29 11:27:35 2014 +0100

----------------------------------------------------------------------
 .../directory/fortress/core/rbac/Hier.java      | 109 +++++++++++++++----
 1 file changed, 88 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/9bb82e6c/src/main/java/org/apache/directory/fortress/core/rbac/Hier.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/Hier.java b/src/main/java/org/apache/directory/fortress/core/rbac/Hier.java
index 9e0db40..8045c80 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/Hier.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/Hier.java
@@ -19,9 +19,12 @@
  */
 package org.apache.directory.fortress.core.rbac;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.api.util.Strings;
+
 /**
  * All entities (User, Role, Permission, Policy, SDSet, etc...) are used to carry data between Fortress's
  * layers starting with the (1) Manager layer down thru middle (2) Process layer and it's processing rules into
@@ -90,11 +93,17 @@ import java.util.List;
  *
  * @author Shawn McKinney
  */
-public class Hier extends FortEntity
-    implements java.io.Serializable
+public class Hier extends FortEntity implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+    
+    /** The operation */
     public Op op;
+    
+    /** The hierarchy type - ROLE, AROLE, USER, PERM */
     public Type type;
+    
+    /** the list of relationships that are set in collection on this entity */
     private List<Relationship> relationships;
 
     /**
@@ -103,26 +112,29 @@ public class Hier extends FortEntity
     public Hier()
     {
     }
+    
 
     /**
      * construct hierarchy given a list of parent-child relationships.
      *
      * @param relationships maps to 'ftRels' attribute on 'ftHier' object class.
      */
-    public Hier(List<Relationship> relationships)
+    public Hier( List<Relationship> relationships )
     {
         this.relationships = relationships;
     }
+    
 
     /**
      * Construct entity given a hierarchy type - ROLE, AROLE, USER, PERM.
      *
      * @param type determines where the target node resides.  For example the 'ROLE' type will specify the RBAC Role container as target.
      */
-    public Hier(Type type)
+    public Hier( Type type )
     {
         this.type = type;
     }
+    
 
     /**
      * Construct entity given a parent, child and a hierarchy type.
@@ -131,11 +143,12 @@ public class Hier extends FortEntity
      * @param child  maps to the 'ftRels' attribute in 'ftHier' object class.
      * @param parent maps to the 'ftRels' attribute in 'ftHier' object class.
      */
-    public Hier(Type type, String child, String parent)
+    public Hier( Type type, String child, String parent )
     {
         this.type = type;
-        setRelationship(child, parent);
+        setRelationship( child, parent );
     }
+    
 
     /**
      * Construct entity given a parent and child.
@@ -143,10 +156,11 @@ public class Hier extends FortEntity
      * @param child  maps to the 'ftRels' attribute in 'ftHier' object class.
      * @param parent maps to the 'ftRels' attribute in 'ftHier' object class.
      */
-    public Hier(String child, String parent)
+    public Hier( String child, String parent )
     {
-        setRelationship(child, parent);
+        setRelationship( child, parent );
     }
+    
 
     /**
      * Operation type specifies if Add, Update or Deletion of relationship is being targeted.
@@ -168,6 +182,7 @@ public class Hier extends FortEntity
          */
         REM
     }
+    
 
     /**
      * Return the operation to execute on behalf of this entity.
@@ -178,6 +193,7 @@ public class Hier extends FortEntity
     {
         return op;
     }
+    
 
     /**
      * The the operation for which this entity is bound for.  Add, Update or Delete.
@@ -188,6 +204,7 @@ public class Hier extends FortEntity
     {
         this.op = op;
     }
+    
 
     /**
      * Enumeration is used to specify which hierarchy node this entity is bound to.  RBAC Role, Admin Roles, User OU or Perm OU.
@@ -214,6 +231,7 @@ public class Hier extends FortEntity
          */
         PERM
     }
+    
 
     /**
      * Return required the type of node this entity is bound to.
@@ -224,13 +242,14 @@ public class Hier extends FortEntity
     {
         return type;
     }
+    
 
     /**
      * Set the required type which determines which directory node this entity is bound to.
      *
      * @param type variable specifies which directory node the hierarchy entity is bound to.
      */
-    public void setType(Type type)
+    public void setType( Type type )
     {
         this.type = type;
     }
@@ -243,16 +262,19 @@ public class Hier extends FortEntity
      * @param role   attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      * @param parent attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      */
-    public boolean isRelationship(String role, String parent)
+    public boolean isRelationship( String role, String parent )
     {
         boolean result = false;
-        if (relationships != null)
+        
+        if ( relationships != null )
         {
-            result = relationships.contains(new Relationship(role.toUpperCase(), parent.toUpperCase()));
+            result = relationships.contains(
+                new Relationship( Strings.toUpperCase( role ), Strings.toUpperCase( parent ) ) );
         }
 
         return result;
     }
+    
 
     /**
      * Set the child and parent into the collection of valid relationships stored in this entity.
@@ -260,30 +282,33 @@ public class Hier extends FortEntity
      * @param role   attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      * @param parent attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      */
-    public void setRelationship(String role, String parent)
+    public void setRelationship( String role, String parent )
     {
         if (relationships == null)
         {
-            relationships = new ArrayList<>();
+            relationships = new ArrayList<Relationship>();
         }
 
-        relationships.add(new Relationship(role.toUpperCase(), parent.toUpperCase()));
+        relationships.add(
+            new Relationship( Strings.toUpperCase( role ), Strings.toUpperCase(parent ) ) );
     }
 
+    
     /**
      * Set the relationship object into the collection of valid relationships stored in this entity.
      *
      * @param rel attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      */
-    public void setRelationship(Relationship rel)
+    public void setRelationship( Relationship rel )
     {
         if (relationships == null)
         {
-            relationships = new ArrayList<>();
+            relationships = new ArrayList<Relationship>();
         }
 
-        relationships.add(rel);
+        relationships.add( rel );
     }
+    
 
     /**
      * Remove the specified relationship from the collection of valid relationships stored in this entity.
@@ -291,13 +316,15 @@ public class Hier extends FortEntity
      * @param role   attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      * @param parent attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      */
-    public void removeRelationship(String role, String parent)
+    public void removeRelationship( String role, String parent )
     {
         if (relationships != null)
         {
-            relationships.remove(new Relationship(role.toUpperCase(), parent.toUpperCase()));
+            relationships.remove(
+                new Relationship( Strings.toUpperCase( role ), Strings.toUpperCase( parent ) ) );
         }
     }
+    
 
     /**
      * Return the list of relationships that are set in collection on this entity.
@@ -308,14 +335,54 @@ public class Hier extends FortEntity
     {
         return relationships;
     }
+    
 
     /**
      * Set the list of relationships that are set in collection on this entity.
      *
      * @param relationships that map to the 'ftRels' attribute on the 'ftHier' object class.
      */
-    public void setRelationships(List<Relationship> relationships)
+    public void setRelationships( List<Relationship> relationships )
     {
         this.relationships = relationships;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "Hier object: \n" );
+
+        sb.append( "    operation :" ).append( op ).append( '\n' );
+        sb.append( "    type :" ).append( type ).append( '\n' );
+
+        if ( relationships != null )
+        {
+            sb.append( "    relationships : " );
+
+            boolean isFirst = true;
+
+            for ( Relationship relationship : relationships )
+            {
+                if ( isFirst )
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    sb.append( ", " );
+                }
+
+                sb.append( relationship );
+            }
+
+            sb.append( '\n' );
+        }
+
+        return sb.toString();
+    }
 }
\ No newline at end of file


[4/6] git commit: o Added the toString() method o Added some Javadoc o A bit of refactoring

Posted by el...@apache.org.
o Added the toString() method
o Added some Javadoc
o A bit of refactoring

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/a4c5e213
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/a4c5e213
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/a4c5e213

Branch: refs/heads/master
Commit: a4c5e213d00a690f02d4e2bab78fdc1c08ffb156
Parents: 9bb82e6
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Wed Oct 29 14:44:04 2014 +0100
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Wed Oct 29 14:44:04 2014 +0100

----------------------------------------------------------------------
 .../directory/fortress/core/rbac/OrgUnit.java   | 98 +++++++++++++++++++-
 1 file changed, 94 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/a4c5e213/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnit.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnit.java b/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnit.java
index a1db133..a975e5b 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnit.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnit.java
@@ -20,6 +20,7 @@
 package org.apache.directory.fortress.core.rbac;
 
 
+import java.io.Serializable;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.UUID;
@@ -161,19 +162,30 @@ import javax.xml.bind.annotation.XmlType;
         "parents",
         "type"
 })
-public class OrgUnit extends FortEntity
-    implements Graphable, java.io.Serializable
+public class OrgUnit extends FortEntity implements Graphable, Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     /**
-     * Maps to the location for a particular OrgUnit entity to either the User, {@code ou=OS-U}, or Permission, {@code ou=OS-P}, tree in ldap.
-     *
+     * Maps to the location for a particular OrgUnit entity to either the User, 
+     * {@code ou=OS-U}, or Permission, {@code ou=OS-P}, tree in ldap.
      */
     public Type type;
+    
+    /** The name required attribute of the OrgUnit object */
     private String name;
+    
+    /** the internal id that is associated with OrgUnit */
     private String id;
+    
+    /** The description that is associated with OrgUnit */
     private String description;
+    
+    /** The names of orgUnits that are parents (direct ascendants) of this orgUnit */
     @XmlElement(nillable = true)
     private Set<String> parents;
+    
+    /** The set of child orgUnit names (direct descendants) of this orgUnit */
     @XmlElement(nillable = true)
     private Set<String> children;
 
@@ -359,6 +371,7 @@ public class OrgUnit extends FortEntity
         {
             this.parents = new HashSet<>();
         }
+        
         this.parents.add( parent );
     }
 
@@ -403,14 +416,91 @@ public class OrgUnit extends FortEntity
     public boolean equals( Object thatObj )
     {
         if ( this == thatObj )
+        {
             return true;
+        }
+        
         if ( this.getName() == null )
+        {
             return false;
+        }
+        
         if ( !( thatObj instanceof OrgUnit ) )
+        {
             return false;
+        }
+        
         OrgUnit thatOrg = ( OrgUnit ) thatObj;
+        
         if ( thatOrg.getName() == null )
+        {
             return false;
+        }
+        
         return thatOrg.getName().equalsIgnoreCase( this.getName() );
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "OrgUnit object: \n" );
+
+        sb.append( "    name :" ).append( name ).append( '\n' );
+        sb.append( "    id :" ).append( id ).append( '\n' );
+        sb.append( "    description :" ).append( description ).append( '\n' );
+        sb.append( "    type :" ).append( type ).append( '\n' );
+
+        if ( parents != null )
+        {
+            sb.append( "    parents : " );
+
+            boolean isFirst = true;
+
+            for ( String parent : parents )
+            {
+                if ( isFirst )
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    sb.append( ", " );
+                }
+
+                sb.append( parent );
+            }
+
+            sb.append( '\n' );
+        }
+
+        if ( children != null )
+        {
+            sb.append( "    children : " );
+
+            boolean isFirst = true;
+
+            for ( String child : children )
+            {
+                if ( isFirst )
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    sb.append( ", " );
+                }
+
+                sb.append( child );
+            }
+
+            sb.append( '\n' );
+        }
+
+        return sb.toString();
+    }
 }


[5/6] git commit: o Added the toString() method o Removed some compiler warnings o Added some javadoc

Posted by el...@apache.org.
o Added the toString() method
o Removed some compiler warnings
o Added some javadoc

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/2ae41291
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/2ae41291
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/2ae41291

Branch: refs/heads/master
Commit: 2ae41291f27bf9628e31340a8e9ed0479b451f90
Parents: a4c5e21
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Wed Oct 29 15:11:18 2014 +0100
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Wed Oct 29 15:28:12 2014 +0100

----------------------------------------------------------------------
 .../core/rbac/AdminRoleRelationship.java        | 26 ++++++++++-
 .../fortress/core/rbac/OrgUnitRelationship.java | 26 ++++++++++-
 .../directory/fortress/core/rbac/PermGrant.java | 48 +++++++++++++++++++-
 3 files changed, 94 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/2ae41291/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleRelationship.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleRelationship.java b/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleRelationship.java
index 22b90d4..ebe5938 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleRelationship.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/AdminRoleRelationship.java
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.fortress.core.rbac;
 
+import java.io.Serializable;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -35,10 +37,14 @@ import javax.xml.bind.annotation.XmlType;
     "child",
     "parent"
 })
-public class AdminRoleRelationship extends FortEntity
-    implements java.io.Serializable
+public class AdminRoleRelationship extends FortEntity implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+    
+    /** The parent AdminRole */
     private AdminRole parent;
+    
+    /** The child AdminRole */
     private AdminRole child;
 
     public AdminRole getParent()
@@ -60,4 +66,20 @@ public class AdminRoleRelationship extends FortEntity
     {
         this.child = child;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "AdminRoleRelationship object: \n" );
+
+        sb.append( "    parent :" ).append( parent ).append( '\n' );
+        sb.append( "    child :" ).append( child ).append( '\n' );
+
+        return sb.toString();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/2ae41291/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitRelationship.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitRelationship.java b/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitRelationship.java
index 3756c93..4425d72 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitRelationship.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/OrgUnitRelationship.java
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.fortress.core.rbac;
 
+import java.io.Serializable;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -36,9 +38,10 @@ import javax.xml.bind.annotation.XmlType;
     "child",
     "parent"
 })
-public class OrgUnitRelationship extends FortEntity
-    implements java.io.Serializable
+public class OrgUnitRelationship extends FortEntity implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+    
     private OrgUnit parent;
     private OrgUnit child;
 
@@ -47,19 +50,38 @@ public class OrgUnitRelationship extends FortEntity
         return parent;
     }
 
+    
     public void setParent(OrgUnit parent)
     {
         this.parent = parent;
     }
 
+    
     public OrgUnit getChild()
     {
         return child;
     }
 
+    
     public void setChild(OrgUnit child)
     {
         this.child = child;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "OrgUnitRelationship object: \n" );
+
+        sb.append( "    parent :" ).append( parent ).append( '\n' );
+        sb.append( "    child :" ).append( child ).append( '\n' );
+
+        return sb.toString();
+    }
 }
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/2ae41291/src/main/java/org/apache/directory/fortress/core/rbac/PermGrant.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/PermGrant.java b/src/main/java/org/apache/directory/fortress/core/rbac/PermGrant.java
index 42bf322..d745730 100755
--- a/src/main/java/org/apache/directory/fortress/core/rbac/PermGrant.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/PermGrant.java
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.fortress.core.rbac;
 
+import java.io.Serializable;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -43,14 +45,26 @@ import javax.xml.bind.annotation.XmlType;
     "roleNm",
     "admin"
 })
-public class PermGrant extends FortEntity
-    implements java.io.Serializable
+public class PermGrant extends FortEntity implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+    
+    /** The permission object name */
     private String objName;
+    
+    /** The permission operation name */
     private String opName;
+    
+    /** The permission object ID */
     private String objId;
+    
+    /** The userId attribute from this entity */
     private String userId;
+    
+    /** The role name associated from this entity */
     private String roleNm;
+    
+    /** Tells if the entity is stored with administrative permissions */
     private boolean admin;
 
     /**
@@ -61,6 +75,7 @@ public class PermGrant extends FortEntity
     {
         return objName;
     }
+    
 
     /**
      * Set the permission object name.
@@ -70,6 +85,7 @@ public class PermGrant extends FortEntity
     {
         this.objName = objName;
     }
+    
 
     /**
      * Return the permission object id.
@@ -79,6 +95,7 @@ public class PermGrant extends FortEntity
     {
         return objId;
     }
+    
 
     /**
      * Set the permission object id.
@@ -88,6 +105,7 @@ public class PermGrant extends FortEntity
     {
         this.objId = objId;
     }
+    
 
     /**
      * Return the permission operation name.
@@ -97,6 +115,7 @@ public class PermGrant extends FortEntity
     {
         return opName;
     }
+    
 
     /**
      * Set the permission operation name.
@@ -106,6 +125,7 @@ public class PermGrant extends FortEntity
     {
         this.opName = opName;
     }
+    
 
     /**
      * Get the userId attribute from this entity.
@@ -117,6 +137,7 @@ public class PermGrant extends FortEntity
         return userId;
     }
 
+    
     /**
      * Set the userId attribute on this entity.
      *
@@ -126,6 +147,7 @@ public class PermGrant extends FortEntity
     {
         this.userId = userId;
     }
+    
 
     /**
      * Get the role name associated from this entity.
@@ -136,6 +158,7 @@ public class PermGrant extends FortEntity
     {
         return roleNm;
     }
+    
 
     /**
      * Set the role name associated with this entity.
@@ -157,6 +180,7 @@ public class PermGrant extends FortEntity
     {
         return admin;
     }
+    
 
     /**
      * Return boolean value that will be set to true if this entity will be stored in Administrative Permissions.
@@ -166,4 +190,24 @@ public class PermGrant extends FortEntity
     {
         this.admin = admin;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "PermGrant object: \n" );
+
+        sb.append( "    roleNm :" ).append( roleNm ).append( '\n' );
+        sb.append( "    objName :" ).append( objName ).append( '\n' );
+        sb.append( "    objId :" ).append( objId ).append( '\n' );
+        sb.append( "    userId :" ).append( userId ).append( '\n' );
+        sb.append( "    opName :" ).append( opName ).append( '\n' );
+        sb.append( "    isAdmin :" ).append( admin ).append( '\n' );
+
+        return sb.toString();
+    }
 }
\ No newline at end of file


[2/6] git commit: o Added a toString method o Added some javadoc

Posted by el...@apache.org.
o Added a toString method
o Added some javadoc

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/10a597b4
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/10a597b4
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/10a597b4

Branch: refs/heads/master
Commit: 10a597b4aef84ab32c1ec4034be0e11c66481362
Parents: 0de1fce
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Wed Oct 29 10:59:21 2014 +0100
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Wed Oct 29 10:59:21 2014 +0100

----------------------------------------------------------------------
 .../directory/fortress/core/rbac/Context.java   | 25 +++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/10a597b4/src/main/java/org/apache/directory/fortress/core/rbac/Context.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rbac/Context.java b/src/main/java/org/apache/directory/fortress/core/rbac/Context.java
index e7a646d..e36b8e7 100644
--- a/src/main/java/org/apache/directory/fortress/core/rbac/Context.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/Context.java
@@ -21,14 +21,18 @@ package org.apache.directory.fortress.core.rbac;
 
 
 /**
- * This class contains the Context id which is used as container for segregating data by customer within the LDAP Directory Information Tree.
+ * This class contains the Context id which is used as container for segregating data by customer 
+ * within the LDAP Directory Information Tree.
  * <p/>
  *
  * @author Shawn McKinney
  */
 public class Context
 {
+    /** The context ID */
     private String name;
+    
+    /** The content description */ 
     private String description;
 
 
@@ -50,6 +54,7 @@ public class Context
     public Context()
     {
     }
+    
 
     /**
      * Get the id to use for sub-directory within the DIT.  This attribute is required.
@@ -60,6 +65,7 @@ public class Context
     {
         return name;
     }
+    
 
     /**
      * Set the id to use for sub-directory within the DIT.  This attribute is required.
@@ -70,6 +76,7 @@ public class Context
     {
         this.name = name;
     }
+    
 
     /**
      * Get the description for the context.  This value is not required or constrained
@@ -81,6 +88,7 @@ public class Context
     {
         return description;
     }
+    
 
     /**
      * Set the description for the context.  This value is not required or constrained
@@ -92,4 +100,19 @@ public class Context
     {
         this.description = description;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "Context object: \n" );
+        sb.append( "    name :" ).append( name ).append( '\n' );
+        sb.append( "    description :" ).append( description ).append( '\n' );
+
+        return sb.toString();
+    }
 }