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.StreamRestartedHandler, 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
XMLException
public static boolean isZLibAvailable(SessionObject sessionObject) throws XMLException
sessionObject
- XMLException
public XmppSessionLogic createSessionLogic(XmppModulesManager modulesManager, PacketWriter writer)
Connector
createSessionLogic
in interface Connector
modulesManager
- module managerwriter
- writerpublic Connector.State getState()
public boolean isCompressed()
isCompressed
in interface Connector
public boolean isSecure()
Connector
public void keepalive() throws JaxmppException
Connector
keepalive
in interface Connector
JaxmppException
public void onTLSStanza(Element elem) throws JaxmppException
JaxmppException
public void onZLibStanza(Element elem) throws JaxmppException
elem
- JaxmppException
public void processElement(Element elem) throws JaxmppException
JaxmppException
public void restartStream() throws JaxmppException
Connector
restartStream
in interface Connector
JaxmppException
public void send(byte[] buffer) throws JaxmppException
JaxmppException
public void send(Element stanza) throws JaxmppException
Connector
send
in interface Connector
stanza
- XML element to send.JaxmppException
public void start() throws JaxmppException
Connector
start
in interface Connector
JaxmppException
public void startTLS() throws JaxmppException
JaxmppException
public void startZLib() throws JaxmppException
JaxmppException
public void stop() throws JaxmppException
Connector
stop
in interface Connector
JaxmppException
@Deprecated public void stop(boolean terminate) throws JaxmppException
Connector
stop
in interface Connector
terminate
- if true then connection will be terminated immediatelly and connector will be
stopped.
JaxmppException
protected void fireOnConnected(SessionObject sessionObject) throws JaxmppException
JaxmppException
protected void fireOnError(Element response, Throwable caught, SessionObject sessionObject) throws JaxmppException
JaxmppException
protected void fireOnStanzaReceived(StreamPacket response, SessionObject sessionObject) throws JaxmppException
JaxmppException
protected void fireOnTerminate(SessionObject sessionObject) throws JaxmppException
JaxmppException
protected String getAuthType(org.bouncycastle.tls.TlsKeyExchange tlsKeyExchange)
protected String getHostname()
protected KeyManager[] getKeyManagers() throws NoSuchAlgorithmException
NoSuchAlgorithmException
protected Integer getTimeout(String propertyName, int defaultValue)
propertyName
- name of propertydefaultValue
- default value if property is null
.null
if value is less than 0.protected void onError(Element response, Throwable caught) throws JaxmppException
JaxmppException
protected void onErrorInThread(Exception e) throws JaxmppException
JaxmppException
protected void onResponse(Element response) throws JaxmppException
JaxmppException
protected void onStreamTerminate() throws JaxmppException
JaxmppException
protected void proceedTLS() throws JaxmppException
JaxmppException
protected void proceedZLib() throws JaxmppException
JaxmppException
protected void setStage(Connector.State state) throws JaxmppException
JaxmppException
Copyright © 2006–2023 Tigase. All rights reserved.