Class GpClient
- java.lang.Object
-
- org.opennms.netmgt.provision.detector.generic.client.GpClient
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Client<GpRequest,GpResponse>
public class GpClient extends Object implements Client<GpRequest,GpResponse>
GpClient class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Constructor Summary
Constructors Constructor Description GpClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
closevoid
connect(InetAddress address, int port, int timeout)
connectString
getArgs()
getArgsString
getBanner()
getBannerString
getError()
getErrorint
getExitStatus()
getExitStatusString
getHoption()
getHoptionString
getMatch()
getMatchString
getResponse()
getResponseString
getScript()
getScriptString
getToption()
getToptionGpResponse
receiveBanner()
receiveBannerGpResponse
sendRequest(GpRequest request)
sendRequestvoid
setArgs(String args)
setArgsvoid
setBanner(String banner)
setBannervoid
setError(String error)
setErrorvoid
setExitStatus(int exitStatus)
setExitStatusvoid
setHoption(String hoption)
setHoptionvoid
setMatch(String match)
setMatchvoid
setResponse(String response)
setResponsevoid
setScript(String script)
setScriptvoid
setToption(String toption)
setToption
-
-
-
Method Detail
-
close
public void close()
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceClient<GpRequest,GpResponse>
- Specified by:
close
in interfaceCloseable
-
connect
public void connect(InetAddress address, int port, int timeout) throws IOException, Exception
connect
- Specified by:
connect
in interfaceClient<GpRequest,GpResponse>
- Parameters:
address
- aInetAddress
object.port
- a int.timeout
- a int.- Throws:
IOException
- if any.Exception
- if any.
-
receiveBanner
public GpResponse receiveBanner() throws IOException, Exception
receiveBanner
- Specified by:
receiveBanner
in interfaceClient<GpRequest,GpResponse>
- Returns:
- a
GpResponse
object. - Throws:
IOException
- if any.Exception
- if any.
-
sendRequest
public GpResponse sendRequest(GpRequest request) throws IOException, Exception
sendRequest
- Specified by:
sendRequest
in interfaceClient<GpRequest,GpResponse>
- Parameters:
request
- aGpRequest
object.- Returns:
- a
GpResponse
object. - Throws:
IOException
- if any.Exception
- if any.
-
setHoption
public void setHoption(String hoption)
setHoption
- Parameters:
hoption
- aString
object.
-
setToption
public void setToption(String toption)
setToption
- Parameters:
toption
- aString
object.
-
setExitStatus
public void setExitStatus(int exitStatus)
setExitStatus
- Parameters:
exitStatus
- a int.
-
getExitStatus
public int getExitStatus()
getExitStatus
- Returns:
- a int.
-
setResponse
public void setResponse(String response)
setResponse
- Parameters:
response
- aString
object.
-
-