Package dev.omega24.upnp4j
Class UPnP4J
java.lang.Object
dev.omega24.upnp4j.UPnP4J
The class to manage upnp4j from
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCloses a port using UPnPstatic StringGets the external IP of the routerstatic StringGets the local IP of the routerstatic voidInitialize a connection to the routerstatic booleanChecks if a port is openstatic booleanChecks if UPnP is available for the routerstatic booleanOpens a port using UPnP
-
Constructor Details
-
UPnP4J
public UPnP4J()
-
-
Method Details
-
initialize
public static void initialize()Initialize a connection to the router -
isUPnPAvailable
public static boolean isUPnPAvailable()Checks if UPnP is available for the router- Returns:
- True if UPnP is available
-
getExternalIP
Gets the external IP of the router- Returns:
- The external IP of the router
-
getLocalIP
Gets the local IP of the router- Returns:
- The local IP of the router
-
open
Opens a port using UPnP- Parameters:
port- A port in the range of 1-65535protocol- The protocol to open the port with- Returns:
- True if the port was able to open
-
isOpen
Checks if a port is open- Parameters:
port- A port in the range of 1-65535protocol- The protocol to check the port with- Returns:
- True if the port is open
-
close
Closes a port using UPnP- Parameters:
port- A port in the range of 1-65535protocol- The protocol to close the port with- Returns:
- True if the port was able to close
-