@Override public String getName() { return connectable.getName(); } }
void adjustCounter(final String name, final long delta) { final String localContext = connectable.getName() + " (" + connectable.getIdentifier() + ")"; final String globalContext = "All " + connectable.getComponentType() + "'s"; counterRepo.adjustCounter(localContext, name, delta); counterRepo.adjustCounter(globalContext, name, delta); }
/** * Creates action details for connect/disconnect actions. * * @param connection connection * @param source source * @param relationships relationships * @param destination destinations * @return details */ public ConnectDetails createConnectDetails(final Connection connection, final Connectable source, final Collection<Relationship> relationships, final Connectable destination) { final Component sourceType = determineConnectableType(source); final Component destiantionType = determineConnectableType(destination); // format the relationship names Collection<String> relationshipNames = new HashSet<>(connection.getRelationships().size()); for (final Relationship relationship : relationships) { relationshipNames.add(relationship.getName()); } final String formattedRelationships = relationshipNames.isEmpty() ? StringUtils.EMPTY : StringUtils.join(relationshipNames, ", "); // create the connect details final FlowChangeConnectDetails connectDetails = new FlowChangeConnectDetails(); connectDetails.setSourceId(source.getIdentifier()); connectDetails.setSourceName(source.getName()); connectDetails.setSourceType(sourceType); connectDetails.setRelationship(formattedRelationships); connectDetails.setDestinationId(destination.getIdentifier()); connectDetails.setDestinationName(destination.getName()); connectDetails.setDestinationType(destiantionType); return connectDetails; }
public static Bulletin createBulletin(final Connectable connectable, final String category, final String severity, final String message) { final ComponentType type; switch (connectable.getConnectableType()) { case REMOTE_INPUT_PORT: case REMOTE_OUTPUT_PORT: type = ComponentType.REMOTE_PROCESS_GROUP; break; case INPUT_PORT: type = ComponentType.INPUT_PORT; break; case OUTPUT_PORT: type = ComponentType.OUTPUT_PORT; break; case PROCESSOR: default: type = ComponentType.PROCESSOR; break; } final ProcessGroup group = connectable.getProcessGroup(); final String groupId = group == null ? null : group.getIdentifier(); final String groupName = group == null ? null : group.getName(); return BulletinFactory.createBulletin(groupId, groupName, connectable.getIdentifier(), type, connectable.getName(), category, severity, message); }
addIfAppropriate(searchStr, source.getName(), "Source name", matches); addIfAppropriate(searchStr, source.getComments(), "Source comments", matches); addIfAppropriate(searchStr, destination.getName(), "Destination name", matches); addIfAppropriate(searchStr, destination.getComments(), "Destination comments", matches); result.setName("From source " + connection.getSource().getName());
public ConnectableComponent mapConnectable(final Connectable connectable) { final ConnectableComponent component = new InstantiatedConnectableComponent(connectable.getIdentifier(), connectable.getProcessGroupIdentifier()); final String versionedId = getIdOrThrow(connectable.getVersionedComponentId(), connectable.getIdentifier(), () -> new IllegalArgumentException("Unable to map Connectable Component with identifier " + connectable.getIdentifier() + " to any version-controlled component")); component.setId(versionedId); component.setComments(connectable.getComments()); final String groupId; if (connectable instanceof RemoteGroupPort) { final RemoteGroupPort port = (RemoteGroupPort) connectable; final RemoteProcessGroup rpg = port.getRemoteProcessGroup(); final Optional<String> rpgVersionedId = rpg.getVersionedComponentId(); groupId = getIdOrThrow(rpgVersionedId, rpg.getIdentifier(), () -> new IllegalArgumentException("Unable to find the Versioned Component ID for Remote Process Group that " + connectable + " belongs to")); } else { groupId = getIdOrThrow(connectable.getProcessGroup().getVersionedComponentId(), connectable.getProcessGroupIdentifier(), () -> new IllegalArgumentException("Unable to find the Versioned Component ID for the Process Group that " + connectable + " belongs to")); } component.setGroupId(groupId); component.setName(connectable.getName()); component.setType(ConnectableComponentType.valueOf(connectable.getConnectableType().name())); return component; }
dto.setComponentName(connectable.getName()); } else { dto.setComponentType(connectable.getConnectableType().toString());
dto.setName(isAuthorized ? connectable.getName() : connectable.getIdentifier()); dto.setType(connectable.getConnectableType().name()); dto.setVersionedComponentId(connectable.getVersionedComponentId().orElse(null));
connStatus.setGroupId(conn.getProcessGroup().getIdentifier()); connStatus.setSourceId(conn.getSource().getIdentifier()); connStatus.setSourceName(isSourceAuthorized ? conn.getSource().getName() : conn.getSource().getIdentifier()); connStatus.setDestinationId(conn.getDestination().getIdentifier()); connStatus.setDestinationName(isDestinationAuthorized ? conn.getDestination().getName() : conn.getDestination().getIdentifier()); connStatus.setBackPressureDataSizeThreshold(conn.getFlowFileQueue().getBackPressureDataSizeThreshold()); connStatus.setBackPressureObjectThreshold(conn.getFlowFileQueue().getBackPressureObjectThreshold());
public static Bulletin createBulletin(final Connectable connectable, final String category, final String severity, final String message) { final ComponentType type; switch (connectable.getConnectableType()) { case REMOTE_INPUT_PORT: case REMOTE_OUTPUT_PORT: type = ComponentType.REMOTE_PROCESS_GROUP; break; case INPUT_PORT: type = ComponentType.INPUT_PORT; break; case OUTPUT_PORT: type = ComponentType.OUTPUT_PORT; break; case PROCESSOR: default: type = ComponentType.PROCESSOR; break; } final ProcessGroup group = connectable.getProcessGroup(); final String groupId = group == null ? null : group.getIdentifier(); final String groupName = group == null ? null : group.getName(); return BulletinFactory.createBulletin(groupId, groupName, connectable.getIdentifier(), type, connectable.getName(), category, severity, message); }