class TicketAdminServiceImpl extends AbstractTicketService implements TicketAdminService {

	@Override
	public Ticket compareGivenTicketToActualAndUpdateAsNeeded(final Ticket ticketWithDesiredData)
			throws DataNotFoundException, JargonException {

		log.info("compareGivenTicketToActualAndUpdateAsNeeded()");
		if (ticketWithDesiredData == null) {
			throw new IllegalArgumentException("null ticketWithDesiredData");
		}

		// data not found will occur here if I cannot find the ticket
		Ticket actualTicket = getTicketForSpecifiedTicketString(ticketWithDesiredData.getTicketString());

		/*
		 * Compare things now and call appropriate updates. This is not within a
		 * transaction, but that's the way it works...sorry
		 */

		// uses limit
		if (ticketWithDesiredData.getUsesLimit() != actualTicket.getUsesLimit()) {
			log.info("setting uses limit to:{}", ticketWithDesiredData.getUsesLimit());
			setTicketUsesLimit(actualTicket.getTicketString(), ticketWithDesiredData.getUsesLimit());
		}

		// files limit
		if (ticketWithDesiredData.getWriteFileLimit() != actualTicket.getWriteFileLimit()) {
			log.info("setting files write limit to:{}", ticketWithDesiredData.getWriteFileLimit());
			setTicketFileWriteLimit(actualTicket.getTicketString(), ticketWithDesiredData.getWriteFileLimit());
		}

		// bytes write limit
		if (ticketWithDesiredData.getWriteByteLimit() != actualTicket.getWriteByteLimit()) {
			log.info("setting bytes write limit to:{}", ticketWithDesiredData.getWriteByteLimit());
			setTicketByteWriteLimit(actualTicket.getTicketString(), ticketWithDesiredData.getWriteByteLimit());
		}

		// expires (
		if (!isDateSame(ticketWithDesiredData.getExpireTime(), actualTicket.getExpireTime())) {
			log.info("updating expires limit");
			setTicketExpiration(actualTicket.getTicketString(), ticketWithDesiredData.getExpireTime());
		}

		log.info("ticket updated, read again to return to caller");
		return getTicketForSpecifiedTicketString(ticketWithDesiredData.getTicketString());

	}

	  TicketAdminServiceImpl(final IRODSAccessObjectFactory irodsAccessObjectFactory, final IRODSAccount irodsAccount);

}