public final class ExternalComponent extends XmppSession
An external component session which connects to an XMPP server using the “Jabber Component Protocol”.
XmppSession.Status
Modifier and Type | Method and Description |
---|---|
void |
connect(Jid from) |
static ExternalComponent |
create(java.lang.String componentName,
java.lang.String sharedSecret,
java.lang.String hostname,
int port)
Creates a new external component using a default configuration.
|
static ExternalComponent |
create(java.lang.String componentName,
java.lang.String sharedSecret,
XmppSessionConfiguration xmppSessionConfiguration,
ClientConnectionConfiguration connectionConfiguration)
Creates a new external component using a default configuration.
|
static ExternalComponent |
create(java.lang.String componentName,
java.lang.String sharedSecret,
XmppSessionConfiguration configuration,
java.lang.String hostname,
int port)
Creates a new external component.
|
Jid |
getConnectedResource()
The connected resource, which is assigned by the server.
|
boolean |
handleElement(java.lang.Object element)
Handles an XMPP element.
|
void |
notifyException(java.lang.Throwable e)
Called if any unhandled exception is thrown during reading or writing.
|
addConnectionListener, addCreationListener, addInboundIQListener, addInboundMessageListener, addInboundPresenceListener, addIQHandler, addIQHandler, addMessageAcknowledgedListener, addOutboundIQListener, addOutboundMessageListener, addOutboundPresenceListener, addSendFailedListener, addSendSucceededListener, addSessionStatusListener, close, connect, createMarshaller, createUnmarshaller, disableFeature, disableFeature, enableFeature, enableFeature, getActiveConnection, getConfiguration, getConnections, getDebugger, getDomain, getEnabledFeatures, getManager, getStatus, getUnacknowledgedStanzas, isAuthenticated, isConnected, isSupported, markAcknowledged, query, query, query, removeConnectionListener, removeCreationListener, removeInboundIQListener, removeInboundMessageListener, removeInboundPresenceListener, removeIQHandler, removeMessageAcknowledgedListener, removeOutboundIQListener, removeOutboundMessageListener, removeOutboundPresenceListener, removeSendFailedListener, removeSendSucceededListener, removeSessionStatusListener, send, sendAndAwaitMessage, sendAndAwaitPresence, sendIQ, sendMessage, sendPresence
public static ExternalComponent create(java.lang.String componentName, java.lang.String sharedSecret, java.lang.String hostname, int port)
Creates a new external component using a default configuration. Any registered creation listeners
are triggered.
componentName
- The component name.sharedSecret
- The shared secret (password).hostname
- The hostname to connect to.port
- The port to connect to.public static ExternalComponent create(java.lang.String componentName, java.lang.String sharedSecret, XmppSessionConfiguration configuration, java.lang.String hostname, int port)
Creates a new external component. Any registered creation listeners
are triggered.
componentName
- The component name.sharedSecret
- The shared secret (password).configuration
- The configuration.hostname
- The hostname to connect to.port
- The port to connect to.public static ExternalComponent create(java.lang.String componentName, java.lang.String sharedSecret, XmppSessionConfiguration xmppSessionConfiguration, ClientConnectionConfiguration connectionConfiguration)
Creates a new external component using a default configuration. Any registered creation listeners
are triggered.
componentName
- The component name.sharedSecret
- The shared secret (password).xmppSessionConfiguration
- The XMPP configuration.connectionConfiguration
- The connection configuration.public final void connect(Jid from) throws XmppException
connect
in class XmppSession
XmppException
public final boolean handleElement(java.lang.Object element) throws XmppException
XmppSession
Handles an XMPP element.
This method should be called on the reader thread.
handleElement
in interface StreamHandler
handleElement
in class XmppSession
element
- The XMPP element.StreamErrorException
- If the element is a stream error.StreamNegotiationException
- If any exception occurred during stream feature negotiation.XmppException
- If any other XMPP exception occurs.public final void notifyException(java.lang.Throwable e)
XmppSession
Called if any unhandled exception is thrown during reading or writing.
This method will close the stream.
notifyException
in class XmppSession
e
- The exception. If an unrecoverable XMPP stream error occurred, the exception is a StreamError
.public final Jid getConnectedResource()
XmppSession
The connected resource, which is assigned by the server.
getConnectedResource
in class XmppSession
Copyright © 2014–2019 XMPP.rocks. All rights reserved.