Author: anil.saldhana(a)jboss.com
Date: 2008-08-30 07:01:55 -0400 (Sat, 30 Aug 2008)
New Revision: 45
Added:
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStoreRepository.java
Log:
JBID-21: portal reqs
Added:
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStoreRepository.java
===================================================================
---
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStoreRepository.java
(rev 0)
+++
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStoreRepository.java 2008-08-30
11:01:55 UTC (rev 45)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.identity.impl.portal;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.identity.api.store.IdentityStore;
+import org.jboss.identity.api.store.IdentityStoreRepository;
+import org.jboss.identity.model.IdentityType;
+
+/**
+ * IdentityStoreRepository for portal realm
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Aug 1, 2008
+ */
+public class PortalIdentityStoreRepository implements IdentityStoreRepository
+{
+ private Map<IdentityType,IdentityStore> storeMap =
+ new HashMap<IdentityType, IdentityStore>();
+
+ public Set<IdentityStore> getConfiguredIdentityStores()
+ {
+ return new HashSet<IdentityStore>(this.storeMap.values());
+ }
+
+ public IdentityStore getIdentityStore(IdentityType identityType)
+ {
+ return this.storeMap.get(identityType);
+ }
+
+ public Map<IdentityType, IdentityStore> getIdentityStoreMappings()
+ {
+ return Collections.unmodifiableMap(storeMap);
+ }
+
+ public void register(IdentityType identityType, IdentityStore identityStore)
+ {
+ this.storeMap.put(identityType, identityStore);
+ }
+}
\ No newline at end of file