Author: bdaw
Date: 2007-03-19 13:12:40 -0400 (Mon, 19 Mar 2007)
New Revision: 6748
Modified:
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/IdentityContext.java
trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceController.java
trunk/identity/src/main/org/jboss/portal/identity/MembershipModule.java
trunk/identity/src/main/org/jboss/portal/identity/UserProfileModule.java
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateRoleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/info/ProfileInfo.java
trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java
Log:
- code cleanup
- small update on javadoc
Modified:
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2007-03-19
15:43:20 UTC (rev 6747)
+++
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -88,18 +88,6 @@
{
log.debug("Delegating to DB module");
return getDBModule().getProperty(user, propertyName);
-
-
- //if property is column it may be some Object - just convert to String for
now
- /*if(o != null && !(o instanceof String))
- {
- return o.toString();
- }
- else
- {
- return o;
- }*/
-
}
throw new IdentityException("Cannot process property - incorrect profile or
module configuration");
}
@@ -129,19 +117,6 @@
{
log.debug("Delegating to DB module");
-
- //Object val = propertyValue;
- //if property is dynamic convert value to String first
-//
if(property.getMappingDBType().equals(PropertyInfo.MAPPING_DB_TYPE_DYNAMIC))
-// {
-// val = propertyValue.toString();
-// }
-// else
-// {
-// val = propertyValue;
-// }
-
-
getDBModule().setProperty(user, name, propertyValue);
return;
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/IdentityContext.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/IdentityContext.java 2007-03-19
15:43:20 UTC (rev 6747)
+++ trunk/identity/src/main/org/jboss/portal/identity/IdentityContext.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -22,6 +22,8 @@
package org.jboss.portal.identity;
/**
+ * Keeps track on all identity modules deployed with simple name-object mapping
+ *
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
* @version $Revision: 1.1 $
*/
@@ -43,10 +45,25 @@
public static final String TYPE_IDENTITY_EVENT_BROADCASTER =
"IdentityEventBroadcaster";
-
+ /**
+ * Retister identity object in context
+ * @param object representing identity object
+ * @param name to map object
+ * @throws IdentityException thrown if such object is already registered or operation
fail.
+ */
public void register(Object object, String name) throws IdentityException;
+ /**
+ * Remove identity object from context
+ * @param name of identity object
+ */
public void unregister(String name);
+ /**
+ * Retrieve registered identity object
+ * @param name
+ * @return
+ * @throws IdentityException thrown if no such object exists in context
+ */
public Object getObject(String name) throws IdentityException;
}
Modified:
trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceController.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceController.java 2007-03-19
15:43:20 UTC (rev 6747)
+++
trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceController.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -22,11 +22,16 @@
package org.jboss.portal.identity;
/**
+ * Service that bootstrap all identity related modules and services. It registers them in
IdentityContext
*
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
* @version $Revision: 1.1 $
*/
public interface IdentityServiceController
{
+ /**
+ * Get IdentityContext that contains modules and services bootstrapped by this
instance.
+ * @return
+ */
public IdentityContext getIdentityContext();
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/MembershipModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/MembershipModule.java 2007-03-19
15:43:20 UTC (rev 6747)
+++ trunk/identity/src/main/org/jboss/portal/identity/MembershipModule.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -44,6 +44,13 @@
*/
Set getRoles(User user) throws IdentityException, IllegalArgumentException;
+ /**
+ * Returns the set of user objects that a given role has.
+ * @param role
+ * @return
+ * @throws IdentityException
+ * @throws IllegalArgumentException
+ */
Set getUsers(Role role) throws IdentityException, IllegalArgumentException;
Modified: trunk/identity/src/main/org/jboss/portal/identity/UserProfileModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/UserProfileModule.java 2007-03-19
15:43:20 UTC (rev 6747)
+++ trunk/identity/src/main/org/jboss/portal/identity/UserProfileModule.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -29,18 +29,48 @@
import java.util.Map;
/**
+ * Manages user properties
+ *
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
* @version $Revision: 1.1 $
*/
public interface UserProfileModule
{
+ /**
+ * Returns user property
+ * @param user
+ * @param propertyName
+ * @return
+ * @throws IdentityException
+ * @throws IllegalArgumentException
+ */
public Object getProperty(User user, String propertyName) throws IdentityException,
IllegalArgumentException;
+ /**
+ * Sets user property
+ * @param user
+ * @param name
+ * @param property
+ * @throws IdentityException
+ * @throws IllegalArgumentException
+ */
public void setProperty(User user, String name, Object property) throws
IdentityException, IllegalArgumentException;
+ /**
+ * Returns all properties related to user
+ * @param user
+ * @return
+ * @throws IdentityException
+ * @throws IllegalArgumentException
+ */
public Map getProperties(User user) throws IdentityException,
IllegalArgumentException;
+ /**
+ * Return ProfileInfo object that can be used to obtain PropertyInfo on specific
property name.
+ * @return
+ * @throws IdentityException
+ */
public ProfileInfo getProfileInfo() throws IdentityException;
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateRoleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateRoleImpl.java 2007-03-19
15:43:20 UTC (rev 6747)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateRoleImpl.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -45,7 +45,6 @@
/**
*
*/
- //TODO: make this protected (clashes with bsh script in HibernateSerssionBinder
public HibernateRoleImpl()
{
this.key = null;
@@ -57,7 +56,6 @@
/**
*
*/
- //TODO: make this protected (clashes with bsh script in HibernateSerssionBinder
public HibernateRoleImpl(String name)
{
this.key = null;
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java 2007-03-19
15:43:20 UTC (rev 6747)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -112,7 +112,6 @@
/**
*
*/
- //TODO: make this protected (clashes with bsh script in HibernateSerssionBinder
public HibernateUserImpl()
{
this.key = null;
Modified:
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java 2007-03-19
15:43:20 UTC (rev 6747)
+++
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -82,11 +82,6 @@
super.stopService();
}
-// public SessionFactory getSessionFactory()
-// {
-// return sessionFactory;
-// }
-
public String getSessionFactoryJNDIName()
{
return sessionFactoryJNDIName;
Modified: trunk/identity/src/main/org/jboss/portal/identity/info/ProfileInfo.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/info/ProfileInfo.java 2007-03-19
15:43:20 UTC (rev 6747)
+++ trunk/identity/src/main/org/jboss/portal/identity/info/ProfileInfo.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -37,6 +37,12 @@
*/
public Map getPropertiesInfo();
+ /**
+ * Returns a PropertyInfo object that describes specified property
+ *
+ * @param name of property
+ * @return PropertyInfo of specified property or null if no such property exists.
+ */
public PropertyInfo getPropertyInfo(String name);
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.java 2007-03-19
15:43:20 UTC (rev 6747)
+++ trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -39,26 +39,70 @@
public static final String MAPPING_DB_TYPE_COLUMN = "column";
public static final String MAPPING_DB_TYPE_DYNAMIC = "dynamic";
+ /**
+ * Returns property name
+ * @return
+ */
public String getName();
+ /**
+ * Returns property type
+ * @return
+ */
public String getType();
+ /**
+ * Returns property access mode
+ * @return
+ */
public String getAccessMode();
+ /**
+ * Returns property usage
+ * @return
+ */
public String getUsage();
+ /**
+ * Returns property display name
+ * @return
+ */
public LocalizedString getDisplayName();
+ /**
+ * Returns property description
+ * @return
+ */
public LocalizedString getDescription();
+ /**
+ * Returns type of property database mapping
+ * @return
+ */
public String getMappingDBType();
+ /**
+ * Returns name of LDAP attribue to which this property corresponds
+ * @return
+ */
public String getMappingLDAPValue();
+ /**
+ * Returns name of database column name to which this property corresponds
+ * @return
+ */
public String getMappingDBValue();
+ /**
+ * If property is mapped in database
+ * @return
+ */
public boolean isMappedDB();
+ /**
+ * If property is mapped in LDAP
+ * @return
+ */
public boolean isMappedLDAP();
Modified:
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java 2007-03-19
15:43:20 UTC (rev 6747)
+++
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java 2007-03-19
17:12:40 UTC (rev 6748)
@@ -66,29 +66,7 @@
private String externalContextJndiName;
- /*public LDAPConnectionContext(String name,
- String url,
- String context,
- String admin,
- String password,
- String protocol,
- String authentication)
- {
- this.name = name;
- this.providerUrl = url;
- this.contextFactory = context;
- this.adminDN = admin;
- this.adminPassword = password;
- this.protocol = protocol;
- this.authentication = authentication;
- }*/
- /*public LDAPConnectionContext()
- {
- super(IdentityContext.TYPE_CONNECTION_CONTEXT);
- }*/
-
-
public Hashtable getEnvironment()
{
Hashtable env = new Hashtable();
@@ -162,7 +140,8 @@
.append(", Port: ").append(getPort())
.append(", Context factory: ").append(getContextFactory())
.append(", Admin user: ").append(getAdminDN())
- //.append(", Admin password: ").append(getAdminPassword())
+
+ // Protect admin credentials to not go in logs
.append(", Admin password: ").append("***")
.append(", Authentication: ").append(getAuthentication())
.append(", Protocol: ").append(getProtocol());