Package net.rim.blackberry.api.bbm.platform.service

Examples of net.rim.blackberry.api.bbm.platform.service.MessagingService


           
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                public void run() {
                    Object[] args;
                    try {
                        final MessagingService msgService = BBMPlatformNamespace.getInstance().getMessagingService();
                        final BBMPlatformOutgoingJoinRequest request = msgService.sendJoinRequest(hostPIN, hostPPID, cookie);
                        final Object scriptRequest;
                        if(request == null) {
                            scriptRequest = UNDEFINED;
                        } else {
                            scriptRequest = new ScriptableOutgoingJoinRequest(request, onHostAccepted, onHostDeclined);
View Full Code Here


            };
        }
    } // JoinHostFunction
   
    private ScriptableOutgoingJoinRequest[] getOutgoingJoinRequests() {
        final MessagingService msgService = BBMPlatformNamespace.getInstance().getMessagingService();
        final Enumeration reqs = msgService.getOutgoingJoinRequests();
        if(reqs == null) {
            return new ScriptableOutgoingJoinRequest[0];
        } else {
            final Vector vectorReqs = new Vector();
            while(reqs.hasMoreElements()) {
View Full Code Here

        public static final String TYPE_CHANNEL = "channel";
        public static final String TYPE_SESSION = "session";
       
        protected Object execute(Object thiz, Object[] args) throws Exception {
            final String type = (String) args[0];
            final MessagingService msgService = BBMPlatformNamespace.getInstance().getMessagingService();
            if(type.equals(TYPE_CHANNEL)) {
                final ConnectionListenerImpl connListenerImpl = new ConnectionListenerImpl();
                final BBMPlatformChannelListener channelListener = new ChannelListener(connListenerImpl);
               
                final BBMPlatformChannel channel = msgService.createChannel(channelListener);
                ChannelObject connObj = new ChannelObject(channel, true);
                connListenerImpl.setConnectionObject(connObj);
               
                return connObj;
            } else if(type.equals(TYPE_SESSION)) {
                final ConnectionListenerImpl connListenerImpl = new ConnectionListenerImpl();
                final BBMPlatformSessionListener sessionListener = new SessionListener(connListenerImpl);
               
                final BBMPlatformSession session = msgService.createSession(sessionListener);
                SessionObject connObj = new SessionObject(session, true);
                connListenerImpl.setConnectionObject(connObj);
               
                return connObj;
            } else {
View Full Code Here

        protected Object execute(Object thiz, Object[] args) throws Exception {
            final ScriptableFunction onComplete = (ScriptableFunction) args[0];
           
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                public void run() {
                    MessagingService msgService = BBMPlatformNamespace.getInstance().getMessagingService();
                    final int result = msgService.sendDownloadInvitation();
                   
                    Dispatcher.getInstance().dispatch(new DispatchableEvent(null) {
                        protected void dispatch() {
                            // Convert to WW result object
                            final Object resultObj;
View Full Code Here

            final String fileURI =                           (String) args[0];
            final String comment =                           (String) args[1];
            final ScriptableFunction onFailure = (ScriptableFunction) args[2];
           
            final BBMPlatformNamespace bbmpNpsc = BBMPlatformNamespace.getInstance();
            final MessagingService msgService = bbmpNpsc.getMessagingService();
            final MessagingServiceListenerImpl msgServiceListener = bbmpNpsc.getMessagingServiceListener();
           
            if(args.length == 3) {
                msgServiceListener.setOnFileTransferFailed(onFailure);
                msgService.sendFile(fileURI, comment);
            } else if(args.length == 4) {
                BBMPlatformUser scriptContact = ((BBMPlatformUser) args[3]);
                BBMPlatformContact contact = (BBMPlatformContact) scriptContact.getPresence();
               
                msgServiceListener.setOnFileTransferFailed(onFailure);
                msgService.sendFile(contact, fileURI, comment);
            }
           
            return UNDEFINED;
        }
View Full Code Here

                }
            }
           
            // Call API
            final BBMPlatformNamespace bbmpNpsc = BBMPlatformNamespace.getInstance();
            final MessagingService msgService = bbmpNpsc.getMessagingService();
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                public void run() {
                    msgService.shareContent(description, new BBMPlatformData(content), contacts, title);
                    Util.dispatchCallback(onComplete, null);
                }
            });
           
            return UNDEFINED;
View Full Code Here

TOP

Related Classes of net.rim.blackberry.api.bbm.platform.service.MessagingService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.