portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r732386 [1/2] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/ components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/ components/jetspeed-security/src/main/java/org/a...
Date Wed, 07 Jan 2009 16:33:28 GMT
Author: ddam
Date: Wed Jan  7 08:33:26 2009
New Revision: 732386

URL: http://svn.apache.org/viewvc?rev=732386&view=rev
Log:
JS2-923 : Security Domains

Added:
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityDomainImpl.java   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedDomainPrincipalAccessManager.java   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainAccessManager.java   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainStorageManager.java   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomain.java   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomains.java   (with props)
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityDomain.java   (with props)
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/TransientJetspeedPrincipal.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/UserPasswordCredentialAccessManager.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/stubs/StubJetspeedPrincipal.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipal.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/security-schema.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/serializer.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/seed/j2-seed.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/seed/min/j2-seed.xml

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml Wed Jan  7 08:33:26 2009
@@ -289,6 +289,11 @@
           nullable="false"
       >
       </field-descriptor>
+      <field-descriptor 
+          name="domainId" 
+          nullable="false" 
+          jdbc-type="BIGINT"
+          column="domain_id"/>
       <collection-descriptor
           name="attributes"
           element-class-ref="org.apache.jetspeed.security.impl.SecurityAttributeValue"
@@ -445,4 +450,49 @@
       </reference-descriptor>
   </class-descriptor>
 
+<!-- 
+    SECURITY DOMAIN
+-->
+    <!--
+        - J E T S P E E D   P R I N C I P A L   A S S O C I A T I O N
+    -->
+    <class-descriptor
+        class="org.apache.jetspeed.security.impl.SecurityDomainImpl"
+        table="SECURITY_DOMAIN"        
+        >
+        <documentation>Security Domain</documentation>
+        <field-descriptor
+            name="domainId"            
+            autoincrement="true"            
+            column="domain_id"
+            jdbc-type="BIGINT"
+            primarykey="true"
+        />
+        <field-descriptor
+            name="name"
+            column="domain_name"
+            jdbc-type="VARCHAR"
+            length="30"
+        />
+        <field-descriptor
+            name="ownerDomainId"
+            column="owner_domain_id"
+            jdbc-type="BIGINT"            
+        />
+        <field-descriptor
+            name="remote"
+            column="remote"
+            jdbc-type="INTEGER"
+            conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+            nullable="false"
+        />
+        <field-descriptor
+            name="enabled"
+            column="enabled"
+            jdbc-type="INTEGER"
+            conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+            nullable="false"
+        />
+    </class-descriptor>
+    
 </descriptor-repository>

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityDomainImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityDomainImpl.java?rev=732386&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityDomainImpl.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/SecurityDomainImpl.java Wed Jan  7 08:33:26 2009
@@ -0,0 +1,87 @@
+/* 
+ * 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.SecurityDomain;
+
+
+/**
+ * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
+ * @version $Id$
+ */
+public class SecurityDomainImpl implements SecurityDomain
+{
+
+    private Long domainId;
+    private String name;
+    private Long ownerDomainId;
+    private boolean remote;
+    private boolean enabled=true;
+    
+    public Long getDomainId()
+    {
+        return domainId;
+    }
+    
+    public void setDomainId(Long domainId)
+    {
+        this.domainId = domainId;
+    }
+    
+    public String getName()
+    {
+        return name;
+    }
+    
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+    
+    public Long getOwnerDomainId()
+    {
+        return ownerDomainId;
+    }
+    
+    public void setOwnerDomainId(Long ownerDomainId)
+    {
+        this.ownerDomainId = ownerDomainId;
+    }
+    
+    public boolean isRemote()
+    {
+        return remote;
+    }
+    
+    public void setRemote(boolean remote)
+    {
+        this.remote = remote;
+    }
+
+    
+    public boolean isEnabled()
+    {
+        return enabled;
+    }
+
+    
+    public void setEnabled(boolean enabled)
+    {
+        this.enabled = enabled;
+    }
+    
+}

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

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

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/TransientJetspeedPrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/TransientJetspeedPrincipal.java?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/TransientJetspeedPrincipal.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/TransientJetspeedPrincipal.java Wed Jan  7 08:33:26 2009
@@ -41,6 +41,7 @@
     
     protected transient JetspeedPrincipalType jpt;
     protected transient SecurityAttributes sa;
