public class XMPPGateway extends AbstractInitializableAttribute implements Executable
XMPP.publish()
method.
This implementation makes use of the
Smack
library.XMPPSource
,
XMPPSink
,
Executable
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
Parameter |
debugEnable
The flag indicates whether or not to enable the smack library debug
If this is true, the raw XML stream will be shown for debug use.
|
FileParameter |
passwordFile
The file that contains the password.
|
Parameter |
port
Port number to connect to.
|
Parameter |
server
Server to connect to.
|
Parameter |
userName
User name to authenticate with.
|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
XMPPGateway(NamedObj container,
java.lang.String name)
Construct an instance of the XMPPGateway attribute.
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute attribute)
Update the local variable associated with the changed attribute
and disconnect from the server.
|
void |
fire()
Return immediately.
|
void |
initialize()
Attempt to connect to the server and login.
|
boolean |
isFireFunctional()
Return false.
|
boolean |
isStrict()
Return true.
|
int |
iterate(int count)
Return immediately.
|
boolean |
postfire()
Return immediately.
|
boolean |
prefire()
Check the connection, reconnect and login if required.
|
void |
publish(java.lang.String nodeId,
java.lang.String value)
Publish a value to a node.
|
void |
removeNode(java.lang.String nodeId)
Remove a node from the server configuration.
|
void |
stop()
Return immediately.
|
void |
stopFire()
Return immediately.
|
void |
terminate()
Return immediately.
|
void |
wrapup()
Disconnect from the server.
|
_getInitializableContainer, addInitializable, clone, hierarchyChanged, hierarchyWillChange, preinitialize, removeInitializable, setContainer
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addInitializable, preinitialize, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
public FileParameter passwordFile
public Parameter port
public Parameter server
public Parameter userName
public Parameter debugEnable
public XMPPGateway(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name.IllegalActionException
- If the superclass throws it.NameDuplicationException
- If the superclass throws it.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The changed attribute.IllegalActionException
- If thrown while getting the
value of the port, server or userName token, or if thrown
by the method in the super class.public void fire() throws IllegalActionException
fire
in interface Executable
IllegalActionException
- If firing is not permitted.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AbstractInitializableAttribute
IllegalActionException
- If unable to login, create a node,
find a node, or subscribe to a node.public boolean isFireFunctional()
isFireFunctional
in interface Executable
public boolean isStrict() throws IllegalActionException
isStrict
in interface Executable
IllegalActionException
- Thrown by subclass.public int iterate(int count) throws IllegalActionException
iterate
in interface Executable
count
- The number of iterations to perform.IllegalActionException
- If iterating is not
permitted, or if prefire(), fire(), or postfire() throw it.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
IllegalActionException
- If prefiring is not permitted.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
IllegalActionException
- If postfiring is not permitted.public void publish(java.lang.String nodeId, java.lang.String value) throws IllegalActionException
nodeId
- The node to publish to.value
- The value to publish.IllegalActionException
- If publishing failed.public void removeNode(java.lang.String nodeId) throws IllegalActionException
nodeId
- The node to remove.IllegalActionException
- If unable to remove the node.public void stop()
stop
in interface Executable
public void stopFire()
stopFire
in interface Executable
public void terminate()
terminate
in interface Executable
public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class AbstractInitializableAttribute
IllegalActionException
- If thrown in the base class.