/** * 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 void verifyRevisions(final Set<Revision> revisions, final NiFiUser user) { for (final Revision revision : revisions) { verifyRevision(revision, user); } }
@Override public VariableRegistryEntity getVariableRegistry(final String groupId, final boolean includeAncestorGroups) { final ProcessGroup processGroup = processGroupDAO.getProcessGroup(groupId); if (processGroup == null) { throw new ResourceNotFoundException("Could not find group with ID " + groupId); } return createVariableRegistryEntity(processGroup, includeAncestorGroups); }
private ComponentDetails getComponentConfiguration(final ProcessorDTO processor) { final ProcessorConfigDTO processorConfig = processor.getConfig(); return new ComponentDetails.Builder() .id(processor.getId()) .name(processor.getName()) .type(processor.getType()) .state(processor.getState()) .annotationData(processorConfig.getAnnotationData()) .properties(processorConfig.getProperties()) .descriptors(buildComponentDescriptorMap(processorConfig)) .validateErrors(processor.getValidationErrors()).build(); }
private ComponentDetails getComponentConfiguration(final ReportingTaskDTO reportingTask) { return new ComponentDetails.Builder() .id(reportingTask.getId()) .name(reportingTask.getName()) .type(reportingTask.getType()) .state(reportingTask.getState()) .annotationData(reportingTask.getAnnotationData()) .properties(reportingTask.getProperties()) .validateErrors(reportingTask.getValidationErrors()).build(); } }
/** * Factory method for creating a new RevisionDTO based on this controller. * * @param lastMod mod * @return dto */ public RevisionDTO createRevisionDTO(final FlowModification lastMod) { final Revision revision = lastMod.getRevision(); // create the dto final RevisionDTO revisionDTO = new RevisionDTO(); revisionDTO.setVersion(revision.getVersion()); revisionDTO.setClientId(revision.getClientId()); revisionDTO.setLastModifier(lastMod.getLastModifier()); return revisionDTO; }
@Override public void verifyRevision(final Revision revision, final NiFiUser user) { final Revision curRevision = revisionManager.getRevision(revision.getComponentId()); if (revision.equals(curRevision)) { return; } throw new InvalidRevisionException(revision + " is not the most up-to-date revision. This component appears to have been modified"); }
/** * 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); }
@Override public Authorizable getLocalConnectable(String id) { final Connectable connectable = controllerFacade.findLocalConnectable(id); if (connectable == null) { throw new ResourceNotFoundException("Unable to find component with id " + id); } return connectable; }
@Around("within(org.apache.nifi.web.NiFiServiceFacade+) && " + "execution(* update*(..))") public Object updateLock(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { return proceedWithWriteLock(proceedingJoinPoint); }
@Around("within(org.apache.nifi.web.NiFiServiceFacade+) && " + "execution(* get*(..))") public Object getLock(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { return proceedWithReadLock(proceedingJoinPoint); }
private DownloadableContent getFlowFileContent(final String connectionId, final String flowfileId, final String dataUri) { // user authorization is handled once we have the actual content so we can utilize the flow file attributes in the resource context return serviceFacade.getContent(connectionId, flowfileId, dataUri); }
public ComponentDetails build() { return new ComponentDetails(this); } }
public ConfigurationAction build() { return new ConfigurationAction(this); } }
public ComponentDescriptor build(){ return new ComponentDescriptor(this); } }
@Around("within(org.apache.nifi.web.NiFiServiceFacade+) && " + "execution(* copy*(..))") public Object copyLock(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { return proceedWithWriteLock(proceedingJoinPoint); }
@Around("within(org.apache.nifi.web.NiFiServiceFacade+) && " + "execution(* search*(..))") public Object searchLock(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { return proceedWithReadLock(proceedingJoinPoint); }
private DownloadableContent getProvenanceEventContent(final Long eventId, final String dataUri, final ContentDirection direction) { // user authorization is handled once we have the actual prov event so we can utilize the event attributes in the resource context return serviceFacade.getContent(eventId, dataUri, direction); }
@Around("within(org.apache.nifi.web.NiFiServiceFacade+) && " + "execution(* schedule*(..))") public Object scheduleLock(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { return proceedWithWriteLock(proceedingJoinPoint); }
@Around("within(org.apache.nifi.web.NiFiServiceFacade+) && " + "execution(* is*(..))") public Object isLock(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { return proceedWithReadLock(proceedingJoinPoint); }