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: FC-188 - add the paset and role constraint services
Date Fri, 07 Oct 2016 06:56:02 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 68364f77d -> 9d820b368


 FC-188 - add the paset and role constraint services


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

Branch: refs/heads/master
Commit: 9d820b36869692778146b2c18598c733698639c9
Parents: 68364f7
Author: Shawn McKinney <smckinney@apache.org>
Authored: Fri Oct 7 01:55:56 2016 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Fri Oct 7 01:55:56 2016 -0500

----------------------------------------------------------------------
 .../core/model/PermissionAttribute.java         | 90 +++++++++++++-------
 .../core/model/PermissionAttributeSet.java      | 75 ++++++++++------
 .../fortress/core/model/RoleConstraint.java     | 66 ++++++++------
 3 files changed, 146 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/9d820b36/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
b/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
index 3fa41a2..960d955 100644
--- a/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
@@ -26,39 +26,47 @@ import java.util.UUID;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 
 /**
- * A Permission Attribute is defines an attribute about a permission used for 
+ * A Permission Attribute is defines an attribute about a permission used for
  * attribute type permission filtering. Fortress merely stores this data, does
  * not enforce the attribute filtering. It is up to the client to do the attribute
  * checks.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@XmlRootElement(name = "ftPA")
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "permission", propOrder =
-{
+@XmlRootElement( name = "fortPermissionAttribute" )
+@XmlAccessorType( XmlAccessType.FIELD )
+@XmlType( name = "permissionAttribute", propOrder = {
     "attributeName",
     "defaultOperator",
     "dataType",
     "defaultValue",
     "defaultStrategy",
     "validValues"
-})
-public class PermissionAttribute extends FortEntity implements Serializable {
+} )
+
+public class PermissionAttribute extends FortEntity implements Serializable
+{
 
-    /** Default serialVersionUID */
+    /**
+     * Default serialVersionUID
+     */
     private static final long serialVersionUID = 1L;
 
     private String attributeName;
     private String defaultOperator;
-    private String dataType;    
+    private String dataType;
     private String defaultValue;
     private String defaultStrategy;
+    @XmlElement( nillable = true )
     private List<String> validValues;
+    @XmlTransient
+
     private String dn;
     private String internalId;
     private String description;
@@ -71,13 +79,13 @@ public class PermissionAttribute extends FortEntity implements Serializable
{
     public PermissionAttribute(String attributeName)
     {
         this.attributeName = attributeName;
-    }       
+    }
 
     /**
      * Checks that attribute names are equal
      */
     @Override
