[jboss-identity-commits] JBoss Identity SVN: r186 - in trunk: identity-impl/src/main/java/org/jboss/identity/impl/api and 20 other directories.
jboss-identity-commits at lists.jboss.org
jboss-identity-commits at lists.jboss.org
Tue Jan 6 09:27:43 EST 2009
Author: bdaw
Date: 2009-01-06 09:27:43 -0500 (Tue, 06 Jan 2009)
New Revision: 186
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/Attribute.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentityObjectAttributeMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleAttributeImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectBinaryAttribute.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectTextAttribute.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/IdentityObjectAttributeMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectCredential.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectCredentialType.java
Removed:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/helper/LDAPTools.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreInvocationContext.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaDataImpl.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredential.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredentialType.java
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/AttributeDescription.java
trunk/identity-api/src/main/java/org/jboss/identity/api/AttributesManager.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AbstractCredential.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AbstractManager.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AttributesManagerImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionFactoryImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/PersistenceManagerImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RelationshipManagerImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RoleManagerImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleCredentialTypeImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributeType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/CredentialsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ExternalConfigType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/GroupTypeMappingType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypeType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoresType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityTypeMappingsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/JbossIdentityType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ObjectFactory.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoriesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/StoresType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedIdentityObjectTypesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedRelationshipTypesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/package-info.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityObjectTypeMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObject.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectAttribute.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectCredential.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectCredentialType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/SimpleIdentityStoreInvocationContext.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentityObject.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentityObjectType.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/OrganizationTest.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/CommonIdentityStoreTest.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreTestCase.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateModelTestCase.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreTestCase.java
trunk/identity-impl/src/test/resources/identity-config.xml
trunk/identity-impl/src/test/resources/identity-config.xsd
trunk/identity-impl/src/test/resources/organization-test-config.xml
trunk/identity-impl/src/test/resources/store-test-config.xml
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/PasswordAttribute.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityObjectTypeMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectAttribute.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
Log:
+++
Added: trunk/identity-api/src/main/java/org/jboss/identity/api/Attribute.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/Attribute.java (rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/Attribute.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -0,0 +1,42 @@
+/*
+* 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.api;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Attribute
+{
+ String getName();
+
+ Object getValue();
+
+ void addValue(Object value);
+
+ Collection getValues();
+
+ int getSize();
+}
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/AttributeDescription.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/AttributeDescription.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/AttributeDescription.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -29,16 +29,25 @@
*/
public interface AttributeDescription
{
+ /**
+ * @return
+ */
+ String getName();
/**
* @return
*/
+ String getType();
+
+ /**
+ * @return
+ */
boolean isReadonly();
/**
* @return
*/
- boolean isMultivalue();
+ boolean isMultivalued();
/**
* @return
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/AttributesManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/AttributesManager.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/AttributesManager.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -73,7 +73,7 @@
* @return
* @throws org.jboss.identity.exception.IdentityException
*/
- Map<String, String[]> getAttributes(IdentityType identity) throws IdentityException;
+ Map<String, Attribute> getAttributes(IdentityType identity) throws IdentityException;
/**
* Get attribute values for the given IdentityType
@@ -83,7 +83,7 @@
* @return
* @throws org.jboss.identity.exception.IdentityException
*/
- String[] getAttributeValues(IdentityType identity, String attributeName) throws IdentityException;
+ Attribute getAttribute(IdentityType identity, String attributeName) throws IdentityException;
/**
* Update attributes with new values - previous values will be overwritten. All the other attributes are not changed -
@@ -92,7 +92,7 @@
* @param attributes
* @throws org.jboss.identity.exception.IdentityException
*/
- void updateAttributes(IdentityType identity, Map<String, String[]> attributes)
+ void updateAttributes(IdentityType identity, Attribute[] attributes)
throws IdentityException;
/**
@@ -103,7 +103,7 @@
* @param attributes
* @throws org.jboss.identity.exception.IdentityException
*/
- void addAttributes(IdentityType identity, Map<String, String[]> attributes)
+ void addAttributes(IdentityType identity, Attribute[] attributes)
throws IdentityException;
/**
@@ -115,7 +115,7 @@
* @param values
* @throws org.jboss.identity.exception.IdentityException
*/
- void addAttribute(IdentityType identity, String attributeName, String[] values)
+ void addAttribute(IdentityType identity, String attributeName, Object[] values)
throws IdentityException;
/**
@@ -127,16 +127,16 @@
* @param value
* @throws org.jboss.identity.exception.IdentityException
*/
- void addAttribute(IdentityType identity, String attributeName, String value)
+ void addAttribute(IdentityType identity, String attributeName, Object value)
throws IdentityException;
/**
* Remove attributes
*
* @param identity
- * @param attributes
+ * @param attributeNames
*/
- void removeAttributes(IdentityType identity, String[] attributes)
+ void removeAttributes(IdentityType identity, String[] attributeNames)
throws IdentityException;
/**
@@ -144,7 +144,7 @@
* @return
* @throws IdentityException
*/
- boolean hasPasswordAttribute(Identity identity) throws IdentityException;
+ boolean hasPassword(Identity identity) throws IdentityException;
/**
*
@@ -153,7 +153,7 @@
* @return
* @throws IdentityException
*/
- boolean validatePasswordAttribute(Identity identity, String password) throws IdentityException;
+ boolean validatePassword(Identity identity, String password) throws IdentityException;
/**
*
@@ -161,7 +161,7 @@
* @param password
* @throws IdentityException
*/
- void updatePasswordAttribute(Identity identity, String password) throws IdentityException;
+ void updatePassword(Identity identity, String password) throws IdentityException;
/**
*
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AbstractCredential.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AbstractCredential.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AbstractCredential.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -22,9 +22,8 @@
package org.jboss.identity.impl.api;
-import org.jboss.identity.spi.credential.IdentityObjectCredential;
+import org.jboss.identity.spi.model.IdentityObjectCredential;
import org.jboss.identity.api.Credential;
-import org.jboss.identity.api.CredentialType;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
@@ -36,6 +35,14 @@
public AbstractCredential(SimpleCredentialTypeImpl type)
{
+ if (type == null)
+ {
+ throw new IllegalArgumentException("type is null");
+ }
+
+
+
+
this.type = type;
}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AbstractManager.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AbstractManager.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AbstractManager.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -28,11 +28,13 @@
import org.jboss.identity.api.GroupType;
import org.jboss.identity.api.IdentityType;
import org.jboss.identity.api.IdentitySearchControl;
+import org.jboss.identity.api.Attribute;
import org.jboss.identity.spi.repository.IdentityStoreRepository;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
import org.jboss.identity.impl.types.SimpleIdentityObject;
import java.util.List;
@@ -152,6 +154,52 @@
return getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(groupType);
}
+ protected IdentityObjectAttribute[] convertAttributes(Attribute[] attributes)
+ {
+ IdentityObjectAttribute[] convertedAttributes = new IdentityObjectAttribute[attributes.length];
+ for (int i = 0; i < attributes.length; i++)
+ {
+ convertedAttributes[i] = convertAttribute(attributes[i]);
+ }
+ return convertedAttributes;
+ }
+
+ protected Attribute[] convertAttributes(IdentityObjectAttribute[] attributes)
+ {
+ Attribute[] convertedAttributes = new Attribute[attributes.length];
+
+ for (int i = 0; i < attributes.length; i++)
+ {
+ convertedAttributes[i] = convertAttribute(attributes[i]);
+ }
+ return convertedAttributes;
+ }
+
+ protected Attribute convertAttribute(IdentityObjectAttribute attribute)
+ {
+ if (attribute instanceof Attribute)
+ {
+ return (Attribute)attribute;
+ }
+ else
+ {
+ return new SimpleAttributeImpl(attribute);
+ }
+ }
+
+ protected IdentityObjectAttribute convertAttribute(Attribute attribute)
+ {
+ if (attribute instanceof IdentityObjectAttribute)
+ {
+ return (IdentityObjectAttribute)attribute;
+ }
+ else
+ {
+ return new SimpleAttributeImpl(attribute);
+ }
+ }
+
+
}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AttributesManagerImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AttributesManagerImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AttributesManagerImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -29,9 +29,12 @@
import org.jboss.identity.api.AttributeDescription;
import org.jboss.identity.api.CredentialType;
import org.jboss.identity.api.Credential;
+import org.jboss.identity.api.Attribute;
import org.jboss.identity.exception.IdentityException;
+import org.jboss.identity.spi.model.IdentityObjectCredential;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
import org.jboss.identity.impl.NotYetImplementedException;
-import org.jboss.identity.spi.credential.IdentityObjectCredential;
import java.util.Set;
import java.util.Map;
@@ -51,12 +54,51 @@
public AttributeDescription getAttributeDescription(IdentityType identityType, String name)
{
+
+ Map<String, IdentityObjectAttributeMetaData> mdMap =
+ getRepository().getAttributesMetaData(getInvocationContext(), createIdentityObject(identityType).getIdentityType());
+
+ if (mdMap != null && mdMap.containsKey(name))
+ {
+ IdentityObjectAttributeMetaData attributeMD = mdMap.get(name);
+ if (attributeMD instanceof AttributeDescription)
+ {
+ return (AttributeDescription)attributeMD;
+ }
+ else
+ {
+ return new IdentityObjectAttributeMetaDataImpl(attributeMD);
+ }
+ }
+
return null;
+
}
public Map<String, AttributeDescription> getSupportedAttributesDescriptions(IdentityType identityType)
{
- return null;
+
+ Map<String, IdentityObjectAttributeMetaData> mdMap =
+ getRepository().getAttributesMetaData(getInvocationContext(), createIdentityObject(identityType).getIdentityType());
+
+ Map<String, AttributeDescription> descriptionMap = new HashMap<String, AttributeDescription>();
+
+ if (mdMap != null)
+ {
+ for (IdentityObjectAttributeMetaData attributeMD : mdMap.values())
+ {
+ if (attributeMD instanceof AttributeDescription)
+ {
+ descriptionMap.put(attributeMD.getName(), (AttributeDescription)attributeMD);
+ }
+ else
+ {
+ descriptionMap.put(attributeMD.getName(), new IdentityObjectAttributeMetaDataImpl(attributeMD));
+ }
+ }
+ }
+
+ return descriptionMap;
}
public Set<String> getSupportedAttributeNames(IdentityType identityType) throws IdentityException
@@ -64,61 +106,68 @@
return getRepository().getSupportedAttributeNames(getInvocationContext(), createIdentityObject(identityType).getIdentityType());
}
- public Map<String, String[]> getAttributes(IdentityType identity) throws IdentityException
+ public Map<String, Attribute> getAttributes(IdentityType identity) throws IdentityException
{
- return getRepository().getAttributes(getInvocationContext(), createIdentityObject(identity));
+ Map<String, IdentityObjectAttribute> map = getRepository().getAttributes(getInvocationContext(), createIdentityObject(identity));
+
+ Map<String, Attribute> newMap = new HashMap<String, Attribute>();
+
+ for (Map.Entry<String, IdentityObjectAttribute> entry : map.entrySet())
+ {
+ newMap.put(entry.getKey(), convertAttribute(entry.getValue()));
+ }
+ return newMap;
}
- public void updateAttributes(IdentityType identity, Map<String, String[]> attributes) throws IdentityException
+ public void updateAttributes(IdentityType identity, Attribute[] attributes) throws IdentityException
{
- getRepository().updateAttributes(getInvocationContext(), createIdentityObject(identity), attributes);
+ getRepository().updateAttributes(getInvocationContext(), createIdentityObject(identity), convertAttributes(attributes));
}
- public String[] getAttributeValues(IdentityType identity, String attributeName) throws IdentityException
+ public Attribute getAttribute(IdentityType identity, String attributeName) throws IdentityException
{
return getAttributes(identity).get(attributeName);
}
- public void addAttribute(IdentityType identity, String attributeName, String[] values) throws IdentityException
+ public void addAttribute(IdentityType identity, String attributeName, Object[] values) throws IdentityException
{
- Map<String, String[]> attrs = new HashMap<String, String[]>();
- attrs.put(attributeName, values);
+ Attribute[] attrs = new Attribute[]{new SimpleAttributeImpl(attributeName, values)};
addAttributes(identity, attrs);
}
- public void addAttribute(IdentityType identity, String attributeName, String value) throws IdentityException
+ public void addAttribute(IdentityType identity, String attributeName, Object value) throws IdentityException
{
- Map<String, String[]> attrs = new HashMap<String, String[]>();
- attrs.put(attributeName, new String[]{value});
+ Attribute[] attrs = new Attribute[]{new SimpleAttributeImpl(attributeName, value)};
+
addAttributes(identity, attrs);
}
- public void addAttributes(IdentityType identity, Map<String, String[]> attributes) throws IdentityException
+ public void addAttributes(IdentityType identity, Attribute[] attributes) throws IdentityException
{
- getRepository().addAttributes(getInvocationContext(), createIdentityObject(identity), attributes);
+ getRepository().addAttributes(getInvocationContext(), createIdentityObject(identity), convertAttributes(attributes));
}
- public void removeAttributes(IdentityType identity, String[] attributes) throws IdentityException
+ public void removeAttributes(IdentityType identity, String[] attributeNames) throws IdentityException
{
- getRepository().removeAttributes(getInvocationContext(), createIdentityObject(identity), attributes);
+ getRepository().removeAttributes(getInvocationContext(), createIdentityObject(identity), attributeNames);
}
- public boolean hasPasswordAttribute(Identity identity) throws IdentityException
+ public boolean hasPassword(Identity identity) throws IdentityException
{
return getRepository().getSupportedFeatures().isCredentialSupported(createIdentityObject(identity).getIdentityType(), PasswordCredential.TYPE);
}
- public boolean validatePasswordAttribute(Identity identity, String password) throws IdentityException
+ public boolean validatePassword(Identity identity, String password) throws IdentityException
{
return getRepository().validateCredential(getInvocationContext(), createIdentityObject(identity), new PasswordCredential(password));
}
- public void updatePasswordAttribute(Identity identity, String password) throws IdentityException
+ public void updatePassword(Identity identity, String password) throws IdentityException
{
getRepository().updateCredential(getInvocationContext(), createIdentityObject(identity), new PasswordCredential(password));
}
@@ -137,12 +186,8 @@
//Handle only those credentials that implement SPI
- if (credential instanceof IdentityObjectCredential)
+ if (!(credential instanceof IdentityObjectCredential))
{
- ioc = (IdentityObjectCredential)ioc;
- }
- else
- {
throw new IdentityException("Unsupported Credential implementation: " + credential.getClass());
}
Copied: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentityObjectAttributeMetaDataImpl.java (from rev 179, trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaDataImpl.java)
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentityObjectAttributeMetaDataImpl.java (rev 0)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentityObjectAttributeMetaDataImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -0,0 +1,96 @@
+/*
+* 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.spi.attribute.IdentityObjectAttributeMetaData;
+import org.jboss.identity.api.AttributeDescription;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityObjectAttributeMetaDataImpl implements IdentityObjectAttributeMetaData, AttributeDescription
+{
+
+ private final String name;
+
+ private final String storeMapping;
+
+ private final String type;
+
+ private final boolean readonly;
+
+ private final boolean multivalued;
+
+ private final boolean required;
+
+ public IdentityObjectAttributeMetaDataImpl(String name, String storeMapping, String type, boolean readonly, boolean multivalued, boolean required)
+ {
+ this.name = name;
+ this.storeMapping = storeMapping;
+ this.type = type;
+ this.readonly = readonly;
+ this.multivalued = multivalued;
+ this.required = required;
+ }
+
+ public IdentityObjectAttributeMetaDataImpl(IdentityObjectAttributeMetaData attributeMD)
+ {
+ this.name = attributeMD.getName();
+ this.type = attributeMD.getType();
+ this.readonly = attributeMD.isReadonly();
+ this.multivalued = attributeMD.isMultivalued();
+ this.required = attributeMD.isRequired();
+ this.storeMapping = attributeMD.getStoreMapping();
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getStoreMapping()
+ {
+ return storeMapping;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public boolean isReadonly()
+ {
+ return readonly;
+ }
+
+ public boolean isMultivalued()
+ {
+ return multivalued;
+ }
+
+ public boolean isRequired()
+ {
+ return required;
+ }
+}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionFactoryImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionFactoryImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionFactoryImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -32,6 +32,7 @@
import org.jboss.identity.spi.store.AttributeStore;
import org.jboss.identity.spi.repository.IdentityStoreRepository;
import org.jboss.identity.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.jboss.identity.exception.IdentityException;
import java.util.Map;
import java.util.HashMap;
@@ -76,7 +77,15 @@
for (IdentityStoreConfigurationMetaData metaData : configMD.getIdentityStores())
{
- Class storeClass = Class.forName(metaData.getClassName());
+ Class storeClass = null;
+ try
+ {
+ storeClass = Class.forName(metaData.getClassName());
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new IdentityException("Cannot instantiate identity store:" + metaData.getClassName(), e);
+ }
Class partypes[] = new Class[1];
partypes[0] = String.class;
@@ -98,7 +107,15 @@
for (IdentityRepositoryConfigurationMetaData metaData : configMD.getRepositories())
{
- Class repoClass = Class.forName(metaData.getClassName());
+ Class repoClass = null;
+ try
+ {
+ repoClass = Class.forName(metaData.getClassName());
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new IdentityException("Cannot instantiate identity store:" + metaData.getClassName(), e);
+ }
Class partypes[] = new Class[1];
partypes[0] = String.class;
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/PersistenceManagerImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/PersistenceManagerImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/PersistenceManagerImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -164,6 +164,6 @@
public boolean isVirtual(Identity identity)
{
//TODO:NYI
- throw new NotYetImplementedException();
+ throw new NotYetImplementedException("Postponed");
}
}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RelationshipManagerImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RelationshipManagerImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RelationshipManagerImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -35,7 +35,6 @@
import org.jboss.identity.spi.model.IdentityObjectRelationship;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
-import org.jboss.identity.impl.NotYetImplementedException;
import java.util.Collection;
import java.util.Iterator;
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RoleManagerImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RoleManagerImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RoleManagerImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -36,7 +36,6 @@
import org.jboss.identity.spi.model.IdentityObjectRelationship;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
-import org.jboss.identity.impl.NotYetImplementedException;
import java.util.Collection;
import java.util.Set;
Added: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleAttributeImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleAttributeImpl.java (rev 0)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleAttributeImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -0,0 +1,108 @@
+/*
+* 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.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.api.Attribute;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Set;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class SimpleAttributeImpl implements IdentityObjectAttribute, Attribute
+{
+
+ private final String name;
+
+ private final List<Object> values = new LinkedList<Object>();
+
+ public SimpleAttributeImpl(String name)
+ {
+ this.name = name;
+ }
+
+ public SimpleAttributeImpl(String name, Object[] values)
+ {
+ this.name = name;
+ for (Object value : values)
+ {
+ this.values.add(value);
+ }
+ }
+
+ public SimpleAttributeImpl(String name, Object value)
+ {
+ this.name = name;
+ this.values.add(value);
+ }
+
+ public SimpleAttributeImpl(Attribute attribute)
+ {
+ this.name = attribute.getName();
+ this.values.addAll(attribute.getValues());
+ }
+
+ public SimpleAttributeImpl(IdentityObjectAttribute attribute)
+ {
+ this.name = attribute.getName();
+ this.values.addAll(attribute.getValues());
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Collection getValues()
+ {
+ return Collections.unmodifiableList(values);
+ }
+
+ public Object getValue()
+ {
+ if (values.size() > 0)
+ {
+ return values.iterator().next();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public int getSize()
+ {
+ return values.size();
+ }
+
+ public void addValue(Object value)
+ {
+ values.add(value);
+ }
+}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleCredentialTypeImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleCredentialTypeImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleCredentialTypeImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -23,7 +23,7 @@
package org.jboss.identity.impl.api;
import org.jboss.identity.api.CredentialType;
-import org.jboss.identity.spi.credential.IdentityObjectCredentialType;
+import org.jboss.identity.spi.model.IdentityObjectCredentialType;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -36,8 +36,8 @@
import org.jboss.identity.spi.configuration.metadata.IdentityConfigurationMetaData;
import org.jboss.identity.spi.configuration.metadata.RelationshipMetaData;
import org.jboss.identity.spi.exception.IdentityConfigurationException;
-import org.jboss.identity.spi.attribute.AttributeMetaData;
-import org.jboss.identity.spi.attribute.AttributeMetaDataImpl;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
+import org.jboss.identity.impl.api.IdentityObjectAttributeMetaDataImpl;
import org.jboss.identity.impl.configuration.jaxb2.generated.JbossIdentityType;
import org.jboss.identity.impl.configuration.jaxb2.generated.IdentityStoreType;
import org.jboss.identity.impl.configuration.jaxb2.generated.RepositoryType;
@@ -229,7 +229,7 @@
// Attributes
- List<AttributeMetaData> attributes = new LinkedList<AttributeMetaData>();
+ List<IdentityObjectAttributeMetaData> attributes = new LinkedList<IdentityObjectAttributeMetaData>();
if (identityObjectTypeType.getAttributes() != null &&
identityObjectTypeType.getAttributes().getAttribute() != null)
@@ -237,29 +237,20 @@
for (AttributeType attributeType : identityObjectTypeType.getAttributes().getAttribute())
{
- AttributeMetaDataImpl attributeMD = new AttributeMetaDataImpl();
- attributeMD.setName(attributeType.getName());
- attributeMD.setStoreMapping(attributeType.getMapping());
-
- String readonly = attributeType.getIsReadOnly();
- if (readonly != null && readonly.equalsIgnoreCase("true"))
- {
- attributeMD.setReadonly(true);
- }
-
+ String readOnly = attributeType.getIsReadOnly();
String multivalued = attributeType.getIsMultivalued();
- if (multivalued != null && multivalued.equalsIgnoreCase("true"))
- {
- attributeMD.setMultivalued(true);
- }
-
String required = attributeType.getIsRequired();
- if (required != null && required.equalsIgnoreCase("true"))
- {
- attributeMD.setRequired(true);
- }
+ IdentityObjectAttributeMetaDataImpl attributeMD = new IdentityObjectAttributeMetaDataImpl(
+ attributeType.getName(),
+ attributeType.getMapping(),
+ attributeType.getType(),
+ (readOnly != null && readOnly.equalsIgnoreCase("true")),
+ (multivalued != null && multivalued.equalsIgnoreCase("true")),
+ (required != null && required.equalsIgnoreCase("true"))
+ );
+
attributes.add(attributeMD);
}
}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributeType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributeType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributeType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
@@ -26,6 +26,7 @@
* <sequence>
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="mapping" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="type" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="isRequired">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
@@ -57,6 +58,7 @@
@XmlType(name = "attributeType", propOrder = {
"name",
"mapping",
+ "type",
"isRequired",
"isMultivalued",
"isReadOnly"
@@ -68,6 +70,8 @@
@XmlElement(required = true)
protected String mapping;
@XmlElement(required = true)
+ protected String type;
+ @XmlElement(required = true)
protected String isRequired;
@XmlElement(required = true)
protected String isMultivalued;
@@ -122,6 +126,30 @@
}
/**
+ * Gets the value of the type property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setType(String value) {
+ this.type = value;
+ }
+
+ /**
* Gets the value of the isRequired property.
*
* @return
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributesType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributesType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributesType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/CredentialsType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/CredentialsType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/CredentialsType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ExternalConfigType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ExternalConfigType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ExternalConfigType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/GroupTypeMappingType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/GroupTypeMappingType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/GroupTypeMappingType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypeType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypeType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypeType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypesType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypesType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypesType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingsType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingsType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingsType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoresType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoresType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoresType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityTypeMappingsType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityTypeMappingsType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityTypeMappingsType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/JbossIdentityType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/JbossIdentityType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/JbossIdentityType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ObjectFactory.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ObjectFactory.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ObjectFactory.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
@@ -41,78 +41,70 @@
}
/**
- * Create an instance of {@link IdentityObjectTypeType }
+ * Create an instance of {@link SupportedRelationshipTypesType }
*
*/
- public IdentityObjectTypeType createIdentityObjectTypeType() {
- return new IdentityObjectTypeType();
+ public SupportedRelationshipTypesType createSupportedRelationshipTypesType() {
+ return new SupportedRelationshipTypesType();
}
/**
- * Create an instance of {@link IdentityObjectTypesType }
+ * Create an instance of {@link RealmsType }
*
*/
- public IdentityObjectTypesType createIdentityObjectTypesType() {
- return new IdentityObjectTypesType();
+ public RealmsType createRealmsType() {
+ return new RealmsType();
}
/**
- * Create an instance of {@link IdentityStoresType }
+ * Create an instance of {@link IdentityStoreMappingType }
*
*/
- public IdentityStoresType createIdentityStoresType() {
- return new IdentityStoresType();
+ public IdentityStoreMappingType createIdentityStoreMappingType() {
+ return new IdentityStoreMappingType();
}
/**
- * Create an instance of {@link IdentityStoreType.Options }
+ * Create an instance of {@link CredentialsType }
*
*/
- public IdentityStoreType.Options createIdentityStoreTypeOptions() {
- return new IdentityStoreType.Options();
+ public CredentialsType createCredentialsType() {
+ return new CredentialsType();
}
/**
- * Create an instance of {@link SupportedRelationshipTypesType }
+ * Create an instance of {@link OptionsType }
*
*/
- public SupportedRelationshipTypesType createSupportedRelationshipTypesType() {
- return new SupportedRelationshipTypesType();
+ public OptionsType createOptionsType() {
+ return new OptionsType();
}
/**
- * Create an instance of {@link CredentialsType }
+ * Create an instance of {@link SupportedIdentityObjectTypesType }
*
*/
- public CredentialsType createCredentialsType() {
- return new CredentialsType();
+ public SupportedIdentityObjectTypesType createSupportedIdentityObjectTypesType() {
+ return new SupportedIdentityObjectTypesType();
}
/**
- * Create an instance of {@link RealmsType }
+ * Create an instance of {@link OptionType }
*
*/
- public RealmsType createRealmsType() {
- return new RealmsType();
+ public OptionType createOptionType() {
+ return new OptionType();
}
/**
- * Create an instance of {@link StoresType }
+ * Create an instance of {@link IdentityStoresType }
*
*/
- public StoresType createStoresType() {
- return new StoresType();
+ public IdentityStoresType createIdentityStoresType() {
+ return new IdentityStoresType();
}
/**
- * Create an instance of {@link IdentityStoreMappingType }
- *
- */
- public IdentityStoreMappingType createIdentityStoreMappingType() {
- return new IdentityStoreMappingType();
- }
-
- /**
* Create an instance of {@link IdentityObjectTypeType.Options }
*
*/
@@ -121,59 +113,59 @@
}
/**
- * Create an instance of {@link RepositoriesType }
+ * Create an instance of {@link GroupTypeMappingType }
*
*/
- public RepositoriesType createRepositoriesType() {
- return new RepositoriesType();
+ public GroupTypeMappingType createGroupTypeMappingType() {
+ return new GroupTypeMappingType();
}
/**
- * Create an instance of {@link GroupTypeMappingType }
+ * Create an instance of {@link IdentityStoreType.Options }
*
*/
- public GroupTypeMappingType createGroupTypeMappingType() {
- return new GroupTypeMappingType();
+ public IdentityStoreType.Options createIdentityStoreTypeOptions() {
+ return new IdentityStoreType.Options();
}
/**
- * Create an instance of {@link IdentityStoreMappingsType }
+ * Create an instance of {@link IdentityObjectTypesType }
*
*/
- public IdentityStoreMappingsType createIdentityStoreMappingsType() {
- return new IdentityStoreMappingsType();
+ public IdentityObjectTypesType createIdentityObjectTypesType() {
+ return new IdentityObjectTypesType();
}
/**
- * Create an instance of {@link IdentityStoreType }
+ * Create an instance of {@link JbossIdentityType }
*
*/
- public IdentityStoreType createIdentityStoreType() {
- return new IdentityStoreType();
+ public JbossIdentityType createJbossIdentityType() {
+ return new JbossIdentityType();
}
/**
- * Create an instance of {@link RealmType }
+ * Create an instance of {@link IdentityTypeMappingsType }
*
*/
- public RealmType createRealmType() {
- return new RealmType();
+ public IdentityTypeMappingsType createIdentityTypeMappingsType() {
+ return new IdentityTypeMappingsType();
}
/**
- * Create an instance of {@link OptionType }
+ * Create an instance of {@link RelationshipsType }
*
*/
- public OptionType createOptionType() {
- return new OptionType();
+ public RelationshipsType createRelationshipsType() {
+ return new RelationshipsType();
}
/**
- * Create an instance of {@link ExternalConfigType }
+ * Create an instance of {@link RelationshipType }
*
*/
- public ExternalConfigType createExternalConfigType() {
- return new ExternalConfigType();
+ public RelationshipType createRelationshipType() {
+ return new RelationshipType();
}
/**
@@ -193,86 +185,94 @@
}
/**
- * Create an instance of {@link OptionsType }
+ * Create an instance of {@link RepositoriesType }
*
*/
- public OptionsType createOptionsType() {
- return new OptionsType();
+ public RepositoriesType createRepositoriesType() {
+ return new RepositoriesType();
}
/**
- * Create an instance of {@link SupportedIdentityObjectTypesType }
+ * Create an instance of {@link AttributesType }
*
*/
- public SupportedIdentityObjectTypesType createSupportedIdentityObjectTypesType() {
- return new SupportedIdentityObjectTypesType();
+ public AttributesType createAttributesType() {
+ return new AttributesType();
}
/**
- * Create an instance of {@link IdentityTypeMappingsType }
+ * Create an instance of {@link IdentityStoreMappingsType }
*
*/
- public IdentityTypeMappingsType createIdentityTypeMappingsType() {
- return new IdentityTypeMappingsType();
+ public IdentityStoreMappingsType createIdentityStoreMappingsType() {
+ return new IdentityStoreMappingsType();
}
/**
- * Create an instance of {@link AttributesType }
+ * Create an instance of {@link ExternalConfigType }
*
*/
- public AttributesType createAttributesType() {
- return new AttributesType();
+ public ExternalConfigType createExternalConfigType() {
+ return new ExternalConfigType();
}
/**
- * Create an instance of {@link IdentityObjectTypeType.Credentials }
+ * Create an instance of {@link IdentityStoreType }
*
*/
- public IdentityObjectTypeType.Credentials createIdentityObjectTypeTypeCredentials() {
- return new IdentityObjectTypeType.Credentials();
+ public IdentityStoreType createIdentityStoreType() {
+ return new IdentityStoreType();
}
/**
- * Create an instance of {@link RelationshipType }
+ * Create an instance of {@link IdentityObjectTypeType.Attributes }
*
*/
- public RelationshipType createRelationshipType() {
- return new RelationshipType();
+ public IdentityObjectTypeType.Attributes createIdentityObjectTypeTypeAttributes() {
+ return new IdentityObjectTypeType.Attributes();
}
/**
- * Create an instance of {@link JbossIdentityType }
+ * Create an instance of {@link IdentityObjectTypeType.Credentials }
*
*/
- public JbossIdentityType createJbossIdentityType() {
- return new JbossIdentityType();
+ public IdentityObjectTypeType.Credentials createIdentityObjectTypeTypeCredentials() {
+ return new IdentityObjectTypeType.Credentials();
}
/**
- * Create an instance of {@link AttributeType }
+ * Create an instance of {@link StoresType }
*
*/
- public AttributeType createAttributeType() {
- return new AttributeType();
+ public StoresType createStoresType() {
+ return new StoresType();
}
/**
- * Create an instance of {@link IdentityObjectTypeType.Attributes }
+ * Create an instance of {@link IdentityObjectTypeType }
*
*/
- public IdentityObjectTypeType.Attributes createIdentityObjectTypeTypeAttributes() {
- return new IdentityObjectTypeType.Attributes();
+ public IdentityObjectTypeType createIdentityObjectTypeType() {
+ return new IdentityObjectTypeType();
}
/**
- * Create an instance of {@link RelationshipsType }
+ * Create an instance of {@link RealmType }
*
*/
- public RelationshipsType createRelationshipsType() {
- return new RelationshipsType();
+ public RealmType createRealmType() {
+ return new RealmType();
}
/**
+ * Create an instance of {@link AttributeType }
+ *
+ */
+ public AttributeType createAttributeType() {
+ return new AttributeType();
+ }
+
+ /**
* Create an instance of {@link JAXBElement }{@code <}{@link JbossIdentityType }{@code >}}
*
*/
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionsType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionsType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionsType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmsType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmsType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmsType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipsType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipsType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipsType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoriesType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoriesType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoriesType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/StoresType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/StoresType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/StoresType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedIdentityObjectTypesType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedIdentityObjectTypesType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedIdentityObjectTypesType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedRelationshipTypesType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedRelationshipTypesType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedRelationshipTypesType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/package-info.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/package-info.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/package-info.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.11.24 at 10:17:31 PM CET
+// Generated on: 2008.12.18 at 03:00:04 PM CET
//
@javax.xml.bind.annotation.XmlSchema(namespace = "urn:jboss:identity:config:v0_1", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityObjectTypeMetaDataImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityObjectTypeMetaDataImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityObjectTypeMetaDataImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -22,7 +22,7 @@
package org.jboss.identity.impl.configuration.metadata;
-import org.jboss.identity.spi.attribute.AttributeMetaData;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
import org.jboss.identity.spi.configuration.metadata.RelationshipMetaData;
@@ -40,7 +40,7 @@
private List<RelationshipMetaData> relationships;
- private List<AttributeMetaData> attributes;
+ private List<IdentityObjectAttributeMetaData> attributes;
private Map<String, List<String>> options;
@@ -70,12 +70,12 @@
this.relationships = relationships;
}
- public List<AttributeMetaData> getAttributes()
+ public List<IdentityObjectAttributeMetaData> getAttributes()
{
return attributes;
}
- public void setAttributes(List<AttributeMetaData> attributes)
+ public void setAttributes(List<IdentityObjectAttributeMetaData> attributes)
{
this.attributes = attributes;
}
Deleted: trunk/identity-impl/src/main/java/org/jboss/identity/impl/helper/LDAPTools.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/helper/LDAPTools.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/helper/LDAPTools.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,56 +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.helper;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class LDAPTools
-{
-
- /**
- * Process dn and retrieves a part from it:
- * uid=xxx,dc=example,dc=org - retrieves xxx
- *
- * @param dn
- * @return
- */
- public static String stripDnToName(String dn)
- {
- if (dn == null || dn.length() == 0)
- {
- throw new IllegalArgumentException("Cannot process empty dn");
- }
- String[] parts = dn.split(",");
-
- parts = parts[0].split("=");
- if (parts.length != 2)
- {
- throw new IllegalArgumentException("Wrong dn format: " + dn);
- }
-
- return parts[1];
- }
-
-}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObject.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObject.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObject.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -29,8 +29,7 @@
import java.util.Collections;
import java.util.Arrays;
import java.util.List;
-import java.util.ArrayList;
-import java.util.LinkedList;
+import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.CascadeType;
@@ -48,8 +47,11 @@
import javax.persistence.JoinTable;
import org.jboss.identity.exception.PolicyValidationException;
+import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.spi.model.IdentityObject;
-import org.jboss.identity.spi.credential.IdentityObjectCredentialType;
+import org.jboss.identity.spi.model.IdentityObjectCredentialType;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CollectionOfElements;
@@ -178,88 +180,79 @@
this.attributes = attributes;
}
- public Set<String> getAttribute(String name)
+// public Collection getAttribute(String name)
+// {
+// for (HibernateIdentityObjectAttribute attribute : attributes)
+// {
+// if (attribute.getName().equals(name))
+// {
+// return Collections.unmodifiableCollection(attribute.getValues());
+// }
+// }
+//
+//
+// return new HashSet<String>();
+// }
+//
+ public Map<String, Collection> getAttributesAsMap()
{
- for (HibernateIdentityObjectAttribute attribute : attributes)
- {
- if (attribute.getName().equals(name))
- {
- return Collections.unmodifiableSet(attribute.getValues());
- }
- }
+ Map<String, Collection> map = new HashMap<String, Collection>();
-
- return new HashSet<String>();
- }
-
- public Map<String, String[]> getAttributesAsMap()
- {
- Map<String, String[]> map = new HashMap<String, String[]>();
-
for (HibernateIdentityObjectAttribute attribute : attributes)
{
- Set<String> values = attribute.getValues();
- map.put(attribute.getName(),values.toArray(new String[values.size()]));
+ Collection values = attribute.getValues();
+ map.put(attribute.getName(), values);
}
return Collections.unmodifiableMap(map);
}
-
- public void addAttribute(String name, String[] values)
+//
+ public void addTextAttribute(String name, String[] values)
{
- attributes.add(new HibernateIdentityObjectAttribute(this, name, values));
+ attributes.add(new HibernateIdentityObjectTextAttribute(this, name, values));
}
- public void updateAttribute(String name, String[] values)
- {
- for (HibernateIdentityObjectAttribute attribute : attributes)
- {
- if (attribute.getName().equals(name))
- {
- Set<String> v = new HashSet<String>();
- for (String value : values)
- {
- v.add(value);
- }
- attribute.setValues(v);
- break;
- }
- }
- }
- public void addAttributeValues(String name, String[] values)
- {
+ //
+// public void updateAttribute(String name, IdentityObjectAttribute attribute, IdentityObjectAttributeMetaData md)
+// throws IdentityException
+// {
+//
+// }
+//
+// public void addAttributeValues(String name, String[] values) throws IdentityException
+// {
+//
+// for (HibernateIdentityObjectAttribute attribute : attributes)
+// {
+// if (attribute.getName().equals(name))
+// {
+// Set<String> mergedValues = new HashSet<String>(attribute.getValues());
+// List<String> list = Arrays.asList(values);
+// mergedValues.addAll(new HashSet<String>(list));
+// attribute.setValues(mergedValues);
+//
+// return;
+// }
+// }
+//
+// addAttribute(name, values);
+// }
+//
+// public void updateAttributes(Map<String, Set<String>> values)
+// {
+// Set<HibernateIdentityObjectAttribute> newAttrs= new HashSet<HibernateIdentityObjectAttribute>();
+//
+// for (String name : values.keySet())
+// {
+// newAttrs.add(new HibernateIdentityObjectAttribute(this, name, new HashSet<String>(values.get(name))));
+// }
+//
+// attributes = newAttrs;
+// }
- for (HibernateIdentityObjectAttribute attribute : attributes)
- {
- if (attribute.getName().equals(name))
- {
- Set<String> mergedValues = new HashSet<String>(attribute.getValues());
- List<String> list = Arrays.asList(values);
- mergedValues.addAll(new HashSet<String>(list));
- attribute.setValues(mergedValues);
- return;
- }
- }
- addAttribute(name, values);
- }
-
- public void updateAttributes(Map<String, Set<String>> values)
- {
- Set<HibernateIdentityObjectAttribute> newAttrs= new HashSet<HibernateIdentityObjectAttribute>();
-
- for (String name : values.keySet())
- {
- newAttrs.add(new HibernateIdentityObjectAttribute(this, name, new HashSet<String>(values.get(name))));
- }
-
- attributes = newAttrs;
- }
-
-
-
public void removeAttribute(String name)
{
HibernateIdentityObjectAttribute attributeToRemove = null;
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectAttribute.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectAttribute.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectAttribute.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -35,6 +35,8 @@
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;
import javax.persistence.UniqueConstraint;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
import java.util.Set;
import java.util.HashSet;
import java.util.List;
@@ -45,8 +47,9 @@
* @version : 0.1 $
*/
@Entity
+ at Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "identity_obj_attrs", uniqueConstraints = {@UniqueConstraint(columnNames = {"NAME", "IDENTITY_OBJECT_ID"})})
-public class HibernateIdentityObjectAttribute implements IdentityObjectAttribute
+public abstract class HibernateIdentityObjectAttribute implements IdentityObjectAttribute
{
@Id
@GeneratedValue
@@ -59,14 +62,11 @@
@Column(name = "NAME")
private String name;
- @CollectionOfElements
- private Set<String> values = new HashSet<String>();
-
public HibernateIdentityObjectAttribute()
{
}
- public HibernateIdentityObjectAttribute(HibernateIdentityObject identityObject, String name)
+ public HibernateIdentityObjectAttribute(HibernateIdentityObject identityObject, String name)
{
this.identityObject = identityObject;
this.name = name;
@@ -76,15 +76,12 @@
{
this.identityObject = identityObject;
this.name = name;
- this.values = values;
}
public HibernateIdentityObjectAttribute(HibernateIdentityObject identityObject, String name, String[] values)
{
this.identityObject = identityObject;
- List<String> list = Arrays.asList(values);
this.name = name;
- this.values = new HashSet<String>(list);
}
public Long getId()
@@ -107,16 +104,6 @@
this.name = name;
}
- public Set<String> getValues()
- {
- return values;
- }
-
- public void setValues(Set<String> values)
- {
- this.values = values;
- }
-
public void addValue(String val)
{
getValues().add(val);
Added: trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectBinaryAttribute.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectBinaryAttribute.java (rev 0)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectBinaryAttribute.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -0,0 +1,90 @@
+/*
+* 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.model.hibernate;
+
+import org.hibernate.annotations.CollectionOfElements;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+
+ at Entity
+ at Table(name = "identity_obj_attrs_binary")
+public class HibernateIdentityObjectBinaryAttribute extends HibernateIdentityObjectAttribute
+{
+ @CollectionOfElements
+ private Set<byte[]> values = new HashSet<byte[]>();
+
+ public HibernateIdentityObjectBinaryAttribute()
+ {
+ }
+
+ public HibernateIdentityObjectBinaryAttribute(HibernateIdentityObject identityObject, String name, Set<byte[]> values)
+ {
+ super(identityObject, name);
+ this.values = values;
+ }
+
+ public Set<byte[]> getValues()
+ {
+ return values;
+ }
+
+ public void setValues(Set<byte[]> values)
+ {
+ this.values = Collections.unmodifiableSet(values);
+ }
+
+ public byte[] getValue()
+ {
+ if (values.size() > 0)
+ {
+ return values.iterator().next();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public int getSize()
+ {
+ return values.size();
+ }
+
+ public void addValue(Object value)
+ {
+ if (value instanceof byte[])
+ {
+ values.add((byte[])value);
+ }
+ }
+
+}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectCredential.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectCredential.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectCredential.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -22,7 +22,7 @@
package org.jboss.identity.impl.model.hibernate;
-import org.jboss.identity.spi.credential.IdentityObjectCredential;
+import org.jboss.identity.spi.model.IdentityObjectCredential;
import org.hibernate.annotations.CollectionOfElements;
import javax.persistence.Entity;
@@ -30,9 +30,7 @@
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.Column;
-import javax.persistence.OneToMany;
import javax.persistence.FetchType;
-import javax.persistence.CascadeType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.JoinTable;
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectCredentialType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectCredentialType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectCredentialType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -22,8 +22,7 @@
package org.jboss.identity.impl.model.hibernate;
-import org.jboss.identity.spi.credential.IdentityObjectCredential;
-import org.jboss.identity.spi.credential.IdentityObjectCredentialType;
+import org.jboss.identity.spi.model.IdentityObjectCredentialType;
import javax.persistence.Entity;
import javax.persistence.Table;
Added: trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectTextAttribute.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectTextAttribute.java (rev 0)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/model/hibernate/HibernateIdentityObjectTextAttribute.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -0,0 +1,96 @@
+/*
+* 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.model.hibernate;
+
+import org.hibernate.annotations.CollectionOfElements;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Arrays;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+ at Entity
+ at Table(name = "identity_obj_attrs_text")
+public class HibernateIdentityObjectTextAttribute extends HibernateIdentityObjectAttribute
+{
+
+ @CollectionOfElements
+ private Set<String> values = new HashSet<String>();
+
+ public HibernateIdentityObjectTextAttribute()
+ {
+ }
+
+ public HibernateIdentityObjectTextAttribute(HibernateIdentityObject identityObject, String name, Set<String> values)
+ {
+ super(identityObject, name);
+ this.values = values;
+ }
+
+ public HibernateIdentityObjectTextAttribute(HibernateIdentityObject identityObject, String name, String[] values)
+ {
+ super(identityObject, name);
+ List<String> list = Arrays.asList(values);
+ }
+
+ public Set<String> getValues()
+ {
+ return Collections.unmodifiableSet(values);
+ }
+
+ public void setValues(Set<String> values)
+ {
+ this.values = values;
+ }
+
+ public String getValue()
+ {
+ if (values.size() > 0)
+ {
+ return values.iterator().next();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void addValue(Object value)
+ {
+ values.add(value.toString());
+ }
+
+ public int getSize()
+ {
+ return values.size();
+ }
+
+
+}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -35,17 +35,14 @@
import org.jboss.identity.spi.exception.OperationNotSupportedException;
import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
-import org.jboss.identity.spi.credential.IdentityObjectCredential;
-import org.jboss.identity.spi.credential.IdentityObjectCredentialType;
+import org.jboss.identity.spi.model.IdentityObjectCredential;
+import org.jboss.identity.spi.model.IdentityObjectCredentialType;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.impl.store.SimpleIdentityStoreInvocationContext;
import org.jboss.identity.impl.api.PageSearchControl;
import org.jboss.identity.impl.api.SortByNameSearchControl;
-import org.jboss.identity.impl.api.AttributeFilterSearchControl;
-import org.jboss.identity.impl.api.NameFilterSearchControl;
-import org.jboss.identity.impl.NotYetImplementedException;
-import org.jboss.identity.impl.configuration.jaxb2.generated.RelationshipType;
-import org.jboss.identity.api.Identity;
import java.util.Map;
import java.util.Collection;
@@ -57,9 +54,8 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.Arrays;
+import java.util.ArrayList;
-import com.sun.corba.se.spi.activation._ActivatorImplBase;
-
/**
* <p>In FallbackIdentityStoreRepository one IdentityStore plays the role of default store. Any operation that cannot be
* handled with other IdentityObjectType/IdentityStore mappings will fallback to such IdentityStore. The most common example
@@ -74,9 +70,11 @@
*/
public class FallbackIdentityStoreRepository extends AbstractIdentityStoreRepository
{
- //TODO: filter out controls based on features MD before passing
- //TODO: configuration option to store not mapped attributes in default store
- //TODO: configuration option to fallback named relationships to default store when not supported in mapped one
+ //TODO: - relationships in default store - after resolving relationships for synced IOs those IOs need to be retreived from proper stores once again
+ //TODO: if they don't exist such relationship + synced identities need to be cleanedup from default store
+ //TODO: - filter out controls based on features MD before passing
+ //TODO: - configuration option to store not mapped attributes in default store
+ //TODO: - configuration option to fallback named relationships to default store when not supported in mapped one
private final String id;
@@ -701,23 +699,75 @@
return results;
}
- public Map<String, String[]> getAttributes(IdentityStoreInvocationContext invocationContext, IdentityObject identity) throws IdentityException
+ public Map<String, IdentityObjectAttributeMetaData> getAttributesMetaData(IdentityStoreInvocationContext invocationContext,
+ IdentityObjectType identityObjectType)
{
- Map<String, String[]> results;
+ IdentityStore targetStore = resolveIdentityStore(identityObjectType);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationContext);
+
+ Map<String, IdentityObjectAttributeMetaData> mdMap = new HashMap<String, IdentityObjectAttributeMetaData>();
+ mdMap.putAll(targetStore.getAttributesMetaData(targetCtx, identityObjectType));
+
+ if (targetStore != defaultAttributeStore)
+ {
+ IdentityStoreInvocationContext defaultCtx = resolveInvocationContext(defaultAttributeStore, invocationContext);
+
+ Map<String, IdentityObjectAttributeMetaData> defaultMDMap = defaultAttributeStore.getAttributesMetaData(defaultCtx, identityObjectType);
+
+
+ // put all missing attribute MD from default store
+ if (defaultMDMap != null)
+ {
+ for (Map.Entry<String, IdentityObjectAttributeMetaData> entry : defaultMDMap.entrySet())
+ {
+ if (!mdMap.containsKey(entry.getKey()))
+ {
+ mdMap.put(entry.getKey(), entry.getValue());
+ }
+ }
+ }
+ }
+
+ return mdMap;
+ }
+
+ public IdentityObjectAttribute getAttribute(IdentityStoreInvocationContext invocationContext, IdentityObject identity, String name) throws IdentityException
+ {
+ IdentityObjectAttribute result;
+
IdentityStore toStore = resolveIdentityStore(identity);
IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, invocationContext);
+ result = toStore.getAttribute(targetCtx, identity, name);
+
+ if (result == null && toStore != defaultAttributeStore)
+ {
+ IdentityStoreInvocationContext defaultCtx = resolveInvocationContext(defaultAttributeStore, invocationContext);
+
+ result = defaultAttributeStore.getAttribute(defaultCtx, identity, name);
+ }
+
+ return result;
+ }
+
+ public Map<String, IdentityObjectAttribute> getAttributes(IdentityStoreInvocationContext invocationContext, IdentityObject identity) throws IdentityException
+ {
+ Map<String, IdentityObjectAttribute> results;
+
+ IdentityStore toStore = resolveIdentityStore(identity);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, invocationContext);
+
results = toStore.getAttributes(targetCtx, identity);
if (toStore != defaultAttributeStore)
{
IdentityStoreInvocationContext defaultCtx = resolveInvocationContext(defaultAttributeStore, invocationContext);
- Map<String, String[]> defaultAttrs = defaultAttributeStore.getAttributes(defaultCtx, identity);
+ Map<String, IdentityObjectAttribute> defaultAttrs = defaultAttributeStore.getAttributes(defaultCtx, identity);
// Add only those attributes which are missing - don't overwrite or merge existing values
- for (Map.Entry<String, String[]> entry : defaultAttrs.entrySet())
+ for (Map.Entry<String, IdentityObjectAttribute> entry : defaultAttrs.entrySet())
{
if (!results.keySet().contains(entry.getKey()))
{
@@ -729,11 +779,13 @@
return results;
}
- public void updateAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, Map<String, String[]> attributes) throws IdentityException
+ public void updateAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException
{
- Map<String, String[]> filteredAttrs = new HashMap<String, String[]>();
- Map<String, String[]> leftAttrs = new HashMap<String, String[]>();
+ ArrayList<IdentityObjectAttribute> filteredAttrs = new ArrayList<IdentityObjectAttribute>();
+ ArrayList<IdentityObjectAttribute> leftAttrs = new ArrayList<IdentityObjectAttribute>();
+ IdentityObjectAttribute[] attributesToAdd = null;
+
IdentityStore toStore = resolveIdentityStore(identity);
IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, invocationCtx);
@@ -743,55 +795,57 @@
Set<String> supportedAttrs = toStore.getSupportedAttributeNames(targetCtx, identity.getIdentityType());
// Filter out supported and not supported attributes
- for (Map.Entry<String, String[]> entry : attributes.entrySet())
+ for (IdentityObjectAttribute entry : attributes)
{
- if (supportedAttrs.contains(entry.getKey()))
+ if (supportedAttrs.contains(entry.getName()))
{
- filteredAttrs.put(entry.getKey(), entry.getValue());
+ filteredAttrs.add(entry);
}
else
{
- leftAttrs.put(entry.getKey(), entry.getValue());
+ leftAttrs.add(entry);
}
}
- toStore.updateAttributes(targetCtx, identity, filteredAttrs);
+ toStore.updateAttributes(targetCtx, identity, filteredAttrs.toArray(new IdentityObjectAttribute[filteredAttrs.size()]));
+ attributesToAdd = leftAttrs.toArray(new IdentityObjectAttribute[leftAttrs.size()]);
}
else
{
- leftAttrs = attributes;
+ attributesToAdd = attributes;
}
IdentityStoreInvocationContext defaultCtx = resolveInvocationContext(defaultAttributeStore, invocationCtx);
if (isAllowNotDefinedAttributes())
{
- defaultAttributeStore.updateAttributes(defaultCtx, identity, leftAttrs);
+ defaultAttributeStore.updateAttributes(defaultCtx, identity, attributesToAdd);
}
else
{
Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identity.getIdentityType());
- for (Map.Entry<String, String[]> entry : leftAttrs.entrySet())
+ for (IdentityObjectAttribute entry : leftAttrs)
{
- if (!supportedAttrs.contains(entry.getKey()))
+ if (!supportedAttrs.contains(entry.getName()))
{
throw new IdentityException("Cannot update not defined attribute. Use '"
+ ALLOW_NOT_DEFINED_ATTRIBUTES + "' option to pass such attributes to default IdentityStore anyway." +
- "Attribute name: " + entry.getKey());
+ "Attribute name: " + entry.getName());
}
}
- defaultAttributeStore.updateAttributes(defaultCtx, identity, leftAttrs);
+ defaultAttributeStore.updateAttributes(defaultCtx, identity, attributesToAdd);
}
}
- public void addAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, Map<String, String[]> attributes) throws IdentityException
+ public void addAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException
{
- Map<String, String[]> filteredAttrs = new HashMap<String, String[]>();
- Map<String, String[]> leftAttrs = new HashMap<String, String[]>();
+ ArrayList<IdentityObjectAttribute> filteredAttrs = new ArrayList<IdentityObjectAttribute>();
+ ArrayList<IdentityObjectAttribute> leftAttrs = new ArrayList<IdentityObjectAttribute>();
+ IdentityObjectAttribute[] attributesToAdd = null;
IdentityStore toStore = resolveIdentityStore(identity);
IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, invocationCtx);
@@ -802,48 +856,50 @@
Set<String> supportedAttrs = toStore.getSupportedAttributeNames(targetCtx, identity.getIdentityType());
// Filter out supported and not supported attributes
- for (Map.Entry<String, String[]> entry : attributes.entrySet())
+ for (IdentityObjectAttribute entry : attributes)
{
- if (supportedAttrs.contains(entry.getKey()))
+ if (supportedAttrs.contains(entry.getName()))
{
- filteredAttrs.put(entry.getKey(), entry.getValue());
+ filteredAttrs.add(entry);
}
else
{
- leftAttrs.put(entry.getKey(), entry.getValue());
+ leftAttrs.add(entry);
}
}
- toStore.addAttributes(targetCtx, identity, filteredAttrs);
+ toStore.addAttributes(targetCtx, identity, filteredAttrs.toArray(new IdentityObjectAttribute[filteredAttrs.size()]));
+ attributesToAdd = leftAttrs.toArray(new IdentityObjectAttribute[leftAttrs.size()]);
+
}
else
{
- leftAttrs = attributes;
+ attributesToAdd = attributes;
}
IdentityStoreInvocationContext defaultCtx = resolveInvocationContext(defaultAttributeStore, invocationCtx);
if (isAllowNotDefinedAttributes())
{
- defaultAttributeStore.addAttributes(defaultCtx, identity, leftAttrs);
+ defaultAttributeStore.addAttributes(defaultCtx, identity, attributesToAdd);
}
else
{
Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identity.getIdentityType());
- for (Map.Entry<String, String[]> entry : leftAttrs.entrySet())
+ for (IdentityObjectAttribute entry : attributesToAdd)
{
// if we hit some unsupported attribute at this stage that we cannot store...
- if (!supportedAttrs.contains(entry.getKey()))
+ if (!supportedAttrs.contains(entry.getName()))
{
throw new IdentityException("Cannot add not defined attribute. Use '"
+ ALLOW_NOT_DEFINED_ATTRIBUTES + "' option to pass such attributes to default IdentityStore anyway." +
- "Attribute name: " + entry.getKey());
+ "Attribute name: " + entry.getName());
}
}
- defaultAttributeStore.addAttributes(defaultCtx, identity, filteredAttrs);
+ defaultAttributeStore.addAttributes(defaultCtx, identity, attributesToAdd);
}
}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesMetaDataImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesMetaDataImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesMetaDataImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -25,7 +25,7 @@
import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
-import org.jboss.identity.spi.credential.IdentityObjectCredentialType;
+import org.jboss.identity.spi.model.IdentityObjectCredentialType;
import org.jboss.identity.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
@@ -35,7 +35,6 @@
import java.util.Set;
import java.util.Map;
import java.util.List;
-import java.util.LinkedList;
import java.util.HashSet;
import java.util.Collections;
import java.util.HashMap;
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/SimpleIdentityStoreInvocationContext.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/SimpleIdentityStoreInvocationContext.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/SimpleIdentityStoreInvocationContext.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -37,6 +37,11 @@
public SimpleIdentityStoreInvocationContext(IdentityStoreSession identityStoreSession, String realmId)
{
+ if (identityStoreSession == null)
+ {
+ throw new IllegalArgumentException("identityStoreSession is null");
+ }
+
this.identityStoreSession = identityStoreSession;
this.realmId = realmId;
}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -31,12 +31,13 @@
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObjectRelationship;
+import org.jboss.identity.spi.model.IdentityObjectCredential;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
-import org.jboss.identity.spi.credential.IdentityObjectCredential;
-import org.jboss.identity.spi.credential.IdentityObjectCredentialType;
-import org.jboss.identity.spi.attribute.AttributeMetaData;
+import org.jboss.identity.spi.model.IdentityObjectCredentialType;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObject;
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectRelationship;
@@ -46,6 +47,9 @@
import org.jboss.identity.impl.model.hibernate.HibernateRealm;
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectCredentialType;
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectCredential;
+import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectAttribute;
+import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectTextAttribute;
+import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute;
import org.jboss.identity.impl.api.PageSearchControl;
import org.jboss.identity.impl.api.SortByNameSearchControl;
import org.jboss.identity.impl.api.AttributeFilterSearchControl;
@@ -157,7 +161,7 @@
private Map<String, Set<String>> attributeMappings = new HashMap<String, Set<String>>();
// <IdentityObjectType name, <Attribute name, MD>
- private Map<String, Map<String, AttributeMetaData>> attributesMetaData = new HashMap<String, Map<String, AttributeMetaData>>();
+ private Map<String, Map<String, IdentityObjectAttributeMetaData>> attributesMetaData = new HashMap<String, Map<String, IdentityObjectAttributeMetaData>>();
// <IdentityObjectType name, <Attribute store mapping, Attribute name>
private Map<String, Map<String, String>> reverseAttributeMappings = new HashMap<String, Map<String, String>>();
@@ -201,9 +205,9 @@
for (IdentityObjectTypeMetaData identityObjectTypeMetaData : configurationMD.getSupportedIdentityTypes())
{
Set<String> names = new HashSet<String>();
- Map<String, AttributeMetaData> metadataMap = new HashMap<String, AttributeMetaData>();
+ Map<String, IdentityObjectAttributeMetaData> metadataMap = new HashMap<String, IdentityObjectAttributeMetaData>();
Map<String, String> reverseMap = new HashMap<String, String>();
- for (AttributeMetaData attributeMetaData : identityObjectTypeMetaData.getAttributes())
+ for (IdentityObjectAttributeMetaData attributeMetaData : identityObjectTypeMetaData.getAttributes())
{
names.add(attributeMetaData.getName());
metadataMap.put(attributeMetaData.getName(), attributeMetaData);
@@ -403,7 +407,7 @@
{
for (Map.Entry<String, String[]> entry : attributes.entrySet())
{
- io.addAttribute(entry.getKey(), entry.getValue());
+ io.addTextAttribute(entry.getKey(), entry.getValue());
}
}
@@ -1249,7 +1253,7 @@
// Attribute store
- public <T extends IdentityObjectType> Set<String> getSupportedAttributeNames(IdentityStoreInvocationContext ctx, T identityType) throws IdentityException
+ public Set<String> getSupportedAttributeNames(IdentityStoreInvocationContext ctx, IdentityObjectType identityType) throws IdentityException
{
checkIOType(identityType);
@@ -1262,21 +1266,41 @@
}
- public Map<String, String[]> getAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity) throws IdentityException
+ public IdentityObjectAttribute getAttribute(IdentityStoreInvocationContext ctx, IdentityObject identity, String name) throws IdentityException
{
+ HibernateIdentityObject hibernateObject = safeGet(ctx, identity);
+ Set<HibernateIdentityObjectAttribute> storeAttributes = hibernateObject.getAttributes();
+ Map<String, IdentityObjectAttribute> result = new HashMap<String, IdentityObjectAttribute>();
+
+ // Remap the names
+ for (HibernateIdentityObjectAttribute attribute : storeAttributes)
+ {
+ String mappedName = resolveAttributeNameFromStoreMapping(identity.getIdentityType(), name);
+ if (mappedName != null)
+ {
+ return attribute;
+ }
+ }
+
+ return null;
+ }
+
+ public Map<String, IdentityObjectAttribute> getAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity) throws IdentityException
+ {
+
HibernateIdentityObject hibernateObject = safeGet(ctx, identity);
- Map<String, String[]> storeAttributes = hibernateObject.getAttributesAsMap();
- Map<String, String[]> result = new HashMap<String, String[]>();
+ Set<HibernateIdentityObjectAttribute> storeAttributes = hibernateObject.getAttributes();
+ Map<String, IdentityObjectAttribute> result = new HashMap<String, IdentityObjectAttribute>();
// Remap the names
- for (Map.Entry<String, String[]> entry : storeAttributes.entrySet())
+ for (HibernateIdentityObjectAttribute attribute : storeAttributes)
{
- String name = resolveAttributeNameFromStoreMapping(identity.getIdentityType(), entry.getKey());
+ String name = resolveAttributeNameFromStoreMapping(identity.getIdentityType(), attribute.getName());
if (name != null)
{
- result.put(name, entry.getValue());
+ result.put(name, attribute);
}
}
@@ -1284,55 +1308,139 @@
}
- public void updateAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, Map<String, String[]> attributes) throws IdentityException
+ public Map<String, IdentityObjectAttributeMetaData> getAttributesMetaData(IdentityStoreInvocationContext invocationContext,
+ IdentityObjectType identityType)
{
+ return attributesMetaData.get(identityType.getName());
+ }
+
+
+ public void updateAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException
+ {
+
if (attributes == null)
{
throw new IllegalArgumentException("attributes are null");
}
- Map<String, String[]> mappedAttributes = new HashMap<String, String[]>();
+ //TODO: check if attribute values time is same as MD type
- for (Map.Entry<String, String[]> entry : attributes.entrySet())
+ Map<String, IdentityObjectAttribute> mappedAttributes = new HashMap<String, IdentityObjectAttribute>();
+
+ Map<String, IdentityObjectAttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
+
+ for (IdentityObjectAttribute attribute : attributes)
{
- String name = resolveAttributeStoreMapping(identity.getIdentityType(), entry.getKey());
- mappedAttributes.put(name, entry.getValue());
+ String name = resolveAttributeStoreMapping(identity.getIdentityType(), attribute.getName());
+ mappedAttributes.put(name, attribute);
- Map<String, AttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
- if (mdMap != null)
+ if (mdMap == null || !mdMap.containsKey(attribute.getName()))
{
- AttributeMetaData amd = mdMap.get(entry.getKey());
- if (amd != null && !amd.isMultivalued() && entry.getValue().length > 1)
+ if (!isAllowNotDefinedAttributes)
{
- throw new IdentityException("Cannot assigned multiply values to single valued attribute: " + entry.getKey());
+ throw new IdentityException("Cannot add not defined attribute. Use '" + ALLOW_NOT_DEFINED_ATTRIBUTES +
+ "' option if needed. Attribute name: " + attribute.getName());
}
- if (amd != null && amd.isReadonly())
- {
- throw new IdentityException("Cannot update readonly attribute: " + entry.getKey());
- }
}
- else
+
+ IdentityObjectAttributeMetaData amd = mdMap.get(attribute.getName());
+
+ if (amd != null)
{
- if (!isAllowNotDefinedAttributes)
+
+ if (!amd.isMultivalued() && attribute.getSize() > 1)
{
- throw new IdentityException("Cannot update not defined attribute. Use '" + ALLOW_NOT_DEFINED_ATTRIBUTES +
- "' option if needed. Attribute name: " + entry.getKey());
+ throw new IdentityException("Cannot assigned multiply values to single valued attribute: " + attribute.getName());
}
+ if (amd.isReadonly())
+ {
+ throw new IdentityException("Cannot update readonly attribute: " + attribute.getName());
+ }
+
+ String type = amd.getType();
+
+ // check if all values have proper type
+
+ for (Object value : attribute.getValues())
+ {
+ if (type.equals(IdentityObjectAttributeMetaData.TEXT_TYPE) && !(value instanceof String))
+ {
+ throw new IdentityException("Cannot update text type attribute with not String type value: "
+ + attribute.getName() + " / " + value);
+ }
+ if (type.equals(IdentityObjectAttributeMetaData.BINARY_TYPE) && !(value instanceof byte[]))
+ {
+ throw new IdentityException("Cannot update binary type attribute with not byte[] type value: "
+ + attribute.getName() + " / " + value);
+ }
+ }
}
}
+
HibernateIdentityObject hibernateObject = safeGet(ctx, identity);
for (String name : mappedAttributes.keySet())
{
- hibernateObject.updateAttribute(name, mappedAttributes.get(name));
+ IdentityObjectAttribute attribute = mappedAttributes.get(name);
+
+ IdentityObjectAttributeMetaData amd = mdMap.get(attribute.getName());
+
+ // Default to text
+ String type = amd != null ? amd.getType() : IdentityObjectAttributeMetaData.TEXT_TYPE;
+
+ for (HibernateIdentityObjectAttribute storeAttribute : hibernateObject.getAttributes())
+ {
+ if (storeAttribute.getName().equals(name))
+ {
+ if (storeAttribute instanceof HibernateIdentityObjectTextAttribute)
+ {
+ if (!type.equals(IdentityObjectAttributeMetaData.TEXT_TYPE))
+ {
+ throw new IdentityException("Wrong attribute mapping. Attribute persisted as text is mapped with: "
+ + type + ". Attribute name: " + name);
+ }
+
+
+ Set<String> v = new HashSet<String>();
+ for (Object value : attribute.getValues())
+ {
+ v.add(value.toString());
+ }
+
+ ((HibernateIdentityObjectTextAttribute)storeAttribute).setValues(v);
+ }
+ else if (storeAttribute instanceof HibernateIdentityObjectBinaryAttribute)
+ {
+
+ if (!type.equals(IdentityObjectAttributeMetaData.BINARY_TYPE))
+ {
+ throw new IdentityException("Wrong attribute mapping. Attribute persisted as binary is mapped with: "
+ + type + ". Attribute name: " + name);
+ }
+
+ Set<byte[]> v = new HashSet<byte[]>();
+ for (Object value : attribute.getValues())
+ {
+ v.add((byte[])value);
+ }
+
+ ((HibernateIdentityObjectBinaryAttribute)storeAttribute).setValues(v);
+ }
+ else
+ {
+ throw new IdentityException("Internal identity store error");
+ }
+ break;
+ }
+ }
}
}
- public void addAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, Map<String, String[]> attributes) throws IdentityException
+ public void addAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException
{
if (attributes == null)
@@ -1340,33 +1448,54 @@
throw new IllegalArgumentException("attributes are null");
}
- Map<String, String[]> mappedAttributes = new HashMap<String, String[]>();
+ Map<String, IdentityObjectAttribute> mappedAttributes = new HashMap<String, IdentityObjectAttribute>();
- for (Map.Entry<String, String[]> entry : attributes.entrySet())
+ Map<String, IdentityObjectAttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
+
+ for (IdentityObjectAttribute attribute : attributes)
{
- String name = resolveAttributeStoreMapping(identity.getIdentityType(), entry.getKey());
- mappedAttributes.put(name, entry.getValue());
+ String name = resolveAttributeStoreMapping(identity.getIdentityType(), attribute.getName());
+ mappedAttributes.put(name, attribute);
- Map<String, AttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
- if (mdMap != null)
+ if ((mdMap == null || !mdMap.containsKey(attribute.getName())) &&
+ !isAllowNotDefinedAttributes)
{
- AttributeMetaData amd = mdMap.get(entry.getKey());
- if (amd != null && !amd.isMultivalued() && entry.getValue().length > 1)
+ throw new IdentityException("Cannot add not defined attribute. Use '" + ALLOW_NOT_DEFINED_ATTRIBUTES +
+ "' option if needed. Attribute name: " + attribute.getName());
+
+ }
+
+ IdentityObjectAttributeMetaData amd = mdMap.get(attribute.getName());
+
+ if (amd != null)
+ {
+
+ if (!amd.isMultivalued() && attribute.getSize() > 1)
{
- throw new IdentityException("Cannot add multiply values to single valued attribute: " + entry.getKey());
+ throw new IdentityException("Cannot add multiply values to single valued attribute: " + attribute.getName());
}
- if (amd != null && amd.isReadonly())
+ if (amd.isReadonly())
{
- throw new IdentityException("Cannot add readonly attribute: " + entry.getKey());
+ throw new IdentityException("Cannot add readonly attribute: " + attribute.getName());
}
- }
- else
- {
- if (!isAllowNotDefinedAttributes)
+
+ String type = amd.getType();
+
+ // check if all values have proper type
+
+ for (Object value : attribute.getValues())
{
- throw new IdentityException("Cannot add not defined attribute. Use '" + ALLOW_NOT_DEFINED_ATTRIBUTES +
- "' option if needed. Attribute name: " + entry.getKey());
+ if (type.equals(IdentityObjectAttributeMetaData.TEXT_TYPE) && !(value instanceof String))
+ {
+ throw new IdentityException("Cannot add text type attribute with not String type value: "
+ + attribute.getName() + " / " + value);
+ }
+ if (type.equals(IdentityObjectAttributeMetaData.BINARY_TYPE) && !(value instanceof byte[]))
+ {
+ throw new IdentityException("Cannot add binary type attribute with not byte[] type value: "
+ + attribute.getName() + " / " + value);
+ }
}
}
}
@@ -1375,7 +1504,94 @@
for (String name : mappedAttributes.keySet())
{
- hibernateObject.addAttributeValues(name, mappedAttributes.get(name));
+ IdentityObjectAttribute attribute = mappedAttributes.get(name);
+
+ IdentityObjectAttributeMetaData amd = mdMap.get(attribute.getName());
+
+ // Default to text
+ String type = amd != null ? amd.getType() : IdentityObjectAttributeMetaData.TEXT_TYPE;
+
+ HibernateIdentityObjectAttribute hibernateAttribute = null;
+
+ for (HibernateIdentityObjectAttribute storeAttribute : hibernateObject.getAttributes())
+ {
+ if (storeAttribute.getName().equals(name))
+ {
+ hibernateAttribute = storeAttribute;
+ break;
+ }
+ }
+
+ if (hibernateAttribute != null)
+ {
+ if (hibernateAttribute instanceof HibernateIdentityObjectTextAttribute)
+ {
+ if (!type.equals(IdentityObjectAttributeMetaData.TEXT_TYPE))
+ {
+ throw new IdentityException("Wrong attribute mapping. Attribute persisted as text is mapped with: "
+ + type + ". Attribute name: " + name);
+ }
+
+
+ Set<String> mergedValues = new HashSet<String>(hibernateAttribute.getValues());
+ for (Object value : attribute.getValues())
+ {
+ mergedValues.add(value.toString());
+ }
+
+ ((HibernateIdentityObjectTextAttribute)hibernateAttribute).setValues(mergedValues);
+ }
+ else if (hibernateAttribute instanceof HibernateIdentityObjectBinaryAttribute)
+ {
+
+ if (!type.equals(IdentityObjectAttributeMetaData.BINARY_TYPE))
+ {
+ throw new IdentityException("Wrong attribute mapping. Attribute persisted as binary is mapped with: "
+ + type + ". Attribute name: " + name);
+ }
+
+ Set<byte[]> mergedValues = new HashSet<byte[]>(hibernateAttribute.getValues());
+ for (Object value : attribute.getValues())
+ {
+ mergedValues.add((byte[])value);
+ }
+
+ ((HibernateIdentityObjectBinaryAttribute)hibernateAttribute).setValues(mergedValues);
+ }
+ else
+ {
+ throw new IdentityException("Internal identity store error");
+ }
+ break;
+
+ }
+ else
+ {
+ if (type.equals(IdentityObjectAttributeMetaData.TEXT_TYPE))
+ {
+ Set<String> values = new HashSet<String>();
+
+ for (Object value: attribute.getValues())
+ {
+ values.add(value.toString());
+ }
+ hibernateAttribute = new HibernateIdentityObjectTextAttribute(hibernateObject, name, values);
+ }
+ else if (type.equals(IdentityObjectAttributeMetaData.BINARY_TYPE))
+ {
+ Set<byte[]> values = new HashSet<byte[]>();
+
+ for (Object value: attribute.getValues())
+ {
+ values.add((byte[])value);
+ }
+ hibernateAttribute = new HibernateIdentityObjectBinaryAttribute(hibernateObject, name, values);
+ }
+
+
+ hibernateObject.getAttributes().add(hibernateAttribute);
+
+ }
}
}
@@ -1394,11 +1610,11 @@
String name = resolveAttributeStoreMapping(identity.getIdentityType(), attributes[i]);
mappedAttributes[i] = name;
- Map<String, AttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
+ Map<String, IdentityObjectAttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
if (mdMap != null)
{
- AttributeMetaData amd = mdMap.get(attributes[i]);
+ IdentityObjectAttributeMetaData amd = mdMap.get(attributes[i]);
if (amd != null && amd.isRequired())
{
throw new IdentityException("Cannot remove required attribute: " + attributes[i]);
@@ -1864,7 +2080,7 @@
if (attributesMetaData.containsKey(type.getName()))
{
- AttributeMetaData amd = attributesMetaData.get(type.getName()).get(name);
+ IdentityObjectAttributeMetaData amd = attributesMetaData.get(type.getName()).get(name);
if (amd != null)
{
@@ -1903,22 +2119,20 @@
}
//TODO: this kills performance and is present here only as "quick" hack to have the feature present and let to add test cases
- //TODO: needs to be redone on the hibernate query level
+ //TODO: needs to be redone at the hibernate query level
private void filterByAttributesValues(Collection<IdentityObject> objects, Map<String, String[]> attrs)
{
Set<IdentityObject> toRemove = new HashSet<IdentityObject>();
for (IdentityObject object : objects)
{
- boolean add = true;
-
- Map<String, String[]> presentAttrs = ((HibernateIdentityObject)object).getAttributesAsMap();
+ Map<String, Collection> presentAttrs = ((HibernateIdentityObject)object).getAttributesAsMap();
for (Map.Entry<String, String[]> entry : attrs.entrySet())
{
if (presentAttrs.containsKey(entry.getKey()))
{
Set<String> given = new HashSet<String>(Arrays.asList(entry.getValue()));
- Set<String> present = new HashSet<String>(Arrays.asList(presentAttrs.get(entry.getKey())));
+ Collection present = presentAttrs.get(entry.getKey());
for (String s : given)
{
@@ -1946,5 +2160,4 @@
}
-
}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreImpl.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -31,22 +31,23 @@
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.spi.model.IdentityObjectRelationship;
+import org.jboss.identity.spi.model.IdentityObjectCredential;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
-import org.jboss.identity.spi.credential.IdentityObjectCredential;
-import org.jboss.identity.spi.attribute.AttributeMetaData;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.impl.store.FeaturesMetaDataImpl;
import org.jboss.identity.impl.model.ldap.LDAPIdentityObjectImpl;
import org.jboss.identity.impl.model.ldap.LDAPIdentityObjectRelationshipImpl;
import org.jboss.identity.impl.helper.Tools;
import org.jboss.identity.impl.NotYetImplementedException;
-import org.jboss.identity.impl.types.SimpleIdentityObjectType;
import org.jboss.identity.impl.api.SortByNameSearchControl;
import org.jboss.identity.impl.api.PageSearchControl;
import org.jboss.identity.impl.api.AttributeFilterSearchControl;
import org.jboss.identity.impl.api.NameFilterSearchControl;
+import org.jboss.identity.impl.api.SimpleAttributeImpl;
import javax.naming.ldap.LdapContext;
import javax.naming.ldap.LdapName;
@@ -105,7 +106,7 @@
private static Set<Class> supportedSearchControls = new HashSet<Class>();
// <IdentityObjectType name, <Attribute name, MD>
- private Map<String, Map<String, AttributeMetaData>> attributesMetaData = new HashMap<String, Map<String, AttributeMetaData>>();
+ private Map<String, Map<String, IdentityObjectAttributeMetaData>> attributesMetaData = new HashMap<String, Map<String, IdentityObjectAttributeMetaData>>();
static {
// List all supported controls classes
@@ -139,8 +140,8 @@
for (IdentityObjectTypeMetaData identityObjectTypeMetaData : configurationMD.getSupportedIdentityTypes())
{
- Map<String, AttributeMetaData> metadataMap = new HashMap<String, AttributeMetaData>();
- for (AttributeMetaData attributeMetaData : identityObjectTypeMetaData.getAttributes())
+ Map<String, IdentityObjectAttributeMetaData> metadataMap = new HashMap<String, IdentityObjectAttributeMetaData>();
+ for (IdentityObjectAttributeMetaData attributeMetaData : identityObjectTypeMetaData.getAttributes())
{
metadataMap.put(attributeMetaData.getName(), attributeMetaData);
}
@@ -272,7 +273,7 @@
{
throw new IdentityException("Failed to close LDAP connection", e);
}
- }
+ }
return findIdentityObject(invocationCtx, name, type);
@@ -1538,10 +1539,21 @@
return getTypeConfiguration(invocationContext, identityType).getMappedAttributesNames();
}
+ public Map<String, IdentityObjectAttributeMetaData> getAttributesMetaData(IdentityStoreInvocationContext invocationContext, IdentityObjectType identityObjectType)
+ {
+ return attributesMetaData.get(identityObjectType.getName());
+ }
- public Map<String, String[]> getAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity) throws IdentityException
+
+ public IdentityObjectAttribute getAttribute(IdentityStoreInvocationContext invocationContext, IdentityObject identity, String name) throws IdentityException
{
+ //TODO: dummy temporary implementation
+ return getAttributes(invocationContext, identity).get(name);
+ }
+ public Map<String, IdentityObjectAttribute> getAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity) throws IdentityException
+ {
+
if (log.isLoggable(Level.FINER))
{
log.finer(toString() + ".getAttributes with "
@@ -1549,7 +1561,7 @@
);
}
- Map<String, String[]> attrsMap = new HashMap<String, String[]>();
+ Map<String, IdentityObjectAttribute> attrsMap = new HashMap<String, IdentityObjectAttribute>();
LDAPIdentityObjectImpl ldapIdentity = getSafeLDAPIO(ctx, identity);
@@ -1574,17 +1586,17 @@
if (attr != null)
{
+
+ IdentityObjectAttribute identityObjectAttribute = new SimpleAttributeImpl(name);
+
NamingEnumeration values = attr.getAll();
- Set<String> attrValues = new HashSet<String>();
-
while (values.hasMoreElements())
{
- String value = values.nextElement().toString();
- attrValues.add(value);
+ identityObjectAttribute.addValue(values.nextElement().toString());
}
- attrsMap.put(name, attrValues.toArray(new String[attrValues.size()]));
+ attrsMap.put(name, identityObjectAttribute);
}
else
{
@@ -1612,7 +1624,7 @@
}
- public void updateAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, Map<String, String[]> attributes) throws IdentityException
+ public void updateAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException
{
if (log.isLoggable(Level.FINER))
@@ -1640,8 +1652,10 @@
try
{
- for (String name : attributes.keySet())
+ for (IdentityObjectAttribute attribute : attributes)
{
+ String name = attribute.getName();
+
String attributeName = getTypeConfiguration(ctx, identity.getIdentityType()).getAttributeMapping(name);
if (attributeName == null)
@@ -1655,14 +1669,14 @@
Attributes attrs = new BasicAttributes(true);
Attribute attr = new BasicAttribute(attributeName);
- String[] values = attributes.get(name);
+ Collection values = attribute.getValues();
- Map<String, AttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
+ Map<String, IdentityObjectAttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
if (mdMap != null)
{
- AttributeMetaData amd = mdMap.get(attributeName);
- if (amd != null && !amd.isMultivalued() && values.length > 1)
+ IdentityObjectAttributeMetaData amd = mdMap.get(attributeName);
+ if (amd != null && !amd.isMultivalued() && values.size() > 1)
{
throw new IdentityException("Cannot assigned multiply values to single valued attribute: " + attributeName);
}
@@ -1674,7 +1688,7 @@
if (values != null)
{
- for (String value : values)
+ for (Object value : values)
{
attr.add(value);
}
@@ -1706,7 +1720,7 @@
}
}
- public void addAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, Map<String, String[]> attributes) throws IdentityException
+ public void addAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException
{
if (log.isLoggable(Level.FINER))
@@ -1734,8 +1748,10 @@
try
{
- for (String name : attributes.keySet())
+ for (IdentityObjectAttribute attribute : attributes)
{
+ String name = attribute.getName();
+
String attributeName = getTypeConfiguration(ctx, identity.getIdentityType()).getAttributeMapping(name);
if (attributeName == null)
@@ -1749,14 +1765,14 @@
Attributes attrs = new BasicAttributes(true);
Attribute attr = new BasicAttribute(attributeName);
- String[] values = attributes.get(name);
+ Collection values = attribute.getValues();
- Map<String, AttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
+ Map<String, IdentityObjectAttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
if (mdMap != null)
{
- AttributeMetaData amd = mdMap.get(attributeName);
- if (amd != null && !amd.isMultivalued() && values.length > 1)
+ IdentityObjectAttributeMetaData amd = mdMap.get(attributeName);
+ if (amd != null && !amd.isMultivalued() && values.size() > 1)
{
throw new IdentityException("Cannot assigned multiply values to single valued attribute: " + attributeName);
}
@@ -1769,7 +1785,7 @@
if (values != null)
{
- for (String value : values)
+ for (Object value : values)
{
attr.add(value);
}
@@ -1801,18 +1817,18 @@
}
}
- public void removeAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, String[] attributes) throws IdentityException
+ public void removeAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, String[] attributeNames) throws IdentityException
{
if (log.isLoggable(Level.FINER))
{
log.finer(toString() + ".removeAttributes with "
+ "identity: " + identity
- + "attributes: " + attributes
+ + "attributeNames: " + attributeNames
);
}
- if (attributes == null)
+ if (attributeNames == null)
{
throw new IllegalArgumentException("attributes is null");
}
@@ -1827,7 +1843,7 @@
try
{
- for (String name : attributes)
+ for (String name : attributeNames)
{
String attributeName = getTypeConfiguration(ctx, identity.getIdentityType()).getAttributeMapping(name);
@@ -1837,12 +1853,12 @@
continue;
}
- Map<String, AttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
+ Map<String, IdentityObjectAttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
if (mdMap != null)
{
//TODO: maybe perform a schema check if this attribute is not required on the LDAP level
- AttributeMetaData amd = mdMap.get(name);
+ IdentityObjectAttributeMetaData amd = mdMap.get(name);
if (amd != null && amd.isRequired())
{
throw new IdentityException("Cannot remove required attribute: " + name);
Deleted: trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreInvocationContext.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreInvocationContext.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreInvocationContext.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,40 +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.store.ldap;
-
-import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
-
-import javax.naming.ldap.LdapContext;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-//public interface LDAPIdentityStoreInvocationContext extends IdentityStoreInvocationContext
-//{
-//
-// LdapContext getLdapContext() throws Exception;
-//
-// LDAPIdentityStoreConfiguration getConfiguration();
-//
-//}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -24,7 +24,7 @@
import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
import org.jboss.identity.spi.configuration.metadata.RelationshipMetaData;
-import org.jboss.identity.spi.attribute.AttributeMetaData;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
import java.util.Map;
import java.util.Set;
@@ -134,7 +134,7 @@
attributeNames = new HashMap<String, String>();
- for (AttributeMetaData attributeMetaData : objectTypeMD.getAttributes())
+ for (IdentityObjectAttributeMetaData attributeMetaData : objectTypeMD.getAttributes())
{
attributeNames.put(attributeMetaData.getName(), attributeMetaData.getStoreMapping());
}
Deleted: trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,73 +0,0 @@
-/*
- * 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.identity.impl.types;
-
-import org.jboss.identity.exception.PolicyValidationException;
-import org.jboss.identity.api.Group;
-import org.jboss.identity.api.GroupType;
-
-/**
- * A simple implementation of group
- * @author Anil.Saldhana at redhat.com
- * @since Aug 6, 2008
- */
-public class SimpleGroup implements Group
-{
- private String name;
-
- public SimpleGroup(String name)
- {
- this.name = name;
- }
-
- public String getId()
- {
- return null;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void validatePolicy() throws PolicyValidationException
- {
-
- }
-
- public String getDisplayName()
- {
- return null;
- }
-
- public String getDescription()
- {
- return null;
- }
-
- public GroupType getGroupType()
- {
- return null;
- }
-
-
-}
\ No newline at end of file
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentityObject.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentityObject.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentityObject.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -35,7 +35,6 @@
public class SimpleIdentityObject implements IdentityObject
{
-
private final String name;
private final String id;
@@ -44,6 +43,19 @@
public SimpleIdentityObject(String name, String id, IdentityObjectType type)
{
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name is null");
+ }
+ if (id == null)
+ {
+ throw new IllegalArgumentException("id is null");
+ }
+ if (type == null)
+ {
+ throw new IllegalArgumentException("type is null");
+ }
+
this.name = name;
this.id = id;
this.type = type;
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentityObjectType.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentityObjectType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentityObjectType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -39,6 +39,11 @@
public SimpleIdentityObjectType(String name)
{
+ if (name == null)
+ {
+ throw new IllegalArgumentException(" is null");
+ }
+
this.name = name;
}
Modified: trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/OrganizationTest.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/OrganizationTest.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/OrganizationTest.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -28,11 +28,15 @@
import org.jboss.identity.api.Identity;
import org.jboss.identity.api.RoleType;
import org.jboss.identity.api.IdentitySessionFactory;
+import org.jboss.identity.api.Attribute;
+import org.jboss.identity.api.AttributeDescription;
import org.jboss.identity.p3p.P3PConstants;
import java.util.Collection;
import java.util.Map;
import java.util.HashMap;
+import java.util.Random;
+import java.util.Arrays;
import junit.framework.Assert;
@@ -258,17 +262,34 @@
assertTrue(groups.contains(employeesGroup));
assertTrue(groups.contains(portalTeamGroup));
+
+ // Check that binary attribute picture is mapped
+
+ AttributeDescription attributeDescription = session.getAttributesManager().getAttributeDescription(bdawidowUser, "picture");
+ assertNotNull(attributeDescription);
+ assertEquals("binary", attributeDescription.getType());
+
+
+ // Generate random binary data for binary attribute
+ Random random = new Random();
+
+ byte[] picture = new byte[5120];
+ random.nextBytes(picture);
// User attributes
- Map<String, String[]> userInfo = new HashMap<String, String[]>();
- userInfo.put(P3PConstants.INFO_USER_NAME_GIVEN, new String[]{"Boleslaw"});
- userInfo.put(P3PConstants.INFO_USER_NAME_FAMILY, new String[]{"Dawidowicz"});
+ Attribute[] userInfo = new Attribute[]
+ {
+ new SimpleAttributeImpl(P3PConstants.INFO_USER_NAME_GIVEN, new String[]{"Boleslaw"}),
+ new SimpleAttributeImpl(P3PConstants.INFO_USER_NAME_FAMILY, new String[]{"Dawidowicz"}),
+ new SimpleAttributeImpl("picture", new byte[][]{picture})
+ };
session.getAttributesManager().addAttributes(bdawidowUser, userInfo);
- userInfo = session.getAttributesManager().getAttributes(bdawidowUser);
- assertEquals(2, userInfo.keySet().size());
- assertEquals("Dawidowicz", (userInfo.get(P3PConstants.INFO_USER_NAME_FAMILY))[0]);
+ Map<String, Attribute> attributes = session.getAttributesManager().getAttributes(bdawidowUser);
+ assertEquals(3, attributes.keySet().size());
+ assertEquals("Dawidowicz", (attributes.get(P3PConstants.INFO_USER_NAME_FAMILY)).getValue());
+ assertTrue(Arrays.equals((byte[])attributes.get("picture").getValue(), picture));
session.getTransaction().commit();
Modified: trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/CommonIdentityStoreTest.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/CommonIdentityStoreTest.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/CommonIdentityStoreTest.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -23,7 +23,8 @@
package org.jboss.identity.impl.store;
import org.jboss.identity.spi.model.IdentityObject;
-import org.jboss.identity.spi.credential.IdentityObjectCredential;
+import org.jboss.identity.spi.model.IdentityObjectCredential;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
import org.jboss.identity.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.impl.api.PasswordCredential;
import org.jboss.identity.impl.api.BinaryCredential;
@@ -31,8 +32,8 @@
import org.jboss.identity.impl.api.SortByNameSearchControl;
import org.jboss.identity.impl.api.AttributeFilterSearchControl;
import org.jboss.identity.impl.api.PageSearchControl;
-import org.jboss.identity.impl.model.hibernate.HibernateIdentityObject;
-import org.opends.server.controls.PagedResultsControl;
+import org.jboss.identity.impl.api.SimpleAttributeImpl;
+import org.jboss.identity.api.Attribute;
import java.util.Collection;
import java.util.Map;
@@ -150,32 +151,32 @@
testContext.flush();
- Map<String, String[]> attrs = new HashMap<String, String[]>();
+ //Map<String, String[]> attrs = new HashMap<String, String[]>();
+ IdentityObjectAttribute[] attrs = new IdentityObjectAttribute[]{
+ new SimpleAttributeImpl("key1", new String[]{"val1", "val2", "val3"}),
+ new SimpleAttributeImpl("key2", new String[]{"val1", "val2", "val3", "val4"})
+ };
- attrs.put("key1", new String[]{"val1", "val2", "val3"});
-
- attrs.put("key2", new String[]{"val1", "val2", "val3", "val4"});
-
testContext.getStore().addAttributes(testContext.getCtx(), user1, attrs);
testContext.flush();
- Map<String, String[]> persistedAttrs = testContext.getStore().getAttributes(testContext.getCtx(), user1);
+ Map<String, IdentityObjectAttribute> persistedAttrs = testContext.getStore().getAttributes(testContext.getCtx(), user1);
assertEquals(2, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("key1"));
- assertEquals(3, persistedAttrs.get("key1").length);
+ assertEquals(3, persistedAttrs.get("key1").getSize());
assertTrue(persistedAttrs.containsKey("key2"));
- assertEquals(4, persistedAttrs.get("key2").length);
+ assertEquals(4, persistedAttrs.get("key2").getSize());
testContext.flush();
- attrs = new HashMap<String, String[]>();
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttributeImpl("key3", new String[]{"val1"})
+ };
- attrs.put("key3", new String[]{"val1"});
-
testContext.getStore().addAttributes(testContext.getCtx(), user1, attrs);
testContext.flush();
@@ -185,17 +186,19 @@
assertEquals(3, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("key1"));
- assertEquals(3, persistedAttrs.get("key1").length);
+ assertEquals(3, persistedAttrs.get("key1").getSize());
assertTrue(persistedAttrs.containsKey("key2"));
- assertEquals(4, persistedAttrs.get("key2").length);
+ assertEquals(4, persistedAttrs.get("key2").getSize());
assertTrue(persistedAttrs.containsKey("key3"));
- assertEquals(1, persistedAttrs.get("key3").length);
+ assertEquals(1, persistedAttrs.get("key3").getSize());
testContext.flush();
- attrs.put("key3", new String[]{"val2"});
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttributeImpl("key3", new String[]{"val2"})
+ };
testContext.getStore().addAttributes(testContext.getCtx(), user1, attrs);
@@ -206,7 +209,7 @@
assertEquals(3, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("key3"));
- assertEquals(2, persistedAttrs.get("key3").length);
+ assertEquals(2, persistedAttrs.get("key3").getSize());
testContext.flush();
@@ -219,7 +222,7 @@
assertEquals(3, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("key3"));
- assertEquals(1, persistedAttrs.get("key3").length);
+ assertEquals(1, persistedAttrs.get("key3").getSize());
testContext.flush();
@@ -495,7 +498,6 @@
}
-
}
if (testContext.getStore().getSupportedFeatures().isControlSupported(IdentityTypeEnum.IDENTITY, AttributeFilterSearchControl.class))
@@ -504,8 +506,11 @@
attrs.put("phone", new String[] {"777 777 777"});
attrs.put("description", new String[] {"sample desc"});
- testContext.getStore().addAttributes(testContext.getCtx(), group1, attrs);
+ IdentityObjectAttribute phone = new SimpleAttributeImpl("phone", new String[] {"777 777 777"});
+ IdentityObjectAttribute description = new SimpleAttributeImpl("description", new String[] {"sample desc"});
+ testContext.getStore().addAttributes(testContext.getCtx(), group1, new IdentityObjectAttribute[]{phone, description});
+
control = new AttributeFilterSearchControl(attrs);
results = testContext.getStore().
Modified: trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreTestCase.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -23,40 +23,24 @@
package org.jboss.identity.impl.store.hibernate;
import org.jboss.identity.spi.model.IdentityObject;
-import org.jboss.identity.spi.model.IdentityObjectType;
-import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.spi.store.IdentityStore;
-import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.store.IdentityStoreSession;
-import org.jboss.identity.spi.searchcontrol.IdentityObjectSearchControl;
-import org.jboss.identity.spi.credential.IdentityObjectCredentialType;
import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.spi.configuration.metadata.IdentityConfigurationMetaData;
import org.jboss.identity.impl.store.hibernate.HibernateIdentityStoreImpl;
import org.jboss.identity.impl.store.hibernate.HibernateTestBase;
-import org.jboss.identity.impl.store.RelationshipTypeEnum;
import org.jboss.identity.impl.store.IdentityTypeEnum;
import org.jboss.identity.impl.store.CommonIdentityStoreTest;
import org.jboss.identity.impl.store.IdentityStoreTestContext;
-import org.jboss.identity.impl.store.FeaturesMetaDataImpl;
-import org.jboss.identity.impl.model.hibernate.HibernateRealm;
-import org.jboss.identity.impl.configuration.metadata.IdentityStoreConfigurationMetaDataImpl;
-import org.jboss.identity.impl.configuration.metadata.IdentityObjectTypeMetaDataImpl;
-import org.jboss.identity.impl.configuration.metadata.IdentityConfigurationMetaDataImpl;
import org.jboss.identity.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.jboss.identity.impl.api.SimpleAttributeImpl;
import org.jboss.identity.exception.IdentityException;
import org.hibernate.ejb.HibernateEntityManager;
-import java.util.Collection;
-import java.util.Set;
import java.util.Map;
import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedList;
import java.io.File;
/**
@@ -186,30 +170,31 @@
em.flush();
- Map<String, String[]> attrs = new HashMap<String, String[]>();
+ IdentityObjectAttribute[] attrs = new IdentityObjectAttribute[]{
+ new SimpleAttributeImpl("key1", new String[]{"val1", "val2", "val3"}),
+ new SimpleAttributeImpl("key2", new String[]{"val1", "val2", "val3", "val4"})
+ };
- attrs.put("key1", new String[]{"val1", "val2", "val3"});
- attrs.put("key2", new String[]{"val1", "val2", "val3", "val4"});
-
store.addAttributes(ctx, user1, attrs);
em.flush();
- Map<String, String[]> persistedAttrs = store.getAttributes(ctx, user1);
+ Map<String, IdentityObjectAttribute> persistedAttrs = store.getAttributes(ctx, user1);
assertEquals(2, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("key1"));
- assertEquals(3, persistedAttrs.get("key1").length);
+ assertEquals(3, persistedAttrs.get("key1").getSize());
assertTrue(persistedAttrs.containsKey("key2"));
- assertEquals(4, persistedAttrs.get("key2").length);
+ assertEquals(4, persistedAttrs.get("key2").getSize());
em.flush();
- attrs = new HashMap<String, String[]>();
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttributeImpl("key3", new String[]{"val1"})
+ };
- attrs.put("key3", new String[]{"val1"});
store.addAttributes(ctx, user1, attrs);
@@ -220,17 +205,19 @@
assertEquals(3, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("key1"));
- assertEquals(3, persistedAttrs.get("key1").length);
+ assertEquals(3, persistedAttrs.get("key1").getSize());
assertTrue(persistedAttrs.containsKey("key2"));
- assertEquals(4, persistedAttrs.get("key2").length);
+ assertEquals(4, persistedAttrs.get("key2").getSize());
assertTrue(persistedAttrs.containsKey("key3"));
- assertEquals(1, persistedAttrs.get("key3").length);
+ assertEquals(1, persistedAttrs.get("key3").getSize());
em.flush();
- attrs.put("key3", new String[]{"val2"});
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttributeImpl("key3", new String[]{"val2"})
+ };
store.addAttributes(ctx, user1, attrs);
@@ -241,7 +228,7 @@
assertEquals(3, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("key3"));
- assertEquals(2, persistedAttrs.get("key3").length);
+ assertEquals(2, persistedAttrs.get("key3").getSize());
em.flush();
@@ -254,7 +241,7 @@
assertEquals(3, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("key3"));
- assertEquals(1, persistedAttrs.get("key3").length);
+ assertEquals(1, persistedAttrs.get("key3").getSize());
em.flush();
Modified: trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateModelTestCase.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateModelTestCase.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateModelTestCase.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -33,6 +33,7 @@
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectType;
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectRelationship;
import org.jboss.identity.impl.model.hibernate.HibernateRealm;
+import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectTextAttribute;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
@@ -262,14 +263,14 @@
HibernateIdentityObject user1 = new HibernateIdentityObject("user1", userType, realm);
em.persist(user1);
- Set<String> values1 = new HashSet<String>();
- values1.add("Val1");
- values1.add("Val2");
- values1.add("Val3");
+// Set<String> values1 = new HashSet<String>();
+// values1.add("Val1");
+// values1.add("Val2");
+// values1.add("Val3");
- user1.updateAttribute("simple1", new String[]{"Val1", "Val2", "Val3"});
- user1.updateAttribute("simple2", new String[]{"Val1", "Val2", "Val3"});
+ user1.getAttributes().add(new HibernateIdentityObjectTextAttribute(user1, "simple1", new String[]{"Val1", "Val2", "Val3"}));
+ user1.getAttributes().add(new HibernateIdentityObjectTextAttribute(user1, "simple2", new String[]{"Val1", "Val2", "Val3"}));
em.getTransaction().commit();
@@ -277,8 +278,10 @@
em.getTransaction().begin();
-// user1 = em.find(HibernateIdentityObject.class, new Long(user1.getId()));
-// assertEquals(2, user1.getProfileAttributes().entrySet().size() );
+
+
+ user1 = em.find(HibernateIdentityObject.class, new Long(user1.getId()));
+ assertEquals(2, user1.getAttributes().size() );
// assertNotNull(user1.getProfileAttributes().get("simple1"));
// assertEquals(3, user1.getProfileAttributes().get("simple1").length);
Modified: trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreTestCase.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreTestCase.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreTestCase.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -28,12 +28,14 @@
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.spi.store.IdentityStoreSession;
import org.jboss.identity.spi.model.IdentityObject;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
import org.jboss.identity.spi.configuration.metadata.IdentityConfigurationMetaData;
import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.impl.store.IdentityTypeEnum;
import org.jboss.identity.impl.store.CommonIdentityStoreTest;
import org.jboss.identity.impl.store.IdentityStoreTestContext;
import org.jboss.identity.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.jboss.identity.impl.api.SimpleAttributeImpl;
import org.jboss.identity.exception.IdentityException;
import org.opends.server.tools.LDAPModify;
@@ -396,30 +398,31 @@
//
- Map<String, String[]> attrs = new HashMap<String, String[]>();
+ IdentityObjectAttribute[] attrs = new IdentityObjectAttribute[]{
+ new SimpleAttributeImpl("phone", new String[]{"val1", "val2", "val3"}),
+ new SimpleAttributeImpl("description", new String[]{"val1", "val2", "val3", "val4"}),
+ };
- attrs.put("phone", new String[]{"val1", "val2", "val3"});
- attrs.put("description", new String[]{"val1", "val2", "val3", "val4"});
-
store.addAttributes(ctx, user1, attrs);
//
- Map<String, String[]> persistedAttrs = store.getAttributes(ctx, user1);
+ Map<String, IdentityObjectAttribute> persistedAttrs = store.getAttributes(ctx, user1);
assertEquals(2, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("phone"));
- assertEquals(3, persistedAttrs.get("phone").length);
+ assertEquals(3, persistedAttrs.get("phone").getSize());
assertTrue(persistedAttrs.containsKey("description"));
- assertEquals(4, persistedAttrs.get("description").length);
+ assertEquals(4, persistedAttrs.get("description").getSize());
//
- attrs = new HashMap<String, String[]>();
- attrs.put("carLicense", new String[]{"val1"});
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttributeImpl("carLicense", new String[]{"val1"})
+ };
store.addAttributes(ctx, user1, attrs);
@@ -430,15 +433,17 @@
assertEquals(3, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("phone"));
- assertEquals(3, persistedAttrs.get("phone").length);
+ assertEquals(3, persistedAttrs.get("phone").getSize());
assertTrue(persistedAttrs.containsKey("description"));
- assertEquals(4, persistedAttrs.get("description").length);
+ assertEquals(4, persistedAttrs.get("description").getSize());
assertTrue(persistedAttrs.containsKey("carLicense"));
- assertEquals(1, persistedAttrs.get("carLicense").length);
+ assertEquals(1, persistedAttrs.get("carLicense").getSize());
- attrs.put("carLicense", new String[]{"val2"});
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttributeImpl("carLicense", new String[]{"val2"})
+ };
store.addAttributes(ctx, user1, attrs);
@@ -449,7 +454,7 @@
assertEquals(3, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("carLicense"));
- assertEquals(2, persistedAttrs.get("carLicense").length);
+ assertEquals(2, persistedAttrs.get("carLicense").getSize());
//
@@ -462,7 +467,7 @@
assertEquals(3, persistedAttrs.keySet().size());
assertTrue(persistedAttrs.containsKey("carLicense"));
- assertEquals(1, persistedAttrs.get("carLicense").length);
+ assertEquals(1, persistedAttrs.get("carLicense").getSize());
//
Modified: trunk/identity-impl/src/test/resources/identity-config.xml
===================================================================
--- trunk/identity-impl/src/test/resources/identity-config.xml 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/test/resources/identity-config.xml 2009-01-06 14:27:43 UTC (rev 186)
@@ -168,6 +168,7 @@
<attribute>
<name></name>
<mapping></mapping>
+ <type></type>
<isRequired></isRequired>
<isMultivalued></isMultivalued>
<isReadOnly></isReadOnly>
@@ -175,6 +176,7 @@
<attribute>
<name></name>
<mapping/>
+ <type></type>
<isRequired></isRequired>
<isMultivalued></isMultivalued>
<isReadOnly></isReadOnly>
@@ -214,12 +216,14 @@
<attribute>
<name></name>
<mapping/>
+ <type></type>
<isRequired>true</isRequired>
<isMultivalued>true</isMultivalued>
</attribute>
<attribute>
<name></name>
<mapping/>
+ <type></type>
<isRequired>false</isRequired>
<isMultivalued>false</isMultivalued>
</attribute>
Modified: trunk/identity-impl/src/test/resources/identity-config.xsd
===================================================================
--- trunk/identity-impl/src/test/resources/identity-config.xsd 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/test/resources/identity-config.xsd 2009-01-06 14:27:43 UTC (rev 186)
@@ -183,6 +183,7 @@
<xs:sequence>
<xs:element type="xs:string" name="name"/>
<xs:element type="xs:string" name="mapping"/>
+ <xs:element type="xs:string" name="type"/>
<xs:element name="isRequired">
<xs:simpleType>
<xs:restriction base="xs:string">
Modified: trunk/identity-impl/src/test/resources/organization-test-config.xml
===================================================================
--- trunk/identity-impl/src/test/resources/organization-test-config.xml 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/test/resources/organization-test-config.xml 2009-01-06 14:27:43 UTC (rev 186)
@@ -184,7 +184,16 @@
<credentials>
<credential-type>PASSWORD</credential-type>
</credentials>
- <attributes/>
+ <attributes>
+ <attribute>
+ <name>picture</name>
+ <mapping>user.picture</mapping>
+ <type>binary</type>
+ <isRequired/>
+ <isMultivalued/>
+ <isReadOnly/>
+ </attribute>
+ </attributes>
<options/>
</identity-object-type>
<identity-object-type>
@@ -308,6 +317,7 @@
<attribute>
<name>phone</name>
<mapping>telephoneNumber</mapping>
+ <type>text</type>
<isRequired/>
<isMultivalued/>
<isReadOnly/>
@@ -315,6 +325,7 @@
<attribute>
<name>description</name>
<mapping>description</mapping>
+ <type>text</type>
<isRequired/>
<isMultivalued/>
<isReadOnly/>
@@ -322,6 +333,7 @@
<attribute>
<name>carLicense</name>
<mapping>carLicense</mapping>
+ <type>text</type>
<isRequired/>
<isMultivalued/>
<isReadOnly/>
Modified: trunk/identity-impl/src/test/resources/store-test-config.xml
===================================================================
--- trunk/identity-impl/src/test/resources/store-test-config.xml 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-impl/src/test/resources/store-test-config.xml 2009-01-06 14:27:43 UTC (rev 186)
@@ -175,6 +175,7 @@
<attribute>
<name>phone</name>
<mapping>telephoneNumber</mapping>
+ <type>text</type>
<isRequired/>
<isMultivalued>true</isMultivalued>
<isReadOnly/>
@@ -182,6 +183,7 @@
<attribute>
<name>description</name>
<mapping>description</mapping>
+ <type>text</type>
<isRequired/>
<isMultivalued>true</isMultivalued>
<isReadOnly/>
@@ -189,6 +191,7 @@
<attribute>
<name>carLicense</name>
<mapping>carLicense</mapping>
+ <type>text</type>
<isRequired/>
<isMultivalued>true</isMultivalued>
<isReadOnly/>
Deleted: trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,55 +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.spi.attribute;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface AttributeMetaData
-{
- /**
- * @return
- */
- String getName();
-
- /**
- * @return
- */
- String getStoreMapping();
-
- /**
- * @return
- */
- boolean isReadonly();
-
- /**
- * @return
- */
- boolean isMultivalued();
-
- /**
- * @return
- */
- boolean isRequired();
-}
Deleted: trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaDataImpl.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaDataImpl.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaDataImpl.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,95 +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.spi.attribute;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class AttributeMetaDataImpl implements AttributeMetaData
-{
-
- private String name;
-
- private String storeMapping;
-
- private boolean readonly;
-
- private boolean multivalued;
-
- private boolean required;
-
- public AttributeMetaDataImpl()
- {
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getStoreMapping()
- {
- return storeMapping;
- }
-
- public void setStoreMapping(String storeMapping)
- {
- this.storeMapping = storeMapping;
- }
-
- public boolean isReadonly()
- {
- return readonly;
- }
-
- public void setReadonly(boolean readonly)
- {
- this.readonly = readonly;
- }
-
- public boolean isMultivalued()
- {
- return multivalued;
- }
-
- public void setMultivalued(boolean multivalued)
- {
- this.multivalued = multivalued;
- }
-
- public boolean isRequired()
- {
- return required;
- }
-
- public void setRequired(boolean required)
- {
- this.required = required;
- }
-}
Copied: trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/IdentityObjectAttributeMetaData.java (from rev 179, trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java)
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/IdentityObjectAttributeMetaData.java (rev 0)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/IdentityObjectAttributeMetaData.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -0,0 +1,64 @@
+/*
+* 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.spi.attribute;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityObjectAttributeMetaData
+{
+ public static final String TEXT_TYPE = "text";
+
+ public static final String BINARY_TYPE = "binary";
+
+ /**
+ * @return
+ */
+ String getName();
+
+ /**
+ * @return
+ */
+ String getStoreMapping();
+
+ /**
+ * @return
+ */
+ String getType();
+
+ /**
+ * @return
+ */
+ boolean isReadonly();
+
+ /**
+ * @return
+ */
+ boolean isMultivalued();
+
+ /**
+ * @return
+ */
+ boolean isRequired();
+}
Modified: trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/PasswordAttribute.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/PasswordAttribute.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/PasswordAttribute.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,72 +1,72 @@
-/*
- * 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.identity.spi.attribute;
-
-import org.jboss.identity.spi.model.IdentityObjectType;
-import org.jboss.identity.spi.model.IdentityObjectAttribute;
-import org.jboss.identity.spi.policy.PasswordExpirationPolicy;
-
-import java.util.Date;
-
-
-
-/**
- * Represents a password
- * @author Anil.Saldhana at redhat.com
- * @since Jul 13, 2008
- */
-public class PasswordAttribute<T extends IdentityObjectType>
-implements IdentityObjectAttribute
-{
- /**
- * Password policy governing this attribute.
- * A null value indicates that there is no policy.
- */
- protected PasswordExpirationPolicy<T> passwordPolicy;
-
- /**
- * Get the date time when the password was last updated.
- * The update can be based on password expiration.
- */
- protected Date lastUpdated = new Date();
-
- public PasswordAttribute()
- {
- }
-
- public PasswordAttribute(PasswordExpirationPolicy<T> aPasswordPolicy)
- {
- this.passwordPolicy = aPasswordPolicy;
- }
-
- public PasswordExpirationPolicy<T> getPasswordPolicy()
- {
- return passwordPolicy;
- }
-
- public void setPasswordPolicy(PasswordExpirationPolicy<T> passwordPolicy)
- {
- this.passwordPolicy = passwordPolicy;
- }
-
-
-}
\ No newline at end of file
+///*
+// * 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.identity.spi.attribute;
+//
+//import org.jboss.identity.spi.model.IdentityObjectType;
+//import org.jboss.identity.spi.model.IdentityObjectAttribute;
+//import org.jboss.identity.spi.policy.PasswordExpirationPolicy;
+//
+//import java.util.Date;
+//
+//
+//
+///**
+// * Represents a password
+// * @author Anil.Saldhana at redhat.com
+// * @since Jul 13, 2008
+// */
+//public class PasswordAttribute<T extends IdentityObjectType>
+//implements IdentityObjectAttribute
+//{
+// /**
+// * Password policy governing this attribute.
+// * A null value indicates that there is no policy.
+// */
+// protected PasswordExpirationPolicy<T> passwordPolicy;
+//
+// /**
+// * Get the date time when the password was last updated.
+// * The update can be based on password expiration.
+// */
+// protected Date lastUpdated = new Date();
+//
+// public PasswordAttribute()
+// {
+// }
+//
+// public PasswordAttribute(PasswordExpirationPolicy<T> aPasswordPolicy)
+// {
+// this.passwordPolicy = aPasswordPolicy;
+// }
+//
+// public PasswordExpirationPolicy<T> getPasswordPolicy()
+// {
+// return passwordPolicy;
+// }
+//
+// public void setPasswordPolicy(PasswordExpirationPolicy<T> passwordPolicy)
+// {
+// this.passwordPolicy = passwordPolicy;
+// }
+//
+//
+//}
\ No newline at end of file
Modified: trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityObjectTypeMetaData.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityObjectTypeMetaData.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityObjectTypeMetaData.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -22,7 +22,7 @@
package org.jboss.identity.spi.configuration.metadata;
-import org.jboss.identity.spi.attribute.AttributeMetaData;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
import java.util.List;
import java.util.Map;
@@ -37,7 +37,7 @@
List<RelationshipMetaData> getRelationships();
- List<AttributeMetaData> getAttributes();
+ List<IdentityObjectAttributeMetaData> getAttributes();
List<String> getCredentials();
Deleted: trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredential.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredential.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredential.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,51 +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.spi.credential;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface IdentityObjectCredential
-{
-
- /**
- *
- * @return
- */
- IdentityObjectCredentialType getType();
-
- /**
- * @return Should return either String for text based credentials or byte[] for binary
- */
- Object getValue();
-
-
- /**
- * @return encoded value. For example hash from a string password.
- * Should return either String for text based credentials or byte[] for binary.
- * May return null if credential implementaion doesn't provide encoding mechanism.
- * IdentityStore is not obligated to use encoded value.
- */
- Object getEncodedValue();
-}
Deleted: trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredentialType.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredentialType.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredentialType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -1,37 +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.spi.credential;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface IdentityObjectCredentialType
-{
-
- /**
- *
- * @return
- */
- String getName();
-}
Modified: trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectAttribute.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectAttribute.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectAttribute.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -21,6 +21,10 @@
*/
package org.jboss.identity.spi.model;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
+
+import java.util.Collection;
+
/**
* An attribute of an identity
* @author Anil.Saldhana at redhat.com
@@ -29,4 +33,15 @@
*/
public interface IdentityObjectAttribute
{
+
+ String getName();
+
+ Object getValue();
+
+ void addValue(Object value);
+
+ Collection getValues();
+
+ int getSize();
+
}
\ No newline at end of file
Copied: trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectCredential.java (from rev 179, trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredential.java)
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectCredential.java (rev 0)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectCredential.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -0,0 +1,51 @@
+/*
+* 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.spi.model;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityObjectCredential
+{
+
+ /**
+ *
+ * @return
+ */
+ IdentityObjectCredentialType getType();
+
+ /**
+ * @return Should return either String for text based credentials or byte[] for binary
+ */
+ Object getValue();
+
+
+ /**
+ * @return encoded value. For example hash from a string password.
+ * Should return either String for text based credentials or byte[] for binary.
+ * May return null if credential implementaion doesn't provide encoding mechanism.
+ * IdentityStore is not obligated to use encoded value.
+ */
+ Object getEncodedValue();
+}
Copied: trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectCredentialType.java (from rev 179, trunk/identity-spi/src/main/java/org/jboss/identity/spi/credential/IdentityObjectCredentialType.java)
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectCredentialType.java (rev 0)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/model/IdentityObjectCredentialType.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -0,0 +1,37 @@
+/*
+* 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.spi.model;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityObjectCredentialType
+{
+
+ /**
+ *
+ * @return
+ */
+ String getName();
+}
Modified: trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -24,6 +24,8 @@
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObject;
+import org.jboss.identity.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.spi.attribute.IdentityObjectAttributeMetaData;
import org.jboss.identity.exception.IdentityException;
import java.util.Set;
@@ -44,17 +46,21 @@
*/
String getId();
- //TODO: replace Set<String> with String[] in method signatures
-
/**
* @param invocationContext
* @param identityType @return names of supported attributes
* @return
* @throws org.jboss.identity.exception.IdentityException
*/
- <T extends IdentityObjectType> Set<String> getSupportedAttributeNames(IdentityStoreInvocationContext invocationContext, T identityType)
+ Set<String> getSupportedAttributeNames(IdentityStoreInvocationContext invocationContext, IdentityObjectType identityType)
throws IdentityException;
+ /**
+ *
+ * @return
+ */
+ Map<String, IdentityObjectAttributeMetaData> getAttributesMetaData(IdentityStoreInvocationContext invocationContext, IdentityObjectType identityType);
+
//TODO: isNotConfiguredAttributeSupported - if store can handle attribute not mentioned in method above
/**
@@ -63,15 +69,23 @@
* @param invocationContext
*@param identity @return @throws IdentityException
*/
- Map<String, String[]> getAttributes(IdentityStoreInvocationContext invocationContext, IdentityObject identity) throws IdentityException;
+ Map<String, IdentityObjectAttribute> getAttributes(IdentityStoreInvocationContext invocationContext, IdentityObject identity) throws IdentityException;
/**
+ * Get attribute for the given identity
+ *
+ * @param invocationContext
+ *@param identity @return @throws IdentityException
+ */
+ IdentityObjectAttribute getAttribute(IdentityStoreInvocationContext invocationContext, IdentityObject identity, String name) throws IdentityException;
+
+ /**
* Update attributes with new values - previous values will be overwritten. Attributes not specified in the map are not changed.
* @param invocationCtx
* @param identity
* @param attributes @throws IdentityException
*/
- void updateAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, Map<String, String[]> attributes)
+ void updateAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, IdentityObjectAttribute[] attributes)
throws IdentityException;
/**
@@ -82,7 +96,7 @@
* @param identity
* @param attributes @throws IdentityException
*/
- void addAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, Map<String, String[]> attributes)
+ void addAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, IdentityObjectAttribute[] attributes)
throws IdentityException;
/**
@@ -90,9 +104,9 @@
*
* @param invocationCtx
* @param identity
- * @param attributes
+ * @param attributeNames
*/
- void removeAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, String[] attributes)
+ void removeAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, String[] attributeNames)
throws IdentityException;
}
Modified: trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -22,12 +22,10 @@
package org.jboss.identity.spi.store;
import java.util.Set;
-import java.util.Map;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
-import org.jboss.identity.spi.exception.IdentityTypeNotSupportedException;
-import org.jboss.identity.spi.credential.IdentityObjectCredentialType;
+import org.jboss.identity.spi.model.IdentityObjectCredentialType;
import org.jboss.identity.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.exception.IdentityException;
Modified: trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java 2009-01-05 21:25:14 UTC (rev 185)
+++ trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java 2009-01-06 14:27:43 UTC (rev 186)
@@ -32,7 +32,7 @@
import org.jboss.identity.spi.model.IdentityObjectRelationship;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
-import org.jboss.identity.spi.credential.IdentityObjectCredential;
+import org.jboss.identity.spi.model.IdentityObjectCredential;
import org.jboss.identity.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.exception.IdentityException;
More information about the jboss-identity-commits
mailing list