| Modifier and Type | Class and Description |
|---|---|
static interface |
SocketConnector.DnsResolver |
static class |
SocketConnector.Entry |
static interface |
SocketConnector.HostChangedHandler
see-other-host
|
Connector.ConnectedHandler, Connector.DisconnectedHandler, Connector.EncryptionEstablishedHandler, Connector.ErrorHandler, Connector.StanzaReceivedHandler, Connector.StanzaSendingHandler, Connector.State, Connector.StateChangedHandler, Connector.StreamTerminatedHandler| Modifier and Type | Field and Description |
|---|---|
static String |
COMPRESSION_DISABLED_KEY |
static HostnameVerifier |
DEFAULT_HOSTNAME_VERIFIER |
static int |
DEFAULT_SOCKET_BUFFER_SIZE
Default size of buffer used to decode data before parsing
|
static int |
DEFAULT_SOCKET_TIMEOUT
Socket timeout.
|
static String |
HOSTNAME_VERIFIER_DISABLED_KEY |
static String |
HOSTNAME_VERIFIER_KEY |
static String |
KEEP_ALIVE_DELAY_KEY |
static String |
KEY_MANAGERS_KEY |
static String |
PLAIN_SOCKET_TIMEOUT_KEY
Property to specify custom socket timeout for Plain Socket.
|
static String |
SASL_EXTERNAL_ENABLED_KEY |
static String |
SERVER_HOST |
static String |
SERVER_PORT |
static String |
SSL_SOCKET_FACTORY_KEY |
static String |
SSL_SOCKET_TIMEOUT_KEY
Property to specify custom
socket timeout for SSL Socket. |
static String |
TLS_DISABLED_KEY |
static String |
TLS_PEER_CERTIFICATE_KEY |
static String |
TLS_SESSION_ID_KEY |
static String |
USE_BOUNCYCASTLE_KEY |
static String |
USE_PLAIN_SSL_KEY |
COMPRESSED_KEY, CONNECTOR_STAGE_KEY, CONNECTOR_STAGE_TIMESTAMP_KEY, DISABLE_KEEPALIVE_KEY, ENCRYPTED_KEY, EXTERNAL_KEEPALIVE_KEY, PROXY_HOST, PROXY_PORT, PROXY_TYPE, RECONNECTING_KEY, SEE_OTHER_HOST_KEY, TRUST_MANAGERS_KEY| Constructor and Description |
|---|
SocketConnector(Context context) |
| Modifier and Type | Method and Description |
|---|---|
XmppSessionLogic |
createSessionLogic(XmppModulesManager modulesManager,
PacketWriter writer)
Returns instance of XmppSessionLogic to work with this
connector.
|
protected void |
fireOnConnected(SessionObject sessionObject) |
protected void |
fireOnError(Element response,
Throwable caught,
SessionObject sessionObject) |
protected void |
fireOnStanzaReceived(StreamPacket response,
SessionObject sessionObject) |
protected void |
fireOnTerminate(SessionObject sessionObject) |
protected String |
getAuthType(org.bouncycastle.tls.TlsKeyExchange tlsKeyExchange) |
protected String |
getHostname() |
protected KeyManager[] |
getKeyManagers() |
Connector.State |
getState()
Returns current State of connector.
|
protected Integer |
getTimeout(String propertyName,
int defaultValue)
Returns timeout value.
|
boolean |
isCompressed()
Returns true when stream is compressed
|
boolean |
isSecure()
Returns connection security state.
|
static boolean |
isTLSAvailable(SessionObject sessionObject) |
static boolean |
isZLibAvailable(SessionObject sessionObject)
Returns true if server send stream features in which it advertises support for stream compression using ZLIB
|
void |
keepalive()
Whitespace ping.
|
protected void |
onError(Element response,
Throwable caught) |
protected void |
onErrorInThread(Exception e) |
protected void |
onResponse(Element response) |
protected void |
onStreamStart(Map<String,String> attribs) |
protected void |
onStreamTerminate() |
void |
onTLSStanza(Element elem) |
void |
onZLibStanza(Element elem)
Handles result of requesting stream compression
|
protected void |
proceedTLS() |
protected void |
proceedZLib()
Method activates stream compression by replacing reader and writer fields values and restarting XMPP stream
|
void |
processElement(Element elem) |
void |
restartStream()
Sends new XML Stream header.
|
void |
send(byte[] buffer) |
void |
send(Element stanza)
Sends given XML Element to server.
|
protected void |
setStage(Connector.State state) |
void |
start()
Starts connector.
|
void |
startTLS() |
void |
startZLib()
Sends
|
void |
stop()
Stops connector and closes connections.
|
void |
stop(boolean terminate)
Deprecated.
|
public static final String COMPRESSION_DISABLED_KEY
public static final HostnameVerifier DEFAULT_HOSTNAME_VERIFIER
public static final int DEFAULT_SOCKET_BUFFER_SIZE
public static final String HOSTNAME_VERIFIER_DISABLED_KEY
public static final String HOSTNAME_VERIFIER_KEY
public static final String KEY_MANAGERS_KEY
public static final String SASL_EXTERNAL_ENABLED_KEY
public static final String SERVER_HOST
public static final String SERVER_PORT
public static final String USE_PLAIN_SSL_KEY
public static final int DEFAULT_SOCKET_TIMEOUT
public static final String SSL_SOCKET_FACTORY_KEY
public static final String TLS_DISABLED_KEY
public static final String SSL_SOCKET_TIMEOUT_KEY
socket timeout for SSL Socket. Default is
0.public static final String PLAIN_SOCKET_TIMEOUT_KEY
180000 ms.public static final String KEEP_ALIVE_DELAY_KEY
public static final String TLS_SESSION_ID_KEY
public static final String TLS_PEER_CERTIFICATE_KEY
public static final String USE_BOUNCYCASTLE_KEY
public SocketConnector(Context context)
public static boolean isTLSAvailable(SessionObject sessionObject) throws XMLException
XMLExceptionpublic static boolean isZLibAvailable(SessionObject sessionObject) throws XMLException
sessionObject - XMLExceptionpublic XmppSessionLogic createSessionLogic(XmppModulesManager modulesManager, PacketWriter writer)
ConnectorcreateSessionLogic in interface ConnectormodulesManager - module managerwriter - writerprotected void fireOnConnected(SessionObject sessionObject) throws JaxmppException
JaxmppExceptionprotected void fireOnError(Element response, Throwable caught, SessionObject sessionObject) throws JaxmppException
JaxmppExceptionprotected void fireOnStanzaReceived(StreamPacket response, SessionObject sessionObject) throws JaxmppException
JaxmppExceptionprotected void fireOnTerminate(SessionObject sessionObject) throws JaxmppException
JaxmppExceptionprotected String getAuthType(org.bouncycastle.tls.TlsKeyExchange tlsKeyExchange)
protected String getHostname()
protected KeyManager[] getKeyManagers() throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic Connector.State getState()
protected Integer getTimeout(String propertyName, int defaultValue)
propertyName - name of propertydefaultValue - default value if property is null.null if value is less than 0.public boolean isCompressed()
isCompressed in interface Connectorpublic boolean isSecure()
Connectorpublic void keepalive()
throws JaxmppException
Connectorkeepalive in interface ConnectorJaxmppExceptionprotected void onError(Element response, Throwable caught) throws JaxmppException
JaxmppExceptionprotected void onErrorInThread(Exception e) throws JaxmppException
JaxmppExceptionprotected void onResponse(Element response) throws JaxmppException
JaxmppExceptionprotected void onStreamTerminate()
throws JaxmppException
JaxmppExceptionpublic void onTLSStanza(Element elem) throws JaxmppException
JaxmppExceptionpublic void onZLibStanza(Element elem) throws JaxmppException
elem - JaxmppExceptionprotected void proceedTLS()
throws JaxmppException
JaxmppExceptionprotected void proceedZLib()
throws JaxmppException
JaxmppExceptionpublic void processElement(Element elem) throws JaxmppException
JaxmppExceptionpublic void restartStream()
throws JaxmppException
ConnectorrestartStream in interface ConnectorJaxmppExceptionpublic void send(byte[] buffer)
throws JaxmppException
JaxmppExceptionpublic void send(Element stanza) throws JaxmppException
Connectorsend in interface Connectorstanza - XML element to send.JaxmppExceptionprotected void setStage(Connector.State state) throws JaxmppException
JaxmppExceptionpublic void start()
throws JaxmppException
Connectorstart in interface ConnectorJaxmppExceptionpublic void startTLS()
throws JaxmppException
JaxmppExceptionpublic void startZLib()
throws JaxmppException
JaxmppExceptionpublic void stop()
throws JaxmppException
Connectorstop in interface ConnectorJaxmppException@Deprecated public void stop(boolean terminate) throws JaxmppException
Connectorstop in interface Connectorterminate - if true then connection will be terminated immediatelly and connector will be
stopped.JaxmppExceptionCopyright © 2006–2018 Tigase. All rights reserved.