CS4B Spring 2007

Class InventoryController

java.lang.Object
  extended by InventoryController
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class InventoryController
extends java.lang.Object
implements java.awt.event.ActionListener

The controller portion of the MVC the controller listens for input and drives the model and viewer Used to add data to inventory and also to monitor the current inventory. current system has three select query buttons that send three different queries to Server system also has buttons for getting thread information, resetting databases and quitting.
System enhances SelectController by adding the ability to update the database quantity, however updating is processed in the InventoryViewer. All buttons that implement ActionPerformed in here, but have getActionCommand set to an appropriate FruitThreadServer command.

See Also:
SelectController, InventoryViewer

Constructor Summary
InventoryController(InventoryViewer v, java.lang.String url)
          Creates a socket connection to the intended Server url is the IP/URL address of the serverSocket
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          send all getActionCommand strings to the model-server
 java.lang.String query(java.lang.String str)
          Send query to FruitServer Query can be a data manipulation or select query it can actuall be any command of FruitThreadServer
 java.util.Vector queryVector(java.lang.String str)
          Send query to FruitServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InventoryController

public InventoryController(InventoryViewer v,
                           java.lang.String url)
Creates a socket connection to the intended Server url is the IP/URL address of the serverSocket

Parameters:
v - view
Method Detail

queryVector

public java.util.Vector queryVector(java.lang.String str)
Send query to FruitServer

Returns:
Server response is Vector
See Also:
Vector

query

public java.lang.String query(java.lang.String str)
Send query to FruitServer Query can be a data manipulation or select query it can actuall be any command of FruitThreadServer

Parameters:
str - query string to send to server
Returns:
String response from server

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
send all getActionCommand strings to the model-server

Specified by:
actionPerformed in interface java.awt.event.ActionListener

CS4B Spring 2007