|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.realtime.xmpp.util.RestartingEndpoint | +--com.realtime.xmpp.dom.DomComponent | +--com.realtime.xmpp.dom.DomAcceptComponent
Provide a Jabber accept component that authenticates using the handshake protocol.
Nested Class Summary | |
class |
DomAcceptComponent.AuthenticationManager
Listener to authenticate whenever a new session is started. |
Field Summary | |
protected java.lang.Object |
m_authenticationMonitor
An authentication monitor. |
protected boolean |
m_bAuthenticated
True when the session has been authenticated. |
protected java.lang.String |
m_sSecret
The secret key used for validation with the Jabber server. |
Fields inherited from class com.realtime.xmpp.dom.DomComponent |
m_transformer |
Fields inherited from class com.realtime.xmpp.util.RestartingEndpoint |
m_session, m_sessionRestarter, XMPP_REQUEST_TIMEOUT |
Constructor Summary | |
DomAcceptComponent(java.lang.String sHost,
int nPort,
java.lang.String sSecret)
Create an ACCEPT namespaced component that generates DOM packets on incoming messages. |
|
DomAcceptComponent(XmlStreamFactory streamFactory,
java.lang.String sSecret)
Create an ACCEPT namespaced component that generates DOM packets on incoming messages. |
Method Summary | |
protected void |
init(java.lang.String sSecret)
* @throws NoSuchAlgorithmException |
void |
start()
Starts the component. |
void |
waitForAuthentication(long timeout)
Wait for authentication to occur on the session. |
Methods inherited from class com.realtime.xmpp.dom.DomComponent |
getDomTransformer, query, send |
Methods inherited from class com.realtime.xmpp.util.RestartingEndpoint |
fastStart, getComponentName, getSession, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String m_sSecret
protected java.lang.Object m_authenticationMonitor
protected boolean m_bAuthenticated
Constructor Detail |
public DomAcceptComponent(java.lang.String sHost, int nPort, java.lang.String sSecret) throws java.security.NoSuchAlgorithmException
Create an ACCEPT namespaced component that generates DOM packets on incoming messages. Uses the secret to handshake with the Jabber server.
* @param sHost The host name to connect to.
nPort
- The server port to connect to.sSecret
- The secret to validate us with the Jabber server.
java.security.NoSuchAlgorithmException
- Generated when the SHA1 digest
is unavailable.public DomAcceptComponent(XmlStreamFactory streamFactory, java.lang.String sSecret) throws java.security.NoSuchAlgorithmException
Create an ACCEPT namespaced component that generates DOM packets on incoming messages. Uses the secret to handshake with the Jabber server.
streamFactory
- An XML connection factory.sSecret
- The secret to validate us with the Jabber server.
java.security.NoSuchAlgorithmException
- Generated when the SHA1 digest
is unavailable.Method Detail |
protected void init(java.lang.String sSecret) throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException
public void start() throws java.io.IOException
Starts the component. Opens the socket, starts XMPP streaming, and authenticates. This is a blocking call and calls waitForAuthentication() before returning. If you do not want to wait for the connection to open, call fastStart() instead.
If you are interested in the XMPP session lifecycle events, then register using getSession().addListener().
start
in interface XmppEndpoint
start
in class RestartingEndpoint
java.io.IOException
- Generated when the component could not start.public void waitForAuthentication(long timeout) throws java.io.IOException
Wait for authentication to occur on the session.
Start is a NON-blocking call and will LIKELY return before session authentication has occured. If you would like to be sure authentication has occured, call this method.
timeout
- The timeout in milliseconds before
an exception is thrown.
java.io.IOException
- Generated when the authentication
does not occur before the timeout expires.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |