1 22 23 package org.objectweb.petals.tools.jbicommon.descriptor; 24 25 import javax.xml.namespace.QName ; 26 27 import org.apache.commons.lang.builder.EqualsBuilder; 28 import org.apache.commons.lang.builder.HashCodeBuilder; 29 import org.apache.commons.lang.builder.ToStringBuilder; 30 31 54 public class Connection { 55 56 59 private String consumerEndpointName; 61 64 private QName consumerInterfaceName; 66 69 private QName consumerServiceName; 71 74 private String providerEndpointName; 76 79 private QName providerServiceName; 81 84 public Connection() { super(); 86 } 87 88 @Override 89 public boolean equals(final Object other) { 90 if (!(other instanceof Connection)) { 91 return false; } 93 Connection castOther = (Connection) other; 94 return new EqualsBuilder().append(consumerInterfaceName, 95 castOther.consumerInterfaceName).append(consumerServiceName, 96 castOther.consumerServiceName).append(consumerEndpointName, 97 castOther.consumerEndpointName).append(providerServiceName, 98 castOther.providerServiceName).append(providerEndpointName, 99 castOther.providerEndpointName).isEquals(); 100 } 101 102 108 public String getConsumerEndpointName() { 109 return consumerEndpointName; 110 } 111 112 118 public QName getConsumerInterfaceName() { 119 return consumerInterfaceName; 120 } 121 122 126 132 public QName getConsumerServiceName() { 133 return consumerServiceName; 134 } 135 136 141 public String getProviderEndpointName() { 142 return providerEndpointName; 143 } 144 145 150 public QName getProviderServiceName() { 151 return providerServiceName; 152 } 153 154 @Override 155 public int hashCode() { 156 return new HashCodeBuilder().append(consumerInterfaceName).append( 157 consumerServiceName).append(consumerEndpointName).append( 158 providerServiceName).append(providerEndpointName).toHashCode(); 159 } 160 161 @Override 162 public String toString() { 163 return new ToStringBuilder(this).append("consumerInterfaceName", 164 consumerInterfaceName).append("consumerServiceName", 165 consumerServiceName).append("consumerEndpointName", 166 consumerEndpointName).append("providerServiceName", 167 providerServiceName).append("providerEndpointName", 168 providerEndpointName).toString(); 169 } 170 171 177 protected void setConsumerEndpointName(final String endpointName) { 178 this.consumerEndpointName = endpointName; 179 } 180 181 187 protected void setConsumerInterfaceName(final QName interfaceName) { 188 this.consumerInterfaceName = interfaceName; 189 } 190 191 197 protected void setConsumerServiceName(final QName serviceName) { 198 this.consumerServiceName = serviceName; 199 } 200 201 207 protected void setProviderEndpointName(final String endpointName) { 208 this.providerEndpointName = endpointName; 209 } 210 211 217 protected void setProviderServiceName(final QName serviceName) { 218 this.providerServiceName = serviceName; 219 } 220 221 } 222 | Popular Tags |