[jboss-dev-forums] [Design of JBoss Portal] - Re: Identity model

bdaw do-not-reply at jboss.com
Thu Nov 16 08:40:03 EST 2006


anonymous wrote : 
  | So we would have that architecture :
  | 
  | XXXModules
  | --------------
  | Stateful session 

I like the concept in prototype as. We should think if we want to put it on 3.0 roadmap. I'm also not sure if this is really needed. The write operations to are probably so rare that can be handle directly. 

anonymous wrote : 1/ the different modules needs to offer simple stateless operations, which seems to be the case today with the 4 different modules we have. If I retrieve data from a module and then use the module to update state affecting that data, then the object I retrieved is stale and the client should either get an updated object or compensate the state change. For instance :
  | 
  | 
  |    Set roles = membershipmodule.getRoles(user);
  |   |    membershipmodule.addRole(user, admin);
  |   | 
  |   |    // Needs to be updated
  |   |    roles = membershipmodule.getRoles(user);
  | 	

Fully agree on this model

At the moment I'm looking at Role and User interface. 

In Role we have:

public interface Role
  | {
  |    /** The role identifier. */
  |    Object getId();
  | 
  |    /** The role name used in security rules. This name can not be modified */
  |    String getName();
  |    
  |    /** The role display name used on screens. This name can be modified */
  |    String getDisplayName();
  | 
  |    /** */
  |    void setDisplayName(String name);
  | }

so there is only one field that can be updated  "displayName' - I think it can be direct LDAP call from Role object

For User:

I was thinking about base set of fields that portal user must have and decided on: id, userName, realEmail, enabled. 
All other properties should be accessed using UserProfileModule and constants defined in User interface.

so we end up with:

public interface User
  | {
  | 
  |    String INFO_USER_REGISTRATION_DATE = "portal.user.registration-date";
  |    String INFO_USER_HOMEPAGE = "portal.user.homepage";
  |    String INFO_USER_TIME_ZONE_OFFSET = "portal.user.time-zone-offset";
  |    String INFO_USER_THEME = "portal.user.theme";
  |    String INFO_USER_LOCATION = "portal.user.location";
  |    String INFO_USER_OCCUPATION = "portal.user.occupation";
  |    String INFO_USER_EXTRA = "portal.user.extra";
  |    String INFO_USER_SIGNATURE = "portal.user.signature";
  |    String INFO_USER_INTERESTS = "portal.user.interests";
  |    String INFO_USER_LOCALE = "portal.user.locale";
  |    String INFO_USER_IM_ICQ = "portal.user.im.icq";
  |    String INFO_USER_IM_AIM = "portal.user.im.aim";
  |    String INFO_USER_IM_MSNM = "portal.user.im.msnm";
  |    String INFO_USER_IM_YIM = "portal.user.im.yim";
  |    String INFO_USER_IM_SKYPE = "portal.user.im.skype";
  |    String INFO_USER_SECURITY_QUESTION = "portal.user.security.question";
  |    String INFO_USER_SECURITY_ANSWER = "portal.user.security.answer";
  |    String INFO_USER_EMAIL_FAKE = "portal.user.email.fake";
  |    String INFO_USER_VIEW_EMAIL_VIEW_REAL = "portal.user.email.view-real";
  |    String INFO_USER_LAST_LOGIN_DATE = "portal.user.last-login-date";
  | 
  |    String INFO_USER_NAME_GIVEN = "portal.user.name.given";
  |    String INFO_USER_NAME_FAMILY = "portal.user.name.family";
  | 
  |    /** The user identifier. */
  |    Object getId();
  | 
  |    /** The user name. */
  |    String getUserName();
  | 
  |    /** The user email address */
  |    String getRealEmail();
  | 
  |    /** */
  |    void setRealEmail(String realEmail);
  | 
  |    /** Disable the user. */
  |    boolean getEnabled();
  | 
  |    /** Enable the user. */
  |    void setEnabled(boolean enable);
  | 
  |    /** Set the password. */
  |    void updatePassword(String password);
  | 
  |    /** Return true if the password is valid. */
  |    boolean validatePassword(String password);
  | }

1) For LDAP implementation
- User.getXXX() and Role.getXXX() are stateless - values need to be updated using RoleModule.getRole() or UserModule.getUser()
- Role.setDisplayName() and User.setRealEmail() .setEnabled() - will trigger direct ldap call to update the values
- UserProfileModule.setProperty() - - will trigger direct ldap call to update the value

2) For Hibernate implementation

the default implementation will remain as current one but refactored to new interfaces. So UserProfileModule will act as a fasade for calls on setter methods in User object. And state will be handled by hibernate as usual

I hope that this keeps things simple. The main question remains if there is a need to introduce statefull management you described for this for future versions. I'm not sure if it buys us a lot at the moment. Maybe it'll be different with redesigned identity model for 3.0.




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986519#3986519

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986519



More information about the jboss-dev-forums mailing list