public class JabberConnection extends org.jivesoftware.smack.tcp.XMPPTCPConnection implements AutoCloseable
org.jivesoftware.smack.tcp.XMPPTCPConnection.PacketReader, org.jivesoftware.smack.tcp.XMPPTCPConnection.PacketWriter
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONNECTION_TIMEOUT |
static int |
DEFAULT_PACKET_REPLY_TIMEOUT |
static int |
DEFAULT_PING_INTERVAL |
authenticated, compressionHandler, connected, connectionCounterValue, connectionListeners, connectionLock, debugger, host, hostAddresses, lastFeaturesReceived, port, reader, saslAuthentication, saslFeatureReceived, streamFeatures, streamId, user, wasAuthenticated, writer
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,
org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration config,
boolean allowReconnection,
long pingInterval) |
Modifier and Type | Method and Description |
---|---|
void |
addChatListener(org.jivesoftware.smack.chat.ChatManagerListener listener) |
static org.jivesoftware.smack.tcp.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() |
protected void |
connectInternal() |
void |
disconnect() |
String |
getName() |
Integer |
getPingInterval() |
Set<org.jivesoftware.smack.roster.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,
org.jivesoftware.smack.packet.Message message) |
void |
sendMessage(String jid,
String message) |
void |
setName(io.toro.martini.endpoint.Endpoint endpoint) |
void |
setName(String name) |
addRequestAckPredicate, addStanzaAcknowledgedListener, addStanzaIdAcknowledgedListener, afterFeaturesReceived, afterSuccessfulLogin, getMaxSmResumptionTime, isDisconnectedButSmResumptionPossible, isSecureConnection, isSmAvailable, isSmEnabled, isSmResumptionPossible, isSocketClosed, isUsingCompression, loginAnonymously, loginNonAnonymously, removeAllRequestAckPredicates, removeAllStanzaAcknowledgedListeners, removeAllStanzaIdAcknowledgedListeners, removeRequestAckPredicate, removeStanzaAcknowledgedListener, removeStanzaIdAcknowledgedListener, requestSmAcknowledgement, send, sendSmAcknowledgement, sendStanzaInternal, setBundleandDeferCallback, setDefaultBundleAndDeferCallback, setPreferredResumptionTime, setUseStreamManagement, setUseStreamManagementDefault, setUseStreamManagementResumptiodDefault, setUseStreamManagementResumption, setUseStreamManagementResumptionDefault, setWriter, shutdown, streamWasResumed, throwAlreadyConnectedExceptionIfAppropriate, throwAlreadyLoggedInExceptionIfAppropriate, throwNotConnectedExceptionIfAppropriate
addAsyncStanzaListener, addConnectionListener, addOneTimeSyncCallback, addPacketInterceptor, addPacketListener, addPacketSendingListener, addSyncStanzaListener, asyncGo, bindResourceAndEstablishSession, callConnectionAuthenticatedListener, callConnectionClosedOnErrorListener, callConnectionConnectedListener, createPacketCollector, createPacketCollector, createPacketCollectorAndSend, createPacketCollectorAndSend, disconnect, finalize, firePacketSendingListeners, getConfiguration, getConnectionCounter, getConnectionCreationListeners, getConnectionLock, getFeature, getFromMode, getHost, getLastStanzaReceived, getPacketReplyTimeout, getParsingExceptionCallback, getPort, getSASLAuthentication, getServiceName, getStreamId, getUser, hasFeature, initDebugger, invokePacketCollectorsAndNotifyRecvListeners, isAnonymous, isAuthenticated, isConnected, notifyReconnection, parseAndProcessStanza, parseFeatures, populateHostAddresses, processPacket, registerIQRequestHandler, removeAsyncStanzaListener, removeConnectionListener, removePacketCollector, removePacketInterceptor, removePacketListener, removePacketSendingListener, removeSyncStanzaListener, schedule, sendIqWithResponseCallback, sendIqWithResponseCallback, sendIqWithResponseCallback, sendPacket, sendStanza, sendStanzaWithResponseCallback, sendStanzaWithResponseCallback, sendStanzaWithResponseCallback, setFromMode, setPacketReplyTimeout, setParsingExceptionCallback, setReplyToUnknownIq, setReplyToUnknownIqDefault, setWasAuthenticated, throwNotConnectedExceptionIfAppropriate, 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, org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration config, boolean allowReconnection, long pingInterval)
public JabberConnection(String name, CharSequence jid, String password, boolean allowReconnection, Integer pingInterval)
public static org.jivesoftware.smack.tcp.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 org.jivesoftware.smack.SmackException, IOException, org.jivesoftware.smack.XMPPException
connect
in class org.jivesoftware.smack.AbstractXMPPConnection
org.jivesoftware.smack.SmackException
IOException
org.jivesoftware.smack.XMPPException
protected void connectInternal() throws org.jivesoftware.smack.SmackException, IOException, org.jivesoftware.smack.XMPPException
connectInternal
in class org.jivesoftware.smack.tcp.XMPPTCPConnection
org.jivesoftware.smack.SmackException
IOException
org.jivesoftware.smack.XMPPException
public void login() throws org.jivesoftware.smack.XMPPException, org.jivesoftware.smack.SmackException, IOException
login
in class org.jivesoftware.smack.AbstractXMPPConnection
org.jivesoftware.smack.XMPPException
org.jivesoftware.smack.SmackException
IOException
public void login(CharSequence username, String password) throws org.jivesoftware.smack.XMPPException, org.jivesoftware.smack.SmackException, IOException
login
in class org.jivesoftware.smack.AbstractXMPPConnection
org.jivesoftware.smack.XMPPException
org.jivesoftware.smack.SmackException
IOException
public void login(CharSequence username, String password, String resource) throws org.jivesoftware.smack.XMPPException, org.jivesoftware.smack.SmackException, IOException
login
in class org.jivesoftware.smack.AbstractXMPPConnection
org.jivesoftware.smack.XMPPException
org.jivesoftware.smack.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<org.jivesoftware.smack.roster.RosterEntry> getUsers()
public void sendMessage(String jid, String message) throws org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.SmackException.NotConnectedException
public void sendMessage(String jid, org.jivesoftware.smack.packet.Message message) throws org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.SmackException.NotConnectedException
public void addChatListener(org.jivesoftware.smack.chat.ChatManagerListener listener)
public void disconnect()
disconnect
in class org.jivesoftware.smack.AbstractXMPPConnection
public void instantShutdown()
instantShutdown
in class org.jivesoftware.smack.tcp.XMPPTCPConnection
public void close()
close
in interface AutoCloseable
Copyright © 2020. All rights reserved.