+    private Long domainId;
     
     public static void setJetspeedPrincipalManagerProvider(JetspeedPrincipalManagerProvider jpmp)
     {
@@ -166,4 +167,13 @@
     {
         return getType().getName()+": "+getName()+" (id: "+(getId())+", transient: "+isTransient()+", mapped: "+isMapped()+")";
     }
+    
+    public Long getDomainId()
+    {
+        return domainId;
+    }
+
+    public void setDomainId(Long domainId){
+        this.domainId=domainId;
+    }
 }

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedDomainPrincipalAccessManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedDomainPrincipalAccessManager.java?rev=732386&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedDomainPrincipalAccessManager.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedDomainPrincipalAccessManager.java Wed Jan  7 08:33:26 2009
@@ -0,0 +1,57 @@
+/* 
+ * 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.spi;
+
+import java.util.List;
+
+import org.apache.jetspeed.security.JetspeedPrincipal;
+import org.apache.jetspeed.security.JetspeedPrincipalType;
+
+
+/**
+ * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
+ * @version $Id$
+ */
+public interface JetspeedDomainPrincipalAccessManager
+{
+    boolean principalExists(String principalName, JetspeedPrincipalType type, Long securityDomain);
+
+    JetspeedPrincipal getPrincipal(String principalName, JetspeedPrincipalType type, Long securityDomain);
+
+    List<JetspeedPrincipal> getPrincipals(String nameFilter, JetspeedPrincipalType type, Long securityDomain);
+
+    List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String attributeValue, JetspeedPrincipalType type, Long securityDomain);
+
+    List<String> getPrincipalNames(String nameFilter, JetspeedPrincipalType type, Long securityDomain);
+    
+    List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain);
+
+    List<JetspeedPrincipal> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain);
+
+    List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain);
+
+    List<JetspeedPrincipal> getAssociatedTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain);
+
+    List<String> getAssociatedNamesFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain);
+
+    List<String> getAssociatedNamesFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain);
+
+    List<String> getAssociatedNamesTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain);
+
+    List<String> getAssociatedNamesTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain);
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedDomainPrincipalAccessManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedDomainPrincipalAccessManager.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainAccessManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainAccessManager.java?rev=732386&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainAccessManager.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainAccessManager.java Wed Jan  7 08:33:26 2009
@@ -0,0 +1,36 @@
+/* 
+ * 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.spi;
+
+import java.util.Collection;
+
+import org.apache.jetspeed.security.SecurityDomain;
+
+
+/**
+ * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
+ * @version $Id$
+ */
+public interface SecurityDomainAccessManager
+{
+
+    SecurityDomain getDomain(Long domainId);
+    SecurityDomain getDomainByName(String name);
+    Collection<SecurityDomain> getAllDomains();
+    Collection<SecurityDomain> getDomainsOwnedBy(Long ownerDomainId);
+    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainAccessManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainAccessManager.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainStorageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainStorageManager.java?rev=732386&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainStorageManager.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainStorageManager.java Wed Jan  7 08:33:26 2009
@@ -0,0 +1,34 @@
+/* 
+ * 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.spi;
+
+import org.apache.jetspeed.security.SecurityDomain;
+import org.apache.jetspeed.security.SecurityException;
+
+
+/**
+ * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
+ * @version $Id$
+ */
+public interface SecurityDomainStorageManager
+{
+
+    public void addDomain(SecurityDomain domain) throws SecurityException;
+    
+    public void removeDomain(SecurityDomain domain) throws SecurityException;
+    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainStorageManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/SecurityDomainStorageManager.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/UserPasswordCredentialAccessManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/UserPasswordCredentialAccessManager.java?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/UserPasswordCredentialAccessManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/UserPasswordCredentialAccessManager.java Wed Jan  7 08:33:26 2009
@@ -39,4 +39,9 @@
     PasswordCredential getPasswordCredential(String userName);
     void loadPasswordCredentialUser(PasswordCredential credential);
     List<PasswordCredential> getHistoricPasswordCredentials(User user);
+
+
+    PasswordCredential getPasswordCredential(String userName, Long securityDomain);
+    List<PasswordCredential> getHistoricPasswordCredentials(User user, Long securityDomain);
+
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java Wed Jan  7 08:33:26 2009
@@ -19,6 +19,7 @@
 import java.io.Serializable;
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
@@ -30,15 +31,21 @@
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationReference;
 import org.apache.jetspeed.security.JetspeedPrincipalType;
 import org.apache.jetspeed.security.PasswordCredential;
+import org.apache.jetspeed.security.SecurityDomain;
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.impl.PersistentJetspeedPrincipal;
+import org.apache.jetspeed.security.impl.SecurityDomainImpl;
+import org.apache.jetspeed.security.impl.TransientJetspeedPrincipal;
+import org.apache.jetspeed.security.spi.JetspeedDomainPrincipalAccessManager;
 import org.apache.jetspeed.security.spi.JetspeedPermissionAccessManager;
 import org.apache.jetspeed.security.spi.JetspeedPermissionStorageManager;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalAccessManager;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalAssociationStorageManager;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalStorageManager;
 import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
+import org.apache.jetspeed.security.spi.SecurityDomainAccessManager;
+import org.apache.jetspeed.security.spi.SecurityDomainStorageManager;
 import org.apache.jetspeed.security.spi.UserPasswordCredentialAccessManager;
 import org.apache.jetspeed.security.spi.UserPasswordCredentialStorageManager;
 import org.apache.ojb.broker.PersistenceBroker;
@@ -51,6 +58,7 @@
 import org.apache.ojb.broker.query.ReportQueryByCriteria;
 import org.apache.ojb.broker.util.collections.ManageableArrayList;
 import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.orm.ObjectRetrievalFailureException;
 import org.springframework.orm.ojb.PersistenceBrokerCallback;
 
 /**
@@ -59,9 +67,14 @@
 public class JetspeedSecurityPersistenceManager
     extends InitablePersistenceBrokerDaoSupport
     implements Serializable,JetspeedPrincipalAccessManager,
-                JetspeedPrincipalStorageManager, UserPasswordCredentialStorageManager, UserPasswordCredentialAccessManager,
-                JetspeedPrincipalAssociationStorageManager, JetspeedPermissionAccessManager, JetspeedPermissionStorageManager
+                JetspeedPrincipalStorageManager, JetspeedDomainPrincipalAccessManager, UserPasswordCredentialStorageManager, UserPasswordCredentialAccessManager,
+                JetspeedPrincipalAssociationStorageManager, JetspeedPermissionAccessManager, JetspeedPermissionStorageManager, 
+                SecurityDomainStorageManager, SecurityDomainAccessManager
 {
+    private static final long serialVersionUID = -2689340557699526023L;
+	
+    private Long defaultSecurityDomainId;
+    
     private static class ManagedListByQueryCallback implements PersistenceBrokerCallback
     {
         private Query query;
@@ -86,69 +99,99 @@
     {
         if (principal.getId() == null)
         {
-            return principalExists(principal.getName(), principal.getType());
+            if (principal.getDomainId() != null){
+                return principalExists(principal.getName(), principal.getType(), principal.getDomainId());    
+            } else {
+                return principalExists(principal.getName(), principal.getType());
+            }
+            
         }
         Criteria criteria = new Criteria();
         criteria.addEqualTo("id", principal.getId());
         criteria.addEqualTo("type", principal.getType().getName());
+        criteria.addEqualTo("domainId", principal.getDomainId());
         Query query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class,criteria);
         return getPersistenceBrokerTemplate().getCount(query) == 1;
     }
 
+	public List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){
+	    return getAssociatedFrom(principalFromName, from, to, associationName, getDefaultSecurityDomainId());
+	}
     //
     // JetspeedPrincipalAccessManager interface implementation
     //
     @SuppressWarnings("unchecked") 
-    public List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName)
+    public List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("associationsTo.associationName", associationName);
         criteria.addEqualTo("associationsTo.from.name", principalFromName);
         criteria.addEqualTo("type", to.getName());
+        criteria.addEqualTo("associationsTo.to.domainId", securityDomain);
         Query query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class, criteria);
         return (List<JetspeedPrincipal>) getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
     }
 
+    public List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){
+        return getAssociatedTo(principalToName, from, to, associationName, getDefaultSecurityDomainId());
+    }
+
     @SuppressWarnings("unchecked") 
-    public List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName)
+    public List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("associationsFrom.associationName", associationName);
         criteria.addEqualTo("associationsFrom.to.name", principalToName);
         criteria.addEqualTo("type", from.getName());
+        criteria.addEqualTo("associationsFrom.from.domainId", securityDomain);
         Query query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class, criteria);
         return (List<JetspeedPrincipal>) getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
     }
 
+    public List<JetspeedPrincipal> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){
+        return getAssociatedFrom(principalFromId, from, to, associationName, getDefaultSecurityDomainId());
+    }
+
     @SuppressWarnings("unchecked") 
-    public List<JetspeedPrincipal> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName)
+    public List<JetspeedPrincipal> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("associationsTo.associationName", associationName);
         criteria.addEqualTo("associationsTo.from.id", principalFromId);
         criteria.addEqualTo("type", to.getName());
+        criteria.addEqualTo("associationsTo.to.domainId", securityDomain);
         Query query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class, criteria);
         return (List<JetspeedPrincipal>) getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
     }
 
+    public List<JetspeedPrincipal> getAssociatedTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){
+        return getAssociatedTo(principalToId, from, to, associationName, getDefaultSecurityDomainId());
+    }
+
     @SuppressWarnings("unchecked") 
-    public List<JetspeedPrincipal> getAssociatedTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName)
+    public List<JetspeedPrincipal> getAssociatedTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("associationsFrom.associationName", associationName);
         criteria.addEqualTo("associationsFrom.to.id", principalToId);
         criteria.addEqualTo("type", from.getName());
+        criteria.addEqualTo("associationsFrom.from.domainId", securityDomain);
         Query query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class, criteria);
         return (List<JetspeedPrincipal>) getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
     }
 
+    public List<String> getAssociatedNamesFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){
+        return getAssociatedNamesFrom(principalFromName, from, to, associationName, getDefaultSecurityDomainId());
+    }
+
     @SuppressWarnings("unchecked") 
-    public List<String> getAssociatedNamesFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName)
+    public List<String> getAssociatedNamesFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("associationsTo.associationName", associationName);
         criteria.addEqualTo("associationsTo.from.name", principalFromName);
         criteria.addEqualTo("type", to.getName());
+        criteria.addEqualTo("associationsTo.to.domainId", securityDomain);
         ReportQueryByCriteria query = QueryFactory.newReportQuery(PersistentJetspeedPrincipal.class, criteria);
         query.setAttributes(new String[]{"name"});
         ArrayList<String> names = new ArrayList<String>();
@@ -159,13 +202,18 @@
         return names;
     }
 
+    public List<String> getAssociatedNamesFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){
+        return getAssociatedNamesFrom(principalFromId, from, to, associationName, getDefaultSecurityDomainId());
+    }
+
     @SuppressWarnings("unchecked") 
-    public List<String> getAssociatedNamesFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName)
+    public List<String> getAssociatedNamesFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("associationsTo.associationName", associationName);
         criteria.addEqualTo("associationsTo.from.id", principalFromId);
         criteria.addEqualTo("type", to.getName());
+        criteria.addEqualTo("associationsTo.to.domainId", securityDomain);
         ReportQueryByCriteria query = QueryFactory.newReportQuery(PersistentJetspeedPrincipal.class, criteria);
         query.setAttributes(new String[]{"name"});
         ArrayList<String> names = new ArrayList<String>();
@@ -176,13 +224,18 @@
         return names;
     }
 
+    public List<String> getAssociatedNamesTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){
+        return getAssociatedNamesTo(principalToName, from, to, associationName, getDefaultSecurityDomainId());
+    }
+
     @SuppressWarnings("unchecked") 
-    public List<String> getAssociatedNamesTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName)
+    public List<String> getAssociatedNamesTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("associationsFrom.associationName", associationName);
         criteria.addEqualTo("associationsFrom.to.name", principalToName);
         criteria.addEqualTo("type", from.getName());
+        criteria.addEqualTo("associationsFrom.from.domainId", securityDomain);
         ReportQueryByCriteria query = QueryFactory.newReportQuery(PersistentJetspeedPrincipal.class, criteria);
         query.setAttributes(new String[]{"name"});
         ArrayList<String> names = new ArrayList<String>();
@@ -193,13 +246,18 @@
         return names;
     }
 
+    public List<String> getAssociatedNamesTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){
+        return getAssociatedNamesTo(principalToId, from, to, associationName, getDefaultSecurityDomainId());
+    }
+
     @SuppressWarnings("unchecked") 
-    public List<String> getAssociatedNamesTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName)
+    public List<String> getAssociatedNamesTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("associationsFrom.associationName", associationName);
         criteria.addEqualTo("associationsFrom.to.id", principalToId);
         criteria.addEqualTo("type", from.getName());
+        criteria.addEqualTo("associationsFrom.from.domainId", securityDomain);
         ReportQueryByCriteria query = QueryFactory.newReportQuery(PersistentJetspeedPrincipal.class, criteria);
         query.setAttributes(new String[]{"name"});
         ArrayList<String> names = new ArrayList<String>();
@@ -217,22 +275,34 @@
 
     public JetspeedPrincipal getPrincipal(String principalName, JetspeedPrincipalType type)
     {
+        return getPrincipal(principalName, type, getDefaultSecurityDomainId());
+    }
+    
+    public JetspeedPrincipal getPrincipal(String principalName, JetspeedPrincipalType type, Long securityDomain)
+    {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("name", principalName);
         criteria.addEqualTo("type", type.getName());
+        criteria.addEqualTo("domainId", securityDomain);
         Query query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class,criteria);
         return (JetspeedPrincipal)getPersistenceBrokerTemplate().getObjectByQuery(query);
     }
 
-    @SuppressWarnings("unchecked") 
     public List<String> getPrincipalNames(String nameFilter, JetspeedPrincipalType type)
     {
+        return getPrincipalNames(nameFilter, type, getDefaultSecurityDomainId());
+    }
+
+    @SuppressWarnings("unchecked") 
+    public List<String> getPrincipalNames(String nameFilter, JetspeedPrincipalType type, Long securityDomain)
+    {
         Criteria criteria = new Criteria();
         if (nameFilter != null && nameFilter.length() > 0)
         {
             criteria.addLike("name", nameFilter+"%");
         }
         criteria.addEqualTo("type", type.getName());
+        criteria.addEqualTo("domainId", securityDomain);
         ReportQueryByCriteria query = QueryFactory.newReportQuery(PersistentJetspeedPrincipal.class,criteria);
         query.setAttributes(new String[]{"name"});
         ArrayList<String> names = new ArrayList<String>();
@@ -243,35 +313,53 @@
         return names;
     }
 
-    @SuppressWarnings("unchecked") 
     public List<JetspeedPrincipal> getPrincipals(String nameFilter, JetspeedPrincipalType type)
     {
+        return getPrincipals(nameFilter, type, getDefaultSecurityDomainId());
+    }
+    
+    @SuppressWarnings("unchecked") 
+    public List<JetspeedPrincipal> getPrincipals(String nameFilter, JetspeedPrincipalType type, Long securityDomain)
+    {
         Criteria criteria = new Criteria();
         if (nameFilter != null && nameFilter.length() > 0)
         {
             criteria.addLike("name", nameFilter+"%");
         }
         criteria.addEqualTo("type", type.getName());
+        criteria.addEqualTo("domainId", securityDomain);
         Query query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class,criteria);
         return (List<JetspeedPrincipal>) getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
     }
 
-    @SuppressWarnings("unchecked") 
     public List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String attributeValue, JetspeedPrincipalType type)
     {
+        return getPrincipalsByAttribute(attributeName, attributeValue, type, getDefaultSecurityDomainId());
+    }
+    
+    @SuppressWarnings("unchecked") 
+    public List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String attributeValue, JetspeedPrincipalType type, Long securityDomain)
+    {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("attributes.name", attributeName);
         criteria.addEqualTo("attributes.value", attributeValue);
         criteria.addEqualTo("type", type.getName());
+        criteria.addEqualTo("domainId", securityDomain);
         Query query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class,criteria);
         return (List<JetspeedPrincipal>) getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
     }
 
     public boolean principalExists(String principalName, JetspeedPrincipalType type)
     {
+        return principalExists(principalName, type, getDefaultSecurityDomainId());
+    }
+    
+    public boolean principalExists(String principalName, JetspeedPrincipalType type, Long securityDomain)
+    {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("name", principalName);
         criteria.addEqualTo("type", type.getName());
+        criteria.addEqualTo("domainId", securityDomain);
         Query query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class,criteria);
         return getPersistenceBrokerTemplate().getCount(query) == 1;
     }
@@ -282,6 +370,9 @@
     public void addPrincipal(JetspeedPrincipal principal, Set<JetspeedPrincipalAssociationReference> associations)
         throws SecurityException
     {
+        if (principal.getDomainId() == null && principal instanceof TransientJetspeedPrincipal){
+            ((TransientJetspeedPrincipal)principal).setDomainId(getDefaultSecurityDomainId());
+        }
         if (principalExists(principal))
         {
             throw new SecurityException(SecurityException.PRINCIPAL_ALREADY_EXISTS.createScoped(principal.getType().getName(), principal.getName()));
@@ -391,6 +482,9 @@
         getPersistenceBrokerTemplate().store(credential);
     }
 
+    public PasswordCredential getPasswordCredential(String userName){
+        return getPasswordCredential(userName,getDefaultSecurityDomainId());
+    }
     //
     // UserPasswordCredentialAccessManager interface implementation
     //
@@ -405,12 +499,13 @@
      * The user reference can be materialized by calling {@link #loadPasswordCredentialUser(PasswordCredential)}.
      * </p>
      */
-    public PasswordCredential getPasswordCredential(String userName)
+    public PasswordCredential getPasswordCredential(String userName, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("user.name", userName);
         criteria.addEqualTo("user.enabled",true);
         criteria.addEqualTo("type", PasswordCredential.TYPE_CURRENT);
+        criteria.addEqualTo("domainId", securityDomain);
         Query query = QueryFactory.newQuery(PasswordCredentialImpl.class,criteria);
         PasswordCredentialImpl pwc = (PasswordCredentialImpl)getPersistenceBrokerTemplate().getObjectByQuery(query);
         if (pwc != null)
@@ -438,8 +533,12 @@
         }
     }
 
+    public List<PasswordCredential> getHistoricPasswordCredentials(User user){
+        return getHistoricPasswordCredentials(user,getDefaultSecurityDomainId());
+    }
+    
     @SuppressWarnings("unchecked") 
-    public List<PasswordCredential> getHistoricPasswordCredentials(User user)
+    public List<PasswordCredential> getHistoricPasswordCredentials(User user, Long securityDomain)
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("principalId", user.getId());
@@ -580,6 +679,7 @@
         {
             criteria.addEqualTo("type", principalType);
         }
+        criteria.addEqualTo("domainId", getDefaultSecurityDomainId());
         QueryByCriteria query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class, criteria);
         query.addOrderByAscending("type");
         query.addOrderByAscending("name");
