Class AdvertisedAddresses
java.lang.Object
org.cloudburstmc.netty.channel.nethernet.signaling.AdvertisedAddresses
Advertised addresses as operators write them, the same for built-in and external signaling: IP
literals or host names, either with a port. A name is looked up once, when the signaling starts,
so a change takes a restart or reload.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe most endpoints announced, which is also what external signaling allows. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<InetSocketAddress>parse(Collection<String> values, int defaultPort) Reads each entry without looking anything up: a literal as its address, a name unresolved.static List<InetSocketAddress>resolve(List<InetSocketAddress> endpoints) Looks every name up, standing for each address it resolves to on the entry's port.
-
Field Details
-
MAX_ENDPOINTS
public static final int MAX_ENDPOINTSThe most endpoints announced, which is also what external signaling allows.- See Also:
-
-
Method Details
-
parse
Reads each entry without looking anything up: a literal as its address, a name unresolved.- Parameters:
values- The entries, such asplay.example.com,IPv4:portor[IPv6]:portdefaultPort- The port of an entry that names none- Returns:
- The endpoints, once each
- Throws:
IllegalArgumentException- If an entry is neither a literal nor a name, or is an address no player can reach
-
resolve
public static List<InetSocketAddress> resolve(List<InetSocketAddress> endpoints) throws UnknownHostException Looks every name up, standing for each address it resolves to on the entry's port.- Parameters:
endpoints- The endpoints fromparse(java.util.Collection<java.lang.String>, int)- Returns:
- The endpoints, all resolved, once each
- Throws:
UnknownHostException- If a name does not resolveIllegalArgumentException- If a name resolves to an address no player can reach, or there are more thanMAX_ENDPOINTS
-