portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r690866 - in /portals/jetspeed-2/portal/branches/security-refactoring: components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/ jetspeed-api/src/main/java/org/apache/jetspeed/security/ jetspeed-api/src/main/java/org/apa...
Date Mon, 01 Sep 2008 07:03:54 GMT
Author: ate
Date: Mon Sep  1 00:03:52 2008
New Revision: 690866

URL: http://svn.apache.org/viewvc?rev=690866&view=rev
Log:
- more standardized naming of some exceptions
- changed several Set<T> get methods to Map<String,T> get methods for SecurityAttributeType and SecurityAttribute related interfaces
- implementations for PrincipalManagerProvider and SecurityAttributes

Added:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/JetspeedPrincipalManagerProviderImpl.java   (with props)
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeImpl.java   (with props)
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeTypeImpl.java   (with props)
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeValue.java   (with props)
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributesImpl.java   (with props)
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeReadOnlyException.java   (with props)
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeRequiredException.java   (contents, props changed)
      - copied, changed from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredAttributeException.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeAlreadyDefinedException.java   (with props)
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeNotFoundException.java   (contents, props changed)
      - copied, changed from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypeNotFoundException.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesNotExtendableException.java   (with props)
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesReadOnlyException.java   (contents, props changed)
      - copied, changed from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/ReadonlyAttributesException.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationRequiredException.java   (contents, props changed)
      - copied, changed from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredPrincipalAssociationException.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationUnsupportedException.java   (contents, props changed)
      - copied, changed from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UnsupportedPrincipalAssociationException.java
Removed:
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/ReadonlyAttributesException.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredAttributeException.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredPrincipalAssociationException.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypeNotFoundException.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UnsupportedPrincipalAssociationException.java
Modified:
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManagerProvider.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeType.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypes.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributes.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAssociationStorageManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalStorageManager.java