@@ -749,6 +849,7 @@
         {
             criteria.addEqualTo("type", principalType);
         }
+        criteria.addEqualTo("domainId", getDefaultSecurityDomainId());
         QueryByCriteria query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class, criteria);
         List<JetspeedPrincipal> currentList = (List<JetspeedPrincipal>) getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
         List<JetspeedPrincipal> targetList = new ArrayList<JetspeedPrincipal>(principals);
@@ -794,6 +895,7 @@
         {
             criteria.addEqualTo("principal.type", principal.getType());
             criteria.addEqualTo("principal.name", principal.getName());
+            criteria.addEqualTo("domainId", getDefaultSecurityDomainId());
         }
         else
         {
@@ -830,6 +932,7 @@
         {
             criteria.addEqualTo("principal.type", principal.getType());
             criteria.addEqualTo("principal.name", principal.getName());
+            criteria.addEqualTo("domainId", getDefaultSecurityDomainId());
         }
         else
         {
@@ -849,4 +952,103 @@
             throw new SecurityException(msg, pbe);
         }
     }
+
+    protected boolean domainExists(SecurityDomain domain){        
+        return getDomainByName(domain.getName()) != null;
+    }
+    
+    public void addDomain(SecurityDomain domain) throws SecurityException 
+    {
+        if (domainExists(domain))
+        {
+            throw new SecurityException(SecurityException.SECURITY_DOMAIN_EXISTS.create(domain.getName()));
+        }
+        try
+        {
+            getPersistenceBrokerTemplate().store(domain);
+        }
+        catch (Exception pbe)
+        {
+            KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager",
+                                                                   "addDomain",
+                                                                   pbe.getMessage());
+            logger.error(msg, pbe);
+            throw new SecurityException(msg, pbe);            
+        }
+    }
+
+    public SecurityDomain getDomain(Long domainId)
+    {
+        try{
+            return (SecurityDomain) getPersistenceBrokerTemplate().getObjectById(SecurityDomainImpl.class, domainId);    
+        } catch (ObjectRetrievalFailureException ore){
+            return null;
+        }
+        
+    }
+
+    protected Long getDefaultSecurityDomainId() {
+        if (defaultSecurityDomainId == null){
+            SecurityDomain d = getDomainByName(SecurityDomain.DEFAULT_NAME);
+            if (d == null){
+                throw new RuntimeException("The default security domain could not be found!");
+            }
+            defaultSecurityDomainId=d.getDomainId();
+        }   
+        return defaultSecurityDomainId;
+    }
+    
+    public SecurityDomain getDomainByName(String domainName)
+    {
+    	Criteria criteria = new Criteria();
+        criteria.addEqualTo("name", domainName);
+        Query query = QueryFactory.newQuery(SecurityDomainImpl.class,criteria);
+        return (SecurityDomain) getPersistenceBrokerTemplate().getObjectByQuery(query);    
+    }
+
+    @SuppressWarnings("unchecked") 
+    public Collection<SecurityDomain> getAllDomains()
+    {
+        QueryByCriteria query = QueryFactory.newQuery(SecurityDomainImpl.class, new Criteria());
+        query.addOrderByAscending("name");
+        return (List<SecurityDomain>)getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
+    }
+    
+    public void removeDomain(SecurityDomain domain) throws SecurityException
+    {
+        if (!domainExists(domain))
+        {
+            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.create(domain.getName()));
+        }
+        try
+        {
+            getPersistenceBrokerTemplate().delete(domain);
+        }
+        catch (Exception pbe)
+        {
+            if (pbe instanceof DataIntegrityViolationException)
+            {
+                logger.error(pbe.getMessage(), pbe);
+                throw new SecurityException(SecurityException.SECURITY_DOMAIN_NOT_REMOVABLE.create(domain.getName()));
+            }
+            
+            KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager",
+                                                                   "removeDomain",
+                                                                   pbe.getMessage());
+            logger.error(msg, pbe);
+            throw new SecurityException(msg, pbe);            
+        }
+        
+    }
+    
+    @SuppressWarnings("unchecked") 
+    public Collection<SecurityDomain> getDomainsOwnedBy(Long ownerDomainId)
+    {
+        Criteria criteria = new Criteria();
+        criteria.addEqualTo("ownerDomainId", ownerDomainId);
+        QueryByCriteria query = QueryFactory.newQuery(SecurityDomainImpl.class, criteria);
+        query.addOrderByAscending("name");
+        return (List<SecurityDomain>)getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
+    }
+    
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java Wed Jan  7 08:33:26 2009
@@ -17,6 +17,8 @@
 package org.apache.jetspeed.serializer;
 
 import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -41,9 +43,13 @@
 import org.apache.jetspeed.security.RoleManager;
 import org.apache.jetspeed.security.SecurityAttribute;
 import org.apache.jetspeed.security.SecurityAttributes;
