Package com.shipmentXpress.dao
Interface ShipmentDao
- All Known Implementing Classes:
ShipmentDaoImpl
public interface ShipmentDao
The ShipmentDao interface defines methods for performing CRUD operations
related to shipments.
-
Method Summary
Modifier and TypeMethodDescriptionaddShipment(Shipment shipment) Adds a new shipment to the system.deteleShipment(int shipmentId) Deletes a shipment based on its shipment ID.getShipment(int shipmentId) Retrieves a shipment based on its shipment ID.updateShipment(int shipmentId, String content, double weight, String address) Updates the details of a shipment.
-
Method Details
-
addShipment
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
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
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.
-