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

Examples of net.rim.blackberry.api.bbm.platform.profile.ContactListProvider


        protected Object execute(Object thiz, Object[] args) throws Exception {
            final String invitationMsg = (String) args[0];
           
            long expiryTime;
            String cookie;
            ContactListProvider contactList;
           
            if(args.length == 2) {
                final Scriptable options = (Scriptable) args[1];
               
                Object expiryTimeObj = options.getField(OPTIONS_FIELD_EXPIRY_TIME);
                if(expiryTimeObj.equals(UNDEFINED)) {
                    expiryTime = 0;
                } else {
                    try {
                        expiryTime = Long.parseLong(expiryTimeObj.toString());
                    } catch(Exception e) {
                        expiryTime = 0;
                    }
                }
               
                try {
                    cookie = (String) options.getField(OPTIONS_FIELD_COOKIE);
                } catch(Exception e) {
                    cookie = null;
                }
               
                try {
                    BBMPlatformUser[] contacts = (BBMPlatformUser[]) options.getField(OPTIONS_FIELD_CONTACTS);
                    contactList = new Util.SimpleContactListProvider(contacts);
                } catch(Exception e) {
                    contactList = null;
                }
            } else {
                expiryTime = 0;
                cookie = null;
                contactList = null;
            }
           
            // Validate args
            if(invitationMsg != null && invitationMsg.length() > _connection.getMaxInvitationMessageLength()) {
                throw new IllegalArgumentException("inviteMessage.length > " + _connection.getMaxInvitationMessageLength());
            }
            if(cookie != null && cookie.length() > _connection.getMaxCookieLength()) {
                throw new IllegalArgumentException("cookie.length > " + _connection.getMaxCookieLength());
            }
           
            final String finalCookie = cookie;
            final long finalExpTime = expiryTime;
            final ContactListProvider finalContactList = contactList;

            UiApplication.getUiApplication().invokeLater(new Runnable() {
                public void run() {
                    try {
                        _connection.sendInvitation(invitationMsg, finalCookie, finalExpTime, finalContactList);
View Full Code Here


                groupTypeInt = Util.groupTypeStrToInt((String) type);
            }
           
            // users is optional. default = null
            final Object users = options.getField("users");
            final ContactListProvider userList;
            if(users.equals(UNDEFINED)) {
                userList = null;
            } else {
                BBMPlatformUser[] usersArray = Util.scriptableUsersArrayToUserArray((Scriptable) users);
                userList = new Util.SimpleContactListProvider(usersArray);
View Full Code Here

                throw new IllegalArgumentException("description.length > " + maxDescLength);
            }
           
            // Parse options object for title and contacts
            final String title;
            final ContactListProvider contacts;
            if(options == null || options.equals(UNDEFINED)) {
                title = null;
                contacts = null;
            } else {
                // Title
View Full Code Here

TOP

Related Classes of net.rim.blackberry.api.bbm.platform.profile.ContactListProvider

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.