/** * Initial IDL for Unicommerce Version 1.0 Baseline Edition * * @author Maneesh Sharma * @author Dawei Gu * @author Wei Zhang * @author Morgan Linton * */ module CampusInfo { /** Struct used to store user data */ struct User { string f_name; string l_name; string u_email; }; /** Struct used to store items in the inventory */ struct Item { long i_id; string i_category; string i_name; float i_price; string i_datetime; string i_note; }; /** Struct used to represent a single item in a user's history */ struct History { long i_id; string h_type; string h_datetime; string i_category; string i_name; float i_price; }; /** List of items */ typedef sequence ItemList; /** History list */ typedef sequence HistoryList; /** The desired user id has already been assigned to another user.*/ exception ex_UidAlreadyExist{}; /** The desired user id has does not exist in the database */ exception ex_UidNotExist{}; /** The password entered does not match the password in the database */ exception ex_PwdNotMatch{}; /** The user could not be authenticated */ exception ex_AuthenticationFailed{}; /** The selected item is not available to be purchased */ exception ex_ItemNotAvailableForBuy{}; /** The selected item for sale cannot be canceled (i.e. cannot cancel the sale) */ exception ex_ItemNotAvailableForCancel{}; /** The selected item does not belong to current user */ exception ex_ItemNotBelongToUser{}; /** The selected item was not found in the database */ exception ex_ItemNotFound{}; /** The current database operation failed */ exception ex_DatabaseOpFailed{}; /** * The main interface for the Unicommerce Server which does the following * */ interface UniCommerce { /** * Allows new user to register with the Unicommerce system. * * @version Baseline * @parm u_id User Account Identifier * @parm u_fname User's first name * @parm l_fname User's last name * @parm u_password User's Account Password * @parm u_email User's E-Mail Address * @returns true if account was registered, false otherwise * @raises ex_UidAlreadyExist The desired user id has already been assigned to another user. * @raises ex_DatabaseOpFailed This database operation could not be performed. */ boolean register (in string u_id, in string u_fname, in string u_lname, in string u_password, in string u_email) raises (ex_DatabaseOpFailed, ex_UidAlreadyExist); /** * Allows existing users to login into the Unicommerce system. * * @version Baseline * @parm u_id User Account Identifier * @parm u_password User Account Password * @returns true if login was successful, false otherwise * @raises ex_UidNotExist The provided user id does not exist. * @raises ex_PwdNotMatch The provided password does not match the provided user id. * @raises ex_DatabaseOpFailed This database operation could not be performed. */ User login (in string u_id, in string u_password) raises (ex_DatabaseOpFailed, ex_UidNotExist, ex_PwdNotMatch); /** * Allows existing users to logout out of the Unicommerce system. * * @version Baseline * @parm u_id User Account Identifier * @returns true if logout was successful, false otherwise * @raises ex_DatabaseOpFailed This database operation could not be performed. * @raises ex_AuthenticationFailed User authentication failed */ boolean logout (in string u_id); /** * Allows existing users to update their name and e-mail address in the Unicommerce system. * * @version Baseline * @parm u_id User Account Identifier * @parm u_new_fname User's new first name * @parm u_new_lname User's new last name * @parm u_new_password User's new password * @parm u_new_email User's new email address * @returns true if account was updated, false otherwise * @raises ex_AuthenticationFailed User is not logged in or session timeout. * @raises ex_DatabaseOpFailed This database operation could not be performed. */ boolean updateInfo (in string u_id, in string u_new_fname, in string u_new_lname, in string u_new_password, in string u_new_email) raises (ex_DatabaseOpFailed, ex_AuthenticationFailed); /** * Perform a sell operation * * @version Baseline * @parm u_id User Account Identifier * @parm i_category item category * @parm i_name item name * @parm i_price item price * @parm i_note the price of the given item * @returns A boolean value showing whether the sale transaction is successful * @raises ex_AuthenticationFailed User is not logged in or session timeout. * @raises ex_DatabaseOpFailed This database operation could not be performed. */ boolean sell (in string u_id, in string i_category, in string i_name, in float i_price, in string i_note) raises (ex_DatabaseOpFailed, ex_AuthenticationFailed); /** * Perform a buy operation * * @version Baseline * @parm u_id User Account Identifier * @parm d_id Item Identifier * @returns A boolean value showing whether the buy transaction is successful * @raises ex_ItemNotAvailableForBuy The desired item is not able to be purchase (i.e. it is not for sale) * @raises ex_AuthenticationFailed User is not logged in or session timeout. * @raises ex_DatabaseOpFailed This database operation could not be performed. */ boolean buy (in string u_id, in long i_id) raises (ex_DatabaseOpFailed, ex_AuthenticationFailed, ex_ItemNotAvailableForBuy); /** * Cancel a previous sell operation. * * @version Baseline * @parm u_id User Account Identifier * @parm d_id Item Identifier * @returns A boolean value showing whether the cancellation of the sell transaction is successful * @raises ex_ItemNotAvailableForCancel The desired item cannot be have the sale canceled * @raises ex_AuthenticationFailed User is not logged in or session timeout. * @raises ex_ItemNotBelongToUser User does not own item so cannot cancel the sale * @raises ex_DatabaseOpFailed This database operation could not be performed. * @see sell * @see history */ boolean sellCancel (in string u_id, in long i_id) raises (ex_DatabaseOpFailed, ex_AuthenticationFailed, ex_ItemNotAvailableForCancel, ex_ItemNotBelongToUser); /** * Allow user to check their own transaction history * * @version Baseline * @parm u_id User Account Identifier * @returns The transaction history in byte array * @raises ex_AuthenticationFailed User is not logged in or session timeout. * @raises ex_DatabaseOpFailed This database operation could not be performed. * @see sell * @see buy */ HistoryList history (in string u_id) raises (ex_DatabaseOpFailed, ex_AuthenticationFailed); /** * Allow user to search items for sale by category and name * * @version Baseline * @parm i_category item category * @parm i_name item name * @returns The item list matching the user's search * @raises ex_ItemNotFound The desired item does not exist, has been sold or canceled. * @raises ex_DatabaseOpFailed This database operation could not be performed. */ ItemList search (in string i_category, in string i_name) raises (ex_DatabaseOpFailed, ex_ItemNotFound); }; };