@Override public ScheduledState getScheduledState(final Port port) { return port.getScheduledState(); } };
@Override public ScheduledState getScheduledState(final Port port) { if (startConnectablesAfterInitialization.contains(port)) { return ScheduledState.RUNNING; } if (startRemoteGroupPortsAfterInitialization.contains(port)) { return ScheduledState.RUNNING; } return port.getScheduledState(); } };
@Override public synchronized void disablePort(final Port port) { if (port.getScheduledState() != ScheduledState.STOPPED) { throw new IllegalStateException("Port cannot be disabled because its state is set to " + port.getScheduledState()); } if (!(port instanceof AbstractPort)) { throw new IllegalArgumentException(); } ((AbstractPort) port).disable(); }
@Override public synchronized void enablePort(final Port port) { if (port.getScheduledState() != ScheduledState.DISABLED) { throw new IllegalStateException("Funnel cannot be enabled because it is not disabled"); } if (!(port instanceof AbstractPort)) { throw new IllegalArgumentException(); } ((AbstractPort) port).enable(); }
@Override public void disableInputPort(final Port port) { readLock.lock(); try { if (!inputPorts.containsKey(port.getIdentifier())) { throw new IllegalStateException("No InputPort with ID " + port.getIdentifier() + " belongs to this Process Group"); } final ScheduledState state = port.getScheduledState(); if (state == ScheduledState.DISABLED) { return; } else if (state == ScheduledState.RUNNING) { throw new IllegalStateException("InputPort is currently running"); } scheduler.disablePort(port); } finally { readLock.unlock(); } }
@Override public void enableOutputPort(final Port port) { readLock.lock(); try { if (!outputPorts.containsKey(port.getIdentifier())) { throw new IllegalStateException("No Output Port with ID " + port.getIdentifier() + " belongs to this Process Group"); } final ScheduledState state = port.getScheduledState(); if (state == ScheduledState.STOPPED) { return; } else if (state == ScheduledState.RUNNING) { throw new IllegalStateException("OutputPort is currently running"); } scheduler.enablePort(port); } finally { readLock.unlock(); } }
@Override public void disableOutputPort(final Port port) { readLock.lock(); try { if (!outputPorts.containsKey(port.getIdentifier())) { throw new IllegalStateException("No OutputPort with ID " + port.getIdentifier() + " belongs to this Process Group"); } final ScheduledState state = port.getScheduledState(); if (state == ScheduledState.DISABLED) { return; } else if (state == ScheduledState.RUNNING) { throw new IllegalStateException("OutputPort is currently running"); } scheduler.disablePort(port); } finally { readLock.unlock(); } }
@Override public void enableInputPort(final Port port) { readLock.lock(); try { if (!inputPorts.containsKey(port.getIdentifier())) { throw new IllegalStateException("No Input Port with ID " + port.getIdentifier() + " belongs to this Process Group"); } final ScheduledState state = port.getScheduledState(); if (state == ScheduledState.STOPPED) { return; } else if (state == ScheduledState.RUNNING) { throw new IllegalStateException("InputPort is currently running"); } scheduler.enablePort(port); } finally { readLock.unlock(); } }
@Override public void stopInputPort(final Port port) { readLock.lock(); try { if (!inputPorts.containsKey(port.getIdentifier())) { throw new IllegalStateException("No Input Port with ID " + port.getIdentifier() + " belongs to this Process Group"); } final ScheduledState state = port.getScheduledState(); if (state == ScheduledState.DISABLED) { throw new IllegalStateException("InputPort is disabled"); } else if (state == ScheduledState.STOPPED) { return; } scheduler.stopPort(port); } finally { readLock.unlock(); } }
@Override public void stopOutputPort(final Port port) { readLock.lock(); try { if (!outputPorts.containsKey(port.getIdentifier())) { throw new IllegalStateException("No Output Port with ID " + port.getIdentifier() + " belongs to this Process Group"); } final ScheduledState state = port.getScheduledState(); if (state == ScheduledState.DISABLED) { throw new IllegalStateException("OutputPort is disabled"); } else if (state == ScheduledState.STOPPED) { return; } scheduler.stopPort(port); } finally { readLock.unlock(); } }
@Override public void startOutputPort(final Port port) { readLock.lock(); try { if (getOutputPort(port.getIdentifier()) == null) { throw new IllegalStateException("Port is not a member of this Process Group"); } final ScheduledState state = port.getScheduledState(); if (state == ScheduledState.DISABLED) { throw new IllegalStateException("OutputPort is disabled"); } else if (state == ScheduledState.RUNNING) { return; } scheduler.startPort(port); } finally { readLock.unlock(); } }
@Override public void startInputPort(final Port port) { readLock.lock(); try { if (getInputPort(port.getIdentifier()) == null) { throw new IllegalStateException("Port " + port.getIdentifier() + " is not a member of this Process Group"); } final ScheduledState state = port.getScheduledState(); if (state == ScheduledState.DISABLED) { throw new IllegalStateException("InputPort " + port.getIdentifier() + " is disabled"); } else if (state == ScheduledState.RUNNING) { return; } scheduler.startPort(port); } finally { readLock.unlock(); } }
if (ScheduledState.DISABLED.equals(port.getScheduledState())) { if (StringUtils.containsIgnoreCase("disabled", searchStr)) { matches.add("Run status: Disabled"); if (StringUtils.containsIgnoreCase("invalid", searchStr) && !port.isValid()) { matches.add("Run status: Invalid"); } else if (ScheduledState.RUNNING.equals(port.getScheduledState()) && StringUtils.containsIgnoreCase("running", searchStr)) { matches.add("Run status: Running"); } else if (ScheduledState.STOPPED.equals(port.getScheduledState()) && StringUtils.containsIgnoreCase("stopped", searchStr)) { matches.add("Run status: Stopped");
public Port updatePortAdvice(ProceedingJoinPoint proceedingJoinPoint, PortDTO portDTO, PortDAO portDAO) throws Throwable { final Port port = portDAO.getPort(portDTO.getId()); final ScheduledState scheduledState = port.getScheduledState(); final String name = port.getName(); final String comments = port.getComments(); final ScheduledState updatedScheduledState = updatedPort.getScheduledState();
if (!purposedScheduledState.equals(outputPort.getScheduledState())) { break; case STOPPED: switch (outputPort.getScheduledState()) { case RUNNING: outputPort.verifyCanStop();
if (ScheduledState.DISABLED.equals(port.getScheduledState())) { disabled++; } else if (port.isRunning()) { if (ScheduledState.DISABLED.equals(port.getScheduledState())) { disabled++; } else if (port.isRunning()) {
if (!purposedScheduledState.equals(inputPort.getScheduledState())) { break; case STOPPED: switch (inputPort.getScheduledState()) { case RUNNING: inputPort.verifyCanStop();
dto.setConcurrentlySchedulableTaskCount(port.getMaxConcurrentTasks()); dto.setParentGroupId(port.getProcessGroup().getIdentifier()); dto.setState(port.getScheduledState().toString()); dto.setType(port.getConnectableType().name()); dto.setVersionedComponentId(port.getVersionedComponentId().orElse(null));
if (!purposedScheduledState.equals(inputPort.getScheduledState())) { try { break; case STOPPED: switch (inputPort.getScheduledState()) { case RUNNING: inputPort.getProcessGroup().stopInputPort(inputPort);
if (!purposedScheduledState.equals(outputPort.getScheduledState())) { try { break; case STOPPED: switch (outputPort.getScheduledState()) { case RUNNING: outputPort.getProcessGroup().stopOutputPort(outputPort);