Package com.sshtools.j2ssh.agent
Class SshAgentSocketListener
- java.lang.Object
-
- com.sshtools.j2ssh.agent.SshAgentSocketListener
-
public class SshAgentSocketListener extends java.lang.Object- Version:
- $Revision: 1.20 $
- Author:
- $author$
-
-
Constructor Summary
Constructors Constructor Description SshAgentSocketListener(java.lang.String location, KeyStore keystore)Creates a new SshAgentSocketListener object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intconfigureNewLocation()Configure a new random port for the agent listener.protected KeyStoregetKeystore()Gets the underlying keystore for this agent listener.intgetPort()The current port of the agent listenerStartStopStategetState()Get the agent listeners statestatic voidmain(java.lang.String[] args)The main entry point for the application.voidstart()Starts the agent listener threadvoidstop()Stops the agent listener
-
-
-
Constructor Detail
-
SshAgentSocketListener
public SshAgentSocketListener(java.lang.String location, KeyStore keystore) throws AgentNotAvailableExceptionCreates a new SshAgentSocketListener object.- Parameters:
location- the location of the listening agent. This should be a random port on the localhost such as localhost:15342keystore- the keystore for agent operation- Throws:
AgentNotAvailableException- if the location specifies an invalid location
-
-
Method Detail
-
getState
public StartStopState getState()
Get the agent listeners state- Returns:
- the current state of the listener
-
start
public void start()
Starts the agent listener thread
-
getPort
public int getPort()
The current port of the agent listener- Returns:
- the integer port
-
stop
public void stop()
Stops the agent listener
-
getKeystore
protected KeyStore getKeystore()
Gets the underlying keystore for this agent listener.- Returns:
- the keystore
-
configureNewLocation
public static int configureNewLocation()
Configure a new random port for the agent listener.- Returns:
- the random port for this agent.
-
main
public static void main(java.lang.String[] args)
The main entry point for the application. This method currently accepts the -start parameter which will look for the sshtools.agent system property. To configure the agent and to get a valid location call with -configure, set the system sshtools.home system property and start.- Parameters:
args- the programs arguments
-
-