use of com.emc.metalnx.core.domain.exceptions.DataGridTicketNotFoundException in project metalnx-web by irods-contrib.
the class TicketServiceImpl method find.
@Override
public DataGridTicket find(String ticketId) throws DataGridConnectionRefusedException, DataGridTicketNotFoundException {
logger.info("Find ticket {}", ticketId);
DataGridTicket dgTicket = null;
TicketAdminService tas = irodsServices.getTicketAdminService();
try {
Ticket t = tas.getTicketForSpecifiedTicketString(ticketId);
dgTicket = convertTicketToDataGridTicket(t);
dgTicket.setHosts(tas.listAllHostRestrictionsForSpecifiedTicket(ticketId, OFFSET));
dgTicket.setUsers(tas.listAllUserRestrictionsForSpecifiedTicket(ticketId, OFFSET));
dgTicket.setGroups(tas.listAllGroupRestrictionsForSpecifiedTicket(ticketId, OFFSET));
} catch (DataNotFoundException e) {
throw new DataGridTicketNotFoundException("Ticket does not exist");
} catch (JargonException e) {
logger.error("Could not find ticket with string: {}", ticketId);
}
return dgTicket;
}
Aggregations