|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + * contributor license agreements. See the NOTICE file distributed with |
| 4 | + * this work for additional information regarding copyright ownership. |
| 5 | + * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | + * (the "License"); you may not use this file except in compliance with |
| 7 | + * the License. You may obtain a copy of the License at |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * Unless required by applicable law or agreed to in writing, software |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | + * See the License for the specific language governing permissions and |
| 13 | + * limitations under the License. |
| 14 | + */ |
| 15 | + |
| 16 | +package org.apache.nifi.web.api.dto; |
| 17 | + |
| 18 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 19 | +import jakarta.xml.bind.annotation.XmlType; |
| 20 | + |
| 21 | +import java.util.List; |
| 22 | + |
| 23 | +@XmlType(name = "listenPort") |
| 24 | +public class ListenPortDTO { |
| 25 | + |
| 26 | + // Port definition |
| 27 | + private int portNumber; |
| 28 | + private String transportProtocol; |
| 29 | + private List<String> applicationProtocols; |
| 30 | + |
| 31 | + // Contextual information about the component providing the port, and the PG containing the component |
| 32 | + private String componentType; |
| 33 | + private String componentId; |
| 34 | + private String componentName; |
| 35 | + private String componentClass; |
| 36 | + |
| 37 | + private String parentGroupId; |
| 38 | + private String parentGroupName; |
| 39 | + |
| 40 | + // TODO not sure this is needed |
| 41 | + // The idea is that if the ListenComponent belongs to a nested PG, the "ancestor" group would identify the highest level PG that is not the root group |
| 42 | + private String ancestorGroupId; |
| 43 | + private String ancestorGroupName; |
| 44 | + |
| 45 | + @Schema(description = "The ingress port number") |
| 46 | + public int getPortNumber() { |
| 47 | + return portNumber; |
| 48 | + } |
| 49 | + |
| 50 | + public void setPortNumber(final int portNumber) { |
| 51 | + this.portNumber = portNumber; |
| 52 | + } |
| 53 | + |
| 54 | + @Schema(description = "The ingress transport protocol (TCP or UDP)") |
| 55 | + public String getTransportProtocol() { |
| 56 | + return transportProtocol; |
| 57 | + } |
| 58 | + |
| 59 | + public void setTransportProtocol(final String transportProtocol) { |
| 60 | + this.transportProtocol = transportProtocol; |
| 61 | + } |
| 62 | + |
| 63 | + @Schema(description = "Supported application protocols, if applicable") |
| 64 | + public List<String> getApplicationProtocols() { |
| 65 | + return applicationProtocols; |
| 66 | + } |
| 67 | + |
| 68 | + public void setApplicationProtocols(final List<String> applicationProtocols) { |
| 69 | + this.applicationProtocols = applicationProtocols; |
| 70 | + } |
| 71 | + |
| 72 | + @Schema(description = "The type of component providing the listen port (e.g., Processor, ControllerService)") |
| 73 | + public String getComponentType() { |
| 74 | + return componentType; |
| 75 | + } |
| 76 | + |
| 77 | + public void setComponentType(final String componentType) { |
| 78 | + this.componentType = componentType; |
| 79 | + } |
| 80 | + |
| 81 | + @Schema(description = "The id of the component providing the listen port") |
| 82 | + public String getComponentId() { |
| 83 | + return componentId; |
| 84 | + } |
| 85 | + |
| 86 | + public void setComponentId(final String componentId) { |
| 87 | + this.componentId = componentId; |
| 88 | + } |
| 89 | + |
| 90 | + @Schema(description = "The name of the component providing the listen port") |
| 91 | + public String getComponentName() { |
| 92 | + return componentName; |
| 93 | + } |
| 94 | + |
| 95 | + public void setComponentName(final String componentName) { |
| 96 | + this.componentName = componentName; |
| 97 | + } |
| 98 | + |
| 99 | + @Schema(description = "The class type of the component providing the listen port") |
| 100 | + public String getComponentClass() { |
| 101 | + return componentClass; |
| 102 | + } |
| 103 | + |
| 104 | + public void setComponentClass(final String componentClass) { |
| 105 | + this.componentClass = componentClass; |
| 106 | + } |
| 107 | + |
| 108 | + @Schema(description = "The id of the process group containing the component providing the listen port, if applicable") |
| 109 | + public String getParentGroupId() { |
| 110 | + return parentGroupId; |
| 111 | + } |
| 112 | + |
| 113 | + public void setParentGroupId(final String parentGroupId) { |
| 114 | + this.parentGroupId = parentGroupId; |
| 115 | + } |
| 116 | + |
| 117 | + @Schema(description = "The name of the process group containing the component providing the listen port, if applicable") |
| 118 | + public String getParentGroupName() { |
| 119 | + return parentGroupName; |
| 120 | + } |
| 121 | + |
| 122 | + public void setParentGroupName(final String parentGroupName) { |
| 123 | + this.parentGroupName = parentGroupName; |
| 124 | + } |
| 125 | + |
| 126 | + @Schema(description = "The id of the highest level process group containing the component providing the listen port that is not the root group, if applicable") |
| 127 | + public String getAncestorGroupId() { |
| 128 | + return ancestorGroupId; |
| 129 | + } |
| 130 | + |
| 131 | + public void setAncestorGroupId(final String ancestorGroupId) { |
| 132 | + this.ancestorGroupId = ancestorGroupId; |
| 133 | + } |
| 134 | + |
| 135 | + @Schema(description = "The name of the highest level process group containing the component providing the listen port that is not the root group, if applicable") |
| 136 | + public String getAncestorGroupName() { |
| 137 | + return ancestorGroupName; |
| 138 | + } |
| 139 | + |
| 140 | + public void setAncestorGroupName(final String ancestorGroupName) { |
| 141 | + this.ancestorGroupName = ancestorGroupName; |
| 142 | + } |
| 143 | + |
| 144 | + @Override |
| 145 | + public String toString() { |
| 146 | + return "ListenPortDTO{" + |
| 147 | + "portNumber=" + portNumber + |
| 148 | + ", transportProtocol='" + transportProtocol + '\'' + |
| 149 | + ", applicationProtocols=" + applicationProtocols + |
| 150 | + ", componentType='" + componentType + '\'' + |
| 151 | + ", componentId='" + componentId + '\'' + |
| 152 | + ", componentName='" + componentName + '\'' + |
| 153 | + ", componentClass='" + componentClass + '\'' + |
| 154 | + '}'; |
| 155 | + } |
| 156 | +} |
0 commit comments