Interface ShipmentDao

All Known Implementing Classes:
ShipmentDaoImpl

public interface ShipmentDao
The ShipmentDao interface defines methods for performing CRUD operations related to shipments.
  • Method Details

    • addShipment

      String addShipment(Shipment shipment) throws ShipmentException
      Adds a new shipment to the system.
      Parameters:
      shipment - The Shipment object to be added.
      Returns:
      A status message indicating the success or failure of the operation.
      Throws:
      ShipmentException - If an error occurs while adding the shipment.
    • deteleShipment

      String deteleShipment(int shipmentId) throws ShipmentException
      Deletes a shipment based on its shipment ID.
      Parameters:
      shipmentId - The ID of the shipment to be deleted.
      Returns:
      A status message indicating the success or failure of the operation.
      Throws:
      ShipmentException - If an error occurs while deleting the shipment.
    • updateShipment

      Shipment updateShipment(int shipmentId, String content, double weight, String address) throws ShipmentException
      Updates the details of a shipment.
      Parameters:
      shipmentId - The ID of the shipment to be updated.
      content - The new content description of the shipment.
      weight - The new weight of the shipment.
      address - The new recipient address of the shipment.
      Returns:
      The updated Shipment object.
      Throws:
      ShipmentException - If an error occurs while updating the shipment.
    • getShipment

      Shipment getShipment(int shipmentId) throws ShipmentException
      Retrieves a shipment based on its shipment ID.
      Parameters:
      shipmentId - The ID of the shipment to retrieve.
      Returns:
      The Shipment object corresponding to the given ID.
      Throws:
      ShipmentException - If an error occurs while retrieving the shipment.