public class GenericGetOne
extends java.applet.Applet
The headless GenericGetOne applet will use the GetNextPdu to request a single MIB variable. The idea is to use this (signed!) applet in a webpage via javascript (livescript). If the applet isn't signed, you can only connect back to the web server.
The applet will call the javascript function loaded() in method start() to indicate the applet is loaded. You have to define this function, even when empty.
In javascript, call the send() method, passing the name of the callback function. The applet will call this javascript function, when receiving the response:
function <jsCallback>(host, port, comm, requestOid, responseOid, value, error) { }
See example html file TestGenericGetOne.html
GetNextPdu
,
Serialized Formjava.applet.Applet.AccessibleApplet
Constructor and Description |
---|
GenericGetOne()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected JSObject |
getWindow() |
void |
init() |
protected void |
printDebug(java.lang.String text) |
protected void |
printError(java.lang.String text) |
protected void |
pushValue(java.lang.String host,
int port,
java.lang.String comm,
java.lang.String requestOid,
java.lang.String responseOid,
java.lang.String value,
java.lang.String error,
java.lang.String jsCallback)
Pushes the value back to javascript by calling setValue.
|
protected void |
removeMe(uk.co.westhawk.examplev1.GenericGetOne.PduCallback pduCb) |
void |
send(java.lang.String host,
java.lang.String port,
java.lang.String comm,
java.lang.String oid,
java.lang.String jsCallback)
Send a GetNext request.
|
void |
start() |
void |
stop() |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public void send(java.lang.String host, java.lang.String port, java.lang.String comm, java.lang.String oid, java.lang.String jsCallback)
host
- The host name or addressport
- The port number of the hostcomm
- The community nameoid
- The request oidjsCallback
- The javascript function to call when the response
comes inpushValue(java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
protected void pushValue(java.lang.String host, int port, java.lang.String comm, java.lang.String requestOid, java.lang.String responseOid, java.lang.String value, java.lang.String error, java.lang.String jsCallback)
function <callback>(host, port, comm, requestOid, responseOid, value, error) { }
value
- The response value of the (latest) request.public void init()
init
in class java.applet.Applet
public void start()
start
in class java.applet.Applet
public void stop()
stop
in class java.applet.Applet
protected JSObject getWindow()
protected void printError(java.lang.String text)
protected void printDebug(java.lang.String text)
protected void removeMe(uk.co.westhawk.examplev1.GenericGetOne.PduCallback pduCb)