Package org.jenkinsci.remoting.engine
Class JnlpAgentEndpoint
- java.lang.Object
-
- org.jenkinsci.remoting.engine.JnlpAgentEndpoint
-
public class JnlpAgentEndpoint extends Object
Represents aTcpSlaveAgentListener
endpoint details.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description JnlpAgentEndpoint(String host, int port, RSAPublicKey publicKey, Set<String> protocols)
JnlpAgentEndpoint(String host, int port, RSAPublicKey publicKey, Set<String> protocols, URL serviceURL)
JnlpAgentEndpoint(String host, int port, RSAPublicKey publicKey, Set<String> protocols, URL serviceURL, String proxyCredentials)
Constructor for a remoteJenkins
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
InetSocketAddress
getAddress()
Gets the socket address.String
getHost()
Gets the hostname.int
getPort()
Gets the port.Set<String>
getProtocols()
Gets the supported protocols if available.RSAPublicKey
getPublicKey()
Gets theInstanceIdentity.getPublic()
if available.URL
getServiceUrl()
Retrieves URL of the web service providing the remoting endpoint.int
hashCode()
boolean
isProtocolSupported(String name)
Checks if the named protocol is supported.Socket
open(int socketTimeout)
Opens a socket connection to the remote endpoint.String
toString()
-
-
-
Constructor Detail
-
JnlpAgentEndpoint
@Deprecated public JnlpAgentEndpoint(@NonNull String host, int port, @CheckForNull RSAPublicKey publicKey, @CheckForNull Set<String> protocols)
-
JnlpAgentEndpoint
@Deprecated public JnlpAgentEndpoint(@NonNull String host, int port, @CheckForNull RSAPublicKey publicKey, @CheckForNull Set<String> protocols, @CheckForNull URL serviceURL)
-
JnlpAgentEndpoint
public JnlpAgentEndpoint(@NonNull String host, int port, @CheckForNull RSAPublicKey publicKey, @CheckForNull Set<String> protocols, @CheckForNull URL serviceURL, @CheckForNull String proxyCredentials)
Constructor for a remoteJenkins
instance.- Parameters:
host
- the hostname.port
- the port.publicKey
- theInstanceIdentity.getPublic()
of the remote instance (if known).protocols
- The supported protocols.serviceURL
- URL of the service hosting the remoting endpoint. Usenull
if it is not a web service or if the URL cannot be determined- Since:
- 3.0
-
-
Method Detail
-
getAddress
@NonNull public InetSocketAddress getAddress()
Gets the socket address.- Returns:
- the socket address
-
getServiceUrl
@CheckForNull public URL getServiceUrl()
Retrieves URL of the web service providing the remoting endpoint.- Returns:
- Service URL if available.
null
otherwise.
-
getHost
@NonNull public String getHost()
Gets the hostname.- Returns:
- the hostname.
-
getPort
public int getPort()
Gets the port.- Returns:
- the port.
-
getPublicKey
@CheckForNull public RSAPublicKey getPublicKey()
Gets theInstanceIdentity.getPublic()
if available.- Returns:
- the
InstanceIdentity.getPublic()
ornull
.
-
getProtocols
@CheckForNull public Set<String> getProtocols()
Gets the supported protocols if available.- Returns:
- the supported protocols or
null
.
-
isProtocolSupported
public boolean isProtocolSupported(@NonNull String name)
Checks if the named protocol is supported.- Parameters:
name
- the name of the protocol to check.- Returns:
false
if and only if the endpoint reports supported protocols and the named protocol is not in the list of supported protocols.
-
open
public Socket open(int socketTimeout) throws IOException
Opens a socket connection to the remote endpoint.- Parameters:
socketTimeout
- theSocket.setSoTimeout(int)
to apply to the socket.- Returns:
- the socket.
- Throws:
IOException
- if things go wrong.
-
-