You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by sb...@apache.org on 2012/07/24 03:32:29 UTC

[20/20] git commit: Rename IdentityObject to IdentityType and adjust ids

Rename IdentityObject to IdentityType and adjust ids


Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/daf6893d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/daf6893d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/daf6893d

Branch: refs/heads/master
Commit: daf6893daadd893396afae679414463ec83eaf23
Parents: 6312fcf
Author: Boleslaw Dawidowicz <bo...@gmail.com>
Authored: Tue Apr 24 08:44:45 2012 +0200
Committer: Shane Bryzak <sb...@gmail.com>
Committed: Tue Jul 24 09:56:36 2012 +1000

----------------------------------------------------------------------
 .../apache/deltaspike/security/api/idm/Group.java  |   11 ++-
 .../security/api/idm/IdentityObject.java           |   81 ---------------
 .../deltaspike/security/api/idm/IdentityType.java  |   78 ++++++++++++++
 .../apache/deltaspike/security/api/idm/Role.java   |    5 +-
 .../apache/deltaspike/security/api/idm/User.java   |    4 +-
 5 files changed, 93 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/daf6893d/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Group.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Group.java b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Group.java
index 8968b55..8b1800b 100644
--- a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Group.java
+++ b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Group.java
@@ -25,7 +25,7 @@ import java.util.Set;
 /**
  * Group representation
  */
-public interface Group extends IdentityObject
+public interface Group extends IdentityType
 {
     //TODO: Javadocs
     //TODO: Exceptions
@@ -45,7 +45,14 @@ public interface Group extends IdentityObject
      */
     String getId();
 
-
+    /**
+     * Group name is unique identifier in specific group tree branch. For example
+     * group with id "/acme/departments/marketing" will have name "marketing" and
+     * parent group of id "/acme/departments"
+     *
+     * @return name
+     */
+    String getName();
 
     // Sub groups
 

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/daf6893d/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/IdentityObject.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/IdentityObject.java b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/IdentityObject.java
deleted file mode 100644
index 31a213f..0000000
--- a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/IdentityObject.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.deltaspike.security.api.idm;
-
-import java.util.Map;
-
-/**
- * IdentityObject
- *
- */
-public interface IdentityObject
-{
-
-    /**
-     *
-     * @return name
-     */
-    String getName();
-
-    // Attributes
-
-    /**
-     * Set attribute with given name and value. Operation will overwrite any previous value.
-     * Null value will remove attribute.
-     *
-     * @param name  of attribute
-     * @param value to be set
-     */
-    void setAttribute(String name, String value);
-
-    /**
-     * Set attribute with given name and values. Operation will overwrite any previous values.
-     * Null value or empty array will remove attribute.
-     *
-     * @param name   of attribute
-     * @param values to be set
-     */
-    void setAttribute(String name, String[] values);
-
-    /**
-     * Remove attribute with given name
-     *
-     * @param name of attribute
-     */
-    void removeAttribute(String name);
-
-    /**
-     * @param name of attribute
-     * @return attribute values or null if attribute with given name doesn't exist. If given attribute has many values
-     *         method will return first one
-     */
-    String getAttribute(String name);
-
-    /**
-     * @param name of attribute
-     * @return attribute values or null if attribute with given name doesn't exist
-     */
-    String[] getAttributeValues(String name);
-
-    /**
-     * @return map of attribute names and their values
-     */
-    Map<String, String[]> getAttributes();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/daf6893d/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/IdentityType.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/IdentityType.java b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/IdentityType.java
new file mode 100644
index 0000000..87fc96a
--- /dev/null
+++ b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/IdentityType.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.security.api.idm;
+
+import java.util.Map;
+
+/**
+ * IdentityObject
+ *
+ */
+public interface IdentityType
+{
+
+    String getKey();
+
+
+    // Attributes
+
+    /**
+     * Set attribute with given name and value. Operation will overwrite any previous value.
+     * Null value will remove attribute.
+     *
+     * @param name  of attribute
+     * @param value to be set
+     */
+    void setAttribute(String name, String value);
+
+    /**
+     * Set attribute with given name and values. Operation will overwrite any previous values.
+     * Null value or empty array will remove attribute.
+     *
+     * @param name   of attribute
+     * @param values to be set
+     */
+    void setAttribute(String name, String[] values);
+
+    /**
+     * Remove attribute with given name
+     *
+     * @param name of attribute
+     */
+    void removeAttribute(String name);
+
+    /**
+     * @param name of attribute
+     * @return attribute values or null if attribute with given name doesn't exist. If given attribute has many values
+     *         method will return first one
+     */
+    String getAttribute(String name);
+
+    /**
+     * @param name of attribute
+     * @return attribute values or null if attribute with given name doesn't exist
+     */
+    String[] getAttributeValues(String name);
+
+    /**
+     * @return map of attribute names and their values
+     */
+    Map<String, String[]> getAttributes();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/daf6893d/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Role.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Role.java b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Role.java
index b193793..d0ca7b0 100644
--- a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Role.java
+++ b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Role.java
@@ -19,12 +19,11 @@
 package org.apache.deltaspike.security.api.idm;
 
 import java.util.Collection;
-import java.util.Map;
 
 /**
  * Role representation
  */
-public interface Role extends IdentityObject
+public interface Role extends IdentityType
 {
     //TODO: Javadocs
     //TODO: Exceptions
@@ -33,6 +32,8 @@ public interface Role extends IdentityObject
 
     // Self
 
+    String getName();
+
     boolean exists(User user, Group group);
 
     boolean exists(String user, String groupId);

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/daf6893d/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/User.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/User.java b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/User.java
index 9289ceb..4721576 100644
--- a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/User.java
+++ b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/User.java
@@ -26,7 +26,7 @@ import java.util.Set;
 /**
  * User representation
  */
-public interface User extends IdentityObject
+public interface User extends IdentityType
 {
     //TODO: Javadocs
     //TODO: Exceptions
@@ -45,6 +45,8 @@ public interface User extends IdentityObject
 
     // Built in attributes
 
+    String getId();
+
     String getFirstName();
 
     void setFirstName(String firstName);