-    public boolean equals( Object thatObj )
+    public boolean equals(Object thatObj)
     {
         if ( this == thatObj )
         {
@@ -111,83 +119,103 @@ public class PermissionAttribute extends FortEntity implements Serializable
{
         return result;
     }
 
-    public String getDefaultOperator() {
+    public String getDefaultOperator()
+    {
         return defaultOperator;
     }
 
-    public void setDefaultOperator(String defaultOperator) {
+    public void setDefaultOperator(String defaultOperator)
+    {
         this.defaultOperator = defaultOperator;
     }
 
-    public String getDataType() {
+    public String getDataType()
+    {
         return dataType;
     }
 
-    public void setDataType(String dataType) {
+    public void setDataType(String dataType)
+    {
         this.dataType = dataType;
     }
 
-    public String getDefaultValue() {
+    public String getDefaultValue()
+    {
         return defaultValue;
     }
 
-    public void setDefaultValue(String defaultValue) {
+    public void setDefaultValue(String defaultValue)
+    {
         this.defaultValue = defaultValue;
     }
 
-    public String getDefaultStrategy() {
+    public String getDefaultStrategy()
+    {
         return defaultStrategy;
     }
 
-    public void setDefaultStrategy(String defaultStrategy) {
+    public void setDefaultStrategy(String defaultStrategy)
+    {
         this.defaultStrategy = defaultStrategy;
     }
 
-    public List<String> getValidValues() {
-        if(validValues == null){
+    public List<String> getValidValues()
+    {
+        if ( validValues == null )
+        {
             validValues = new ArrayList<String>();
         }
         return validValues;
     }
 
-    public void setValidValues(List<String> validValues) {
+    public void setValidValues(List<String> validValues)
+    {
         this.validValues = validValues;
     }
 
-    public String getAttributeName() {
+    public String getAttributeName()
+    {
         return attributeName;
     }
 
-    public void setAttributeName(String attributeName) {
+    public void setAttributeName(String attributeName)
+    {
         this.attributeName = attributeName;
     }
 
-    public String getDn() {
+    public String getDn()
+    {
         return dn;
     }
 
-    public void setDn(String dn) {
+    public void setDn(String dn)
+    {
         this.dn = dn;
     }
 
-    public String getInternalId() {
+    public String getInternalId()
+    {
         return internalId;
     }
 
-    public void setInternalId() {
+    public void setInternalId()
+    {
         UUID uuid = UUID.randomUUID();
         this.internalId = uuid.toString();
     }
 
-    public void setInternalId(String internalId) {        
+    public void setInternalId(String internalId)
+    {
         this.internalId = internalId;
     }
 
-    public String getDescription() {
+    public String getDescription()
+    {
         return description;
     }
 
-    public void setDescription(String description) {
+    public void setDescription(String description)
+    {
         this.description = description;
     }
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/9d820b36/src/main/java/org/apache/directory/fortress/core/model/PermissionAttributeSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/PermissionAttributeSet.java
b/src/main/java/org/apache/directory/fortress/core/model/PermissionAttributeSet.java
index 84822fc..5cc8d82 100644
--- a/src/main/java/org/apache/directory/fortress/core/model/PermissionAttributeSet.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/PermissionAttributeSet.java
@@ -32,29 +32,32 @@ import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 
 /**
- * This a grouping of {@link org.apache.directory.fortress.core.model.PermissionAttribute}.

+ * This a grouping of {@link org.apache.directory.fortress.core.model.PermissionAttribute}.
  * A {@link org.apache.directory.fortress.core.model.Permission} can link to 0 to many Permission
- * Attribute Sets. 
+ * Attribute Sets.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@XmlRootElement(name = "ftPermissionAttributeSet")
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "permission", propOrder =
-{
+@XmlRootElement( name = "fortPermissionAttributeSet" )
+@XmlAccessorType( XmlAccessType.FIELD )
+@XmlType( name = "permissionAttributeSet", propOrder = {
     "name",
     "attributes",
     "internalId",
     "description",
     "type"
-})
-public class PermissionAttributeSet extends FortEntity implements Serializable {
+} )
+
+public class PermissionAttributeSet extends FortEntity implements Serializable
+{
 
-    /** Default serialVersionUID */
+    /**
+     * Default serialVersionUID
+     */
     private static final long serialVersionUID = 1L;
 
     private String name;
-    @XmlElement(nillable = true)
+    @XmlElement( nillable = true )
     private Set<PermissionAttribute> attributes;
     private String internalId;
     private String description;
@@ -63,31 +66,37 @@ public class PermissionAttributeSet extends FortEntity implements Serializable
{
     private String dn;
 
 
-    public PermissionAttributeSet(String name){
+    public PermissionAttributeSet(String name)
+    {
         this.name = name;
     }
 
-    public PermissionAttributeSet(){
+    public PermissionAttributeSet()
+    {
 
     }
 
-    public String getName() {
+    public String getName()
+    {
         return name;
     }
 
-    public void setName(String name) {
+    public void setName(String name)
+    {
         this.name = name;
-    }	
+    }
 
     /**
-     * Return the collection of optional Attributes that have been loaded into this entity.
 This is stored as a multi-occurring
+     * Return the collection of optional Attributes that have been loaded into this entity.
 This is stored as a
+     * multi-occurring
      * attribute of ftPA entries on the 'ftAttributeSet' object class.
      *
      * @return Set containing the roles which maps to 'ftRoles' attribute in 'ftOperation'
object class.
      */
     public Set<PermissionAttribute> getAttributes()
     {
-        if(this.attributes == null){
+        if ( this.attributes == null )
+        {
             attributes = new HashSet<PermissionAttribute>();
         }
 
@@ -96,50 +105,60 @@ public class PermissionAttributeSet extends FortEntity implements Serializable
{
 
 
     /**
-     * Set the collection of optional Attributes that have been loaded into this entity.
 This is stored as a multi-occurring
+     * Set the collection of optional Attributes that have been loaded into this entity.
 This is stored as a
+     * multi-occurring
      * attribute of ftPAs on the 'ftOperation' object class.
      *
      * @param attributes maps to 'ftPA' attribute in 'ftOperation' object class.
      */
-    public void setAttributes( Set<PermissionAttribute> attributes )
+    public void setAttributes(Set<PermissionAttribute> attributes)
     {
         this.attributes = attributes;
     }
 
-    public void setInternalId(String internalId){
+    public void setInternalId(String internalId)
+    {
         this.internalId = internalId;
     }
 
-    public String getInternalId() {
+    public String getInternalId()
+    {
         return internalId;
     }
 
-    public void setInternalId() {
+    public void setInternalId()
+    {
         UUID uuid = UUID.randomUUID();
         this.internalId = uuid.toString();
     }
 
-    public String getDescription() {
+    public String getDescription()
+    {
         return description;
     }
 
-    public void setDescription(String description) {
+    public void setDescription(String description)
+    {
         this.description = description;
     }
 
-    public String getType() {
+    public String getType()
+    {
         return type;
     }
 
-    public void setType(String type) {
+    public void setType(String type)
+    {
         this.type = type;
     }
 
-    public String getDn() {
+    public String getDn()
+    {
         return dn;
     }
 
-    public void setDn(String dn) {
+    public void setDn(String dn)
+    {
         this.dn = dn;
     }
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/9d820b36/src/main/java/org/apache/directory/fortress/core/model/RoleConstraint.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/RoleConstraint.java b/src/main/java/org/apache/directory/fortress/core/model/RoleConstraint.java
index cdc83d8..b921a42 100644
--- a/src/main/java/org/apache/directory/fortress/core/model/RoleConstraint.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/RoleConstraint.java
@@ -34,15 +34,16 @@ import javax.xml.bind.annotation.XmlType;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@XmlRootElement(name = "fortSet")
-@XmlAccessorType( XmlAccessType.FIELD)
-@XmlType(name = "roleconstraint", propOrder =
-    {
-        "paSetName",
-        "value",
-        "type"
-    })
-public class RoleConstraint  extends FortEntity implements Serializable {
+@XmlRootElement( name = "fortRoleConstraint" )
+@XmlAccessorType( XmlAccessType.FIELD )
+@XmlType( name = "roleconstraint", propOrder = {
+    "paSetName",
+    "value",
+    "type"
+} )
+
+public class RoleConstraint extends FortEntity implements Serializable
+{
 
     private static final long serialVersionUID = 1L;
 
@@ -53,7 +54,7 @@ public class RoleConstraint  extends FortEntity implements Serializable
{
      *
      * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
      */
-    @XmlType(name = "rctype")
+    @XmlType( name = "rctype" )
     @XmlEnum
     public enum RCType
     {
@@ -65,49 +66,62 @@ public class RoleConstraint  extends FortEntity implements Serializable
{
     private String value;
     private String paSetName;
 
-    public RoleConstraint(){
+    public RoleConstraint()
+    {
 
     }
 
-    public RoleConstraint(String value, RCType type, String paSetName){
+    public RoleConstraint(String value, RCType type, String paSetName)
+    {
         this.type = type;
         this.value = value;
         this.paSetName = paSetName;
-    }	
+    }
 
-    public RCType getType() {
+    public RCType getType()
+    {
         return type;
     }
-    public void setType(RCType type) {
+
+    public void setType(RCType type)
+    {
         this.type = type;
     }
-    public String getValue() {
+
+    public String getValue()
+    {
         return value;
     }
-    public void setValue(String value) {
+
+    public void setValue(String value)
+    {
         this.value = value;
     }
-    public String getPaSetName() {
+
+    public String getPaSetName()
+    {
         return paSetName;
     }
 
-    public void setPaSetName(String paSetName) {
+    public void setPaSetName(String paSetName)
+    {
         this.paSetName = paSetName;
-    }	
+    }
 
-    public String getRawData(UserRole uRole){
-        StringBuilder sb = new StringBuilder();        
+    public String getRawData(UserRole uRole)
+    {
+        StringBuilder sb = new StringBuilder();
         String delimeter = Config.getInstance().getDelimiter();
 
-        sb.append(uRole.getName());        
+        sb.append( uRole.getName() );
         sb.append( delimeter );
-        sb.append(RC_TYPE_NAME);
+        sb.append( RC_TYPE_NAME );
         sb.append( delimeter );
         sb.append( type );
         sb.append( delimeter );
-        sb.append(paSetName);
+        sb.append( paSetName );
         sb.append( delimeter );
-        sb.append(value);
+        sb.append( value );
 
         return sb.toString();
     }


Mime
View raw message