Source : AdminRAndREngine.java

CS22120 Group Project - project source listings

Questions and comments on this file can be directed to this classes author: Paul Smith

View Test Results.


package cs221.groupk.reportandreconciliation;

import cs221.groupk.database.*;
import cs221.groupk.common.*;
import cs221.groupk.exceptions.database.*;
import java.util.*;

/**
 * AdminRandREngine is the class responsible for editing the database. This
 * class utilises methods in the DatabaseEngine class. There is some
 * processing carried on in this class, but this class is provided to allow
 * a simple interface for a <B>u</B>ser <B>i</B>nterface to operate on.
 *
 * <P><I>Code spell-checked - Chris Milner - 5th December 2000.</I><P>
 *
 * @author <A HREF="mailto:[email protected]">Paul Smith</A>
 */

public class AdminRandREngine implements Constants
{
  protected StdDatabaseEngine databaseEngine;

  /**
   * This Constructor CANNOT BE USED. You MUST use <A HREF=
   * "#AdminRandREngine(cs221.groupk.database.StdDatabaseEngine)">
   * <CODE>AdminRandREngine(StdDatabaseEngine databaseEngine)</CODE></A>.
   */
  public AdminRandREngine()
  {
  }

  /**
   * Over-loaded contructor for AdminRandREngine - <B>This is the only
   * constructor to use.</B> The default constructor will not connect to
   * a database, so will throw excetions whenver you attempt to execute an
   * operation.
   * @param StdDatabaseEngine databaseEngine is the instance of the database
   * engine that this engine will operate upon.
   */
  public AdminRandREngine(StdDatabaseEngine databaseEngine)
  {
    this.databaseEngine = databaseEngine;
  }

  /**
   * getActiveUsers returns an array of the active users presently available
   * in the database.
   * @return user[] users.
   */
  public User[] getActiveUsers()
  {
    return null;
  }

  /**
   * getActiveSaleItems returns an array of the active SaleItems presently
   * available in the database.
   * @return SaleItem[]
   */
  public SaleItem[] getActiveSaleItems()
  {
    return null;
  }

  /**
   * writeTopDisk creates a Disk object for the date specified, with the
   * SaleItems and Users specified, but for the Top POST.
   * @param User[] users
   * @param SaleItem[] saleItems
   * @param Date date
   * @return int zero on success, or negative error code.
   */
  public int writeTopDisk(User[] users, SaleItem[] saleItems, Date date)
  {
    return -1;
  }

  /**
   * writeTopDisk creates a Disk object for the date specified, with the
   * SaleItems and Users specified, but for the Bottom POST.
   * @param User[] users
   * @param SaleItem[] saleItems
   * @param Date date
   * @return int zero on success, or negative error code.
   */
  public int writeBottomDisk(User[] users, SaleItem[] saleItems, Date data)
  {
    return -1;
  }

  /**
   *
   * @return int zero on success, or negative error code.
   * @see cs221.groupk.common.Constants
   */
  public int insertDiskIntoDatabase()
  {
    return OPERATION_FAILED;
  }

  /**
   * rebuildDatabase will cause the data in the database to be rebuilt. This
   * method will create a dialogbox allowing the user to select which Disk
   * objects to rebuild the database from.
   * @return int zero on success or negative error code.
   * @see cs221.groupk.common.Constants
   */
  public int rebuildDatabase()
  {
    return OPERATION_FAILED;
  }

  /**
   * addUser adds the provided user to the database.
   * @param User user to add to the database.
   * @return int zero on success or negative error code.
   * @exception InsufficientAccessPrivilegeException is thrown if the current
   * user does not have sufficient access privalges for admin tasks.
   * @exception UserAlreadyExistsException is thrown when the User user's ID
   * already exists.
   * @see cs221.groupk.common.Constants
   */
  public final int addUser(User user)
    throws InsufficientAccessPrivilegeException,
           UserAlreadyExistsException
  {
    return OPERATION_FAILED;
  }

  /**
   * setUserPermissions sets the Users permissions specifed by the userID
   * String. <B>Caution</B> to be used with this method as it is possible to
   * lock out users.
   * @param String userID of user to set permissions.
   * @param boolean admin or not.
   * @param boolean topStation or not.
   * @param boolean bottomStation or not.
   * @return int zero on success or negative error code.
   * @exception UserNotFoundException is thrown if the user specifed with
   * userID is not found within the database.
   * @exception InsufficientAccessPrivilegeException is thrown if the current
   * user does not have sufficient access privalges for admin tasks.
   */
  public final int setUserPermissions(String userID,
                                       boolean admin,
			 	       boolean topStation,
				       boolean bottomStation)
    throws UserNotFoundException,
           InsufficientAccessPrivilegeException
  {
    return OPERATION_FAILED;
  }

  /**
   * setUserPassword sets the specifed User's password with the password
   * specified.
   * @param String userID of user to change password.
   * @param String the new password.
   * @return int zero on success or negative error code.
   * @exception UserNotFoundException is thrown if the user specifed with
   * userID is not found within the database.
   * @exception InsufficientAccessPrivilegeException is thrown if the current
   * user does not have sufficient access privalges for admin tasks.
   */
  public int setUserPassword(String userID, String password)
    throws UserNotFoundException,
           InsufficientAccessPrivilegeException
  {
    return OPERATION_FAILED;
  }

  /**
   * addSaleItem adds the SaleItem saleItem to the database.
   * @param SaleItem saleItem is the new SaleItem to be added
   * @return int positive SaleItemID on success or negative error code.
   * @exception InsufficientAccessPrivilegeException is thrown if the current
   * user does not have sufficient access privalges for admin tasks.
   */
  public int addSaleItem(SaleItem saleItem)
    throws InsufficientAccessPrivilegeException
  {
    return OPERATION_FAILED;
  }

  /**
   * saveConfiguration saves the current configuration of the Disk Writing
   * options.
   * @return int zero on success or negative error code.
   */
  public int saveConfiguration()
  {
    return OPERATION_FAILED;
  }

  /**
   * readConfiguration a previous configuration of the Disk Writing
   * options.
   * @return int zero on success or negative error code.
   */
  public int readConfiguration()
  {
    return OPERATION_FAILED;
  }
}


Up one level.

Page automatically generated on: 26/01/01 at: 10:48:19.