Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Use Case Model
Note: All sellers and bidders need to register as users; both of them can get latest
auction news, and change their preferred currency as well. And for seller they
can provide items and details of the item that they want to sell; as for bidder, they
can bid an item and check the item they have bidden.
UML Model
In this system, the entities are seller, bidder and item. Relationship between seller
and item is 1 to many (0...*), and the relationship between bidder and item is
many (0...*) to many (0...*).
Top level structure
Auction
Server
One
Client
·
·
·
Balancing
Server
Data
Exchange
Server
Auction
Server
Two
Client
Notes: Every client will login via a balancing server from which client can get a ticket for an
auction server. Auction servers will process all requests from clients who take a valid ticket via a
exchange server in case a client wants to change current currency.
Communication Details for each Section
(1)Client first talk with Balancing Server:
Client
Balancing Server
Registry or get a Balancing
ticket for Auction regist/ login
Server via login Interface
Balancing
Balancing
regist/ login
Server
Interface Implementation
(2)Client then take the ticket to Auction Server:
Client
Selling, bidding
or browse items
Auction Server
Auction
Interface
Auction
Interface
Auction Server
Implementation
(3)When client wants to change his/her currency, Auction Server will
communicate with Exchange Server for current exchange rate:
Auction Server
Request for a
certain
Exchange Rate
Exchange
Rate
Interface
Exchange Server
Exchange
Rate
Interface
Exchange
Server
Implementation
To run the program
(1)
Compile all .idl files in each folder using idlj.exe;
(2)
Copy folder LoadBanlencingApp in loadbanlencing to Client folder, folder
ExchangeServer in exchangeserver to auctionserver1 and auctionserver2 folder,
folder AsApp in auctionserver1 to client folder.
(3)
Compile all .java files in each folder using Javac.exe;
(4)
Start corba regist using orbd.exe;
(5)
Start Server: Run LoadbanlencingServer.java, ExchangeServer.java,
AuctionServer1.java and AuctionServer2.java using java.exe by described order;
(6)
Start Client: Run Client.java by java.exe;
Screen shots of sample running
(1)LoadBanlencing Server running:
(2)ExchangeRate Server running:
(3)Auction Server 1 running:
(4)Auction Server 2 running:
(5)Client Running:
(6)Sample login as userid: 000003 whose name is Michal Ju:
And he logged on Auction Server 1
(7)Sample of using this system: the currency will automatically loaded as user
saved last time.
(8)Auction News System:
Features for this system
(1)Two Auction Servers will update data immediately and write data into files
simultaneously, which is to keep data coincidence between two auction servers.
(2)One user can not login the system twice.
(2)Bid time will count into minute.
(3)Seller can decide the reserve price, and bid price must be higher than the
reserve price provided by seller, otherwise, the system will not accept.
(4)An item provided by a seller and out-dated items will not be displayed in bid
item list.
Core Code and Interfaces for this system
(1)Balancing Server
/*Interface for LoadBanlencingServer*/
module LoadBanlencingApp
{
interface LoadBanlencing
{
string login(in string userid,in string pw);
string regist(in string surname,in string firstname,in string
address,in string pass);
string loadCurid(in string userid);
oneway void logoff(in string userid);
oneway void saveCurid(in string userid,in string curid);
};
};
/*Implementation the Interface of LoadBanlencingServer*/
public String login(String userid,String pw)
{
String str=userm.Login(userid,pw);
if (str.length()==1)
return str;
else
{
if (count==1)count++;
else count--;
return "AuctionServer"+count+str;
}
}
public String regist(String surname,String firstname,String
emailaddress,String pass)
{
String str=userm.Signup(surname,firstname,emailaddress,pass);
userm.saveToFile();
return str;
}
public void logoff(String userid)
{
userm.Logoff(userid);
}
public void saveCurid(String userid,String curid)
{
userm.saveCurid(userid,curid);
}
public String loadCurid(String userid)
{
return userm.loadCurid(userid);
}
//User.java and UserManagment.java
import java.io.Serializable;
/*-------------------------------------------------------------* User.java
* @Date 4/11/2005
*-------------------------------------------------------------*/
class User extends Object implements Serializable
{//Attributes for a user
private int Userid;
private String SurName;
private String FirstName;
private String EmailAddress;
private String password;
private int
Curid;
private boolean Status;
//Constructor
public User(int userid,String surname,String firstname,String
eaddress,String pass)
{Userid=userid;
SurName=surname;
FirstName=firstname;
EmailAddress=eaddress;
Curid=0;
password=pass;
Status=false;
}
//**************************************************
// Set User attribues
//**************************************************
public void setSurName(String surname){SurName=surname;}
public void setFirstName(String firstname){FirstName=firstname;}
public void setEmailAddress(String address)
{EmailAddress=address;}
public void setpassword(String pass){password=pass;}
public void setStatus(boolean status){Status=status;}
public void setCurid(int curid){Curid=curid;}
//**************************************************
// Get User attribues
//**************************************************
public int getUserid(){return Userid;}
public String getSurName(){return SurName;}
public String getFirstName(){return FirstName;}
public String getEmailAddress(){return EmailAddress;}
public String getpassword(){return password;}
public int
getCurid(){return Curid;}
public boolean getStatus(){return Status;}
//return all attributes by a certain format
public String ToString()
{
return FirstName;
}
}//end of User.java
import java.util.*;
import java.io.*;
/*-------------------------------------------------------------* UserManagement.java
* @Date 4/11/2005
*-------------------------------------------------------------*/
class UserManagement extends ArrayList
{
private static int maxuserid=1;//available userid for a new user
private User user;
//constructor
public UserManagement()
{openFromFile();}
//To sign up a user;
public String Signup(String surname,String firstname,String
address,String pass)
{
String idlen="000000";
user=new User(maxuserid,surname, firstname,address,pass);
this.add(user);
maxuserid++;
return (userid);
}
//To login
public String Login(String id,String pass)
{
int userid=Integer.parseInt(id);
//0:normal login; 1:wrong password or userid; 2:user is online
int logincode=1;
int i=0;
while (i<this.size())
{user=(User)this.get(i);
if (user.getUserid()==userid && pass.equals(user.getpassword()))
{
if (!user.getStatus())
{logincode=0;
user.setStatus(true);
return user.ToString();}
else
logincode=2;
break;
}
i++;
}
return logincode+"";
}
//Save a user's currency id
public void saveCurid(String userid,String curid)
{
int i=0;
while (i<this.size())
{
user=(User)this.get(i);
if (user.getUserid()==Integer.parseInt(userid))
{
user.setCurid(Integer.parseInt(curid));
saveToFile();
break;
}
i++;
}
}
//Load a user's currency id
public String loadCurid(String userid)
{int i=0;
while (i<this.size())
{user=(User)this.get(i);
if (user.getUserid()==Integer.parseInt(userid))
return user.getCurid()+"";
i++;
}
return "0";
}
// to log off
public void Logoff(String id)
{
int userid=Integer.parseInt(id);
int i=0;
while (i<this.size())
{user=(User)this.get(i);
if (user.getUserid()==userid)
{user.setStatus(false);break;}
i++;
}
}
//Add all users in this list from file:userdata/User.dat
public void openFromFile(){openFromFile("../userdata/User.dat");}
public void openFromFile(String Filename)
{try
{ObjectInputStream ois=new ObjectInputStream(new
FileInputStream(Filename));
while (ois!=null)
{user=(User)ois.readObject();}
super.add(user);
if (user.getUserid()>=maxuserid)maxuserid=user.getUserid()+1;
}
ois.close();
}catch(Exception e){ }
}
//Save all users in this list to file:userdata/User.dat
public void saveToFile(){saveToFile("../userdata/User.dat");}
public void saveToFile(String Filename)
{try
{ObjectOutputStream oos=new ObjectOutputStream(new
FileOutputStream(Filename));
for (int i=0;i<super.size();i++ )
{oos.writeObject((User)super.get(i));
oos.flush();
}
oos.close();
}catch(Exception e){System.out.println(e);}
}
}//end of UserManagement.java
(2)Exchange Server
/*Interface for ExchangeServer*/
module ExchangeServer
{
interface Currency
{
double getExchangeRate(in string curid);
};
};
/*Implementation the Interface of ExchangeServer*/
//Loading currency information from Currency.txt
public void loadcurrency()
{String temp;
try
{
java.io.DataInputStream dis=new java.io.DataInputStream(new
java.io.FileInputStream("currency.txt"));
for (int i=0;i<6 ;i++ )
{
temp=dis.readLine();
curstr[i]=temp.substring(0,temp.indexOf(','));
currencyrate[i]=Double.valueOf(temp.substring(temp.indexOf
(',')+1,temp.length()));
}
dis.close();
}
catch(Exception ev){}
}//end of loadcurrency
public double getExchangeRate(String curid)
{
return currencyrate[Integer.parseInt(curid)];
}
(3)Auction Server 1
/*Interface for AuctionServer1*/
module ASApp
{typedef sequence <string> Checkbids;
typedef sequence <string> Availableitems;
typedef sequence <string> Biditems;
typedef sequence <string> News;
interface Seller
{string additem(in string itemname,in string userid,in string
desc);
string setReservePrice(in string itemid,in string userid,in
string price,in string curid);
string setAvailableDate(in string itemid,in string userid,in
string adate);
Checkbids checkbid(in string userid,in string curid);
News
getNews(in string userid,in string adate);
};
interface Bidder
{Availableitems getavailableitems(in string userid,in string
date,in string curid);
Biditems getbiditems(in string userid,in string curid);
string setBiditem(in string itemid,in string bidderid,in string
price,in string curid );
News
getNews(in string userid,in string adate);
};
};
/*Implementation the Interface of AuctionServer1(Seller)*/
private ItemManagement itemm;
private static Currency cuh;
public String[] checkbid(String uid,String curid)
{return itemm.checkbid(uid,cuh.getExchangeRate(curid));}
public String setAvailableDate(String itid,String uid,String
date)
{return itemm.setAvailableDate(itid,uid,date)+"";}
public String setReservePrice(String itid,String uid,String
price,String curid)
{double sprice=Double.valueOf(price)/cuh.getExchangeRate(curid);
return itemm.setReservePrice(itid,uid,sprice)+"";
}
public String additem(String itemname,String userid,String desc)
{itemm.Newitem(itemname,Integer.parseInt(userid),desc);
return "Item added successfully!";
}
public String[] getNews(String userid,String date)
{return itemm.getNewsSeller(userid,date);}
/*Implementation the Interface of AuctionServer1(Bidder)*/
private ItemManagement itemm;
private static Currency cuh;
public String[] getbiditems(String bidderid,String curid)
{
return itemm.getbiditems(bidderid,cuh.getExchangeRate(curid));
}//end of getbiditems
public String[] getavailableitems(String userid,String
date,String curid)
{return itemm.getavailablitems(userid,date,cuh.getExchangeRate
(curid));
}//end of getavailableitems
public String setBiditem(String itemid,String bidderid,String
price,String curid)
{double sprice=Double.valueOf(price)/cuh.getExchangeRate(curid);
return itemm.setBiditem(itemid,bidderid,sprice);
}//end of setBiditem
public String[] getNews(String userid,String date)
{return itemm.getNewsBidder(userid,date);
}//end of getNews
//Item.java and ItemManagement.java
import java.io.Serializable;
/*-------------------------------------------------------------* Item.java
* @Date 4/11/2005
*-------------------------------------------------------------*/
public class Items extends Object implements Serializable
{//Attributes for a item
private int
Itemid;
private String ItemName;
private int
UserID;
private String Desc;
private String AvailableDate;
private double ReservePrice;
private int
BidUser;
private double BidPrice;
//Constructor
public Items(int itemid,String itemname,int userid,String
desc,String availabledate,double reserveprice)
{Itemid=itemid;
ItemName=itemname;
UserID=userid;
Desc=desc;
AvailableDate=availabledate;
ReservePrice=reserveprice;
BidUser=-1;
BidPrice=reserveprice;
}
//**************************************************
// Set item attributs
//**************************************************
public
public
public
public
void
void
void
void
setItemName(String itemname){ItemName=itemname;}
setUserID(int userid){UserID=userid;}
setDesc(String desc){Desc=desc;}
setAvailableDate(Stringavailabledate)
{AvailableDate=availabledate;}
public void setReservePrice(double reserveprice)
{ReservePrice=reserveprice;BidPrice=reserveprice;}
public void setBidUser(int biduser){BidUser=biduser;}
public void setBidPrice(double bidprice){BidPrice=bidprice;}
//**************************************************
// Get item attributes
//**************************************************
public int getItemid(){return Itemid;}
public String getItemName(){return ItemName;}
public int
getUserID(){return UserID;}
public String getDesc(){return Desc;}
public String getAvailableDate(){return AvailableDate;}
public double getReservePrice(){return ReservePrice;}
public double getBidPrice(){return BidPrice;}
public int
getBidUser(){return BidUser;}
}//End of Item.java
import java.util.*;
import java.io.*;
import java.text.*;
/*-------------------------------------------------------------* ItemManagement.java
* @Date 5/11/2005
*-------------------------------------------------------------*/
class ItemManagement extends ArrayList
{ private static int maxitemid=1;//available itemid for new items
private Items items;
//Constructor
public ItemManagement(){openFromFile();}
//To add new items
public void Newitem(String itemname,int userid,String desc)
{items=new Items(maxitemid,itemname,userid,desc,"No Date",0.99);
this.add(items);
maxitemid++;
saveToFile();
}
//check one user's own bid
public String[] checkbid(String uid,double currate)
{
String[] item= new String[20];
int h=0;
for (int i=0;i<this.size() ;i++ )
{
items=(Items)this.get(i);
if (items.getUserID()==Integer.parseInt(uid))
{
item[h]=items.ToString(currate);
h++;
}
}
String[] it=new String [h];
for (int i=0;i<h ;i++ )
{
it[i]=item[i];
}
return it;
}
//set one user's own reserved price
public String setReservePrice(String itemid,String uid,double
price)
{
int i=0;
while (i<this.size())
{
items=(Items)this.get(i);
if (items.getItemid()==Integer.parseInt(itemid)&&
items.getUserID()==Integer.parseInt(uid))
{
items.setReservePrice(price);
saveToFile();
return "Reserved price updated successfully";
}
i++;
}
return "Sorry, this is not your item!";
}
//set one user's prefered date
public String setAvailableDate(String Iid,String uid,String date)
{
int i=0;
while (i<this.size())
{
items=(Items)this.get(i);
if (items.getItemid()==Integer.parseInt(Iid)&&
items.getUserID()==Integer.parseInt(uid))
{
items.setAvailableDate(date);
saveToFile();
return "Date updated successfully";
}
i++;
}
return "Sorry, this is not your item!";
}
//get one user's biding items
public String[] getbiditems(String bidderid,double currate)
{
String[] item= new String[20];
int h=0;
for (int i=0;i<this.size() ;i++ )
{
items=(Items)this.get(i);
if (items.getBidUser()==Integer.parseInt(bidderid))
{
item[h]=items.ToString(currate);
h++;
}
}
String[] it=new String [h];
for (int i=0;i<h ;i++ )
{
it[i]=item[i];
}
return it;
}
//get items for bidding
public String[] getavailablitems(String userid,String date,double
currate)
{
String[] item= new String[20];
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd-MM-yyyy");
int h=0;
try
{Date da=sdf.parse(date);
for (int i=0;i<this.size() ;i++ )
{items=(Items)this.get(i);
if (da.compareTo(sdf.parse(items.getAvailableDate()))==-1 &&
items.getUserID()!=Integer.parseInt(userid))
{item[h]=items.ToString(currate);
h++;
}
}
}catch (Exception e){e.printStackTrace(System.out);}
String[] it=new String [h];
for (int i=0;i<h ;i++ )
it[i]=item[i];
return it;
}
//one user can bid on an item
public String setBiditem(String itemid,String bidderid,double
price)
{int i=0;
while (i<this.size())
{items=(Items)this.get(i);
if (items.getItemid()==Integer.parseInt(itemid))
{if (price>items.getBidPrice())
{items.setBidPrice(price);
items.setBidUser(Integer.parseInt(bidderid));
saveToFile();
return "Your bidding price accepted!";
}
}
i++;
}
return "Higher price is needed!";
}
//Sending news to Seller users
public String[] getNewsSeller(String userid,String date)
{String[] item= new String[20];
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd-MM-yyyy");
int h=0;
try
{Date da=sdf.parse(date);
for (int i=0;i<this.size() ;i++ )
{items=(Items)this.get(i);
if (da.compareTo(sdf.parse(items.getAvailableDate()))==1 &&
items.getUserID()==Integer.parseInt(userid))
{if (items.getBidUser()==-1)
item[h]="No one bid on your item "+items.getItemName()
+"(itemid:"+items.getItemid()+")! ";
else
item[h]="userid:00000"+items.getBidUser()+
" will purchase your item "+
items.getItemName()+"(itemid:"+items.getItemid()+
") at "+items.getBidPrice();
h++;
}
}
}catch (Exception e){e.printStackTrace(System.out);}
if (h==0)
{String[] it=new String [1];
it[0]="No selling news for you till now!";
return it;
}
String[] it=new String [h];
for (int i=0;i<h ;i++ ){it[i]=item[i];}
return it;
}
//Sending news to Bidder users
public String[] getNewsBidder(String userid,String date)
{
String[] item= new String[20];
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd-MM-yyyy");
int h=0;
try
{Date da=sdf.parse(date);
for (int i=0;i<this.size() ;i++ )
{items=(Items)this.get(i);
if (da.compareTo(sdf.parse(items.getAvailableDate()))==1 &&
items.getBidUser()==Integer.parseInt(userid))
{item[h]="You won the bid on item:"+items.getItemName();
h++;
}
}
}catch (Exception e){e.printStackTrace(System.out);}
if (h==0)
{String[] it=new String [1];
it[0]="No bidding news for you till now!";
return it;
}
String[] it=new String [h];
for (int i=0;i<h ;i++ ){ it[i]=item[i];}
return it;
}
//Add all items in this list from file:userdata/Items.dat
publicvoid openFromFile(){openFromFile("../userdata/Items.dat");}
public void openFromFile(String Filename)
{try
{ObjectInputStream ois=new ObjectInputStream(new FileInputStream
(Filename));
while (ois!=null)
{items=(Items)ois.readObject();
super.add(items);
if (items.getItemid()>maxitemid){maxitemid=items.getItemid();}
}
ois.close();
}catch(Exception e){System.out.println(e); }
}
//Save all item items in this list to file:userdata/Items.dat
public void saveToFile(){saveToFile("../userdata/Items.dat");}
public void saveToFile(String Filename)
{try
{ObjectOutputStream oos=new ObjectOutputStream(new
FileOutputStream(Filename));
for (int i=0;i<super.size();i++ )
{oos.writeObject((Items)super.get(i));
oos.flush();
}
oos.close();
}catch(Exception e){System.out.println(e);}
}
}//end of ItemManagement.java
(4)Auction Server 2
The same strucutre as Auction Server 1, and just change the name
of the server.
(5)Client
//main methods
public static void main(String[] args) throws Exception
{String[] a=new String[4];
a[0]="–ORBInitialPort";
a[1]="1234";
a[2]="–ORBInitialHost";
a[3]="localhost";
Client app = new Client();
orb = ORB.init(a, null);
app.run();
}
//Regist via BanlencingServer
private LoadBanlencing lbImpl;
public void regist()
{Scanner scan=new Scanner(System.in);
String sn;String fn;String ad;
System.out.print("Your SurName:");
scan.nextLine();
sn=scan.nextLine();
System.out.print("Your First Name:");
fn=scan.nextLine();
System.out.print("Your Address:");
ad=scan.next();
//get password
String pass1="pass1";
String pass2="pass2";
InputMasking masking = new InputMasking();
try
{while (!pass1.equals(pass2))
{
pass1=masking.getPassword("Your Password:");
pass2=masking.getPassword("Retype your Password:");
if (!pass1.equals(pass2))
System.out.println("Your password is incorrect!");
}
} catch(IOException ex) {ex.printStackTrace();}
//dsplay important information
System.out.println("NB:Please keep this userid for sign in.");
System.out.println("Userid:"+lbImpl.regist(sn,fn,ad,pass1));
}
}//end of regist
//Login via BanlencingServer
private LoadBanlencing lbImpl;
public void Login()
{
String userid; String pass="";
String login;
System.out.print("Please Enter your Userid:");
userid=scan.next();
InputMasking masking = new InputMasking();
try
{pass=masking.getPassword("Please Enter your Password:");}
catch (IOException ex) {ex.printStackTrace();}
login=lbImpl.login(userid,pass);
if (login.equals("1"))
System.out.println("Illegal password or userid!");
else
if (login.equals("2"))
System.out.println("Your account is activated now!");
else
{//Valid login and display ticket information
String ticket=login.substring(0,14);
String firstname=login.substring(14,login.length());
System.out.println("\nYou logged on "+ticket);
//Pass the ticket to Customer who will communicate with
//an AuctionServer
Customer cus=new Customer(ticket,userid,firstname,lbImpl);
cus.run();
}
}//end of Login
(6)Customer
//Constructor: get ticket and related information
public Customer(String sn,String ui,String fn,LoadBanlencing lb)
{userid=ui;
System.out.println(userid);
servername=sn;//the ticket
firstname=fn;
lbImpl=lb;
curid=Integer.parseInt(lbImpl.loadCurid(userid));
}
//connect with auction server
public void run()
{
try{
String[] a=new String[4];
a[0]="–ORBInitialPort";
a[1]="1234";
a[2]="–ORBInitialHost";
a[3]="localhost";
Client app = new Client();
orb = ORB.init(a, null);
org.omg.CORBA.Object objRef =
orb.resolve_initial_references("NameService");
NamingContextExt ncRef =
NamingContextExtHelper.narrow(objRef);
String name = servername+".seller";
sellerImpl =
SellerHelper.narrow(ncRef.resolve_str(name));
name=servername+".bidder";
bidderImpl=BidderHelper.narrow(ncRef.resolve_str(name));
}
catch (Exception e) {
System.out.println("ERROR : " + e) ;
e.printStackTrace(System.out);
}
while(true)
{showUser();
showMenu();
getUserInput();
}
}//end of run
//Exit
public void exit()
{lbImpl.logoff(userid);
System.exit(0);
}
//Display News
public void news()
{
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd-MM-yyyy");
String[] sellnews=
sellerImpl.getNews(userid,sdf.format(calendar.getTime()));
String[] bidnews=
bidderImpl.getNews(userid,sdf.format(calendar.getTime()));
String [] news=new String [sellnews.length+bidnews.length];
for (int i=0;i<sellnews.length ;i++ )news[i]=sellnews[i];
for (int i=sellnews.length;i<sellnews.length+bidnews.length;i++)
news[i]=bidnews[i-sellnews.length];
itemarray=news;
}
//Change currency rate
public void exchangerate()
{Scanner scan=new Scanner(System.in);
System.out.println("Following currencies are available:");
System.out.println("1--U.S. Dollar(USD)");
System.out.println("2--Australian Dollar(AUD)");
System.out.println("3--Euro Dollar(EUD)");
System.out.println("4--Chinese Dollar(RMB)");
System.out.println("5--Pound(POD)");
System.out.println("6--Ruble(RUB)");
System.out.print("Please enter your choice(1..6):");
curid=Integer.parseInt(scan.next())-1;
lbImpl.saveCurid(userid,curid+"");
}
//Check mybiditem
private int curid;//keep user prefered currency
public void mybiditem()
{itemarray=bidderImpl.getbiditems(userid,curid+"");}
//set bid items
public void biditem()
{Scanner scan=new Scanner(System.in);
String itemid=itemarray[focus].substring(0,6);
System.out.print("Please input your prefered price:");
String price=scan.nextLine();
bidderImpl.setBiditem(itemid,userid,price,curid+"");
availableitem();
}
//get available items
public void availableitem()
{Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd-MM-yyyy");
String date= sdf.format(calendar.getTime());
itemarray=bidderImpl.getavailableitems(userid,date,curid+"");
}
//The owner can check bid information
public void checkbid()
{itemarray=sellerImpl.checkbid(userid,curid+"");}
//The owner can set reserved price
public void reserveprice()
{Scanner scan=new Scanner(System.in);
String itemid=itemarray[focus].substring(0,6);
System.out.print("Please input price for the item:");
String price=scan.nextLine();
String info=
sellerImpl.setReservePrice(itemid,userid,price,curid);
System.out.println(info);
//refresh data
if (!info.substring(0,1).equals("S"))checkbid();
}
//The owner can set prefered date
public void setdate()
{Scanner scan=new Scanner(System.in);
String itemid=itemarray[focus].substring(0,6);
System.out.print("Please input your prefered date and time:");
String date=scan.nextLine();
String info=sellerImpl.setAvailableDate(itemid,userid,date);
System.out.println(info);
//refresh data
if (!info.substring(0,1).equals("S"))checkbid();
}
//add an item for bidding
public void additem()
{Scanner scan=new Scanner(System.in);
System.out.print("Please input item name:");
String itemname=scan.nextLine();
System.out.print("Description of the item:");
String description=scan.nextLine();
sellerImpl.additem(itemname,userid,description);
}