📄 usermanagementsessionremote.java
字号:
/*
* @author : Umesh Kulkarni
* @version 1.0
*
* Development Environment : Oracle9i JDeveloper
*
* Name of the File : UserManagementSessionRemote.java
*
* Creation / Modification History
* Umesh 26-Apr-2002 Created
*
*/
package oracle.otnsamples.ibfbs.usermanagement.ejb;
// Import Required Packages
import java.rmi.RemoteException;
import java.util.Collection;
import java.util.Hashtable;
/**
* This Interface Class acts as a remote interface to the Session Bean namely
* 'UserManagementSessionFacadeBean'. This Session facade bean manages all the
* User Management Functionality such as
* a) Creating a New Account
* b) Setting Preferences / Alerts
* c) Adding Preferences / Alerts
* d) Updating Preferences / Alerts
* e) Getting User Account Information and Contact Information etc
*
* Note that the data for all the above functionality comes from UserAccount
* Local Entity Bean, Alerts Local Entity Bean and Preferences Local Entity
* Bean. The client never invokes those Entity Beans directly but all the calls
* to the entity beans goes through this Session Bean and thus we demonstrate
* Session Facade Design Pattern.
*
* Also note that the clients while calling the methods in this Session Bean,
* pass the Value Object - A Granular object encapsulating a set of related
* fields. The usage of Value Object Design Pattern, helps in reducing network
* traffic between client and bean.
*
* @version 1.0
* @since 1.0
*/
public interface UserManagementSessionRemote extends javax.ejb.EJBObject {
/**
* Method to create a New User Account. After creating the new User Account,
* the account Number is returned back. Note that the parameters passed to
* this method are Value Objects.
*
* @param contactInfo The Contact Information Value Object
* For more information @see ContactInfo.java
* @param accountInfo The account Information Value Object
* For more information @see AccountInfo.java
* @return Account Number of created Account.
* @since 1.0
*/
public Integer createNewAccount(ContactInfo contactInfo,
AccountInfo accountInfo)
throws RemoteException;
/**
* Method to get Contact Information for a particular User. Note that the
* parameters returned by this method is ContactInfo Value Object.
*
* @param accountNumber Account Number of the User Account.
* @return The Contact Information Value Object for the given user.
* For more information @see ContactInfo.java
* @since 1.0
*/
public ContactInfo getContactInfo(Integer accountNumber)
throws RemoteException;
/**
* Method to get Account Information for a particular User. Note that the
* parameters returned by this method is AccountInfo Value Object.
*
* @param accountNumber Account Number of the User Account.
* @return The Account Information Value Object for the given user.
* For more information @see AccountInfo.java
* @since 1.0
*/
public AccountInfo getAccountInfo(Integer accountNumber)
throws RemoteException;
/**
* Method to get Timer Information associated with Admin. Note that the
* parameters returned by this method is TimerInfo Value Object.
*
* @return The Timer Information Value Object for the given user.
* For more information @see TimerInfo.java
* @since 1.0
*/
public TimerInfo getAdminTimerInfo()
throws RemoteException;
/**
* Method to set the New Value of Contact Information for a particular User.
* Note that the one of the parameter passed to this method is ContactInfo
* Value Object.
*
* @param accountNumber Account Number of the User Account.
* @param contactInfo The Contact Information Value Object for the given user.
* For more information @see ContactInfo.java
* @return Status of this operation
* @since 1.0
*/
public String setContactInfo(Integer accountNumber, ContactInfo contactInfo)
throws RemoteException;
/**
* Method to set the New Value of Account Information for a particular User.
* Note that the one of the parameter passed to this method is AccountInfo
* Value Object.
*
* @param accountNumber Account Number of the User Account.
* @param accountInfo The Account Information Value Object for the given user.
* For more information @see AccountInfo.java
* @return Status of this operation
* @since 1.0
*/
public String setAccountInfo(Integer accountNumber, AccountInfo accountInfo)
throws RemoteException;
/**
* Method to change User's Password Value.
* @param accountNumber Account Number of the User Account.
* @param newPassword New Password Value
* @return Status of this Operation
* @since 1.0
*/
public String changePassword(Integer accountNumber, String newPassword,
String oldPassword)
throws RemoteException;
/**
* Method to retrieve Preferences for a given User Account. As a single user
* account can have multiple preferences, this method returns a collection
* of PreferencesInfo Value Object.
*
* @param accountNumber Account Number of the User Account.
* @return A Collection of PreferencesInfo Value Object. This represents all
* the preferences for the User Account.
* @since 1.0
*/
public Collection getPreferences(Integer accountNumber)
throws RemoteException;
/**
* Method to retrieve Alerts for a given User Account. As a single user
* account can have multiple alerts, this method returns a collection
* of AlertsInfo Value Object.
*
* @param accountNumber Account Number of the User Account.
* @return A Collection of AlertsInfo Value Object. This represents all
* the alerts for the User Account.
* @since 1.0
*/
public Collection getAlerts(Integer accountNumber)
throws RemoteException;
/**
* Method to add an Alert for a given User Account.
*
* @param accountNumber Account Number of the User Account.
* @param alertInfo Value Object for Alert Information
* @return Status of this Operation
* @since 1.0
*/
public String addAlert(Integer accountNumber, AlertsInfo alertInfo)
throws RemoteException;
/**
* Method to add a Preference for a given User Account.
*
* @param accountNumber Account Number of the User Account.
* @param preferencesInfo Value Object for Preferences Information
* @return Status of this Operation
* @since 1.0
*/
public String addPreferences(Integer accountNumber,
PreferencesInfo preferencesInfo)
throws RemoteException;
/**
* Method to Update a Single Alert Record for a given User Account.
*
* @param accountNumber Account Number of the User Account.
* @param alertInfo Value Object for Alert Information to be updated.
* @return Status of this Operation
* @since 1.0
*/
public String changeAlertInfo(Integer accountNumber, AlertsInfo alertInfo)
throws RemoteException;
/**
* Method to Update a Single Preference Record for a given User Account.
*
* @param accountNumber Account Number of the User Account.
* @return Status of this Operation
* @since 1.0
*/
public String changePreferencesInfo(Integer accountNumber,
PreferencesInfo alertInfo)
throws RemoteException;
/**
* Method to check whether the password provided by the user is correct.
* @param accountNumber Account Number of the User Account.
* @param password User Supplied Password
* @return Boolean Flag indicating whether user provided Valid Password
* @since 1.0
*/
public boolean validUser(Integer accountNumber, String password)
throws RemoteException;
/**
* Method to Delete an Alert from a given User Account.
*
* @param accountNumber Account Number of the User Account.
* @param symbol Symbol whose record need to be removed.
* @return Status of this Operation
* @since 1.0
*/
public String deleteAlert(Integer accountNumber, String symbol)
throws RemoteException;
/**
* Method to Delete a Preference from a given User Account.
*
* @param accountNumber Account Number of the User Account.
* @param symbol Symbol whose record need to be removed.
* @return Status of this Operation
* @since 1.0
*/
public String deletePreference(Integer accountNumber, String symbol)
throws RemoteException;
/**
* Method to get the User's AccountNumber and password for the input Email.
*
* @param email Email of the User.
* @return Hashtable with UserAccountNumber and Password corresponding
* to the input Email.
* @since 1.0
*/
public Hashtable getUserAccount(String email)
throws RemoteException;
/**
* Method to call the EJB-QL method of UserAccountBean to check wheather
* Admin account has been created. Creates a new account if Admin user
* does not exist and initializes Timer for TradeDetails Updates
* with default values of '0' hour and '15' minutes.
*
* @return accountNumber of Admin user (if new account was created)
*
* @exception RemoteException if creating Admin account fails
* @since 1.0
*/
public Integer createAdminAccount()
throws RemoteException;
/**
* Method to call the EJB-QL method of UserAccountBean to check whether
* Admin account has been created. If Admin user already exists,
* initializes Timer for TradeDetails Updates with the input values.
*
* @param timerInfo TimerInfo value object
*
* @return String indicating if the updation of Timer was successful or not
*
* @exception RemoteException if updating Admin account fails
* @since 1.0
*/
public String updateAdminAccount(TimerInfo timerInfo)
throws RemoteException;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -