
io.mosip.registration.service.packet.RegPacketStatusService Maven / Gradle / Ivy
package io.mosip.registration.service.packet;
import java.util.List;
import io.mosip.registration.dto.ErrorResponseDTO;
import io.mosip.registration.dto.ResponseDTO;
import io.mosip.registration.dto.SuccessResponseDTO;
import io.mosip.registration.entity.Registration;
import io.mosip.registration.exception.ConnectionException;
import io.mosip.registration.exception.PreConditionCheckException;
import io.mosip.registration.exception.RegBaseCheckedException;
/**
* Interface to update status of the registration packets based on Packet Status
* Reader service and delete the Registration Packets based on the status of the
* packets
*
* @author Himaja Dhanyamraju
* @since 1.0.0
*/
public interface RegPacketStatusService {
/**
* Updates the server status code of the packets based on the status received
* from Packet Status Reader Service
*
*
* Fetch the Registration ID of the packets with Client Status Code as PUSHED.
* Send these Registration IDs to the Packet Status Reader service. Based on the
* response status received, update the Server Status Code of the Packet.
*
*
*
* Returns the {@link ResponseDTO} object.
*
*
*
* If all the above processes had completed successfully,
* {@link SuccessResponseDTO} will be set in {@link ResponseDTO} object
*
*
*
* If any exception occurs, {@link ErrorResponseDTO} will be set in
* {@link ResponseDTO} object
*
*
* @param triggerpoint
* - the point by which the service was triggered.
*
* SYSTEM
*
*
* If service is triggered by System
*
*
* User ID
*
*
* If service is triggered by the User
*
*
* @return {@link ResponseDTO} which specifies either success response or error response
* after sync with server
* @throws RegBaseCheckedException
*/
ResponseDTO syncServerPacketStatus(String triggerpoint) throws RegBaseCheckedException, ConnectionException;
ResponseDTO syncServerPacketStatusWithRetryWrapper(String triggerpoint) throws RegBaseCheckedException, ConnectionException;
/**
* Deletes the Registration Packets from the local system based on the status of
* the packets and the configured number of days
*
*
* The criteria for deleting are:
*
*
* - The status of the Packet has to be PROCESSED
* - The configured number of days specifies the days after which the server
* status code had been updated to PROCESSED
*
*
*
* Deletes the following based
*
*
* - Registration Packet and Acknowledgement Receipt from local system
* - Registration data from {@link Registration} table
*
*
*
* Returns the {@link ResponseDTO} object.
*
*
*
* If all the above processes had completed successfully,
* {@link SuccessResponseDTO} will be set in {@link ResponseDTO} object
*
*
*
* If any exception occurs, {@link ErrorResponseDTO} will be set in
* {@link ResponseDTO} object
*
*
* @return {@link ResponseDTO} specifying the status after deleting the
* Registration Packets
*/
ResponseDTO deleteRegistrationPackets();
/**
* Deletes the list of {@link Registration} entries from the local system based
* on the status of the packets
*
*
* The criterion for deleting is:
*
*
* - The status of the Packet has to be PROCESSED
*
*
*
* Deletes the following based
*
*
* - Registration Packet and Acknowledgement Receipt from local system
* - Registration data from {@link Registration} table
*
*
* @param registrations
* the list of {@link Registration} entries to be deleted
*/
void deleteRegistrations(List registrations);
/**
* Deletes all the registration packets which are no more needed for the
* re-mapped machine
*
*
* The status of the registration has to be anyone of the following for
* deletion:
*
*
* - RE-REGISTER
* - PROCESSING
* - processed
*
*
*
* Deletes the following based
*
*
* - Registration Packet and Acknowledgement Receipt from local system
* - Registration data from {@link Registration} table
*
*/
void deleteAllProcessedRegPackets();
}