Package org.jboss.resteasy.utils
Class PortProviderUtil
- java.lang.Object
-
- org.jboss.resteasy.utils.PortProviderUtil
-
public class PortProviderUtil extends Object
Utility class that provides a port number for the Resteasy embedded container.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ASYNC_JOB_SERVICE_CONTEXT_KEY
-
Constructor Summary
Constructors Constructor Description PortProviderUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
createProxy(Class<T> clazz, String testName)
Create a Resteasy client proxy with an empty base request path.static <T> T
createProxy(Class<T> clazz, String path, String testName)
Create a Resteasy client proxy.static URI
createURI(String path, String testName)
Create a URI for the provided path, using the configured portstatic URL
createURL(String path, String testName)
Create a URL for the provided path, using the configured portstatic String
generateBaseUrl(String testName)
Generate a base URL incorporating the configured port.static String
generateURL(String path, String testName)
Generate a URL incorporating the configured port.static String
generateURL(String path, String testName, String hostName, int port)
Generate a URL with port, hostnamestatic String
getHost()
Get host IP.static int
getPort()
Get port.static boolean
isIpv6()
Get information about IPv6 connectivity.
-
-
-
Field Detail
-
ASYNC_JOB_SERVICE_CONTEXT_KEY
public static final String ASYNC_JOB_SERVICE_CONTEXT_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
createProxy
public static <T> T createProxy(Class<T> clazz, String testName)
Create a Resteasy client proxy with an empty base request path.- Parameters:
clazz
- the client interface class- Returns:
- the proxy object
-
createProxy
public static <T> T createProxy(Class<T> clazz, String path, String testName)
Create a Resteasy client proxy.- Parameters:
clazz
- the client interface classpath
- the base request path- Returns:
- the proxy object
-
createURI
public static URI createURI(String path, String testName)
Create a URI for the provided path, using the configured port- Parameters:
path
- the request path- Returns:
- a full URI
-
createURL
public static URL createURL(String path, String testName) throws MalformedURLException
Create a URL for the provided path, using the configured port- Parameters:
path
- the request path- Returns:
- a full URL
- Throws:
MalformedURLException
-
generateBaseUrl
public static String generateBaseUrl(String testName)
Generate a base URL incorporating the configured port.- Returns:
- a full URL
-
generateURL
public static String generateURL(String path, String testName)
Generate a URL incorporating the configured port.- Parameters:
path
- the pathtestName
- the test name- Returns:
- a full URL
-
generateURL
public static String generateURL(String path, String testName, String hostName, int port)
Generate a URL with port, hostname- Parameters:
path
- the path- Returns:
- a full URL
-
getPort
public static int getPort()
Get port.- Returns:
- The port number
-
getHost
public static String getHost()
Get host IP.- Returns:
- The host IP
-
isIpv6
public static boolean isIpv6()
Get information about IPv6 connectivity.- Returns:
- IPv6 connectivity.
-
-