All Packages Class Hierarchy This Package Previous Next Index
Class Snmp.SASClient
java.lang.Object
|
+----Snmp.SASClient
- public class SASClient
- extends Object
The SASClient class is needed on account of browser security which
prevents Java applets from sending data to any host but the applet host
when loaded over the network.
We do not recommend directly using this class, except for the
saveFile method or appendFile method to save data on the applet host.
This class implements a client to send/receive PDUs from any SNMP peer
via a deamon (SAS) on the Applet Host, i.e. Web server. Your applet
needs to instantiate this class to communicate with an SNMP entity
using Java enabled browsers that do not permit socket connections
to anything but the applet host.
Use the open method on your session instance to specify whether this
class needs to be instantiated..
For each session, you will call the open method with the
applet as an argument. If you don't supply the applet argument,
or the connection to the SAS daemon fails,
the session will try and open a local port.
- See Also:
- SnmpSession
-
connected
- Indicates if the connection to the SNMP Applet Server has been
successfully established.
-
SASClient(Applet, boolean)
- By Default this constructor will look for the SASocketPort file in
the applet html directory.
-
appendFile(String, byte[])
- The appendFile method for appending data to a file in "users" sub-directory
of the applet code base directory on the applet host.
-
clientCall(byte[])
-
-
close()
- Close the remote session
-
createDir(String)
- The createDir method for deleting a directory on the applet host.
-
deleteDir(String)
- The deleteDir method for deleting a directory on the applet host.
-
deleteFile(String)
- The deleteFile method for deleting a file on the applet host.
-
receive()
- Used to pick up PDUs from the remote port on the SAS server
Blocks until a PDU has been received
-
saveFile(String, byte[])
- The saveFile method for saving data to a file in "users" sub-directory
of the applet code base directory on the applet host.
-
send(String, int, byte[])
- The send method for sending PDUs
connected
public boolean connected
- Indicates if the connection to the SNMP Applet Server has been
successfully established.
SASClient
public SASClient(Applet applet,
boolean debug) throws SnmpException
- By Default this constructor will look for the SASocketPort file in
the applet html directory. If the SASocketPort file is created elsewhere
then the direcory where it is created is specified in the applet html file
using an applet parameter SAS_PORT_DIR.
- Throws: SnmpException
- is thrown upon error.
send
public void send(String hostname,
int port,
byte data[]) throws IOException
- The send method for sending PDUs
saveFile
public void saveFile(String filename,
byte data[]) throws IOException
- The saveFile method for saving data to a file in "users" sub-directory
of the applet code base directory on the applet host. Lacks error
checking at this point.
appendFile
public void appendFile(String filename,
byte data[]) throws IOException
- The appendFile method for appending data to a file in "users" sub-directory
of the applet code base directory on the applet host. Lacks error
checking at this point.
receive
public void receive() throws SnmpException, IOException
- Used to pick up PDUs from the remote port on the SAS server
Blocks until a PDU has been received
- Throws: SnmpException
- is thrown on receive errors.
- Throws: IOException
- is thrown on receive errors.
close
public void close()
- Close the remote session
clientCall
public synchronized byte[] clientCall(byte bytes[])
createDir
public void createDir(String directory) throws IOException
- The createDir method for deleting a directory on the applet host.
Can specify a relative path to SASusers sub-dir of applet directory.
deleteFile
public void deleteFile(String filename) throws IOException
- The deleteFile method for deleting a file on the applet host.
deleteDir
public void deleteDir(String directory) throws IOException
- The deleteDir method for deleting a directory on the applet host.
Will not delete a directory that is not empty.
All Packages Class Hierarchy This Package Previous Next Index