com.beem.project.beem.service
Class ChatAdapter

Package class diagram package ChatAdapter
java.lang.Object
  extended by android.os.Binder
      extended by com.beem.project.beem.service.aidl.IChat.Stub
          extended by com.beem.project.beem.service.ChatAdapter
All Implemented Interfaces:
IBinder, IInterface, IChat

public class ChatAdapter
extends IChat.Stub

An adapter for smack's Chat class.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.beem.project.beem.service.aidl.IChat
IChat.Stub
 
Nested classes/interfaces inherited from interface android.os.IBinder
IBinder.DeathRecipient
 
Field Summary
 
Fields inherited from interface android.os.IBinder
DUMP_TRANSACTION, FIRST_CALL_TRANSACTION, FLAG_ONEWAY, INTERFACE_TRANSACTION, LAST_CALL_TRANSACTION, PING_TRANSACTION
 
Constructor Summary
ChatAdapter(Chat chat)
          Constructor.
 
Method Summary
 void addMessageListener(IMessageListener listen)
          Add a message listener.
 void endOtrSession()
          Stop the OTR session.
 String getAccountUser()
          get Account user name.
 Chat getAdaptee()
          Get the adaptee for the Chat.
 boolean getHistory()
          get History state.
 File getHistoryPath()
          get History path.
 String getLocalOtrFingerprint()
          get local OTR key fingerprints.
 List<Message> getMessages()
          
 String getOtrStatus()
          get current OTR status.
 Contact getParticipant()
          Get the participant of the chat
 String getRemoteOtrFingerprint()
          get remote OTR key fingerprints.
 String getState()
          
 void injectMessage(String msg)
          send message.
 boolean isOpen()
          
 void listenOtrSession()
           
 boolean localEndOtrSession()
          end an Otr session.
 void otrStateChanged(String otrState)
          This method is executed when the otr session status change.
 void removeMessageListener(IMessageListener listen)
          Remove a message listener.
 void saveHistory(Message msg, String contactName)
          Save message in SDCard.
 void sendMessage(Message message)
          Send a message.
 void setAccountUser(String accountUser)
          Set Account user name.
 void setHistory(boolean isHisory)
          set History enable/disable.
 void setHistoryPath(File historyPath)
          set History path.
 void setOpen(boolean isOpen)
          
 void setState(String state)
          
 void startOtrSession()
          Try to start an OTR session.
 void verifyRemoteFingerprint(boolean ok)
           
 
Methods inherited from class com.beem.project.beem.service.aidl.IChat.Stub
asBinder, asInterface, onTransact
 
Methods inherited from class android.os.Binder
attachInterface, clearCallingIdentity, dump, dump, finalize, flushPendingCommands, getCallingPid, getCallingUid, getInterfaceDescriptor, isBinderAlive, joinThreadPool, linkToDeath, pingBinder, queryLocalInterface, restoreCallingIdentity, transact, unlinkToDeath
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatAdapter

public ChatAdapter(Chat chat)
Constructor.

Parameters:
chat - The chat to adapt
Method Detail

getParticipant

public Contact getParticipant()
                       throws RemoteException
Get the participant of the chat

Returns:
the participant
Throws:
RemoteException

sendMessage

public void sendMessage(Message message)
                 throws RemoteException
Send a message.

Parameters:
message - the message to send
Throws:
RemoteException

injectMessage

public void injectMessage(String msg)
send message.

Parameters:
msg - to send.

addMessageListener

public void addMessageListener(IMessageListener listen)
Add a message listener.

Parameters:
listen - the listener to add.

removeMessageListener

public void removeMessageListener(IMessageListener listen)
Remove a message listener.

Parameters:
listen - the listener to remove.

getState

public String getState()
                throws RemoteException

Throws:
RemoteException

setState

public void setState(String state)
              throws RemoteException

Throws:
RemoteException

getAdaptee

public Chat getAdaptee()
Get the adaptee for the Chat.

Returns:
The real chat object

setOpen

public void setOpen(boolean isOpen)


isOpen

public boolean isOpen()


getMessages

public List<Message> getMessages()
                          throws RemoteException

Throws:
RemoteException

saveHistory

public void saveHistory(Message msg,
                        String contactName)
Save message in SDCard.

Parameters:
msg - the message receive
contactName - the name of the contact

setHistory

public void setHistory(boolean isHisory)
set History enable/disable.

Parameters:
isHisory - history state

getHistory

public boolean getHistory()
get History state.

Returns:
mIsHistory

setAccountUser

public void setAccountUser(String accountUser)
Set Account user name.

Parameters:
accountUser - user name

getAccountUser

public String getAccountUser()
get Account user name.

Returns:
mAccountUser

setHistoryPath

public void setHistoryPath(File historyPath)
set History path.

Parameters:
historyPath - history path

getHistoryPath

public File getHistoryPath()
get History path.

Returns:
mHistoryPath;

otrStateChanged

public void otrStateChanged(String otrState)
This method is executed when the otr session status change.

Parameters:
otrState - the new state of otr session.

startOtrSession

public void startOtrSession()
                     throws RemoteException
Description copied from interface: IChat
Try to start an OTR session.

Throws:
RemoteException

endOtrSession

public void endOtrSession()
                   throws RemoteException
Description copied from interface: IChat
Stop the OTR session.

Throws:
RemoteException

localEndOtrSession

public boolean localEndOtrSession()
                           throws OtrException
end an Otr session.

Returns:
false if something bad happened.
Throws:
OtrException - an exception from otr

listenOtrSession

public void listenOtrSession()

getLocalOtrFingerprint

public String getLocalOtrFingerprint()
                              throws RemoteException
Description copied from interface: IChat
get local OTR key fingerprints.

Throws:
RemoteException

getRemoteOtrFingerprint

public String getRemoteOtrFingerprint()
                               throws RemoteException
Description copied from interface: IChat
get remote OTR key fingerprints.

Throws:
RemoteException

verifyRemoteFingerprint

public void verifyRemoteFingerprint(boolean ok)

getOtrStatus

public String getOtrStatus()
                    throws RemoteException
Description copied from interface: IChat
get current OTR status.

Throws:
RemoteException


Copyright © 2009 Beem-project.com. All Rights Reserved.