@Override void syncMetrics( final Execution<?, ?> execution, final Timestamp timestamp, final int numberObjectsLoaded, final int numberObjectsDirtied) { execution.completedAt = timestamp; final MetricsDto metricsDto = metricsFor(execution); final PeriodDto periodDto = timingsFor(metricsDto); periodDto.setCompletedAt(JavaSqlTimestampXmlGregorianCalendarAdapter.print(timestamp)); final ObjectCountsDto objectCountsDto = objectCountsFor(metricsDto); numberObjectsLoadedFor(objectCountsDto).setAfter(numberObjectsLoaded); numberObjectsDirtiedFor(objectCountsDto).setAfter(numberObjectsDirtied); }
return (T) valueDto.getBigInteger(); case JAVA_SQL_TIMESTAMP: return (T) JavaSqlTimestampXmlGregorianCalendarAdapter.parse(valueDto.getDateTime()); case JODA_DATE_TIME: return (T) JodaDateTimeXMLGregorianCalendarAdapter.parse(valueDto.getDateTime());
@Override void syncMetrics( final Execution<?, ?> execution, final Timestamp timestamp, final int numberObjectsLoaded, final int numberObjectsDirtied) { execution.startedAt = timestamp; final MetricsDto metricsDto = metricsFor(execution); final PeriodDto periodDto = timingsFor(metricsDto); periodDto.setStartedAt(JavaSqlTimestampXmlGregorianCalendarAdapter.print(timestamp)); final ObjectCountsDto objectCountsDto = objectCountsFor(metricsDto); numberObjectsLoadedFor(objectCountsDto).setBefore(numberObjectsLoaded); numberObjectsDirtiedFor(objectCountsDto).setBefore(numberObjectsDirtied); }
protected ChangesDto newChangesDto(final ObjectsDto objectsDto) { final ChangesDto changesDto = new ChangesDto(); changesDto.setMajorVersion("1"); changesDto.setMinorVersion("0"); changesDto.setTransactionId(transactionUuid.toString()); changesDto.setSequence(sequence); changesDto.setUser(userName); changesDto.setCompletedAt(JavaSqlTimestampXmlGregorianCalendarAdapter.print(completedAt)); changesDto.setObjects(objectsDto); return changesDto; }
public CommandDto process(final Command command, CommandDto commandDto) { // for some reason this isn't being persisted initially, so patch it in. TODO: should fix this commandDto.setUser(command.getUser()); // the timestamp field was only introduced in v1.4 of cmd.xsd, so there's no guarantee // it will have been populated. We therefore copy the value in from CommandWithDto entity. if(commandDto.getTimestamp() == null) { final Timestamp timestamp = command.getTimestamp(); commandDto.setTimestamp(JavaSqlTimestampXmlGregorianCalendarAdapter.print(timestamp)); } CommandDtoUtils.setUserData(commandDto, CommandWithDto.USERDATA_KEY_TARGET_CLASS, command.getTargetClass()); CommandDtoUtils.setUserData(commandDto, CommandWithDto.USERDATA_KEY_TARGET_ACTION, command.getTargetAction()); CommandDtoUtils.setUserData(commandDto, CommandWithDto.USERDATA_KEY_ARGUMENTS, command.getArguments()); final Bookmark result = command.getResult(); CommandDtoUtils.setUserData(commandDto, CommandWithDto.USERDATA_KEY_RETURN_VALUE, result != null ? result.toString() : null); // knowing whether there was an exception is on the master is used to determine whether to // continue when replayed on the slave if an exception occurs there also CommandDtoUtils.setUserData(commandDto, CommandWithDto.USERDATA_KEY_EXCEPTION, command.getException()); PeriodDto timings = CommandDtoUtils.timingsFor(commandDto); timings.setStartedAt(JavaSqlTimestampXmlGregorianCalendarAdapter.print(command.getStartedAt())); timings.setCompletedAt(JavaSqlTimestampXmlGregorianCalendarAdapter.print(command.getCompletedAt())); return commandDto; } }
valueDto.setTimestamp(JavaSqlTimestampXmlGregorianCalendarAdapter.print(argValue)); return valueDto;