Class Proxy
Class Proxy
java.lang.Object
|
+----Proxy
- public class Proxy
- extends Object
This class implements the interface with Liaison. It is used by
SNMPObj and CMIPObj to send/receive data. Proxy communicates with
Liaison using the HTTP protocol.
This class sends the following /BATCH/<operation>/<context>/<data>, where:
- <operation>: is the requested operation (for instance CMIP_Get)
- <context>: contains some context dependent information (for instance CMIP agent AE-Title)
- <data>: operation-dependent data.
Liaison sends back an HTTP response that contains a set of couples
divided by carriage returns. Each couple contains a key (attribute
name) and a value (attribute value). For instance in front og the following CMIP Set
request
/CMIP/CMIP_Set/MIBCTL/objectClass=system&objectInstance=systemId%3d%28name+Telco%29&systemTitle=%28nothing+NULL%29
the following response is returned:
HTTP/1.0 200 OK
Server: IBM ZRL Proxy Server
Date: Fri, 28 Jun 1996 12:30:16 GMT
Content-type: text/x-www-form-urlencoded
Content-length: 73
currentTime
Fri,+28+Jun+1996+12:30:16+GMT
systemTitle
%28othing+NULL%29
To know about how the Proxy works, please read the following paper: Network Management
for the 90s.
- See Also:
- CMIPObj, SNMPObj
-
Proxy(String host, int port)
-
-
dispose()
- Used to dispose a Proxy instance. Not yet used.
-
SendRequest(String operation, String context, Information input)
- Sends a request to Liaison. This method is called whenever the
request returns one or more responses.
-
SendOffLineRequest(String operation, String context, String input)
- Sends a request to Liaison. This method is called only for
non-protocol requests when simple response is returned.
-
SendOffLineReqWithMultipleOut(String operation, String context, String input)
- Similar to the previous method with the difference that Liaison can send back multiple responses.
-
toString()
- Coverts the instance to a String. Mostly used in order to print the instance.
Proxy
public Proxy(String host, int port)
- Creates a Proxy instance
- Parameters:
- host - the TCP/IP address of the host where Liaison is running
- port - the port where the Proxy server is running (default 1998)
dispose
public void dispose() throws IOException
- Used to dispose a Proxy instance. Not yet used.
SendRequest
public Vector SendRequest(String operation, String context,
Information input) throws ProxyException
- Sends a protocol request to Liaison.
- Parameters:
- operation - the requested operation
- context - the operation context
- input - the information that has to be sent out as part of the request
- Returns:
- A vector of Information instances containing the response(s).
- Throws: ProxyException
- If an I/O error has occurred (e.g Liaison down or unreachable).
SendOffLineRequest
public String SendOffLineRequest(String operation, String context, String input) throws ProxyException
- Sends a non-protocol request to Liaison.
- Parameters:
- operation - the requested operation
- context - the operation context
- input - the operation-dependent data
- Returns:
- A string containing the requested information.
- Throws: ProxyException
- If an I/O error has occurred (e.g Liaison down or unreachable).
SendOffLineReqWithMultipleOut
public Information SendOffLineReqWithMultipleOut(String operation, String context, String input) throws ProxyException
- Sends a non-protocol request to Liaison. Multiple responses are
expected out from this request
- Parameters:
- operation - the requested operation
- context - the operation context
- input - the operation-dependent data
- Returns:
- An Information instance containing the responses
- Throws: ProxyException
- If an I/O error has occurred (e.g Liaison down or unreachable).
toString
public synchronized String toString()
- Coverts the instance to a String.