Author: bdaw
Date: 2008-10-21 07:05:46 -0400 (Tue, 21 Oct 2008)
New Revision: 107
Removed:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/ProfileManagerImpl.java
Log:
Cleanup
Deleted:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/ProfileManagerImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/ProfileManagerImpl.java 2008-10-21
10:51:41 UTC (rev 106)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/ProfileManagerImpl.java 2008-10-21
11:05:46 UTC (rev 107)
@@ -1,111 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.identity.impl.api;
-
-import org.jboss.identity.api.IdentitySession;
-import org.jboss.identity.api.ProfileManager;
-import org.jboss.identity.api.IdentityType;
-import org.jboss.identity.exception.IdentityException;
-
-import java.util.Set;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.HashSet;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public class ProfileManagerImpl extends AbstractManager implements ProfileManager
-{
- public ProfileManagerImpl(IdentitySession session)
- {
- super(session);
- }
-
- //TODO: fix to have similar signatures in API/SPI for String[] and avoid unnesesary
iterations
-
- public Set<String> getSupportedAttributeNames(IdentityType identityType) throws
IdentityException
- {
- return getRepository().getSupportedAttributeNames(getInvocationContext(),
createIdentityObject(identityType).getIdentityType());
- }
-
- public Map<String, String[]> getAttributes(IdentityType identity) throws
IdentityException
- {
- Map<String, Set<String>> attributes =
getRepository().getAttributes(getInvocationContext(), createIdentityObject(identity));
-
- Map<String, String[]> attrs = new HashMap<String, String[]>();
-
- for (Map.Entry<String, Set<String>> entry : attributes.entrySet())
- {
- attrs.put(entry.getKey(), entry.getValue().toArray(new
String[entry.getValue().size()]));
- }
-
- return attrs;
- }
-
- public void updateAttributes(IdentityType identity, Map<String, String[]>
attributes) throws IdentityException
- {
- Map<String, Set<String>> attrs = new HashMap<String,
Set<String>>();
-
- for (Map.Entry<String, String[]> entry : attributes.entrySet())
- {
- Set<String> vals = new HashSet<String>();
- for (String s : entry.getValue())
- {
- vals.add(s);
- }
-
- attrs.put(entry.getKey(),vals);
- }
-
- getRepository().updateAttributes(getInvocationContext(),
createIdentityObject(identity), attrs);
-
- }
-
- public void addAttributes(IdentityType identity, Map<String, String[]>
attributes) throws IdentityException
- {
- Map<String, Set<String>> attrs = new HashMap<String,
Set<String>>();
-
- for (Map.Entry<String, String[]> entry : attributes.entrySet())
- {
- Set<String> vals = new HashSet<String>();
- for (String s : entry.getValue())
- {
- vals.add(s);
- }
-
- attrs.put(entry.getKey(),vals);
- }
-
- getRepository().addAttributes(getInvocationContext(),
createIdentityObject(identity), attrs);
- }
-
- public void removeAttributes(IdentityType identity, Set<String> attributes)
throws IdentityException
- {
- getRepository().removeAttributes(getInvocationContext(),
createIdentityObject(identity), attributes);
-
- }
-}