http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeDTO.java new file mode 100644 index 0000000..9499c2e --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeDTO.java @@ -0,0 +1,188 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.Date; +import java.util.List; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.apache.nifi.web.api.dto.util.DateTimeAdapter; + +/** + * Details of a node within this NiFi. + */ +@XmlType(name = "node") +public class NodeDTO { + + private String nodeId; + private String address; + private Integer apiPort; + private String status; + private Date heartbeat; + private Date connectionRequested; + private Boolean primary; + private Integer activeThreadCount; + private String queued; + private List<NodeEventDTO> events; + private Date nodeStartTime; + + /** + * The node's last heartbeat timestamp. + * + * @return + */ + @XmlJavaTypeAdapter(DateTimeAdapter.class) + public Date getHeartbeat() { + return heartbeat; + } + + public void setHeartbeat(Date heartbeat) { + this.heartbeat = heartbeat; + } + + /** + * The time of the node's last connection request. + * + * @return + */ + @XmlJavaTypeAdapter(DateTimeAdapter.class) + public Date getConnectionRequested() { + return connectionRequested; + } + + public void setConnectionRequested(Date connectionRequested) { + this.connectionRequested = connectionRequested; + } + + /** + * The active thread count. + * + * @return The active thread count + */ + public Integer getActiveThreadCount() { + return activeThreadCount; + } + + public void setActiveThreadCount(Integer activeThreadCount) { + this.activeThreadCount = activeThreadCount; + } + + /** + * The queue for the controller. + * + * @return + */ + public String getQueued() { + return queued; + } + + public void setQueued(String queued) { + this.queued = queued; + } + + /** + * The node's host/IP address. + * + * @return + */ + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + /** + * The node ID. + * + * @return + */ + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + /** + * The port the node is listening for API requests. + * + * @return + */ + public Integer getApiPort() { + return apiPort; + } + + public void setApiPort(Integer port) { + this.apiPort = port; + } + + /** + * The node's status. + * + * @return + */ + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + /** + * The node's events. + * + * @return + */ + public List<NodeEventDTO> getEvents() { + return events; + } + + public void setEvents(List<NodeEventDTO> events) { + this.events = events; + } + + /** + * Whether this node is the primary node within the cluster. + * + * @return + */ + public Boolean isPrimary() { + return primary; + } + + public void setPrimary(Boolean primary) { + this.primary = primary; + } + + /** + * The time at which this Node was last restarted + * + * @return + */ + @XmlJavaTypeAdapter(DateTimeAdapter.class) + public Date getNodeStartTime() { + return nodeStartTime; + } + + public void setNodeStartTime(Date nodeStartTime) { + this.nodeStartTime = nodeStartTime; + } +}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeEventDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeEventDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeEventDTO.java new file mode 100644 index 0000000..3cad8d8 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeEventDTO.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.Date; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.apache.nifi.web.api.dto.util.DateTimeAdapter; + +/** + * A event for a node within this NiFi cluster. + */ +@XmlType(name = "nodeEvent") +public class NodeEventDTO { + + private Date timestamp; + private String category; + private String message; + + /** + * The category of the node event. + * + * @return + */ + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + /** + * The message of the node event. + * + * @return + */ + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * The timestamp of the node event. + * + * @return + */ + @XmlJavaTypeAdapter(DateTimeAdapter.class) + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeSystemDiagnosticsDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeSystemDiagnosticsDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeSystemDiagnosticsDTO.java new file mode 100644 index 0000000..8c83331 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/NodeSystemDiagnosticsDTO.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import javax.xml.bind.annotation.XmlType; + +/** + * The system diagnostics for a node with this NiFi cluster. + */ +@XmlType(name = "nodeSystemDiagnostics") +public class NodeSystemDiagnosticsDTO { + + private NodeDTO node; + private SystemDiagnosticsDTO systemDiagnostics; + + /** + * The node. + * + * @return + */ + public NodeDTO getNode() { + return node; + } + + public void setNode(NodeDTO node) { + this.node = node; + } + + /** + * The system diagnostics. + * + * @return + */ + public SystemDiagnosticsDTO getSystemDiagnostics() { + return systemDiagnostics; + } + + public void setControllerStatus(SystemDiagnosticsDTO systemDiagnostics) { + this.systemDiagnostics = systemDiagnostics; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PortDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PortDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PortDTO.java new file mode 100644 index 0000000..2a372f4 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PortDTO.java @@ -0,0 +1,161 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.Collection; +import java.util.Set; +import javax.xml.bind.annotation.XmlType; + +/** + * The details for a port within this NiFi flow. + */ +@XmlType(name = "port") +public class PortDTO extends NiFiComponentDTO { + + private String name; + private String comments; + private String state; + private String type; + private Boolean transmitting; + private Integer concurrentlySchedulableTaskCount; + private Set<String> userAccessControl; + private Set<String> groupAccessControl; + + private Collection<String> validationErrors; + + /** + * The name of this port. + * + * @return + */ + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + + /** + * The state of this port. Possible states are 'RUNNING', 'STOPPED', and + * 'DISABLED'. + * + * @return + */ + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + /** + * The type of port. Possible values are 'INPUT_PORT' or 'OUTPUT_PORT'. + * + * @return + */ + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * The number of tasks that should be concurrently scheduled for this port. + * + * @return + */ + public Integer getConcurrentlySchedulableTaskCount() { + return concurrentlySchedulableTaskCount; + } + + public void setConcurrentlySchedulableTaskCount(Integer concurrentlySchedulableTaskCount) { + this.concurrentlySchedulableTaskCount = concurrentlySchedulableTaskCount; + } + + /** + * The comments for this port. + * + * @return + */ + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + /** + * Whether this port has incoming or outgoing connections to a remote NiFi. + * This is only applicable when the port is running on the root group. + * + * @return + */ + public Boolean isTransmitting() { + return transmitting; + } + + public void setTransmitting(Boolean transmitting) { + this.transmitting = transmitting; + } + + /** + * Groups that are allowed to access this port. + * + * @return + */ + public Set<String> getGroupAccessControl() { + return groupAccessControl; + } + + public void setGroupAccessControl(Set<String> groupAccessControl) { + this.groupAccessControl = groupAccessControl; + } + + /** + * Users that are allowed to access this port. + * + * @return + */ + public Set<String> getUserAccessControl() { + return userAccessControl; + } + + public void setUserAccessControl(Set<String> userAccessControl) { + this.userAccessControl = userAccessControl; + } + + /** + * Gets the validation errors from this port. These validation errors + * represent the problems with the port that must be resolved before it can + * be started. + * + * @return The validation errors + */ + public Collection<String> getValidationErrors() { + return validationErrors; + } + + public void setValidationErrors(Collection<String> validationErrors) { + this.validationErrors = validationErrors; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PositionDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PositionDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PositionDTO.java new file mode 100644 index 0000000..ab077f3 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PositionDTO.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import javax.xml.bind.annotation.XmlType; + +/** + * A position on the canvas. + */ +@XmlType(name = "position") +public class PositionDTO { + + private Double x; + private Double y; + + public PositionDTO() { + } + + public PositionDTO(Double x, Double y) { + this.x = x; + this.y = y; + } + + /* getters / setters */ + /** + * The x coordinate. + * + * @return + */ + public Double getX() { + return x; + } + + public void setX(Double x) { + this.x = x; + } + + /** + * The y coordinate. + * + * @return + */ + public Double getY() { + return y; + } + + public void setY(Double y) { + this.y = y; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PreviousValueDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PreviousValueDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PreviousValueDTO.java new file mode 100644 index 0000000..fb33c67 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PreviousValueDTO.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.Date; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.apache.nifi.web.api.dto.util.DateTimeAdapter; + +/** + * The previous value for a processor property. + */ +@XmlType(name = "previousValue") +public class PreviousValueDTO { + + private String previousValue; + private Date timestamp; + private String userName; + + /** + * The previous value. + * + * @return + */ + public String getPreviousValue() { + return previousValue; + } + + public void setPreviousValue(String previousValue) { + this.previousValue = previousValue; + } + + /** + * When it was modified. + * + * @return + */ + @XmlJavaTypeAdapter(DateTimeAdapter.class) + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + /** + * The user who changed the previous value. + * + * @return + */ + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessGroupDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessGroupDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessGroupDTO.java new file mode 100644 index 0000000..4140046 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessGroupDTO.java @@ -0,0 +1,219 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import javax.xml.bind.annotation.XmlType; + +/** + * The details for a process group within this NiFi flow. + */ +@XmlType(name = "processGroup") +public class ProcessGroupDTO extends NiFiComponentDTO { + + private String name; + private String comments; + private Boolean running; + + private ProcessGroupDTO parent; + + private Integer runningCount; + private Integer stoppedCount; + private Integer invalidCount; + private Integer disabledCount; + private Integer activeRemotePortCount; + private Integer inactiveRemotePortCount; + + private Integer inputPortCount; + private Integer outputPortCount; + + private FlowSnippetDTO contents; + + public ProcessGroupDTO() { + super(); + } + + /** + * The name of this Process Group. + * + * @return The name of this Process Group + */ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * This Process Group's parent + * + * @return This Process Group's parent + */ + public ProcessGroupDTO getParent() { + return parent; + } + + public void setParent(ProcessGroupDTO parent) { + this.parent = parent; + } + + /** + * The comments for this process group. + * + * @return + */ + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + /** + * The contents of this process group. This field will be populated if the + * request is marked verbose. + * + * @return + */ + public FlowSnippetDTO getContents() { + return contents; + } + + public void setContents(FlowSnippetDTO contents) { + this.contents = contents; + } + + /** + * The number of input ports contained in this process group. + * + * @return + */ + public Integer getInputPortCount() { + return inputPortCount; + } + + public void setInputPortCount(Integer inputPortCount) { + this.inputPortCount = inputPortCount; + } + + /** + * The number of invalid components in this process group. + * + * @return + */ + public Integer getInvalidCount() { + return invalidCount; + } + + public void setInvalidCount(Integer invalidCount) { + this.invalidCount = invalidCount; + } + + /** + * The number of output ports in this process group. + * + * @return + */ + public Integer getOutputPortCount() { + return outputPortCount; + } + + public void setOutputPortCount(Integer outputPortCount) { + this.outputPortCount = outputPortCount; + } + + /** + * Used in requests, indicates whether this process group should be running. + * + * @return + */ + public Boolean isRunning() { + return running; + } + + public void setRunning(Boolean running) { + this.running = running; + } + + /** + * The number of running component in this process group. + * + * @return + */ + public Integer getRunningCount() { + return runningCount; + } + + public void setRunningCount(Integer runningCount) { + this.runningCount = runningCount; + } + + /** + * The number of stopped components in this process group. + * + * @return + */ + public Integer getStoppedCount() { + return stoppedCount; + } + + public void setStoppedCount(Integer stoppedCount) { + this.stoppedCount = stoppedCount; + } + + /** + * The number of disabled components in this process group. + * + * @return + */ + public Integer getDisabledCount() { + return disabledCount; + } + + public void setDisabledCount(Integer disabledCount) { + this.disabledCount = disabledCount; + } + + /** + * The number of active remote ports in this process group. + * + * @return + */ + public Integer getActiveRemotePortCount() { + return activeRemotePortCount; + } + + public void setActiveRemotePortCount(Integer activeRemotePortCount) { + this.activeRemotePortCount = activeRemotePortCount; + } + + /** + * The number of inactive remote ports in this process group. + * + * @return + */ + public Integer getInactiveRemotePortCount() { + return inactiveRemotePortCount; + } + + public void setInactiveRemotePortCount(Integer inactiveRemotePortCount) { + this.inactiveRemotePortCount = inactiveRemotePortCount; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorConfigDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorConfigDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorConfigDTO.java new file mode 100644 index 0000000..1481b0f --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorConfigDTO.java @@ -0,0 +1,486 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.Map; +import java.util.Set; + +import javax.xml.bind.annotation.XmlType; + +/** + * Configuration details for a processor in this NiFi. + */ +@XmlType(name = "processorConfig") +public class ProcessorConfigDTO { + + private Map<String, String> properties; + private Map<String, PropertyDescriptorDTO> descriptors; + + // settings + private String schedulingPeriod; + private String schedulingStrategy; + private String penaltyDuration; + private String yieldDuration; + private String bulletinLevel; + private Long runDurationMillis; + private Integer concurrentlySchedulableTaskCount; + private Set<String> autoTerminatedRelationships; + private String comments; + private String customUiUrl; + private Boolean lossTolerant; + + // annotation data + private String annotationData; + + private Map<String, String> defaultConcurrentTasks; + private Map<String, String> defaultSchedulingPeriod; + + public ProcessorConfigDTO() { + + } + + /** + * The amount of time that should elapse between task executions. This will + * not affect currently scheduled tasks. + * + * @return The scheduling period in seconds + */ + public String getSchedulingPeriod() { + return schedulingPeriod; + } + + public void setSchedulingPeriod(String setSchedulingPeriod) { + this.schedulingPeriod = setSchedulingPeriod; + } + + /** + * Indicates whether the processor should be scheduled to run in + * event-driven mode or timer-driven mode + * + * @return + */ + public String getSchedulingStrategy() { + return schedulingStrategy; + } + + public void setSchedulingStrategy(String schedulingStrategy) { + this.schedulingStrategy = schedulingStrategy; + } + + /** + * The amount of time that is used when this processor penalizes a flow + * file. + * + * @return + */ + public String getPenaltyDuration() { + return penaltyDuration; + } + + public void setPenaltyDuration(String penaltyDuration) { + this.penaltyDuration = penaltyDuration; + } + + /** + * When yielding, this amount of time must elaspe before this processor is + * scheduled again. + * + * @return + */ + public String getYieldDuration() { + return yieldDuration; + } + + public void setYieldDuration(String yieldDuration) { + this.yieldDuration = yieldDuration; + } + + /** + * The level at this this processor will report bulletins. + * + * @return + */ + public String getBulletinLevel() { + return bulletinLevel; + } + + public void setBulletinLevel(String bulletinLevel) { + this.bulletinLevel = bulletinLevel; + } + + /** + * The number of tasks that should be concurrently scheduled for this + * processor. If this processor doesn't allow parallel processing then any + * positive input will be ignored. + * + * @return The concurrently schedulable task count + */ + public Integer getConcurrentlySchedulableTaskCount() { + return concurrentlySchedulableTaskCount; + } + + public void setConcurrentlySchedulableTaskCount(Integer concurrentlySchedulableTaskCount) { + this.concurrentlySchedulableTaskCount = concurrentlySchedulableTaskCount; + } + + /** + * Whether or not this Processor is Loss Tolerant + * + * @return + */ + public Boolean isLossTolerant() { + return lossTolerant; + } + + public void setLossTolerant(final Boolean lossTolerant) { + this.lossTolerant = lossTolerant; + } + + /** + * The comments for this processor. + * + * @return The comments + */ + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + /** + * The properties for this processor. Properties whose value is not set will + * only contain the property name. These properties are (un)marshalled + * differently since we need/want to control the ordering of the properties. + * The descriptors and metadata are used as a lookup when processing these + * properties. + * + * @return The optional properties + */ + public Map<String, String> getProperties() { + return properties; + } + + public void setProperties(Map<String, String> properties) { + this.properties = properties; + } + + /** + * The descriptors for this processor's properties. + * + * @return + */ + public Map<String, PropertyDescriptorDTO> getDescriptors() { + return descriptors; + } + + public void setDescriptors(Map<String, PropertyDescriptorDTO> descriptors) { + this.descriptors = descriptors; + } + + /** + * Annotation data for this processor. + * + * @return The annotation data + */ + public String getAnnotationData() { + return annotationData; + } + + public void setAnnotationData(String annotationData) { + this.annotationData = annotationData; + } + + /** + * Whether of not this processor has a custom UI. + * + * @return + */ + public String getCustomUiUrl() { + return customUiUrl; + } + + public void setCustomUiUrl(String customUiUrl) { + this.customUiUrl = customUiUrl; + } + + /** + * The names of all processor relationships that cause a flow file to be + * terminated if the relationship is not connected to anything + * + * @return + */ + public Set<String> getAutoTerminatedRelationships() { + return autoTerminatedRelationships; + } + + public void setAutoTerminatedRelationships(final Set<String> autoTerminatedRelationships) { + this.autoTerminatedRelationships = autoTerminatedRelationships; + } + + /** + * Maps default values for concurrent tasks for each applicable scheduling + * strategy. + * + * @return + */ + public Map<String, String> getDefaultConcurrentTasks() { + return defaultConcurrentTasks; + } + + public void setDefaultConcurrentTasks(Map<String, String> defaultConcurrentTasks) { + this.defaultConcurrentTasks = defaultConcurrentTasks; + } + + /** + * The run duration in milliseconds. + * + * @return + */ + public Long getRunDurationMillis() { + return runDurationMillis; + } + + public void setRunDurationMillis(Long runDurationMillis) { + this.runDurationMillis = runDurationMillis; + } + + /** + * Maps default values for scheduling period for each applicable scheduling + * strategy. + * + * @return + */ + public Map<String, String> getDefaultSchedulingPeriod() { + return defaultSchedulingPeriod; + } + + public void setDefaultSchedulingPeriod(Map<String, String> defaultSchedulingPeriod) { + this.defaultSchedulingPeriod = defaultSchedulingPeriod; + } + + /** + * The allowable values for a property with a constrained set of options. + */ + @XmlType(name = "allowableValue") + public static class AllowableValueDTO { + + private String displayName; + private String value; + private String description; + + /** + * Returns the human-readable value that is allowed for this + * PropertyDescriptor + * + * @return + */ + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + /** + * Returns the value for this allowable value. + * + * @return + */ + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * Returns a description of this Allowable Value, or <code>null</code> + * if no description is given + * + * @return + */ + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + + if (!(obj instanceof AllowableValueDTO)) { + return false; + } + + final AllowableValueDTO other = (AllowableValueDTO) obj; + return (this.value.equals(other.getValue())); + } + + @Override + public int hashCode() { + return 23984731 + 17 * value.hashCode(); + } + } + + /** + * A description of a processor property. + */ + @XmlType(name = "propertyDescriptor") + public static class PropertyDescriptorDTO { + + private String name; + private String displayName; + private String description; + private String defaultValue; + private Set<AllowableValueDTO> allowableValues; + private boolean required; + private boolean sensitive; + private boolean dynamic; + private boolean supportsEl; + + /** + * The set of allowable values for this property. If empty then the + * allowable values are not constrained. + * + * @return + */ + public Set<AllowableValueDTO> getAllowableValues() { + return allowableValues; + } + + public void setAllowableValues(Set<AllowableValueDTO> allowableValues) { + this.allowableValues = allowableValues; + } + + /** + * The default value for this property. + * + * @return + */ + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * And explanation of the meaning of the given property. This + * description is meant to be displayed to a user or simply provide a + * mechanism of documenting intent. + * + * @return + */ + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * The property name. + * + * @return + */ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * The human-readable name to display to users. + * + * @return + */ + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + /** + * Determines whether the property is required for this processor. + * + * @return + */ + public boolean isRequired() { + return required; + } + + public void setRequired(boolean required) { + this.required = required; + } + + /** + * Indicates that the value for this property should be considered + * sensitive and protected whenever stored or represented. + * + * @return + */ + public boolean isSensitive() { + return sensitive; + } + + public void setSensitive(boolean sensitive) { + this.sensitive = sensitive; + } + + /** + * Indicates whether this property is dynamic. + * + * @return + */ + public boolean isDynamic() { + return dynamic; + } + + public void setDynamic(boolean dynamic) { + this.dynamic = dynamic; + } + + /** + * Specifies whether or not this property support expression language. + * + * @return + */ + public boolean getSupportsEl() { + return supportsEl; + } + + public void setSupportsEl(boolean supportsEl) { + this.supportsEl = supportsEl; + } + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java new file mode 100644 index 0000000..71ba4ed --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java @@ -0,0 +1,181 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import javax.xml.bind.annotation.XmlType; + +/** + * Details for a processor within this NiFi. + */ +@XmlType(name = "processor") +public class ProcessorDTO extends NiFiComponentDTO { + + private String name; + private String type; + private String state; + private Map<String, String> style; + private List<RelationshipDTO> relationships; + private String description; + private Boolean supportsParallelProcessing; + private Boolean supportsEventDriven; + + private ProcessorConfigDTO config; + + private Collection<String> validationErrors; + + public ProcessorDTO() { + super(); + } + + /** + * The name of this processor. + * + * @return This processors name + */ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * The type of this processor. + * + * @return This processors type + */ + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * The state of this processor. Possible states are 'RUNNING', 'STOPPED', + * and 'DISABLED'. + * + * @return + */ + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + /** + * The styles for this processor. (Currently only supports color). + * + * @return + */ + public Map<String, String> getStyle() { + return style; + } + + public void setStyle(Map<String, String> style) { + this.style = style; + } + + /** + * Whether this processor supports parallel processing. + * + * @return + */ + public Boolean getSupportsParallelProcessing() { + return supportsParallelProcessing; + } + + public void setSupportsParallelProcessing(Boolean supportsParallelProcessing) { + this.supportsParallelProcessing = supportsParallelProcessing; + } + + /** + * Whether this processor supports event driven scheduling. + * + * @return + */ + public Boolean getSupportsEventDriven() { + return supportsEventDriven; + } + + public void setSupportsEventDriven(Boolean supportsEventDriven) { + this.supportsEventDriven = supportsEventDriven; + } + + /** + * Gets the available relationships that this processor currently supports. + * + * @return The available relationships + */ + public List<RelationshipDTO> getRelationships() { + return relationships; + } + + public void setRelationships(List<RelationshipDTO> relationships) { + this.relationships = relationships; + } + + /** + * The configuration details for this processor. These details will be + * included in a response if the verbose flag is set to true. + * + * @return The processor configuration details + */ + public ProcessorConfigDTO getConfig() { + return config; + } + + public void setConfig(ProcessorConfigDTO config) { + this.config = config; + } + + /** + * Gets the validation errors from this processor. These validation errors + * represent the problems with the processor that must be resolved before it + * can be started. + * + * @return The validation errors + */ + public Collection<String> getValidationErrors() { + return validationErrors; + } + + public void setValidationErrors(Collection<String> validationErrors) { + this.validationErrors = validationErrors; + } + + /** + * Gets the description for this processor. + * + * @return + */ + public String getDescription() { + return description; + } + + public void setDescription(final String description) { + this.description = description; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorHistoryDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorHistoryDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorHistoryDTO.java new file mode 100644 index 0000000..2741116 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorHistoryDTO.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.Map; +import javax.xml.bind.annotation.XmlType; + +/** + * History of a processor's properties. + */ +@XmlType(name = "processorHistory") +public class ProcessorHistoryDTO { + + private String processorId; + private Map<String, PropertyHistoryDTO> propertyHistory; + + /** + * The processor id. + * + * @return + */ + public String getProcessorId() { + return processorId; + } + + public void setProcessorId(String processorId) { + this.processorId = processorId; + } + + /** + * The history for this processors properties. + * + * @return + */ + public Map<String, PropertyHistoryDTO> getPropertyHistory() { + return propertyHistory; + } + + public void setPropertyHistory(Map<String, PropertyHistoryDTO> propertyHistory) { + this.propertyHistory = propertyHistory; + } +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PropertyHistoryDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PropertyHistoryDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PropertyHistoryDTO.java new file mode 100644 index 0000000..064ad21 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/PropertyHistoryDTO.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.List; +import javax.xml.bind.annotation.XmlType; + +/** + * History of a processor property. + */ +@XmlType(name = "propertyHistory") +public class PropertyHistoryDTO { + + private List<PreviousValueDTO> previousValues; + + /** + * The previous values. + * + * @return + */ + public List<PreviousValueDTO> getPreviousValues() { + return previousValues; + } + + public void setPreviousValues(List<PreviousValueDTO> previousValues) { + this.previousValues = previousValues; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RelationshipDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RelationshipDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RelationshipDTO.java new file mode 100644 index 0000000..7042aaa --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RelationshipDTO.java @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import javax.xml.bind.annotation.XmlType; + +/** + * Details of a relationship. + */ +@XmlType(name = "relationship") +public class RelationshipDTO { + + private String name; + private String description; + private Boolean autoTerminate; + + /** + * The relationship name. + * + * @return + */ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * The relationship description. + * + * @return + */ + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * Whether or not this relationship is auto terminated. + * + * @return + */ + public Boolean isAutoTerminate() { + return autoTerminate; + } + + public void setAutoTerminate(Boolean autoTerminate) { + this.autoTerminate = autoTerminate; + } +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupContentsDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupContentsDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupContentsDTO.java new file mode 100644 index 0000000..1e5356d --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupContentsDTO.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.Set; +import javax.xml.bind.annotation.XmlType; + +/** + * Contents of a remote process group. + */ +@XmlType(name = "remoteProcessGroupContents") +public class RemoteProcessGroupContentsDTO { + + private Set<RemoteProcessGroupPortDTO> inputPorts; + private Set<RemoteProcessGroupPortDTO> outputPorts; + + /** + * The Controller Input Ports to which data can be sent + * + * @return + */ + public Set<RemoteProcessGroupPortDTO> getInputPorts() { + return inputPorts; + } + + public void setInputPorts(Set<RemoteProcessGroupPortDTO> inputPorts) { + this.inputPorts = inputPorts; + } + + /** + * The Controller Output Ports from which data can be retrieved + * + * @return + */ + public Set<RemoteProcessGroupPortDTO> getOutputPorts() { + return outputPorts; + } + + public void setOutputPorts(Set<RemoteProcessGroupPortDTO> outputPorts) { + this.outputPorts = outputPorts; + } +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupDTO.java new file mode 100644 index 0000000..df59b13 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupDTO.java @@ -0,0 +1,279 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.Date; +import java.util.List; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.apache.nifi.web.api.dto.util.DateTimeAdapter; + +/** + * Details of a remote process group in this NiFi. + */ +@XmlType(name = "remoteProcessGroup") +public class RemoteProcessGroupDTO extends NiFiComponentDTO { + + private String targetUri; + private Boolean targetSecure; + + private String name; + private String comments; + private String communicationsTimeout; + private String yieldDuration; + + private List<String> authorizationIssues; + private Boolean transmitting; + + private Integer inputPortCount; + private Integer outputPortCount; + + private Integer activeRemoteInputPortCount; + private Integer inactiveRemoteInputPortCount; + private Integer activeRemoteOutputPortCount; + private Integer inactiveRemoteOutputPortCount; + + private Date flowRefreshed; + + private RemoteProcessGroupContentsDTO contents; + + public RemoteProcessGroupDTO() { + super(); + } + + public RemoteProcessGroupDTO(final RemoteProcessGroupDTO toCopy) { + setId(toCopy.getId()); + setPosition(toCopy.getPosition()); + targetUri = toCopy.getTargetUri(); + name = toCopy.getName(); + } + + public void setTargetUri(final String targetUri) { + this.targetUri = targetUri; + } + + /** + * The target uri of this remote process group. + * + * @return + */ + public String getTargetUri() { + return this.targetUri; + } + + /** + * The name of this remote process group. + * + * @param name + */ + public void setName(final String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + + /** + * Comments for this remote process group. + * + * @return + */ + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + /** + * Returns any remote authorization issues for this remote process group. + * + * @return + */ + public List<String> getAuthorizationIssues() { + return authorizationIssues; + } + + public void setAuthorizationIssues(List<String> authorizationIssues) { + this.authorizationIssues = authorizationIssues; + } + + /** + * Whether or not this remote process group is actively transmitting. + * + * @return + */ + public Boolean isTransmitting() { + return transmitting; + } + + public void setTransmitting(Boolean transmitting) { + this.transmitting = transmitting; + } + + /** + * Whether or not the target is running securely. + * + * @return + */ + public Boolean isTargetSecure() { + return targetSecure; + } + + public void setTargetSecure(Boolean targetSecure) { + this.targetSecure = targetSecure; + } + + /** + * Returns the time period used for the timeout when communicating with this + * RemoteProcessGroup. + * + * @return + */ + public String getCommunicationsTimeout() { + return communicationsTimeout; + } + + public void setCommunicationsTimeout(String communicationsTimeout) { + this.communicationsTimeout = communicationsTimeout; + } + + /** + * When yielding, this amount of time must elaspe before this remote process + * group is scheduled again. + * + * @return + */ + public String getYieldDuration() { + return yieldDuration; + } + + public void setYieldDuration(String yieldDuration) { + this.yieldDuration = yieldDuration; + } + + /** + * The number of active remote input ports. + * + * @return + */ + public Integer getActiveRemoteInputPortCount() { + return activeRemoteInputPortCount; + } + + public void setActiveRemoteInputPortCount(Integer activeRemoteInputPortCount) { + this.activeRemoteInputPortCount = activeRemoteInputPortCount; + } + + /** + * The number of inactive remote input ports. + * + * @return + */ + public Integer getInactiveRemoteInputPortCount() { + return inactiveRemoteInputPortCount; + } + + public void setInactiveRemoteInputPortCount(Integer inactiveRemoteInputPortCount) { + this.inactiveRemoteInputPortCount = inactiveRemoteInputPortCount; + } + + /** + * The number of active remote output ports. + * + * @return + */ + public Integer getActiveRemoteOutputPortCount() { + return activeRemoteOutputPortCount; + } + + public void setActiveRemoteOutputPortCount(Integer activeRemoteOutputPortCount) { + this.activeRemoteOutputPortCount = activeRemoteOutputPortCount; + } + + /** + * The number of inactive remote output ports. + * + * @return + */ + public Integer getInactiveRemoteOutputPortCount() { + return inactiveRemoteOutputPortCount; + } + + public void setInactiveRemoteOutputPortCount(Integer inactiveRemoteOutputPortCount) { + this.inactiveRemoteOutputPortCount = inactiveRemoteOutputPortCount; + } + + /** + * The number of Remote Input Ports currently available in the remote NiFi + * instance + * + * @return + */ + public Integer getInputPortCount() { + return inputPortCount; + } + + public void setInputPortCount(Integer inputPortCount) { + this.inputPortCount = inputPortCount; + } + + /** + * The number of Remote Output Ports currently available in the remote NiFi + * instance + * + * @return + */ + public Integer getOutputPortCount() { + return outputPortCount; + } + + public void setOutputPortCount(Integer outputPortCount) { + this.outputPortCount = outputPortCount; + } + + /** + * The contents of this remote process group. Will contain available + * input/output ports. + * + * @return + */ + public RemoteProcessGroupContentsDTO getContents() { + return contents; + } + + public void setContents(RemoteProcessGroupContentsDTO contents) { + this.contents = contents; + } + + /** + * When the flow for this remote group was last refreshed. + * + * @return + */ + @XmlJavaTypeAdapter(DateTimeAdapter.class) + public Date getFlowRefreshed() { + return flowRefreshed; + } + + public void setFlowRefreshed(Date flowRefreshed) { + this.flowRefreshed = flowRefreshed; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupPortDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupPortDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupPortDTO.java new file mode 100644 index 0000000..7948dad --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RemoteProcessGroupPortDTO.java @@ -0,0 +1,192 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import javax.xml.bind.annotation.XmlType; + +/** + * Details of a port in a remote process group. + */ +@XmlType(name = "remoteProcessGroupPort") +public class RemoteProcessGroupPortDTO { + + private String id; + private String groupId; + private String name; + private String comments; + private Integer concurrentlySchedulableTaskCount; + private Boolean transmitting; + private Boolean useCompression; + private Boolean exists; + private Boolean targetRunning; + private Boolean connected; + + /** + * The comments as configured in the target port. + * + * @return + */ + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + /** + * The number tasks that may transmit flow files to the target port + * concurrently. + * + * @return + */ + public Integer getConcurrentlySchedulableTaskCount() { + return concurrentlySchedulableTaskCount; + } + + public void setConcurrentlySchedulableTaskCount(Integer concurrentlySchedulableTaskCount) { + this.concurrentlySchedulableTaskCount = concurrentlySchedulableTaskCount; + } + + /** + * The id of the target port. + * + * @return + */ + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * The id of the remote process group that this port resides in. + * + * @return + */ + public String getGroupId() { + return groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + /** + * The name of the target port. + * + * @return + */ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * Whether or not this remote group port is configured for transmission. + * + * @return + */ + public Boolean isTransmitting() { + return transmitting; + } + + public void setTransmitting(Boolean transmitting) { + this.transmitting = transmitting; + } + + /** + * Whether or not flow file are compressed when sent to this target port. + * + * @return + */ + public Boolean getUseCompression() { + return useCompression; + } + + public void setUseCompression(Boolean useCompression) { + this.useCompression = useCompression; + } + + /** + * Whether or not the target port exists. + * + * @return + */ + public Boolean getExists() { + return exists; + } + + public void setExists(Boolean exists) { + this.exists = exists; + } + + /** + * Whether or not the target port is running. + * + * @return + */ + public Boolean isTargetRunning() { + return targetRunning; + } + + public void setTargetRunning(Boolean targetRunning) { + this.targetRunning = targetRunning; + } + + /** + * Whether or not this port has either an incoming or outgoing connection. + * + * @return + */ + public Boolean isConnected() { + return connected; + } + + public void setConnected(Boolean connected) { + this.connected = connected; + } + + @Override + public int hashCode() { + return 923847 + String.valueOf(name).hashCode(); + } + + @Override + public boolean equals(final Object obj) { + if (obj == null) { + return false; + } + if (!(obj instanceof RemoteProcessGroupPortDTO)) { + return false; + } + final RemoteProcessGroupPortDTO other = (RemoteProcessGroupPortDTO) obj; + if (name == null && other.name == null) { + return true; + } + + if (name == null) { + return false; + } + return name.equals(other.name); + } +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RevisionDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RevisionDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RevisionDTO.java new file mode 100644 index 0000000..e608a7e --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/RevisionDTO.java @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import javax.xml.bind.annotation.XmlType; + +/** + * Current revision for this NiFi. + */ +@XmlType(name = "revision") +public class RevisionDTO { + + private String clientId; + private Long version; + + /* getters / setters */ + /** + * A client identifier used to make a request. By including a client + * identifier, the API can allow multiple requests without needing the + * current revision. Due to the asynchronous nature of requests/responses + * this was implemented to allow the client to make numerous requests + * without having to wait for the previous response to come back. + * + * @return The client id + */ + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + /** + * NiFi employs an optimistic locking strategy where the client must include + * a revision in their request when performing an update. In a response, + * this field represents the updated base version. + * + * @return The revision + */ + public Long getVersion() { + return version; + } + + public void setVersion(Long version) { + this.version = version; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4d998c12/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/SnippetDTO.java ---------------------------------------------------------------------- diff --git a/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/SnippetDTO.java b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/SnippetDTO.java new file mode 100644 index 0000000..2ee1310 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/client-dto/src/main/java/org/apache/nifi/web/api/dto/SnippetDTO.java @@ -0,0 +1,239 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto; + +import java.util.HashSet; +import java.util.Set; +import javax.xml.bind.annotation.XmlType; + +/** + * The contents of a snippet of a flow. + */ +@XmlType(name = "snippet") +public class SnippetDTO { + + private String id; + private String uri; + private String parentGroupId; + private Boolean linked; + + // when specified these are only considered during creation + private Set<String> processGroups = new HashSet<>(); + private Set<String> remoteProcessGroups = new HashSet<>(); + private Set<String> processors = new HashSet<>(); + private Set<String> inputPorts = new HashSet<>(); + private Set<String> outputPorts = new HashSet<>(); + private Set<String> connections = new HashSet<>(); + private Set<String> labels = new HashSet<>(); + private Set<String> funnels = new HashSet<>(); + + private FlowSnippetDTO contents; + + /** + * The id of this snippet. + * + * @return + */ + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * The uri of this snippet. + * + * @return + */ + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + /** + * The group id for the components in this snippet. + * + * @return + */ + public String getParentGroupId() { + return parentGroupId; + } + + public void setParentGroupId(String parentGroupId) { + this.parentGroupId = parentGroupId; + } + + /** + * Whether or not this snippet is linked to the underlying data flow. + * + * @return + */ + public Boolean isLinked() { + return linked; + } + + public void setLinked(Boolean linked) { + this.linked = linked; + } + + /** + * The ids of the connections in this snippet. These ids will be populated + * within each response. They can be specified when creating a snippet. + * However, once a snippet has been created its contents cannot be modified + * (these ids are ignored during update requests). + * + * @return + */ + public Set<String> getConnections() { + return connections; + } + + public void setConnections(Set<String> connections) { + this.connections = connections; + } + + /** + * The ids of the funnels in this snippet. These ids will be populated + * within each response. They can be specified when creating a snippet. + * However, once a snippet has been created its contents cannot be modified + * (these ids are ignored during update requests). + * + * @param funnels + */ + public Set<String> getFunnels() { + return funnels; + } + + public void setFunnels(Set<String> funnels) { + this.funnels = funnels; + } + + /** + * The ids of the input port in this snippet. These ids will be populated + * within each response. They can be specified when creating a snippet. + * However, once a snippet has been created its contents cannot be modified + * (these ids are ignored during update requests). + * + * @return + */ + public Set<String> getInputPorts() { + return inputPorts; + } + + public void setInputPorts(Set<String> inputPorts) { + this.inputPorts = inputPorts; + } + + /** + * The ids of the labels in this snippet. These ids will be populated within + * each response. They can be specified when creating a snippet. However, + * once a snippet has been created its contents cannot be modified (these + * ids are ignored during update requests). + * + * @return + */ + public Set<String> getLabels() { + return labels; + } + + public void setLabels(Set<String> labels) { + this.labels = labels; + } + + /** + * The ids of the output ports in this snippet. These ids will be populated + * within each response. They can be specified when creating a snippet. + * However, once a snippet has been created its contents cannot be modified + * (these ids are ignored during update requests). + * + * @return + */ + public Set<String> getOutputPorts() { + return outputPorts; + } + + public void setOutputPorts(Set<String> outputPorts) { + this.outputPorts = outputPorts; + } + + /** + * The ids of the process groups in this snippet. These ids will be + * populated within each response. They can be specified when creating a + * snippet. However, once a snippet has been created its contents cannot be + * modified (these ids are ignored during update requests). + * + * @return + */ + public Set<String> getProcessGroups() { + return processGroups; + } + + public void setProcessGroups(Set<String> processGroups) { + this.processGroups = processGroups; + } + + /** + * The ids of the processors in this snippet. These ids will be populated + * within each response. They can be specified when creating a snippet. + * However, once a snippet has been created its contents cannot be modified + * (these ids are ignored during update requests). + * + * @return + */ + public Set<String> getProcessors() { + return processors; + } + + public void setProcessors(Set<String> processors) { + this.processors = processors; + } + + /** + * The ids of the remote process groups in this snippet. These ids will be + * populated within each response. They can be specified when creating a + * snippet. However, once a snippet has been created its contents cannot be + * modified (these ids are ignored during update requests). + * + * @return + */ + public Set<String> getRemoteProcessGroups() { + return remoteProcessGroups; + } + + public void setRemoteProcessGroups(Set<String> remoteProcessGroups) { + this.remoteProcessGroups = remoteProcessGroups; + } + + /** + * The contents of the configuration for this snippet. + * + * @return + */ + public FlowSnippetDTO getContents() { + return contents; + } + + public void setContents(FlowSnippetDTO contents) { + this.contents = contents; + } + +}
