📄 profilemgrbean.java
字号:
/**/package org.impact.stars.organizationmd.profilemgr.ejb;import java.rmi.RemoteException;import javax.naming.NamingException;import javax.ejb.DuplicateKeyException;import javax.ejb.EJBException;import javax.ejb.FinderException;import javax.ejb.CreateException;import javax.ejb.RemoveException;import javax.ejb.EntityBean;import javax.ejb.EntityContext;import org.impact.stars.organizationmd.profilemgr.model.ProfileMgrModel;import org.impact.stars.organizationmd.profilemgr.model.ExplicitInformation;import org.impact.stars.organizationmd.profilemgr.model.MutableProfileMgrModel;import org.impact.stars.organizationmd.profilemgr.exceptions.ProfileMgrAppException;import org.impact.stars.organizationmd.profilemgr.exceptions.ProfileMgrAppInvalidCharException;import org.impact.stars.organizationmd.profilemgr.exceptions.ProfileMgrAppLongIdException;/** * ProfileMgrEJB is a class which represents the implementation of * a personal preferences profile as an Entity Bean using bean managed * persistance. */public abstract class ProfileMgrBean implements EntityBean { public abstract String getStakeholderID(); public abstract void setStakeholderID(String sid); public abstract ExplicitInformation getExplicitInfo(); public abstract void setExplicitInfo(ExplicitInformation expinfo); private MutableProfileMgrModel currentProfile; private EntityContext context; /** * Default class constructor with no arguments. */ public ProfileMgrBean() {} /** */ public String ejbCreate (String userId, ExplicitInformation eInfo) throws CreateException, DuplicateKeyException, ProfileMgrAppException { int MAX_USERID_LENGTH = 20; if(userId.length() > MAX_USERID_LENGTH) throw new ProfileMgrAppLongIdException("The user id given should " + " be less than " + MAX_USERID_LENGTH + " chars long"); if( (userId.indexOf('%') != -1) || (userId.indexOf('*') != -1)) throw new ProfileMgrAppLongIdException("The user id given should " + " not have '%' or '*' characters"); // set the instance data this.currentProfile = new MutableProfileMgrModel(userId, eInfo); setStakeholderID(this.currentProfile.getUserId()); setExplicitInfo(this.currentProfile.getExplicitInformation()); return userId; } public void ejbPostCreate(String userId, ExplicitInformation eInfo) throws CreateException, DuplicateKeyException, ProfileMgrAppException { } public void ejbRemove(){ } public void setEntityContext(EntityContext ec) { context = ec; } public void unsetEntityContext() {} public void ejbLoad() { } public void ejbStore() { } public void ejbActivate() { } public void ejbPassivate() { } public void updateExplicitInformation(ExplicitInformation eInfo) { this.currentProfile.setExplicitInformation(eInfo); } public ProfileMgrModel getDetails() { return(new ProfileMgrModel(currentProfile.getUserId(), currentProfile.getExplicitInformation())); } // private methods}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -