de.unibi.airobots.resaidroid.services
Class XmppConnection

java.lang.Object
  extended by de.unibi.airobots.resaidroid.services.XmppConnection

public class XmppConnection
extends java.lang.Object


Constructor Summary
XmppConnection()
           
 
Method Summary
static void addListener(org.jivesoftware.smack.PacketListener packetListener, org.jivesoftware.smack.filter.PacketFilter packetFilter)
          Add a new listener to connection using given filter.
static void connect(java.lang.String _server, int _port)
          Connects to given XMPP Server.
static void disconnect()
          Disconnect from XMPP Server.
static long getBeaconDuration()
           
static long getClientTime()
           
static long getServerTime()
           
static long getStartTime()
           
static long getTimeDiff()
           
static Activity getUsingActivity()
           
static boolean isConnected()
          Check if connection is connected.
static boolean isConnectedToReSAI()
           
static boolean isLoggedIn()
          Check if account is authenticated.
static void login(java.lang.String _account, java.lang.String _password)
          Login to given account on XMPP Connection.
static void removeListener(org.jivesoftware.smack.PacketListener packetListener)
          Remove given listener from connection.
static void sendMessage(org.jivesoftware.smack.packet.Message _mout)
          Send a message over XMPP connection.
static void setBeaconDuration(long beaconDuration)
           
static void setClientTime(long clientTime)
           
static void setConnectedToReSAI(boolean connectedToReSAI)
           
static void setServerTime(long serverTime)
           
static void setStartTime(long startTime)
           
static void setTimeDiff(long timeDiff)
           
static void setUsingActivity(Activity usingActivity)
           
static void startBeacon()
          Start beacon to show ReSAI that connection is alive.
static void stopBeacon()
          Stop beacon.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmppConnection

public XmppConnection()
Method Detail

startBeacon

public static void startBeacon()
Start beacon to show ReSAI that connection is alive.


stopBeacon

public static void stopBeacon()
Stop beacon. ReSAI will now kick the connection after serveral seconds.


connect

public static void connect(java.lang.String _server,
                           int _port)
                    throws org.jivesoftware.smack.XMPPException
Connects to given XMPP Server.

Parameters:
_server -
_port -
Throws:
org.jivesoftware.smack.XMPPException

login

public static void login(java.lang.String _account,
                         java.lang.String _password)
                  throws org.jivesoftware.smack.XMPPException
Login to given account on XMPP Connection.

Parameters:
_account -
_password -
Throws:
org.jivesoftware.smack.XMPPException

disconnect

public static void disconnect()
                       throws org.jivesoftware.smack.XMPPException
Disconnect from XMPP Server.

Throws:
org.jivesoftware.smack.XMPPException

sendMessage

public static void sendMessage(org.jivesoftware.smack.packet.Message _mout)
Send a message over XMPP connection.


addListener

public static void addListener(org.jivesoftware.smack.PacketListener packetListener,
                               org.jivesoftware.smack.filter.PacketFilter packetFilter)
Add a new listener to connection using given filter.

Parameters:
packetListener -
packetFilter -

removeListener

public static void removeListener(org.jivesoftware.smack.PacketListener packetListener)
Remove given listener from connection.

Parameters:
packetListener -

isConnected

public static boolean isConnected()
Check if connection is connected.

Returns:
true if connected

isLoggedIn

public static boolean isLoggedIn()
Check if account is authenticated.

Returns:
true if authenticated

setStartTime

public static void setStartTime(long startTime)

getStartTime

public static long getStartTime()

setTimeDiff

public static void setTimeDiff(long timeDiff)

getTimeDiff

public static long getTimeDiff()

setServerTime

public static void setServerTime(long serverTime)

getServerTime

public static long getServerTime()

setClientTime

public static void setClientTime(long clientTime)

getClientTime

public static long getClientTime()

setBeaconDuration

public static void setBeaconDuration(long beaconDuration)

getBeaconDuration

public static long getBeaconDuration()

isConnectedToReSAI

public static boolean isConnectedToReSAI()

setConnectedToReSAI

public static void setConnectedToReSAI(boolean connectedToReSAI)

getUsingActivity

public static Activity getUsingActivity()

setUsingActivity

public static void setUsingActivity(Activity usingActivity)