/** * Returns a new Revision that has the same Client ID and Component ID as this one * but with a larger version * * @return the updated Revision */ public Revision incrementRevision(final String clientId) { return new Revision(version + 1, clientId, componentId); }
@Override public Revision getRevision(final String componentId) { return revisionMap.computeIfAbsent(componentId, id -> new Revision(0L, null, componentId)); }
/** * @return the revision retrieved from the request parameters with keys * equal to "clientId", "revision", and "id". */ @Override public Revision getRevision() { final String revisionParamVal = request.getParameter(REVISION_PARAM); Long revision; try { revision = Long.parseLong(revisionParamVal); } catch (final Exception ex) { revision = null; } final String clientId = request.getParameter(CLIENT_ID_PARAM); final String componentId = request.getParameter(ID_PARAM); return new Revision(revision, clientId, componentId); }
private Map<String, Revision> mapDtoToRevision(final Map<String, RevisionDTO> revisionMap) { final Map<String, Revision> revisions = new HashMap<>(revisionMap.size()); for (final Map.Entry<String, RevisionDTO> entry : revisionMap.entrySet()) { final RevisionDTO revisionDto = entry.getValue(); final Revision revision = new Revision(revisionDto.getVersion(), revisionDto.getClientId(), entry.getKey()); revisions.put(entry.getKey(), revision); } return revisions; }
/** * Converts a Revision DTO and an associated Component ID into a Revision object * * @param revisionDto the Revision DTO * @param componentId the ID of the component that the Revision DTO belongs to * @return a Revision that has the same client ID and Version as the Revision DTO and the Component ID specified */ protected Revision getRevision(final RevisionDTO revisionDto, final String componentId) { return new Revision(revisionDto.getVersion(), revisionDto.getClientId(), componentId); }
public Revision toRevision() { return new Revision(getVersion(), getClientId(), getComponentId()); }
final Revision requestRevision = new Revision(version == null ? null : version.getLong(), clientId.getClientId(), groupId); return withWriteLock( serviceFacade,
final Revision requestRevision = new Revision(version == null ? null : version.getLong(), clientId.getClientId(), id); return withWriteLock( serviceFacade,
final Revision requestRevision = new Revision(version == null ? null : version.getLong(), clientId.getClientId(), id); return withWriteLock( serviceFacade,
final Revision requestRevision = new Revision(version == null ? null : version.getLong(), clientId.getClientId(), id); return withWriteLock( serviceFacade,
final Revision requestRevision = new Revision(version == null ? null : version.getLong(), clientId.getClientId(), id); return withWriteLock( serviceFacade,
final Revision requestRevision = new Revision(version == null ? null : version.getLong(), clientId.getClientId(), id); return withWriteLock( serviceFacade,
final Revision requestRevision = new Revision(version == null ? null : version.getLong(), clientId.getClientId(), id); return withWriteLock( serviceFacade,
final Revision requestRevision = new Revision(version == null ? null : version.getLong(), clientId.getClientId(), id); return withWriteLock( serviceFacade,
final Revision groupRevision = new Revision(revisionDto.getVersion(), revisionDto.getClientId(), groupId); return withWriteLock( serviceFacade,
requestProcessorEntity.setId(id); final Revision requestRevision = new Revision(version == null ? null : version.getLong(), clientId.getClientId(), id); return withWriteLock( serviceFacade,
Revision revision = new Revision(revisionDTO.getVersion(), revisionDTO.getClientId(), userEntity.getComponent().getId());
Revision revision = new Revision(revisionDTO.getVersion(), revisionDTO.getClientId(), userGroupEntity.getComponent().getId());
Revision revision = new Revision(revisionDTO.getVersion(), revisionDTO.getClientId(), accessPolicyEntity.getComponent().getId());
@org.junit.Ignore public void testSendObjectToQueue() throws Exception { final TestRunner runner = TestRunners.newTestRunner(GetJMSQueue.class); runner.setProperty(JmsProperties.JMS_PROVIDER, JmsProperties.ACTIVEMQ_PROVIDER); runner.setProperty(JmsProperties.URL, "tcp://localhost:61616"); runner.setProperty(JmsProperties.DESTINATION_TYPE, JmsProperties.DESTINATION_TYPE_QUEUE); runner.setProperty(JmsProperties.DESTINATION_NAME, "queue.testing"); runner.setProperty(JmsProperties.ACKNOWLEDGEMENT_MODE, JmsProperties.ACK_MODE_AUTO); WrappedMessageProducer wrappedProducer = JmsFactory.createMessageProducer(runner.getProcessContext(), true); final Session jmsSession = wrappedProducer.getSession(); final MessageProducer producer = wrappedProducer.getProducer(); // Revision class is used because test just needs any Serializable class in core NiFi final ObjectMessage message = jmsSession.createObjectMessage(new Revision(1L, "ID", "COMP_ID")); producer.send(message); jmsSession.commit(); producer.close(); jmsSession.close(); } }