Added: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/JetspeedPrincipalManagerProviderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/JetspeedPrincipalManagerProviderImpl.java?rev=690866&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/JetspeedPrincipalManagerProviderImpl.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/JetspeedPrincipalManagerProviderImpl.java Mon Sep  1 00:03:52 2008
@@ -0,0 +1,91 @@
+/*
+ * 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.jetspeed.security.impl;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.jetspeed.security.JetspeedPrincipalManager;
+import org.apache.jetspeed.security.JetspeedPrincipalManagerProvider;
+import org.apache.jetspeed.security.JetspeedPrincipalType;
+
+/**
+ * @version $Id$
+ *
+ */
+public class JetspeedPrincipalManagerProviderImpl implements JetspeedPrincipalManagerProvider
+{
+    private Map<String, JetspeedPrincipalType> nameMap;
+    private Map<String, JetspeedPrincipalType> classNameMap;
+    private Map<String, JetspeedPrincipalManager> managersMap;
+    
+    public JetspeedPrincipalManagerProviderImpl(Set<JetspeedPrincipalManager> managers)
+    {
+        HashSet<JetspeedPrincipalType> types = new HashSet<JetspeedPrincipalType>();
+        nameMap = new HashMap<String, JetspeedPrincipalType>();
+        classNameMap = new HashMap<String, JetspeedPrincipalType>();
+        managersMap = new HashMap<String, JetspeedPrincipalManager>();
+        for (JetspeedPrincipalManager m : managers)
+        {
+            JetspeedPrincipalType type = m.getPrincipalType();
+            if (nameMap.containsKey(type.getName()))
+            {
+                throw new IllegalArgumentException("Duplicate JetspeedPrincipalType.name "+type.getName());
+            }
+            if (classNameMap.containsKey(type.getClassName()))
+            {
+                throw new IllegalArgumentException("Duplicate JetspeedPrincipalType.className "+type.getClassName());
+            }
+            nameMap.put(type.getName(), type);
+            classNameMap.put(type.getClassName(), type);
+            types.add(type);
+            managersMap.put(type.getName(), m);
+        }
+        this.nameMap = Collections.unmodifiableMap(nameMap);
+    }
+
+    public JetspeedPrincipalManager getManager(JetspeedPrincipalType type)
+    {
+        return managersMap.get(type.getName());
+    }
+
+    public JetspeedPrincipalType getPrincipalType(String name)
+    {
+        return nameMap.get(name);
+    }
+
+    public JetspeedPrincipalType getPrincipalTypeByClassName(String className)
+    {
+        return classNameMap.get(className);
+    }
+
+    public Map<String, JetspeedPrincipalType> getPrincipalTypeMap()
+    {
+        return nameMap;
+    }
+    
+    public void destroy()
+    {
+        nameMap = null;
+        classNameMap = null;
+        managersMap = null;
+    }
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/JetspeedPrincipalManagerProviderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/JetspeedPrincipalManagerProviderImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/JetspeedPrincipalManagerProviderImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeImpl.java?rev=690866&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeImpl.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeImpl.java Mon Sep  1 00:03:52 2008
@@ -0,0 +1,81 @@
+/*
+ * 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.jetspeed.security.impl;
+
+import org.apache.jetspeed.security.SecurityAttributeType;
+
+/**
+ * @version $Id$
+ *
+ */
+public class SecurityAttributeImpl implements org.apache.jetspeed.security.SecurityAttribute
+{
+    private SecurityAttributeType type;
+    private SecurityAttributeValue value;
+    
+    public SecurityAttributeImpl(SecurityAttributeType type, SecurityAttributeValue value)
+    {
+        this.type = type;
+        this.value = value;
+    }
+    
+    public SecurityAttributeValue getSecurityAttributeValue()
+    {
+        return value;
+    }
+
+    public String getStringValue()
+    {
+        return value.getStringValue();
+    }
+
+    public void setStringValue(String stringValue)
+    {
+        value.setStringValue(stringValue);
+    }
+
+    public String getCategory()
+    {
+        return type.getCategory();
+    }
+
+    public DataType getDataType()
+    {
+        return type.getDataType();
+    }
+
+    public String getName()
+    {
+        return type.getName();
+    }
+
+    public boolean isReadOnly()
+    {
+        return type.isReadOnly();
+    }
+
+    public boolean isRequired()
+    {
+        return type.isRequired();
+    }
+
+    public boolean isRegistered()
+    {
+        return type.isRegistered();
+    }
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeTypeImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeTypeImpl.java?rev=690866&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeTypeImpl.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeTypeImpl.java Mon Sep  1 00:03:52 2008
@@ -0,0 +1,95 @@
+/*
+ * 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.jetspeed.security.impl;
+
+import org.apache.jetspeed.security.SecurityAttributeType;
+import org.apache.jetspeed.security.SecurityAttributes;
+
+/**
+ * @version $Id$
+ *
+ */
+public class SecurityAttributeTypeImpl implements SecurityAttributeType
+{
+    private String name;
+    private String category;
+    private DataType dataType;
+    private boolean readOnly;
+    private boolean required;
+    private boolean registered;
+    
+    public SecurityAttributeTypeImpl(String name)
+    {
+        this.name = name;
+        this.category = SecurityAttributes.INFO_CATEGORY;
+        this.dataType = SecurityAttributeType.DataType.STRING;
+        this.readOnly = false;
+        this.required = false;
+        this.registered = false;
+    }
+
+    public SecurityAttributeTypeImpl(String name, String category)
+    {
+        this.name = name;
+        this.category = category;
+        this.dataType = SecurityAttributeType.DataType.STRING;
+        this.readOnly = false;
+        this.required = false;
+        this.registered = true;
+    }
+
+    public SecurityAttributeTypeImpl(String name, String category, DataType dataType, boolean readOnly, boolean required)
+    {
+        this.name = name;
+        this.category = category;
+        this.dataType = dataType;
+        this.readOnly = readOnly;
+        this.required = required;
+        this.registered = true;
+    }
+
+    public String getCategory()
+    {
+        return category;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public DataType getDataType()
+    {
+        return dataType;
+    }
+
+    public boolean isReadOnly()
+    {
+        return readOnly;
+    }
+
+    public boolean isRequired()
+    {
+        return required;
+    }
+
+    public boolean isRegistered()
+    {
+        return registered;
+    }
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeTypeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeTypeImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeTypeImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeValue.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeValue.java?rev=690866&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeValue.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeValue.java Mon Sep  1 00:03:52 2008
@@ -0,0 +1,58 @@
+/*
+ * 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.jetspeed.security.impl;
+
+import java.io.Serializable;
+
+/**
+ * @version $Id$
+ *
+ */
+public class SecurityAttributeValue implements Serializable
+{
+    private static final long serialVersionUID = -5305625934872996140L;
+
+    private String name;
+    private String stringValue;
+    
+    /*
+     * default constructor required for persistence engine
+     */
+    public SecurityAttributeValue()
+    {}
+    
+    public SecurityAttributeValue(String name)
+    {
+        this.name = name;
+    }
+    
+    public String getName()
+    {
+        return name;
+    }
+    
+    public String getStringValue()
+    {
+        return stringValue;
+    }
+    
+    public void setStringValue(String stringValue)
+    {
+        this.stringValue = stringValue;
+    }
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeValue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeValue.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributeValue.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributesImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributesImpl.java?rev=690866&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributesImpl.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributesImpl.java Mon Sep  1 00:03:52 2008
@@ -0,0 +1,209 @@
+/*
+ * 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.jetspeed.security.impl;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.jetspeed.security.AttributeAlreadyExistsException;
+import org.apache.jetspeed.security.AttributesNotExtendableException;
+import org.apache.jetspeed.security.JetspeedPrincipal;
+import org.apache.jetspeed.security.AttributeReadOnlyException;
+import org.apache.jetspeed.security.AttributesReadOnlyException;
+import org.apache.jetspeed.security.AttributeRequiredException;
+import org.apache.jetspeed.security.SecurityAttribute;
+import org.apache.jetspeed.security.SecurityAttributeType;
+import org.apache.jetspeed.security.AttributeTypeAlreadyDefinedException;
+import org.apache.jetspeed.security.AttributeTypeNotFoundException;
+import org.apache.jetspeed.security.SecurityAttributeTypes;
+import org.apache.jetspeed.security.SecurityAttributes;
+import org.apache.jetspeed.security.SecurityAttributeType.DataType;
+
+/**
+ * @version $Id$
+ *
+ */
+public class SecurityAttributesImpl implements SecurityAttributes
+{
+    JetspeedPrincipal jp;
+    @SuppressWarnings("unchecked")
+    /*
+     * unchecked collection to allow using default OJB managed collections which are not Generics extendable
+     */
+    private Collection avColl;
+    private boolean readOnly;
+    private boolean extendable;
+    
+    private HashMap<String, SecurityAttributeImpl> saMap = new HashMap<String, SecurityAttributeImpl>();
+    
+    @SuppressWarnings("unchecked")
+    public SecurityAttributesImpl(JetspeedPrincipal jp, Collection avColl, boolean readOnly, boolean extendable)
+    {
+        this.jp = jp;
+        this.avColl = avColl;
+        this.readOnly = jp.getType().getAttributeTypes().isReadOnly() ? true : readOnly;
+        this.extendable = jp.getType().getAttributeTypes().isExtendable() ? true : extendable;
+        
+        Map<String, SecurityAttributeType> stMap = jp.getType().getAttributeTypes().getAttributeTypeMap();
+        for (Object avObj : avColl)
+        {
+            SecurityAttributeValue av = (SecurityAttributeValue)avObj;
+            SecurityAttributeType sat = stMap.get(av.getName());
+            saMap.put(av.getName(), new SecurityAttributeImpl(sat != null ? sat : new SecurityAttributeTypeImpl(av.getName()), av));
+        }
+    }
+
+    public JetspeedPrincipal getPrincipal()
+    {
+        return jp;
+    }
+
+    public int size()
+    {
+        return saMap.size();
+    }
+
+    public boolean isReadOnly()
+    {
+        return readOnly;
+    }
+    
+    public boolean isExtendable()
+    {
+        return extendable;
+    }
+
+    public SecurityAttributeTypes getSecurityAttributeTypes()
+    {
+        return jp.getType().getAttributeTypes();
+    }
+
+    public Set<String> getAttributeNames()
+    {
+        return Collections.unmodifiableSet(new HashSet<String>(saMap.keySet()));
+    }
+
+    public Set<String> getAttributeNames(String category)
+    {
+        HashSet<String> set = new HashSet<String>(saMap.size());
+        for (SecurityAttribute sa : saMap.values())
+        {
+            if (sa.getCategory().equals(category))
+            {
+                set.add(sa.getName());
+            }
+        }
+        return Collections.unmodifiableSet(set);
+    }
+
+    public Map<String, SecurityAttribute> getAttributeMap()
+    {
+        return Collections.unmodifiableMap(new HashMap<String, SecurityAttribute>(saMap));
+    }
+
+    public Map<String, SecurityAttribute> getAttributeMap(String category)
+    {
+        HashMap<String, SecurityAttribute> map = new HashMap<String,SecurityAttribute>(saMap.size());
+        for (SecurityAttribute sa : saMap.values())
+        {
+            if (sa.getCategory().equals(category))
+            {
+                map.put(sa.getName(), sa);
+            }
+        }
+        return Collections.unmodifiableMap(map);
+    }
+
+    public SecurityAttribute getAttribute(String name)
+    {
+        return saMap.get(name);
+    }
+
+    public SecurityAttribute addAttribute(String name)
+        throws AttributesReadOnlyException, AttributeTypeNotFoundException, AttributeAlreadyExistsException
+    {
+        if (isReadOnly())
+        {
+            throw new AttributesReadOnlyException();
+        }        
+        SecurityAttributeType sat = getSecurityAttributeTypes().getAttributeTypeMap().get(name);
+        if (sat == null)
+        {
+            throw new AttributeTypeNotFoundException();
+        }
+        if (saMap.containsKey(name))
+        {
+            throw new AttributeAlreadyExistsException();
+        }
+        SecurityAttributeValue value = new SecurityAttributeValue(name);
+        avColl.add(value);
+        return saMap.put(name, new SecurityAttributeImpl(sat, value));
+    }
+
+    public SecurityAttribute addNewInfoAttribute(String name, DataType type)
+        throws AttributesReadOnlyException, AttributeTypeAlreadyDefinedException, AttributeAlreadyExistsException, AttributesNotExtendableException
+    {
+        if (isReadOnly())
+        {
+            throw new AttributesReadOnlyException();
+        }        
+        if (!isExtendable())
+        {
+            throw new AttributesNotExtendableException();
+        }        
+        SecurityAttributeType sat = getSecurityAttributeTypes().getAttributeTypeMap().get(name);
+        if (sat != null)
+        {
+            throw new AttributeTypeAlreadyDefinedException();
+        }
+        if (saMap.containsKey(name))
+        {
+            throw new AttributeAlreadyExistsException();
+        }
+        // TODO: making use of the DataType parameter (now ignored)
+        SecurityAttributeValue value = new SecurityAttributeValue(name);
+        avColl.add(value);
+        return saMap.put(name, new SecurityAttributeImpl(new SecurityAttributeTypeImpl(name), value));
+    }
+
+    public void removeAttribute(String name) throws AttributesReadOnlyException, AttributeReadOnlyException, AttributeRequiredException
+    {
+        if (isReadOnly())
+        {
+            throw new AttributesReadOnlyException();
+        }
+        SecurityAttributeImpl sa = saMap.get(name);
+        if (sa != null)
+        {
+            if (sa.isReadOnly())
+            {
+                throw new AttributeReadOnlyException();
+            }
+            if (sa.isRequired())
+            {
+                throw new AttributeRequiredException();
+            }
+            saMap.remove(name);
+            avColl.remove(sa.getSecurityAttributeValue());
+        }
+    }
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributesImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributesImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityAttributesImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeReadOnlyException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeReadOnlyException.java?rev=690866&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeReadOnlyException.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeReadOnlyException.java Mon Sep  1 00:03:52 2008
@@ -0,0 +1,28 @@
+/*
+ * 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.jetspeed.security;
+
+import org.apache.jetspeed.exception.JetspeedException;
+
+/**
+ * @version $Id$
+ *
+ */
+public class AttributeReadOnlyException extends JetspeedException
+{
+    private static final long serialVersionUID = 2836721697942980269L;
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeReadOnlyException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeReadOnlyException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeReadOnlyException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeRequiredException.java (from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredAttributeException.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeRequiredException.java?p2=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeRequiredException.java&p1=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredAttributeException.java&r1=690597&r2=690866&rev=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredAttributeException.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeRequiredException.java Mon Sep  1 00:03:52 2008
@@ -21,7 +21,7 @@
 /**
  * @version $Id$
  */
-public class RequiredAttributeException extends JetspeedException
+public class AttributeRequiredException extends JetspeedException
 {
     private static final long serialVersionUID = -7652890285446916215L;
 }

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeRequiredException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeAlreadyDefinedException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeAlreadyDefinedException.java?rev=690866&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeAlreadyDefinedException.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeAlreadyDefinedException.java Mon Sep  1 00:03:52 2008
@@ -0,0 +1,27 @@
+/*
+ * 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.jetspeed.security;
+
+import org.apache.jetspeed.exception.JetspeedException;
+
+/**
+ * @version $Id$
+ */
+public class AttributeTypeAlreadyDefinedException extends JetspeedException
+{
+    private static final long serialVersionUID = 8489109575962501156L;
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeAlreadyDefinedException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeAlreadyDefinedException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeAlreadyDefinedException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeNotFoundException.java (from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypeNotFoundException.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeNotFoundException.java?p2=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeNotFoundException.java&p1=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypeNotFoundException.java&r1=690597&r2=690866&rev=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypeNotFoundException.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeNotFoundException.java Mon Sep  1 00:03:52 2008
@@ -21,7 +21,7 @@
 /**
  * @version $Id$
  */
-public class SecurityAttributeTypeNotFoundException extends JetspeedException
+public class AttributeTypeNotFoundException extends JetspeedException
 {
     private static final long serialVersionUID = 8489109575962501156L;
 }

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributeTypeNotFoundException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesNotExtendableException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesNotExtendableException.java?rev=690866&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesNotExtendableException.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesNotExtendableException.java Mon Sep  1 00:03:52 2008
@@ -0,0 +1,27 @@
+/*
+ * 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.jetspeed.security;
+
+import org.apache.jetspeed.exception.JetspeedException;
+
+/**
+ * @version $Id$
+ */
+public class AttributesNotExtendableException extends JetspeedException
+{
+    private static final long serialVersionUID = -6078545521650063319L;
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesNotExtendableException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesNotExtendableException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesNotExtendableException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesReadOnlyException.java (from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/ReadonlyAttributesException.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesReadOnlyException.java?p2=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesReadOnlyException.java&p1=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/ReadonlyAttributesException.java&r1=690597&r2=690866&rev=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/ReadonlyAttributesException.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesReadOnlyException.java Mon Sep  1 00:03:52 2008
@@ -21,7 +21,7 @@
 /**
  * @version $Id$
  */
-public class ReadonlyAttributesException extends JetspeedException
+public class AttributesReadOnlyException extends JetspeedException
 {
     private static final long serialVersionUID = 5331466107561705454L;
 }

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/AttributesReadOnlyException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java?rev=690866&r1=690865&r2=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalAssociationHandler.java Mon Sep  1 00:03:52 2008
@@ -33,7 +33,7 @@
 
     void add(JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalNotFoundException, PrincipalAssociationNotAllowedException;
 
-    void remove(JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalNotFoundException, RequiredPrincipalAssociationException;
+    void remove(JetspeedPrincipal from, JetspeedPrincipal to) throws PrincipalNotFoundException, PrincipalAssociationRequiredException;
 
     // may only be called when removing the principal itself
     void removeAllFrom(JetspeedPrincipal from) throws PrincipalNotFoundException, PrincipalNotRemovableException; 

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManagerProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManagerProvider.java?rev=690866&r1=690865&r2=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManagerProvider.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipalManagerProvider.java Mon Sep  1 00:03:52 2008
@@ -16,14 +16,14 @@
  */
 package org.apache.jetspeed.security;
 
-import java.util.Set;
+import java.util.Map;
 
 /**
  * @version $Id$
  */
 public interface JetspeedPrincipalManagerProvider
 {
-    Set<JetspeedPrincipalType> getPrincipalTypes();
+    Map<String, JetspeedPrincipalType> getPrincipalTypeMap();
 
     JetspeedPrincipalType getPrincipalType(String name);
 

Copied: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationRequiredException.java (from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredPrincipalAssociationException.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationRequiredException.java?p2=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationRequiredException.java&p1=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredPrincipalAssociationException.java&r1=690597&r2=690866&rev=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/RequiredPrincipalAssociationException.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationRequiredException.java Mon Sep  1 00:03:52 2008
@@ -21,7 +21,7 @@
 /**
  * @version $Id$
  */
-public class RequiredPrincipalAssociationException extends JetspeedException
+public class PrincipalAssociationRequiredException extends JetspeedException
 {
     private static final long serialVersionUID = 1693885988445864406L;
 }

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationRequiredException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationUnsupportedException.java (from r690597, portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UnsupportedPrincipalAssociationException.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationUnsupportedException.java?p2=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationUnsupportedException.java&p1=portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UnsupportedPrincipalAssociationException.java&r1=690597&r2=690866&rev=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/UnsupportedPrincipalAssociationException.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationUnsupportedException.java Mon Sep  1 00:03:52 2008
@@ -21,7 +21,7 @@
 /**
  * @version $Id$
  */
-public class UnsupportedPrincipalAssociationException extends JetspeedException
+public class PrincipalAssociationUnsupportedException extends JetspeedException
 {
     private static final long serialVersionUID = -7974095505573133535L;
 }

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PrincipalAssociationUnsupportedException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeType.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeType.java?rev=690866&r1=690865&r2=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeType.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeType.java Mon Sep  1 00:03:52 2008
@@ -32,4 +32,6 @@
     boolean isReadOnly();
 
     boolean isRequired();
+
+    boolean isRegistered();
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypes.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypes.java?rev=690866&r1=690865&r2=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypes.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributeTypes.java Mon Sep  1 00:03:52 2008
@@ -16,18 +16,18 @@
  */
 package org.apache.jetspeed.security;
 
-import java.util.Set;
+import java.util.Map;
 
 /**
  * @version $Id$
  */
 public interface SecurityAttributeTypes
 {
-    Set<SecurityAttributeType> getAttributeTypes();
+    Map<String, SecurityAttributeType> getAttributeTypeMap();
 
-    Set<SecurityAttributeType> getAttributeTypes(String category);
+    Map<String, SecurityAttributeType> getAttributeTypeMap(String category);
 
-    boolean isReadonly();
+    boolean isReadOnly();
 
     boolean isExtendable();
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributes.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributes.java?rev=690866&r1=690865&r2=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributes.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityAttributes.java Mon Sep  1 00:03:52 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.jetspeed.security;
 
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -23,33 +24,33 @@
  */
 public interface SecurityAttributes
 {
-    String USER_INFO_CATEGORY = "user_info";
+    String INFO_CATEGORY = "info";
 
     JetspeedPrincipal getPrincipal();
 
     int size();
 
-    boolean isReadonly();
-
-    Set<SecurityAttributeType> getAttributeTypes();
-
-    Set<SecurityAttributeType> getAttributeTypes(String category);
+    boolean isReadOnly();
+    
+    boolean isExtendable();
+    
+    SecurityAttributeTypes getSecurityAttributeTypes();
 
     Set<String> getAttributeNames();
 
     Set<String> getAttributeNames(String category);
 
-    Set<SecurityAttribute> getAttributes();
-
-    Set<SecurityAttribute> getAttributes(String category);
+    Map<String, SecurityAttribute> getAttributeMap();
 
+    Map<String, SecurityAttribute> getAttributeMap(String category);
+    
     SecurityAttribute getAttribute(String name);
 
-    SecurityAttribute newAttribute(String name)
-        throws ReadonlyAttributesException, SecurityAttributeTypeNotFoundException, AttributeAlreadyExistsException;
+    SecurityAttribute addAttribute(String name)
+        throws AttributesReadOnlyException, AttributeTypeNotFoundException, AttributeAlreadyExistsException;
 
-    SecurityAttribute newAttribute(String name, String category, SecurityAttributeType.DataType type)
-        throws ReadonlyAttributesException, AttributeAlreadyExistsException;
+    SecurityAttribute addNewInfoAttribute(String name, SecurityAttributeType.DataType type)
+        throws AttributesReadOnlyException, AttributeTypeAlreadyDefinedException, AttributeAlreadyExistsException, AttributesNotExtendableException;
 
-    void removeAttribute(String name) throws ReadonlyAttributesException, RequiredAttributeException;
+    void removeAttribute(String name) throws AttributesReadOnlyException, AttributeReadOnlyException, AttributeRequiredException;
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAssociationStorageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAssociationStorageManager.java?rev=690866&r1=690865&r2=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAssociationStorageManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalAssociationStorageManager.java Mon Sep  1 00:03:52 2008
@@ -19,8 +19,8 @@
 import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.PrincipalAssociationNotAllowedException;
 import org.apache.jetspeed.security.PrincipalNotFoundException;
-import org.apache.jetspeed.security.RequiredPrincipalAssociationException;
-import org.apache.jetspeed.security.UnsupportedPrincipalAssociationException;
+import org.apache.jetspeed.security.PrincipalAssociationRequiredException;
+import org.apache.jetspeed.security.PrincipalAssociationUnsupportedException;
 
 /**
  * @version $Id$
@@ -28,8 +28,8 @@
 public interface JetspeedPrincipalAssociationStorageManager
 {
     void addAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName)
-        throws PrincipalNotFoundException, UnsupportedPrincipalAssociationException, PrincipalAssociationNotAllowedException;
+        throws PrincipalNotFoundException, PrincipalAssociationUnsupportedException, PrincipalAssociationNotAllowedException;
 
     void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName)
-        throws PrincipalNotFoundException, UnsupportedPrincipalAssociationException, RequiredPrincipalAssociationException;
+        throws PrincipalNotFoundException, PrincipalAssociationUnsupportedException, PrincipalAssociationRequiredException;
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalStorageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalStorageManager.java?rev=690866&r1=690865&r2=690866&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalStorageManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/spi/JetspeedPrincipalStorageManager.java Mon Sep  1 00:03:52 2008
@@ -25,7 +25,7 @@
 import org.apache.jetspeed.security.PrincipalNotFoundException;
 import org.apache.jetspeed.security.PrincipalNotRemovableException;
 import org.apache.jetspeed.security.PrincipalUpdateException;
-import org.apache.jetspeed.security.RequiredPrincipalAssociationException;
+import org.apache.jetspeed.security.PrincipalAssociationRequiredException;
 
 /**
  * @version $Id$
@@ -33,7 +33,7 @@
 public interface JetspeedPrincipalStorageManager
 {
     void addPrincipal(JetspeedPrincipal principal, Set<JetspeedPrincipalAssociationReference> associations)
-        throws PrincipalAlreadyExistsException, RequiredPrincipalAssociationException;
+        throws PrincipalAlreadyExistsException, PrincipalAssociationRequiredException;
 
     void updatePrincipal(JetspeedPrincipal principal) throws PrincipalUpdateException, PrincipalNotFoundException;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message