public class JabberConnection extends XMPPTCPConnection implements AutoCloseable
XMPPConnection.FromMode
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONNECTION_TIMEOUT |
static int |
DEFAULT_PACKET_REPLY_TIMEOUT |
static int |
DEFAULT_PING_INTERVAL |
Constructor and Description |
---|
JabberConnection(String name,
CharSequence jid,
String password,
boolean allowReconnection,
Integer pingInterval) |
JabberConnection(String name,
CharSequence username,
String password,
String serviceName,
boolean allowReconnection,
Integer pingInterval) |
JabberConnection(String name,
Map configuration) |
JabberConnection(String name,
XMPPTCPConnectionConfiguration config,
boolean allowReconnection,
long pingInterval) |
Modifier and Type | Method and Description |
---|---|
void |
addChatListener(ChatManagerListener listener) |
static XMPPTCPConnectionConfiguration |
buildConfiguration(Map configuration)
Creates a jabber based on the configuration map provided
Properties for configuring jabber connection
NOTE THIS IS FOR ENDPOINT ONLY
{ Key: replyServiceResponse, Type: - Set
to true if service response will return its object to the sender. |
void |
close() |
JabberConnection |
connect() |
void |
disconnect() |
String |
getName() |
Integer |
getPingInterval() |
Set<RosterEntry> |
getUsers() |
void |
instantShutdown() |
boolean |
isAllowReconnection() |
void |
login() |
void |
login(CharSequence username,
String password) |
void |
login(CharSequence username,
String password,
String resource) |
void |
sendMessage(String jid,
Message message) |
void |
sendMessage(String jid,
String message) |
void |
setName(io.toro.martini.endpoint.Endpoint endpoint) |
void |
setName(String name) |
addRequestAckPredicate, addStanzaAcknowledgedListener, addStanzaIdAcknowledgedListener, getMaxSmResumptionTime, isDisconnectedButSmResumptionPossible, isSecureConnection, isSmAvailable, isSmEnabled, isSmResumptionPossible, isSocketClosed, isUsingCompression, loginAnonymously, removeAllRequestAckPredicates, removeAllStanzaAcknowledgedListeners, removeAllStanzaIdAcknowledgedListeners, removeRequestAckPredicate, removeStanzaAcknowledgedListener, removeStanzaIdAcknowledgedListener, requestSmAcknowledgement, send, sendSmAcknowledgement, setBundleandDeferCallback, setDefaultBundleAndDeferCallback, setPreferredResumptionTime, setUseStreamManagement, setUseStreamManagementDefault, setUseStreamManagementResumptiodDefault, setUseStreamManagementResumption, setUseStreamManagementResumptionDefault, streamWasResumed
addAsyncStanzaListener, addConnectionListener, addOneTimeSyncCallback, addPacketInterceptor, addPacketListener, addPacketSendingListener, addSyncStanzaListener, createPacketCollector, createPacketCollector, createPacketCollectorAndSend, createPacketCollectorAndSend, disconnect, getConfiguration, getConnectionCounter, getFeature, getFromMode, getHost, getLastStanzaReceived, getPacketReplyTimeout, getParsingExceptionCallback, getPort, getServiceName, getStreamId, getUser, hasFeature, isAnonymous, isAuthenticated, isConnected, registerIQRequestHandler, removeAsyncStanzaListener, removeConnectionListener, removePacketCollector, removePacketInterceptor, removePacketListener, removePacketSendingListener, removeSyncStanzaListener, sendIqWithResponseCallback, sendIqWithResponseCallback, sendIqWithResponseCallback, sendPacket, sendStanza, sendStanzaWithResponseCallback, sendStanzaWithResponseCallback, sendStanzaWithResponseCallback, setFromMode, setPacketReplyTimeout, setParsingExceptionCallback, setReplyToUnknownIq, setReplyToUnknownIqDefault, unregisterIQRequestHandler, unregisterIQRequestHandler
public static final int DEFAULT_PING_INTERVAL
public static final int DEFAULT_CONNECTION_TIMEOUT
public static final int DEFAULT_PACKET_REPLY_TIMEOUT
public JabberConnection(String name, Map configuration) throws ToroException
ToroException
public JabberConnection(String name, CharSequence username, String password, String serviceName, boolean allowReconnection, Integer pingInterval)
public JabberConnection(String name, XMPPTCPConnectionConfiguration config, boolean allowReconnection, long pingInterval)
public JabberConnection(String name, CharSequence jid, String password, boolean allowReconnection, Integer pingInterval)
public static XMPPTCPConnectionConfiguration buildConfiguration(Map configuration) throws ToroException
{ Key: replyServiceResponse, Type: Boolean
}
- Set
to true if service response will return its object to the sender. Only String and Gstring will be returned. if
you want to return marshalled object make sure to set useObjectConverter configuration to true{
Key: useObjectConverter, Type: Boolean
}
- If service response is set to true. Objects will return
as jsonname
- Jabber connection nameconfiguration
- { Key: callbackHandler, Type: CallbackHandler
}
- See ConnectionConfiguration.Builder#setCallbackHandler(CallbackHandler)
{ compressionEnabled, Type:
Boolean
}
- See XMPPTCPConnectionConfiguration.Builder#setCompressionEnabled(boolean)
{ connectTimeout, Type: Integer
DEFAULT 50seconds }
- See XMPPTCPConnectionConfiguration.Builder#setConnectTimeout(int)
{ sslContext, Type: SSLContext
}
- See ConnectionConfiguration.Builder#setCustomSSLContext(SSLContext)
{ debuggerEnabled, Type: Boolean
}
- See
ConnectionConfiguration.Builder#setDebuggerEnabled(boolean)
{ enabledSSLCiphers, Type: String[]
or List
}
- See ConnectionConfiguration.Builder#setEnabledSSLCiphers(String[])
{ enabledSSLProtocols, Type:
String[]
or List
}
- See
ConnectionConfiguration.Builder#setEnabledSSLProtocols(String[])
{ host, Type: String
}
- See
ConnectionConfiguration.Builder#setHost(String)
{ hostnameVerifier, Type: HostnameVerifier
}
- See ConnectionConfiguration.Builder#setHostnameVerifier(HostnameVerifier)
{ keystorePath, Type:
String
}
- See ConnectionConfiguration.Builder#setKeystorePath(String)
{
keystoreType, Type: String
}
- See
ConnectionConfiguration.Builder#setKeystoreType(String)
{ legacySessionDisabled, Type: Boolean
}
- See ConnectionConfiguration.Builder#setLegacySessionDisabled(boolean)
{ pkcs11Library, Type: String
}
- See ConnectionConfiguration.Builder#setPKCS11Library(String)
{ port,
Type: Integer
}
- See ConnectionConfiguration.Builder#setPort(int)
{
proxyInfo, Type: ProxyInfo
}
- See
ConnectionConfiguration.Builder#setProxyInfo(ProxyInfo)
{ resource, Type: String
}
- See
ConnectionConfiguration.Builder#setResource(String)
{ securityMode, Type: ConnectionConfiguration.SecurityMode
or String
}
- See ConnectionConfiguration.Builder#setSecurityMode(SecurityMode)
{ sendPresence, Type: Boolean
}
- See ConnectionConfiguration.Builder#setSendPresence(boolean)
{
serviceName, Type: String
}
- See
ConnectionConfiguration.Builder#setServiceName(String)
{ socketFactory, Type: SocketFactory
}
- See ConnectionConfiguration.Builder#setSocketFactory(SocketFactory)
{ username, Type: String
}
- Username of your jabber account{ password, Type: Boolean
}
- password
of jabber account{ packetReplyTimeout, Type: Long
DEFAULT 10seconds }
- See AbstractXMPPConnection.setPacketReplyTimeout(long)
{ pingInterval, Type: Integer
DEFAULT
20seconds }
- See PingManager.setPingInterval(int)
{ allowEmptyOrNullUsernames,
Type: Boolean
}
- See ConnectionConfiguration.Builder#allowEmptyOrNullUsernames()
{ allowReconnection, Type: Boolean
DEFAULT: true }
- Enables ReconnectionManager
ToroException
public JabberConnection connect() throws SmackException, IOException, XMPPException
connect
in class AbstractXMPPConnection
SmackException
IOException
XMPPException
public void login() throws XMPPException, SmackException, IOException
login
in class AbstractXMPPConnection
XMPPException
SmackException
IOException
public void login(CharSequence username, String password) throws XMPPException, SmackException, IOException
login
in class AbstractXMPPConnection
XMPPException
SmackException
IOException
public void login(CharSequence username, String password, String resource) throws XMPPException, SmackException, IOException
login
in class AbstractXMPPConnection
XMPPException
SmackException
IOException
public String getName()
public void setName(io.toro.martini.endpoint.Endpoint endpoint)
public void setName(String name)
public boolean isAllowReconnection()
public Integer getPingInterval()
public Set<RosterEntry> getUsers()
public void sendMessage(String jid, String message) throws SmackException.NotConnectedException
public void sendMessage(String jid, Message message) throws SmackException.NotConnectedException
public void addChatListener(ChatManagerListener listener)
public void disconnect()
disconnect
in class AbstractXMPPConnection
public void instantShutdown()
instantShutdown
in class XMPPTCPConnection
public void close()
close
in interface AutoCloseable
Copyright © 2019. All rights reserved.