- 论坛徽章:
- 0
|
1.用户组和用户操作接口
package org.jbpm.api.identity
在这个包下面有二个接口:Group和User。分别定义了用户组和用户的行为。
public interface Group {
/**用户组ID必须唯一*/
String getId();
/** 在一个工作组类型内必须唯一*/
String getName();
/** 获取工作组类型 */
String getType();
}
public interface User {
/** 用户ID必须唯一 */
String getId();
/** 获取用户的名 */
String getGivenName();
/** 获取用户的姓 */
String getFamilyName();
/** 获取用户的email */
String getBusinessEmail();
}
这二个接口在org.jbpm.pvm.internal.identity.impl包中被实现,具体关系如下
Group:GroupImpl
User:UserImpl
2.用户组和用户操作实现
org.jbpm.pvm.internal.identity.impl
GroupImpl 和UserImpl 只相当于一个数据model类
注:下面去掉了不必要的代码
public class UserImpl implements User, Serializable {
protected long dbid;
protected int dbversion;
protected String id;
protected String password;
protected String givenName;
protected String familyName;
protected String businessEmail;
public UserImpl(String id, String givenName, String familyName) {
this.id = id;
this.givenName = givenName;
this.familyName = familyName;
}
}
public class GroupImpl implements Group, Serializable {
protected long dbid;
protected int dbversion;
protected GroupImpl parent;
protected String id;
protected String name;
protected String type;
}
类IdentitySessionImpl 相当于command模式中的Receiver,即具体的执行者
public class IdentitySessionImpl implements IdentitySession {
待续
参考文献
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/21752/showart_2107601.html |
|