use of org.jboss.as.network.ClientMapping in project wildfly by wildfly.
the class AssociationImpl method getClusterInfo.
ClusterTopologyListener.ClusterInfo getClusterInfo(final Map<String, List<ClientMapping>> added, final String clusterName) {
final List<ClusterTopologyListener.NodeInfo> nodeInfoList = new ArrayList<>(added.size());
for (Map.Entry<String, List<ClientMapping>> entry : added.entrySet()) {
final String nodeName = entry.getKey();
final List<ClientMapping> clientMappingList = entry.getValue();
final List<ClusterTopologyListener.MappingInfo> mappingInfoList = new ArrayList<>();
for (ClientMapping clientMapping : clientMappingList) {
mappingInfoList.add(new ClusterTopologyListener.MappingInfo(clientMapping.getDestinationAddress(), clientMapping.getDestinationPort(), clientMapping.getSourceNetworkAddress(), clientMapping.getSourceNetworkMaskBits()));
}
nodeInfoList.add(new ClusterTopologyListener.NodeInfo(nodeName, mappingInfoList));
}
return new ClusterTopologyListener.ClusterInfo(clusterName, nodeInfoList);
}
use of org.jboss.as.network.ClientMapping in project wildfly by wildfly.
the class EJBRemotingConnectorClientMappingsEntryProviderService method getClientMappings.
List<ClientMapping> getClientMappings() {
final List<ClientMapping> ret = new ArrayList<>();
RemotingConnectorBindingInfoService.RemotingConnectorInfo info = this.remotingConnectorInfo.getValue();
if (info.getSocketBinding().getClientMappings() != null && !info.getSocketBinding().getClientMappings().isEmpty()) {
ret.addAll(info.getSocketBinding().getClientMappings());
} else {
// TODO: We use the textual form of IP address as the destination address for now.
// This needs to be configurable (i.e. send either host name or the IP address). But
// since this is a corner case (i.e. absence of any client-mappings for a socket binding),
// this should be OK for now
final String destinationAddress = info.getSocketBinding().getAddress().getHostAddress();
final InetAddress clientNetworkAddress;
try {
clientNetworkAddress = InetAddress.getByName("::");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
final ClientMapping defaultClientMapping = new ClientMapping(clientNetworkAddress, 0, destinationAddress, info.getSocketBinding().getAbsolutePort());
ret.add(defaultClientMapping);
}
return ret;
}
Aggregations