Interface Deleteable

All Known Subinterfaces:
CustomerDAO, OrderDAO, ProductDAO, SupplierDAO
All Known Implementing Classes:
CustomerDAOImpl, OrderDAOImpl, ProductDAOImpl, SupplierDAOImpl

public interface Deleteable
This is the Deletable interface for the DAO components of the Customer Web Application.
Since:
1.0
Author:
Jonathan Earl
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deleteEntity(org.example.websecurity.UserCredentials credentials, int id)
    Deletes a CuUstomerEntity by id.
    void
    deleteEntity(org.example.websecurity.UserCredentials credentials, org.example.customer.utility.CustomerEntity entity)
    Deletes an CustomerEntity.
    boolean
    isDeleteable(org.example.websecurity.UserCredentials credentials, int id)
    This method will determine if a CustomerEntity record can be deleted.
    boolean
    isDeleteable(org.example.websecurity.UserCredentials credentials, org.example.customer.utility.CustomerEntity entity)
    Checks to see if a Product has Orders, if not the Product is deleteable.
  • Method Details

    • isDeleteable

      boolean isDeleteable(org.example.websecurity.UserCredentials credentials, int id)
      This method will determine if a CustomerEntity record can be deleted.

      Only Managers can delete CustomerEntity records.

      Parameters:
      credentials - the UserCredentials for this Database operation
      id - the if of the object to delete
      Returns:
      true if the object is deleteable
    • isDeleteable

      boolean isDeleteable(org.example.websecurity.UserCredentials credentials, org.example.customer.utility.CustomerEntity entity)
      Checks to see if a Product has Orders, if not the Product is deleteable.

      Only Managers can delete CustomerEntity records.

      Parameters:
      credentials - the UserCredentials for this Database operation
      entity - the CustomerEntity object to check
      Returns:
      true if the CustomerEntity is deleteable
      Throws:
      IllegalArgumentException - if there is a connection or permission problem
    • deleteEntity

      void deleteEntity(org.example.websecurity.UserCredentials credentials, org.example.customer.utility.CustomerEntity entity) throws NonDeleteableRecordException
      Deletes an CustomerEntity.

      Only a Manager is permitted to delete a CustomerEntity.

      If this CustomerEntity fails to meet the criteria for deletion, the delete will fail.

      Parameters:
      credentials - the UserCredentials for this Database operation
      entity - the CustomerEntity object to delete
      Throws:
      IllegalArgumentException - if there is a connection or permission problem
      NonDeleteableRecordException - if this CustomerEntity cannot be deleted
    • deleteEntity

      void deleteEntity(org.example.websecurity.UserCredentials credentials, int id) throws NonDeleteableRecordException
      Deletes a CuUstomerEntity by id.

      Only a Manager is permitted to delete a CustomerEntity.

      Parameters:
      credentials - the UserCredentials for this Database operation
      id - the CustomerEntity id to delete
      Throws:
      IllegalArgumentException - if there is a connection or permission problem
      NonDeleteableRecordException - if this CustomerEntity cannot be deleted