private String generatePortId(final String targetId) { return UUID.nameUUIDFromBytes((this.getIdentifier() + targetId).getBytes(StandardCharsets.UTF_8)).toString(); }
@Override public void verifyCanStopTransmitting() { if (!isTransmitting()) { throw new IllegalStateException(this.getIdentifier() + " is not transmitting"); } }
private File getPeerPersistenceFile() { final File stateDir = nifiProperties.getPersistentStateDirectory(); return new File(stateDir, getIdentifier() + ".peers"); }
@Override public void verifyCanUpdate() { readLock.lock(); try { if (isTransmitting()) { throw new IllegalStateException(this.getIdentifier() + " is currently transmitting"); } for (final Port port : inputPorts.values()) { if (port.isRunning()) { throw new IllegalStateException(this.getIdentifier() + " has running Port: " + port.getIdentifier()); } } for (final Port port : outputPorts.values()) { if (port.isRunning()) { throw new IllegalStateException(this.getIdentifier() + " has running Port: " + port.getIdentifier()); } } } finally { readLock.unlock(); } }
@Override public Resource getResource() { return ResourceFactory.getComponentResource(ResourceType.RemoteProcessGroup, getIdentifier(), getName()); }
@Override public void verifyCanDelete(final boolean ignoreConnections) { readLock.lock(); try { if (isTransmitting()) { throw new IllegalStateException(this.getIdentifier() + " is transmitting"); } for (final Port port : inputPorts.values()) { if (!ignoreConnections && port.hasIncomingConnection()) { throw new IllegalStateException(this.getIdentifier() + " is the destination of another component"); } if (port.isRunning()) { throw new IllegalStateException(this.getIdentifier() + " has running Port: " + port.getIdentifier()); } } for (final Port port : outputPorts.values()) { if (!ignoreConnections) { for (final Connection connection : port.getConnections()) { connection.verifyCanDelete(); } } if (port.isRunning()) { throw new IllegalStateException(this.getIdentifier() + " has running Port: " + port.getIdentifier()); } } } finally { readLock.unlock(); } }
try { if (isTransmitting()) { throw new IllegalStateException(this.getIdentifier() + " is already transmitting"); throw new IllegalStateException(this.getIdentifier() + " has running Port: " + port.getIdentifier()); throw new IllegalStateException(this.getIdentifier() + " has a Connection to Port " + port.getIdentifier() + ", but that Port no longer exists on the remote system"); throw new IllegalStateException(this.getIdentifier() + " has running Port: " + port.getIdentifier()); throw new IllegalStateException(this.getIdentifier() + " has a Connection to Port " + port.getIdentifier() + ", but that Port no longer exists on the remote system");
@Override public void reportEvent(final Severity severity, final String category, final String message) { final String groupId = StandardRemoteProcessGroup.this.getProcessGroup().getIdentifier(); final String groupName = StandardRemoteProcessGroup.this.getProcessGroup().getName(); final String sourceId = StandardRemoteProcessGroup.this.getIdentifier(); final String sourceName = StandardRemoteProcessGroup.this.getName(); bulletinRepository.addBulletin(BulletinFactory.createBulletin(groupId, groupName, sourceId, ComponentType.REMOTE_PROCESS_GROUP, sourceName, category, severity.name(), message)); } };