From portal-commits at lists.jboss.org Mon Mar 19 13:12:41 2007 Content-Type: multipart/mixed; boundary="===============3544387342259159997==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r6748 - in trunk/identity/src/main/org/jboss/portal/identity: db and 2 other directories. Date: Mon, 19 Mar 2007 13:12:41 -0400 Message-ID: --===============3544387342259159997== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/DelegatingUserProfileM= oduleImpl.java trunk/identity/src/main/org/jboss/portal/identity/IdentityContext.java trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControl= ler.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.j= ava trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserImpl.j= ava trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfil= eModuleImpl.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/LDAPConnectionCon= text.java Log: - code cleanup - small update on javadoc Modified: trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserP= rofileModuleImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfile= ModuleImpl.java 2007-03-19 15:43:20 UTC (rev 6747) +++ trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfile= ModuleImpl.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 t= o String for now - /*if(o !=3D 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 =3D propertyValue; - //if property is dynamic convert value to String first -// if(property.getMappingDBType().equals(PropertyInfo.MAPPING_D= B_TYPE_DYNAMIC)) -// { -// val =3D propertyValue.toString(); -// } -// else -// { -// val =3D propertyValue; -// } - - getDBModule().setProperty(user, name, propertyValue); return; } Modified: trunk/identity/src/main/org/jboss/portal/identity/IdentityContext= .java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 ma= pping + * * @author Bolesla= w Dawidowicz * @version $Revision: 1.1 $ */ @@ -43,10 +45,25 @@ = public static final String TYPE_IDENTITY_EVENT_BROADCASTER =3D "Identit= yEventBroadcaster"; = - + /** + * Retister identity object in context + * @param object representing identity object + * @param name to map object + * @throws IdentityException thrown if such object is already registere= d or operation fail. + */ public void register(Object object, String name) throws IdentityExcepti= on; = + /** + * 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/IdentityService= Controller.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceContro= ller.java 2007-03-19 15:43:20 UTC (rev 6747) +++ trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceContro= ller.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 re= gisters them in IdentityContext * * @author Bolesla= w Dawidowicz * @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/MembershipModul= e.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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, IllegalArgumentExcept= ion; = + /** + * Returns the set of user objects that a given role has. + * @param role + * @return + * @throws IdentityException + * @throws IllegalArgumentException + */ Set getUsers(Role role) throws IdentityException, IllegalArgumentExcept= ion; = = Modified: trunk/identity/src/main/org/jboss/portal/identity/UserProfileModu= le.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity/src/main/org/jboss/portal/identity/UserProfileModule.jav= a 2007-03-19 15:43:20 UTC (rev 6747) +++ trunk/identity/src/main/org/jboss/portal/identity/UserProfileModule.jav= a 2007-03-19 17:12:40 UTC (rev 6748) @@ -29,18 +29,48 @@ import java.util.Map; = /** + * Manages user properties + * * @author Boleslaw Daw= idowicz * @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 Identi= tyException, 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, IllegalAr= gumentException; = + /** + * 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/HibernateRol= eImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 HibernateSerssi= onBinder public HibernateRoleImpl() { this.key =3D null; @@ -57,7 +56,6 @@ /** * */ - //TODO: make this protected (clashes with bsh script in HibernateSerssi= onBinder public HibernateRoleImpl(String name) { this.key =3D null; Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUse= rImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 HibernateSerssi= onBinder public HibernateUserImpl() { this.key =3D null; Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUse= rProfileModuleImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfi= leModuleImpl.java 2007-03-19 15:43:20 UTC (rev 6747) +++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfi= leModuleImpl.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/ProfileInf= o.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 proper= ty exists. + */ public PropertyInfo getPropertyInfo(String name); = } Modified: trunk/identity/src/main/org/jboss/portal/identity/info/PropertyIn= fo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.jav= a 2007-03-19 15:43:20 UTC (rev 6747) +++ trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.jav= a 2007-03-19 17:12:40 UTC (rev 6748) @@ -39,26 +39,70 @@ public static final String MAPPING_DB_TYPE_COLUMN =3D "column"; public static final String MAPPING_DB_TYPE_DYNAMIC =3D "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 correspo= nds + * @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/LDAPConnec= tionContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionCo= ntext.java 2007-03-19 15:43:20 UTC (rev 6747) +++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionCo= ntext.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 =3D name; - this.providerUrl =3D url; - this.contextFactory =3D context; - this.adminDN =3D admin; - this.adminPassword =3D password; - this.protocol =3D protocol; - this.authentication =3D authentication; - }*/ = - /*public LDAPConnectionContext() - { - super(IdentityContext.TYPE_CONNECTION_CONTEXT); - }*/ - - public Hashtable getEnvironment() { Hashtable env =3D 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()); --===============3544387342259159997==--