Class ShipmentDaoImpl

java.lang.Object
com.shipmentXpress.dao.ShipmentDaoImpl
All Implemented Interfaces:
ShipmentDao

public class ShipmentDaoImpl extends Object implements ShipmentDao
Implementation of the ShipmentDao interface for managing shipments.
  • Constructor Details

    • ShipmentDaoImpl

      public ShipmentDaoImpl()
  • Method Details

    • addShipment

      public String addShipment(Shipment shipment) throws ShipmentException
      Adds a new shipment to the system.
      Specified by:
      addShipment in interface ShipmentDao
      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

      public String deteleShipment(int shipmentId) throws ShipmentException
      Deletes a shipment based on its shipment ID.
      Specified by:
      deteleShipment in interface ShipmentDao
      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

      public Shipment updateShipment(int shipmentId, String content, double weight, String address) throws ShipmentException
      Updates the details of a shipment.
      Specified by:
      updateShipment in interface ShipmentDao
      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

      public Shipment getShipment(int shipmentId) throws ShipmentException
      Retrieves a shipment based on its shipment ID.
      Specified by:
      getShipment in interface ShipmentDao
      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.