Professional Documents
Culture Documents
Assignment 1
Total Marks: 10
If you have to use WinRAR, choose the winzip option before you compress the files.
Page1of12
You are required to develop an application that can be used for tournament draw selection. This application will be used to schedule a preliminary round in a tennis tournament (singles) and the guidelines for draw selection are given in Appendix A. The interface defines three methods: 1. The search() method searches whether the player name is already in the server. If a player name is not in the server a false value is returned. If the player name is found in the server a true value is returned indicating that the player is able to play in the tournament. Top seeded tennis player names and their seeds (or ranks) are stored in the server in players.txt file (the list of players are available in Appendix B). 2. The getOpponent() method returns the name of the opponent player associated with the players name supplied. If the supplied players name is not found in players.txt file then a string No player is returned. 3. The getMatchDetails() method is used to get the details of match associated with the supplied match number. If the supplied match number is not available, a string No match is returned. The match details are returned as a string Player A vs Player B Court 1). We assume that there are only two courts and the courts are scheduled in sequential order of the matches. You are required to implement the DrawPlayersServer interface. You may implement the methods in whatever way you deem fit subject to the following conditions:
Page2of12
1. There are only 8 players with their corresponding seed (or rank) available in the server. You are required to use players.txt file (See Appendix B). We will assume that the 8 players and their rankings have been fixed as shown in Appendix B. 2. The search() method searches whether a player name supplied is in the players.txt file and the getOpponent() method draws players using the seed of the players (See Appendix A). 3. The getMatchDetails() method must randomly generate and assign a court between 1 to 2 to a match. Same court can be repeatedly assigned to two or more matches. For example, court 1 can be used for match-1 and match-2. 4. The server is case-insensitive. That is Roger Federer is the same as RogER feDErer. 5. Guidelines for draw selection in tennis tournaments are given in Appendix A. Follow the guidelines given in Appendix A in implementing the match schedules for this application. 6. Name the implementation class of the DrawPlayersServer interface as DrawPlayersServerImpl. Produce an accompanying server application class to start the server. Name the server application as DrawPlayersServerApp. Create a client application and name it Main. Your client should be able to demonstrate the following functionalities: Able to connect to the server via the RMI protocol using the default port 1099. It has one argument localhost entered at the DOS prompt. This argument denotes the servers IP address. Able to repeatedly call the servers search() method to search a player, getOpponent() method to get the opponent of the supplied player, and getMatchDetails() method to get the player names and the court for a tennis match. Able to terminate the repeated call when the user is done with your client application. Is case-insensitive. That is Roger Federer is same as RogER feDErer.
Page3of12
Server outputs:
Page4of12
Server outputs:
Page5of12
Server outputs:
Page6of12
You are required to develop an application that can be used for tournament draw selection. This application will be used to schedule a preliminary round in a tennis tournament (singles) and the guidelines for draw selection are given in Appendix A. The interface defines three methods: 1. The search() method searches whether the player name is already in the server. If a player name is not in the server a false value is returned. If the player name is found in the server a true value is returned indicating that the player is able to play in the tournament. Top seeded tennis player names and their seeds (or ranks) are stored in the server in players.txt file (the list of players are available in Appendix B). 2. The getOpponent() method returns the name of the opponent player associated with the players name supplied. If the supplied players name is not found in players.txt file then a string No player is returned. 3. The getMatchDetails() method is used to get the details of match associated with the supplied match number. If the supplied match number is not available, a string No match is returned. The match details are returned as a string Player A vs Player B Court 1). We assume that there are only two courts and the courts are scheduled in sequential order of the matches. You are required to implement the DrawPlayersServer interface. You may implement the methods in whatever way you deem fit subject to the following conditions:
Page7of12
1. There are only 8 players with their corresponding seed (or rank) available in the server. You are required to use players.txt file (See Appendix B). We will assume that the 8 players and their rankings have been fixed as shown in Appendix B. 2. The search() method searches whether a player name supplied is in the players.txt file and the getOpponent() method draws players using the seed of the players (See Appendix A). 3. The getMatchDetails() method must randomly generate and assign a court between 1 to 2 to a match. Same court can be repeatedly assigned to two or more matches. For example, court 1 can be used for match-1 and match-2. 4. The server is case-insensitive. That is Roger Federer is the same as RogER feDErer. 5. Guidelines for draw selection in tennis tournaments are given in Appendix A. Follow the guidelines given in Appendix A in implementing the match schedules for this application. 6. Name the implementation class of the DrawPlayersServer interface as DrawPlayersServerImpl. Produce an accompanying server application class to start the server. Name the server application as DrawPlayersServerApp. Create a client application and name it Main. Your client should be able to demonstrate the following functionalities: Able to connect to the server via the RMI-IIOP protocol using the default port 900. It has one argument localhost entered at the DOS prompt. This argument denotes the servers IP address. Able to repeatedly call the servers search() method to search a player, getOpponent() method to get the opponent of the supplied player, and getMatchDetails() method to get the player names and the court for a tennis match. Able to terminate the repeated call when the user is done with your client application. Is case-insensitive. That is Roger Federer is same as RogER feDErer. Client and Server Outputs are similar to Assignment 1a: RMI.
Page8of12
You are required to develop an application that can be used for tournament draw selection. This application will be used to schedule a preliminary round in a tennis tournament (singles) and the guidelines for draw selection are given in Appendix A. The interface defines three methods: 1. The search() method searches whether the player name is already in the server. If a player name is not in the server a false value is returned. If the player name is found in the server a true value is returned indicating that the player is able to play in the tournament. Top seeded tennis player names and their seeds (or ranks) are stored in the server in players.txt file (the list of players are available in Appendix B). 2. The getOpponent() method returns the name of the opponent player associated with the players name supplied. If the supplied players name is not found in players.txt file then a string No player is returned. 3. The getMatchDetails() method is used to get the details of match associated with the supplied match number. If the supplied match number is not available, a string No match is returned. The match details are returned as a string Player A vs Player B Court 1). We assume that there are only two courts and the courts are scheduled in sequential order of the matches. You are required to implement the DrawPlayersServerRemote interface using a session bean. You may implement the methods in whatever way you deem fit subject to the following conditions:
Page9of12
1. There are only 8 players with their corresponding seed (or rank) available in the server. You are required to use players.txt file (See Appendix B). We will assume that the 8 players and their rankings have been fixed as shown in Appendix B. 2. The search() method searches whether a player name supplied is in the players.txt file and the getOpponent() method draws players using the seed of the players (See Appendix A). 3. The getMatchDetails() method must randomly generate and assign a court between 1 to 2 to a match. Same court can be repeatedly assigned to two or more matches. For example, court 1 can be used for match-1 and match-2. 4. The server is case-insensitive. That is Roger Federer is the same as RogER feDErer. 5. Guidelines for draw selection in tennis tournaments are given in Appendix A. Follow the guidelines given in Appendix A in implementing the match schedules for this application. 6. Name the implementation class of the DrawPlayersServerRemote interface as DrawPlayersServerBean. 7. The implementation must be able to deploy the session bean. You are to decide which type of session bean (stateful or stateless) is suitable for the solution. Create a client application and name it Main. Your client should be able to demonstrate the following functionalities: Able to connect to the EJB server. Able to repeatedly call the servers search() method to search a player, getOpponent() method to get the opponent of the supplied player, and getMatchDetails() method to get the player names and the court for a tennis match. Able to terminate the repeated call when the user is done with your client application. Is case-insensitive. That is Roger Federer is same as RogER feDErer. Client and Server Outputs are similar to Assignment 1a: RMI and Assignment 1b: RMI-IIOP.
Page10of12
Page11of12
Page12of12