src/com/beem/project/beem/service/XmppFacade.java
author Da Risk <darisk972@gmail.com>
Sat, 04 Apr 2009 19:02:11 +0200
changeset 68 0c76c67a2b99
parent 59 src/com/beem/project/beem/service/XMPPFacade.java@ff98ffba21f4
parent 67 src/com/beem/project/beem/service/XMPPFacade.java@8c3870db8e31
child 72 cdedc3a25d39
permissions -rw-r--r--
Merge avec Nikita
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     1
package com.beem.project.beem.service;
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     2
import android.os.RemoteException;
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     3
57
c91278dda166 La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents: 55
diff changeset
     4
import com.beem.project.beem.service.aidl.IChatManager;
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     5
import com.beem.project.beem.service.aidl.IRoster;
55
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
     6
import com.beem.project.beem.service.aidl.IXmppConnection;
67
8c3870db8e31 Rename some XMPP* classes in Xmpp*
Da Risk <darisk972@gmail.com>
parents: 57
diff changeset
     7
import com.beem.project.beem.service.aidl.IXmppFacade;;
55
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
     8
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     9
/**
55
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    10
 * This class is a facade for the Beem Service.
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    11
 * @author darisk
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    12
 */
67
8c3870db8e31 Rename some XMPP* classes in Xmpp*
Da Risk <darisk972@gmail.com>
parents: 57
diff changeset
    13
public class XmppFacade extends IXmppFacade.Stub {
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    14
67
8c3870db8e31 Rename some XMPP* classes in Xmpp*
Da Risk <darisk972@gmail.com>
parents: 57
diff changeset
    15
    private XmppConnectionAdapter mConnexion;
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    16
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    17
    /**
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    18
     * Constructor for XMPPFacade.
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    19
     * @param connection the connection use by the facade
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    20
     */
67
8c3870db8e31 Rename some XMPP* classes in Xmpp*
Da Risk <darisk972@gmail.com>
parents: 57
diff changeset
    21
    public XmppFacade(final XmppConnectionAdapter connection) {
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    22
	this.mConnexion = connection;
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    23
    }
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    24
55
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    25
    /**
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    26
     * {@inheritDoc}
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    27
     */
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    28
    @Override
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    29
    public void connectAsync() throws RemoteException {
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    30
	mConnexion.connectAsync();
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    31
    }
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    32
55
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    33
    /**
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    34
     * {@inheritDoc}
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    35
     */
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    36
    @Override
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    37
    public void connectSync() throws RemoteException {
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    38
	mConnexion.connectSync();
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    39
    }
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    40
55
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    41
    /**
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    42
     * {@inheritDoc}
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    43
     */
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    44
    @Override
55
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    45
    public IXmppConnection createConnection() throws RemoteException {
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    46
	return mConnexion;
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    47
    }
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    48
55
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    49
    /**
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    50
     * {@inheritDoc}
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    51
     */
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    52
    @Override
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    53
    public void disconnect() throws RemoteException {
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    54
	mConnexion.disconnect();
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    55
    }
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    56
55
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    57
    /**
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    58
     * {@inheritDoc}
66732dd2cb77 Add an interface for sending im message.
Da Risk <darisk972@gmail.com>
parents: 38
diff changeset
    59
     */
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    60
    @Override
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    61
    public IRoster getRoster() throws RemoteException {
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    62
	return mConnexion.getRoster();
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    63
    }
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    64
57
c91278dda166 La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents: 55
diff changeset
    65
    /**
c91278dda166 La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents: 55
diff changeset
    66
     * {@inheritDoc}
c91278dda166 La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents: 55
diff changeset
    67
     */
c91278dda166 La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents: 55
diff changeset
    68
    @Override
c91278dda166 La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents: 55
diff changeset
    69
    public IChatManager getChatManager() throws RemoteException {
c91278dda166 La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents: 55
diff changeset
    70
	return mConnexion.getChatManager();
c91278dda166 La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents: 55
diff changeset
    71
    }
c91278dda166 La facade et la connexion permette de recuperer une instance de ChatManager
Da Risk <darisk972@gmail.com>
parents: 55
diff changeset
    72
38
3e76846c48a9 We can now get the contact list of the user.
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    73
}