+import org.apache.jetspeed.security.SecurityDomain;
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
+import org.apache.jetspeed.security.impl.SecurityDomainImpl;
+import org.apache.jetspeed.security.spi.SecurityDomainAccessManager;
+import org.apache.jetspeed.security.spi.SecurityDomainStorageManager;
 import org.apache.jetspeed.security.spi.impl.SynchronizationStateAccess;
 import org.apache.jetspeed.serializer.objects.JSGroup;
 import org.apache.jetspeed.serializer.objects.JSNVPElement;
@@ -54,6 +60,7 @@
 import org.apache.jetspeed.serializer.objects.JSPrincipalAssociation;
 import org.apache.jetspeed.serializer.objects.JSRole;
 import org.apache.jetspeed.serializer.objects.JSSecurityAttributes;
+import org.apache.jetspeed.serializer.objects.JSSecurityDomain;
 import org.apache.jetspeed.serializer.objects.JSSnapshot;
 import org.apache.jetspeed.serializer.objects.JSUser;
 import org.apache.jetspeed.serializer.objects.JSUserAttributes;
@@ -61,6 +68,8 @@
 import org.apache.jetspeed.serializer.objects.JSUserRoles;
 import org.apache.jetspeed.serializer.objects.JSUserUsers;
 
+import edu.emory.mathcs.backport.java.util.Collections;
+
 /**
  * JetspeedSecuritySerializer - Security component serializer
  *
@@ -131,15 +140,17 @@
         }
     }
 
+    protected SecurityDomainStorageManager domainStorageManager; 
+    protected SecurityDomainAccessManager domainAccessManager;
     protected JetspeedPrincipalManagerProvider principalManagerProvider;
     protected GroupManager groupManager;
     protected RoleManager roleManager;
     protected UserManager userManager;
     protected CredentialPasswordEncoder cpe;
     protected PermissionManager pm;
-
+    
     public JetspeedSecuritySerializer(JetspeedPrincipalManagerProvider principalManagerProvider, GroupManager groupManager, RoleManager roleManager, UserManager userManager,
-            CredentialPasswordEncoder cpe, PermissionManager pm)
+            CredentialPasswordEncoder cpe, PermissionManager pm, SecurityDomainStorageManager sdsm, SecurityDomainAccessManager sdam )
     {
         this.principalManagerProvider = principalManagerProvider;
         this.groupManager = groupManager;
@@ -147,6 +158,8 @@
         this.userManager = userManager;
         this.cpe = cpe;
         this.pm = pm;
+        this.domainAccessManager=sdam;
+        this.domainStorageManager=sdsm;
     }
 
     protected void processExport(JSSnapshot snapshot, Map settings, Log log) throws SerializerException
@@ -182,9 +195,11 @@
             {
                 SynchronizationStateAccess.setSynchronizing(Boolean.TRUE);
                 ImportRefs refs = new ImportRefs();
+                
+                recreateSecurityDomains(refs, snapshot, settings, log);
                 recreateJetspeedPrincipals(refs, snapshot, settings, log);
                 recreateJetspeedPrincipalAssociations(refs, snapshot, settings, log);
-                
+
                 if (isSettingSet(settings, JetspeedSerializer.KEY_PROCESS_PERMISSIONS))
                 {
                     log.info("creating permissions");
@@ -238,6 +253,107 @@
         }
     }
 
+    protected SecurityDomain checkDomainExistsOtherwiseCreate(String domainName) throws SecurityException{
+        SecurityDomain domain = domainAccessManager.getDomainByName(domainName);
+        if (domain == null){
+            SecurityDomainImpl newDomain = new SecurityDomainImpl();
+            newDomain.setName(domainName);
+            newDomain.setEnabled(true);
+            newDomain.setRemote(false);
+            
+            domainStorageManager.addDomain(newDomain);
+            domain = domainAccessManager.getDomainByName(domainName);
+        }
+        return domain;
+    }
+    
+    private void recreateSecurityDomains(ImportRefs refs, JSSnapshot snapshot, Map settings, Log log) throws SerializerException {
+        log.debug("recreateSecurityDomains");
+    
+     // create system and default domain. Adding them to the seed is not necessary!           
+        Long systemDomainId=null;            
+        Long defaultDomainId=null;
+        try{
+            defaultDomainId=checkDomainExistsOtherwiseCreate(SecurityDomain.DEFAULT_NAME).getDomainId();
+            systemDomainId=checkDomainExistsOtherwiseCreate(SecurityDomain.SYSTEM_NAME).getDomainId();
+        } catch (Exception e){
+            throw new SerializerException(SerializerException.CREATE_OBJECT_FAILED.create(new String[] { "SecurityDomains",
+                    "Could not create default and / or system domains!\n"+e.getMessage() }), e);
+        }
+        
+        if (snapshot.getSecurityDomains() != null && snapshot.getSecurityDomains().size() > 0){
+            
+            // sort the domains according to whether they have an owner domain
+            // domains without owner domains ( = base or parent domains) should be created first
+            ArrayList<JSSecurityDomain> sortedDomains = new ArrayList<JSSecurityDomain>(snapshot.getSecurityDomains());
+            
+            Collections.sort(sortedDomains, new Comparator<JSSecurityDomain>(){
+                public int compare(JSSecurityDomain o1, JSSecurityDomain o2)
+                {
+                    boolean o1HasOwner = o1.getOwnerDomain() != null;
+                    boolean o2HasOwner = o2.getOwnerDomain() != null;
+                    
+                    if (o1HasOwner==o2HasOwner){
+                        return 0;
+                    } else if (o1HasOwner){
+                        return 1;
+                    } else {
+                        return -1;
+                    }
+                }
+            });
+            
+            
+            
+            // create other domains
+            for (JSSecurityDomain jsDomain : sortedDomains){      
+                // do some checks first
+                
+                // if domain is the system domain or the default domain, skip creation (they exist already)
+                if (jsDomain.getName().equals(SecurityDomain.SYSTEM_NAME) || jsDomain.getName().equals(SecurityDomain.DEFAULT_NAME)){
+                    break;
+                }
+                if (jsDomain.getName().length() == 0){
+                    throw new SerializerException(SerializerException.CREATE_OBJECT_FAILED.create(new String[] { "SecurityDomain",
+                            "Name of Security Domain must not be empty!" }));
+                }
+                Long ownerDomainId = null;
+                if (jsDomain.getOwnerDomain() != null){                    
+                    if (jsDomain.getOwnerDomain().equals(SecurityDomain.SYSTEM_NAME)){
+                        ownerDomainId=defaultDomainId;
+                    } else if (jsDomain.getOwnerDomain().equals(SecurityDomain.SYSTEM_NAME)) {
+                        ownerDomainId=systemDomainId;
+                    } else {
+                        SecurityDomain ownerDomain = domainAccessManager.getDomainByName(jsDomain.getOwnerDomain());
+                        if (ownerDomain == null){
+                            throw new SerializerException(SerializerException.CREATE_OBJECT_FAILED.create(new String[] { "SecurityDomain","Could not find owner domain with name "+jsDomain.getOwnerDomain()+"for domain with name "+jsDomain.getName()}));
+                        }
+                        ownerDomainId=ownerDomain.getDomainId();
+                    }
+                } else {
+                    // remote domains always need an owner domain. Set the default domain if owner domain is not specified
+                    if (jsDomain.isRemote()){
+                        ownerDomainId=defaultDomainId;
+                    }
+                }
+                
+                SecurityDomainImpl newDomain = new SecurityDomainImpl();
+                newDomain.setName(jsDomain.getName());
+                newDomain.setOwnerDomainId(ownerDomainId);
+                newDomain.setRemote(jsDomain.isRemote());
+                newDomain.setEnabled(jsDomain.isEnabled());
+                try{
+                    domainStorageManager.addDomain(newDomain);    
+                  } catch (Exception e){
+                  throw new SerializerException(SerializerException.CREATE_OBJECT_FAILED.create(new String[] { "SecurityDomain",
+                          e.getMessage() }), e);
+              }
+                
+            }
+            
+        }
+    }
+    
     /**
      * import the groups, roles and finally the users to the current environment
      * 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/stubs/StubJetspeedPrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/stubs/StubJetspeedPrincipal.java?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/stubs/StubJetspeedPrincipal.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/java/org/apache/jetspeed/security/stubs/StubJetspeedPrincipal.java Wed Jan  7 08:33:26 2009
@@ -150,4 +150,10 @@
 
     }
 
+    public Long getDomainId()
+    {
+        // TODO Auto-generated method stub
+        return 1L;
+    }
+
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java Wed Jan  7 08:33:26 2009
@@ -25,6 +25,10 @@
 import java.util.List;
 import java.util.Map;
 
+import javolution.xml.XMLBinding;
+import javolution.xml.XMLObjectReader;
+import javolution.xml.XMLObjectWriter;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.serializer.objects.JSApplication;
@@ -64,6 +68,8 @@
 import org.apache.jetspeed.serializer.objects.JSRuleCriterion;
 import org.apache.jetspeed.serializer.objects.JSRuleCriterions;
 import org.apache.jetspeed.serializer.objects.JSSecurityAttributes;
+import org.apache.jetspeed.serializer.objects.JSSecurityDomain;
+import org.apache.jetspeed.serializer.objects.JSSecurityDomains;
 import org.apache.jetspeed.serializer.objects.JSSnapshot;
 import org.apache.jetspeed.serializer.objects.JSUser;
 import org.apache.jetspeed.serializer.objects.JSUserAttributes;
@@ -72,10 +78,6 @@
 import org.apache.jetspeed.serializer.objects.JSUserUsers;
 import org.apache.jetspeed.serializer.objects.JSUsers;
 
-import javolution.xml.XMLBinding;
-import javolution.xml.XMLObjectReader;
-import javolution.xml.XMLObjectWriter;
-
 /**
  * Main JetspeedSerializer implementation delegating the real serializing to JetspeedComponentSerializer instances
  * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
@@ -227,6 +229,8 @@
         binding.setAlias(JSEntities.class, "Entities");
         binding.setAlias(JSEntityPreference.class, "Principal");
         binding.setAlias(JSEntityPreferences.class, "Settings");
+        binding.setAlias(JSSecurityDomains.class, "SecurityDomains");
+        binding.setAlias(JSSecurityDomain.class, "SecurityDomain");
 
         binding.setAlias(String.class, "String");
         binding.setAlias(Integer.class, "int");

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomain.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomain.java?rev=732386&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomain.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomain.java Wed Jan  7 08:33:26 2009
@@ -0,0 +1,136 @@
+/* 
+ * 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.serializer.objects;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
+
+/**
+ * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
+ */
+public class JSSecurityDomain
+{
+
+ // private int refID;
+   
+    String name;
+    String ownerDomain;
+    boolean remote;
+    boolean enabled;
+    
+    public JSSecurityDomain()
+    {
+        // refID = id;
+    }
+
+    /***************************************************************************
+     * SERIALIZER
+     */
+    private static final XMLFormat XML = new XMLFormat(JSSecurityDomain.class)
+    {
+    public void write(Object o, OutputElement xml) throws XMLStreamException
+    {
+
+        try
+        {
+            JSSecurityDomain domain = (JSSecurityDomain) o;
+            xml.setAttribute("name",domain.getName());
+            xml.setAttribute("ownerDomain",domain.getOwnerDomain());
+            xml.setAttribute("remote",domain.isRemote());
+            xml.setAttribute("enabled",domain.isEnabled());            
+        } catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    public void read(InputElement xml, Object o)
+    {
+        try
+        {
+            JSSecurityDomain domain = (JSSecurityDomain) o;
+            domain.setName(xml.getAttribute("name").toString());
+            domain.setOwnerDomain(xml.getAttribute("ownerDomain",(String)null));
+            domain.setRemote(xml.getAttribute("remote",false));
+            domain.setEnabled(xml.getAttribute("enabled",true));
+        } catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+    };
+    /**
+     * @return Returns the name.
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
+     * @param name
+     *            The name to set.
+     */
+    public void setNameId(String name)
+    {
+        this.name = name;
+    }
+
+    public boolean isRemote()
+    {
+        return remote;
+    }
+    
+    public void setRemote(boolean remote)
+    {
+        this.remote = remote;
+    }
+
+    
+    public boolean isEnabled()
+    {
+        return enabled;
+    }
+
+    
+    public void setEnabled(boolean enabled)
+    {
+        this.enabled = enabled;
+    }
+
+    
+    public String getOwnerDomain()
+    {
+        return ownerDomain;
+    }
+
+    
+    public void setOwnerDomain(String ownerDomain)
+    {
+        this.ownerDomain = ownerDomain;
+    }
+    
+    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomain.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomains.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomains.java?rev=732386&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomains.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomains.java Wed Jan  7 08:33:26 2009
@@ -0,0 +1,30 @@
+/* 
+ * 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.serializer.objects;
+
+import java.util.ArrayList;
+
+
+/**
+ * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
+ */
+public class JSSecurityDomains extends ArrayList<JSSecurityDomain>
+{
+
+    private static final long serialVersionUID = 8502780843122685920L;
+  
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomains.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSecurityDomains.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java Wed Jan  7 08:33:26 2009
@@ -73,6 +73,9 @@
     private String defaultRule;
 
     private JSApplications applications;
+    
+    private JSSecurityDomains securityDomains;
+    
 
     /**
      * check the software version and subvversion against the saved
@@ -104,6 +107,7 @@
         permissions = new JSPermissions();
         rules = new JSProfilingRules();
         applications = new JSApplications();
+        securityDomains=new JSSecurityDomains();
     }
 
     public JSSnapshot(String name)
@@ -486,6 +490,16 @@
         this.applications = applications;
     }
 
+    public JSSecurityDomains getSecurityDomains()
+    {
+        return securityDomains;
+    }
+    
+    public void setSecurityDomains(JSSecurityDomains securityDomains)
+    {
+        this.securityDomains = securityDomains;
+    }
+
 
     /***************************************************************************
      * SERIALIZER
@@ -579,6 +593,10 @@
                 {
                     xml.add(g.getApplications());
                 }
+                if ( !g.getSecurityDomains().isEmpty() )
+                {
+                    xml.add(g.getSecurityDomains());
+                }
             }
             catch (Exception e)
             {
@@ -665,6 +683,8 @@
                         g.rules = (JSProfilingRules) o1;
                     else if (o1 instanceof JSApplications)
                         g.applications = (JSApplications) o1;
+                    else if (o1 instanceof JSSecurityDomains)
+                        g.securityDomains = (JSSecurityDomains) o1;
                 }
             }
             catch (Exception e)

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties Wed Jan  7 08:33:26 2009
@@ -45,6 +45,8 @@
 org.apache.jetspeed.security.SecurityException.UNEXPECTED = Unexpected security error at {0} from {1}: {2}
 org.apache.jetspeed.security.SecurityException.INVALID_UID = The uid cannot contain any regular expression meta-characters or be null or be empty.
 org.apache.jetspeed.security.SecurityException.INVALID_DN = The dn cannot be null or empty.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_EXISTS = The security domain {0} already exists.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_DOES_NOT_EXIST = The security domain {0} does not exist.
 
 #### deprecated resource strings: see SecurityException #####
 org.apache.jetspeed.security.SecurityException.USER_ALREADY_EXISTS = The user {0} already exists.
@@ -109,4 +111,4 @@
 org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_IS_READ_ONLY = The group attribute {0} is read only.
 org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_IS_REQUIRED = The group attribute {0} is required.
 org.apache.jetspeed.security.SecurityException.group.ATTRIBUTES_ARE_READ_ONLY = The group attributes are read only.
-org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_NOT_EXTENDABLE = Adding new group attributes is not supported.
+org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_NOT_EXTENDABLE = Adding new group attributes is not supported.
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties Wed Jan  7 08:33:26 2009
@@ -44,6 +44,8 @@
 org.apache.jetspeed.security.SecurityException.UNEXPECTED = Unexpected security error at {0} from {1}: {2}
 org.apache.jetspeed.security.SecurityException.INVALID_UID = The uid cannot contain any regular expression meta-characters or be null or be empty.
 org.apache.jetspeed.security.SecurityException.INVALID_DN = The dn cannot be null or empty.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_EXISTS = The security domain {0} already exists.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_DOES_NOT_EXIST = The security domain {0} does not exist.
 
 #### deprecated resource strings: see SecurityException #####
 org.apache.jetspeed.security.SecurityException.USER_ALREADY_EXISTS = The user {0} already exists.

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties Wed Jan  7 08:33:26 2009
@@ -44,6 +44,8 @@
 org.apache.jetspeed.security.SecurityException.UNEXPECTED = {1} \u304b\u3089 {0} \u3067\u4e88\u671f\u3057\u306a\u3044\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30a8\u30e9\u30fc: {2}
 org.apache.jetspeed.security.SecurityException.INVALID_UID = UID\u306f\u6b63\u898f\u8868\u73fe\u306e\u30e1\u30bf\u30ad\u30e3\u30e9\u30af\u30bf\u3001null\u3001\u307e\u305f\u306f\u7a7a\u306b\u3067\u304d\u307e\u305b\u3093\u3002
 org.apache.jetspeed.security.SecurityException.INVALID_DN = DN\u306f null \u307e\u305f\u306f\u7a7a\u306b\u3067\u304d\u307e\u305b\u3093\u3002
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_EXISTS = The security domain {0} already exists.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_DOES_NOT_EXIST = The security domain {0} does not exist.
 
 #### deprecated resource strings: see SecurityException #####
 org.apache.jetspeed.security.SecurityException.USER_ALREADY_EXISTS = \u30e6\u30fc\u30b6\u30fc {0} \u304c\u5b58\u5728\u3057\u307e\u3059\u3002

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties Wed Jan  7 08:33:26 2009
@@ -44,6 +44,8 @@
 org.apache.jetspeed.security.SecurityException.UNEXPECTED = \uc608\uae30\uce58 \uc54a\uc740 \ubcf4\uc548 \uc624\ub958\uc785\ub2c8\ub2e4: at {0} from {1}: {2}
 org.apache.jetspeed.security.SecurityException.INVALID_UID = UID\ub294 \uc815\uaddc\uc2dd \ud45c\ud604\uc774\ub098 \uba54\ud0c0 \ubb38\uc790\uac00 \ud3ec\ud568\ub420 \uc218 \uc5c6\uc73c\uba70, \ub110 \uac12\uc774\uac70\ub098 \ube48 \uac12\uc774\uba74 \uc548\ub429\ub2c8\ub2e4.
 org.apache.jetspeed.security.SecurityException.INVALID_DN = DN\uc740 \ub110 \uac12\uc774\uac70\ub098 \ube48 \uac12\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_EXISTS = The security domain {0} already exists.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_DOES_NOT_EXIST = The security domain {0} does not exist.
 
 #### deprecated resource strings: see SecurityException #####
 org.apache.jetspeed.security.SecurityException.USER_ALREADY_EXISTS = \uc0ac\uc6a9\uc790, {0} \uc740 \uc774\ubbf8 \uc874\uc7ac\ud569\ub2c8\ub2e4.

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties Wed Jan  7 08:33:26 2009
@@ -44,6 +44,8 @@
 org.apache.jetspeed.security.SecurityException.UNEXPECTED = Onverwachte beveiligingsfout in {0} vanuit {1}: {2}
 # org.apache.jetspeed.security.SecurityException.INVALID_UID = The uid cannot contain any regular expression meta-characters or be null or be empty.
 # org.apache.jetspeed.security.SecurityException.INVALID_DN = The dn cannot be null or empty.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_EXISTS = Het beveilingingsdomein {0} bestaat al.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_DOES_NOT_EXIST = Het beveilingingsdomein {0} bestaat niet.
 
 #### deprecated resource strings: see SecurityException #####
 org.apache.jetspeed.security.SecurityException.USER_ALREADY_EXISTS = De gebruiker {0} bestaat al.
@@ -94,7 +96,7 @@
 # resource strings for specific principal, group
 org.apache.jetspeed.security.SecurityException.group.PRINCIPAL_DOES_NOT_EXIST = The groep {0} bestaat niet.
 org.apache.jetspeed.security.SecurityException.group.PRINCIPAL_ALREADY_EXISTS = De groep {0} bestaat al.
-org.apache.jetspeed.security.SecurityException.group.PRINCIPAL_IS_READ_ONLY = De groep {0} mag niet gewijzigd worden.
+org.apache.jetspeed.security.SecurityException.group.PRINCIPAL_IS_READ_ONLY = De groep {0} mag nThe security domainiet gewijzigd worden.
 org.apache.jetspeed.security.SecurityException.group.PRINCIPAL_UPDATE_FAILURE = Opslaan van de groep {0} is mislukt.
 org.apache.jetspeed.security.SecurityException.group.PRINCIPAL_NOT_REMOVABLE = De groep {0} mag niet worden verwijderd.
 org.apache.jetspeed.security.SecurityException.group.DEPENDENT_PRINCIPAL_EXISTS = De groep {0} heeft een of meer verplichte {1} {2} koppelingen.
@@ -108,4 +110,4 @@
 org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_IS_READ_ONLY = Het groepsattribuut {0} mag niet gewijzigd worden.
 org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_IS_REQUIRED = Het groepsattribuut {0} is verplicht.
 org.apache.jetspeed.security.SecurityException.group.ATTRIBUTES_ARE_READ_ONLY = De groepsattributen mogen niet gewijzigd worden.
-org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_NOT_EXTENDABLE = Toevoegen van nieuwe groepsattributen is niet mogelijk.
+org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_NOT_EXTENDABLE = Toevoegen van nieuwe groepsattributen is niet mogelijk.
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties Wed Jan  7 08:33:26 2009
@@ -44,6 +44,8 @@
 org.apache.jetspeed.security.SecurityException.UNEXPECTED = \u041d\u0435\u043e\u0447\u0456\u043a\u0443\u0432\u0430\u043d\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430 \u0431\u0435\u0437\u043f\u0435\u043a\u0438 \u043d\u0430 {0} \u0437 {1}: {2}
 org.apache.jetspeed.security.SecurityException.INVALID_UID = uid \u043d\u0435 \u043c\u043e\u0436\u0435 \u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u043c\u0435\u0442\u0430\u0441\u0438\u043c\u0432\u043e\u043b\u0438 \u0441\u0442\u0430\u043b\u043e\u0433\u043e \u0432\u0438\u0440\u0430\u0437\u0443, \u0430 \u0442\u0430\u043a\u043e\u0436 \u0431\u0443\u0442\u0438 null \u0430\u0431\u043e \u043f\u043e\u0440\u043e\u0436\u043d\u0456\u043c.
 org.apache.jetspeed.security.SecurityException.INVALID_DN = dn \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 null \u0430\u0431\u043e \u043f\u043e\u0440\u043e\u0436\u043d\u0456\u043c.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_EXISTS = The security domain {0} already exists.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_DOES_NOT_EXIST = The security domain {0} does not exist.
 
 #### deprecated resource strings: see SecurityException #####
 org.apache.jetspeed.security.SecurityException.USER_ALREADY_EXISTS = \u041a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447 {0} \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0456.

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties Wed Jan  7 08:33:26 2009
@@ -44,6 +44,8 @@
 org.apache.jetspeed.security.SecurityException.UNEXPECTED = \u610f\u5916\u7684\u5b89\u5168\u9519\u8bef {0} \u4ece {1}: {2}
 org.apache.jetspeed.security.SecurityException.INVALID_UID = uid\u4e0d\u80fd\u4e3a\u7a7a\u5b57\u7b26\u4e32, null\u6216\u5305\u542b\u4efb\u4f55\u6b63\u5219\u8868\u8fbe\u5f0f\u4e13\u7528\u5b57\u7b26.
 org.apache.jetspeed.security.SecurityException.INVALID_DN = dn\u4e0d\u80fd\u4e3a\u7a7a\u5b57\u7b26\u4e32\u6216\u4e3anull.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_EXISTS = The security domain {0} already exists.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_DOES_NOT_EXIST = The security domain {0} does not exist.
 
 #### deprecated resource strings: see SecurityException #####
 org.apache.jetspeed.security.SecurityException.USER_ALREADY_EXISTS = \u7528\u6237 {0} \u5df2\u5b58\u5728.
@@ -108,4 +110,4 @@
 org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_IS_READ_ONLY = The group attribute {0} is read only.
 org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_IS_REQUIRED = The group attribute {0} is required.
 org.apache.jetspeed.security.SecurityException.group.ATTRIBUTES_ARE_READ_ONLY = The group attributes are read only.
-org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_NOT_EXTENDABLE = Adding new group attributes is not supported.
+org.apache.jetspeed.security.SecurityException.group.ATTRIBUTE_NOT_EXTENDABLE = Adding new group attributes is not supported.
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties Wed Jan  7 08:33:26 2009
@@ -44,6 +44,8 @@
 org.apache.jetspeed.security.SecurityException.UNEXPECTED = \u610f\u5916\u7684\u5b89\u5168\u932f\u8aa4 {0} \u5728 {1}: {2} 
 org.apache.jetspeed.security.SecurityException.INVALID_UID = uid\u4e0d\u80fd\u70ba\u7a7a\u5b57\u4e32, null\u6216\u5305\u542b\u4efb\u4f55\u5e38\u898f\u8868\u793a\u5f0f\u8b8a\u5316\u7528\u5b57\u5143. 
 org.apache.jetspeed.security.SecurityException.INVALID_DN = dn\u4e0d\u80fd\u70ba\u7a7a\u5b57\u4e32\u6216\u662fnull. 
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_EXISTS = The security domain {0} already exists.
+org.apache.jetspeed.security.SecurityException.SECURITY_DOMAIN_DOES_NOT_EXIST = The security domain {0} does not exist.
 
 #### deprecated resource strings: see SecurityException #####
 org.apache.jetspeed.security.SecurityException.USER_ALREADY_EXISTS = \u4f7f\u7528\u8005 {0} \u5df2\u5b58\u5728. 

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipal.java?rev=732386&r1=732385&r2=732386&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipal.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/security/JetspeedPrincipal.java Wed Jan  7 08:33:26 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jetspeed.security;
 
-import java.security.Principal;
+import java.security.Principal; 
 import java.sql.Timestamp;
 import java.util.Map;
 
@@ -55,4 +55,6 @@
      * @return an unmodifiable Map<String,String> of the SecurityAttributes.INFO_CATEGORY SecurityAttributes
      */
     Map<String, String> getInfoMap();
+    
+    Long getDomainId();
 }



---------------------------------------------------------------------
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