public RemoteDestinationOutboundSocketBindingService(final String name, final String destinationAddress, final int destinationPort, final Integer sourcePort, final boolean fixedSourcePort) { super(name, sourcePort, fixedSourcePort); if (destinationAddress == null || destinationAddress.trim().isEmpty()) { throw NetworkMessages.MESSAGES.nullDestinationAddress(name); } if (destinationPort < 0) { throw NetworkMessages.MESSAGES.negativeDestinationPort(destinationPort, name); } this.destinationHost = destinationAddress; this.destinationPort = destinationPort; }
/** * Get the multicast socket address. * * @return the multicast address */ public InetSocketAddress getMulticastSocketAddress() { if (multicastAddress == null) { throw MESSAGES.noMulticastBinding(name); } return new InetSocketAddress(multicastAddress, multicastPort); }
final boolean fixedSourcePort) { if (name == null || name.trim().isEmpty()) { throw NetworkMessages.MESSAGES.nullOrEmptyVar("Socket name"); throw NetworkMessages.MESSAGES.nullOutboundSocketBindingParam(SocketBindingManager.class.getSimpleName(), name); throw NetworkMessages.MESSAGES.nullDestinationAddress(name); throw NetworkMessages.MESSAGES.negativeDestinationPort(destinationPort, name);
void checkNotBound() { if(isBound()) { throw MESSAGES.cannotChangeWhileBound(); } }
final boolean fixedSourcePort) { if (name == null || name.trim().isEmpty()) { throw NetworkMessages.MESSAGES.nullOrEmptyVar("Socket name"); throw NetworkMessages.MESSAGES.nullOutboundSocketBindingParam(SocketBindingManager.class.getSimpleName(), name); throw NetworkMessages.MESSAGES.nullDestinationAddress(name); throw NetworkMessages.MESSAGES.negativeDestinationPort(destinationPort, name);
void checkNotBound() { if(isBound()) { throw MESSAGES.cannotChangeWhileBound(); } }
public RemoteDestinationOutboundSocketBindingService(final String name, final String destinationAddress, final int destinationPort, final Integer sourcePort, final boolean fixedSourcePort) { super(name, sourcePort, fixedSourcePort); if (destinationAddress == null || destinationAddress.trim().isEmpty()) { throw NetworkMessages.MESSAGES.nullDestinationAddress(name); } if (destinationPort < 0) { throw NetworkMessages.MESSAGES.negativeDestinationPort(destinationPort, name); } this.destinationHost = destinationAddress; this.destinationPort = destinationPort; }
/** * Get the multicast socket address. * * @return the multicast address */ public InetSocketAddress getMulticastSocketAddress() { if (multicastAddress == null) { throw MESSAGES.noMulticastBinding(name); } return new InetSocketAddress(multicastAddress, multicastPort); }