/**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "canRead":
                FileDescriptor descriptor0 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           response0   = this.CanRead(descriptor0);
                responseJSON = GetJSONProcessor().SerializeObject(response0);
                break;

            case "canWrite":
                FileDescriptor descriptor1 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           response1   = this.CanWrite(descriptor1);
                responseJSON = GetJSONProcessor().SerializeObject(response1);
                break;

            case "create":
                FileDescriptor      descriptor2 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileResultCallback callback2   = new FileResultCallbackImpl(request.GetAsyncId());
                this.Create(descriptor2, callback2);
                break;

            case "delete":
                FileDescriptor descriptor3 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           cascade3    = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[1]);
                bool           response3   = this.Delete(descriptor3, cascade3);
                responseJSON = GetJSONProcessor().SerializeObject(response3);
                break;

            case "exists":
                FileDescriptor descriptor4 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           response4   = this.Exists(descriptor4);
                responseJSON = GetJSONProcessor().SerializeObject(response4);
                break;

            case "getContent":
                FileDescriptor descriptor5            = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileDataLoadResultCallback callback5 = new FileDataLoadResultCallbackImpl(request.GetAsyncId());
                this.GetContent(descriptor5, callback5);
                break;

            case "getFileStorageType":
                FileDescriptor         descriptor6 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileSystemStorageType response6   = this.GetFileStorageType(descriptor6);
                responseJSON = GetJSONProcessor().SerializeObject(response6);
                break;

            case "getFileType":
                FileDescriptor  descriptor7 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileSystemType response7   = this.GetFileType(descriptor7);
                responseJSON = GetJSONProcessor().SerializeObject(response7);
                break;

            case "getSecurityType":
                FileDescriptor      descriptor8 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileSystemSecurity response8   = this.GetSecurityType(descriptor8);
                responseJSON = GetJSONProcessor().SerializeObject(response8);
                break;

            case "isDirectory":
                FileDescriptor descriptor9 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           response9   = this.IsDirectory(descriptor9);
                responseJSON = GetJSONProcessor().SerializeObject(response9);
                break;

            case "listFiles":
                FileDescriptor          descriptor10 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                IFileListResultCallback callback10   = new FileListResultCallbackImpl(request.GetAsyncId());
                this.ListFiles(descriptor10, callback10);
                break;

            case "listFilesForRegex":
                FileDescriptor          descriptor11 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                string                  regex11      = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                IFileListResultCallback callback11   = new FileListResultCallbackImpl(request.GetAsyncId());
                this.ListFilesForRegex(descriptor11, regex11, callback11);
                break;

            case "mkDir":
                FileDescriptor descriptor12 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                bool           recursive12  = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[1]);
                bool           response12   = this.MkDir(descriptor12, recursive12);
                responseJSON = GetJSONProcessor().SerializeObject(response12);
                break;

            case "move":
                FileDescriptor      source13      = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                FileDescriptor      destination13 = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[1]);
                bool                createPath13  = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[2]);
                bool                overwrite13   = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[3]);
                IFileResultCallback callback13    = new FileResultCallbackImpl(request.GetAsyncId());
                this.Move(source13, destination13, createPath13, overwrite13, callback13);
                break;

            case "setContent":
                FileDescriptor descriptor14             = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                byte[]         content14                = GetJSONProcessor().DeserializeObject <byte[]>(request.GetParameters()[1]);
                IFileDataStoreResultCallback callback14 = new FileDataStoreResultCallbackImpl(request.GetAsyncId());
                this.SetContent(descriptor14, content14, callback14);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "FileBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
Exemple #2
0
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "addButtonListener":
                IButtonListener listener0 = new ButtonListenerImpl(request.GetAsyncId());
                this.AddButtonListener(listener0);
                break;

            case "addDeviceOrientationListener":
                IDeviceOrientationListener listener1 = new DeviceOrientationListenerImpl(request.GetAsyncId());
                this.AddDeviceOrientationListener(listener1);
                break;

            case "getDeviceInfo":
                DeviceInfo response2 = this.GetDeviceInfo();
                if (response2 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response2);
                }
                break;

            case "getLocaleCurrent":
                Locale response3 = this.GetLocaleCurrent();
                if (response3 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response3);
                }
                break;

            case "getOrientationCurrent":
                ICapabilitiesOrientation response4 = this.GetOrientationCurrent();
                responseJSON = GetJSONProcessor().SerializeObject(response4);
                break;

            case "removeButtonListener":
                IButtonListener listener5 = new ButtonListenerImpl(request.GetAsyncId());
                this.RemoveButtonListener(listener5);
                break;

            case "removeButtonListeners":
                this.RemoveButtonListeners();
                break;

            case "removeDeviceOrientationListener":
                IDeviceOrientationListener listener7 = new DeviceOrientationListenerImpl(request.GetAsyncId());
                this.RemoveDeviceOrientationListener(listener7);
                break;

            case "removeDeviceOrientationListeners":
                this.RemoveDeviceOrientationListeners();
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "DeviceBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "createFileDescriptor":
                FileDescriptor parent0   = GetJSONProcessor().DeserializeObject <FileDescriptor>(request.GetParameters()[0]);
                string         name0     = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                FileDescriptor response0 = this.CreateFileDescriptor(parent0, name0);
                if (response0 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response0);
                }
                break;

            case "getApplicationCacheFolder":
                FileDescriptor response1 = this.GetApplicationCacheFolder();
                if (response1 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response1);
                }
                break;

            case "getApplicationCloudFolder":
                FileDescriptor response2 = this.GetApplicationCloudFolder();
                if (response2 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response2);
                }
                break;

            case "getApplicationDocumentsFolder":
                FileDescriptor response3 = this.GetApplicationDocumentsFolder();
                if (response3 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response3);
                }
                break;

            case "getApplicationFolder":
                FileDescriptor response4 = this.GetApplicationFolder();
                if (response4 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response4);
                }
                break;

            case "getApplicationProtectedFolder":
                FileDescriptor response5 = this.GetApplicationProtectedFolder();
                if (response5 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response5);
                }
                break;

            case "getSeparator":
                char response6 = this.GetSeparator();
                responseJSON = GetJSONProcessor().SerializeObject(response6);
                break;

            case "getSystemExternalFolder":
                FileDescriptor response7 = this.GetSystemExternalFolder();
                if (response7 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response7);
                }
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "FileSystemBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "getServiceRequest":
                ServiceToken   serviceToken0 = GetJSONProcessor().DeserializeObject <ServiceToken>(request.GetParameters()[0]);
                ServiceRequest response0     = this.GetServiceRequest(serviceToken0);
                if (response0 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response0);
                }
                break;

            case "getServiceToken":
                string         serviceName1  = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                string         endpointName1 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                string         functionName1 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[2]);
                IServiceMethod method1       = GetJSONProcessor().DeserializeObject <IServiceMethod>(request.GetParameters()[3]);
                ServiceToken   response1     = this.GetServiceToken(serviceName1, endpointName1, functionName1, method1);
                if (response1 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response1);
                }
                break;

            case "getServiceTokenByUri":
                string       uri2      = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                ServiceToken response2 = this.GetServiceTokenByUri(uri2);
                if (response2 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response2);
                }
                break;

            case "getServicesRegistered":
                ServiceToken[] response3 = this.GetServicesRegistered();
                if (response3 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response3);
                }
                break;

            case "invokeService":
                ServiceRequest         serviceRequest4 = GetJSONProcessor().DeserializeObject <ServiceRequest>(request.GetParameters()[0]);
                IServiceResultCallback callback4       = new ServiceResultCallbackImpl(request.GetAsyncId());
                this.InvokeService(serviceRequest4, callback4);
                break;

            case "isServiceRegistered":
                string         serviceName5  = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                string         endpointName5 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                string         functionName5 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[2]);
                IServiceMethod method5       = GetJSONProcessor().DeserializeObject <IServiceMethod>(request.GetParameters()[3]);
                bool           response5     = this.IsServiceRegistered(serviceName5, endpointName5, functionName5, method5);
                responseJSON = GetJSONProcessor().SerializeObject(response5);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "ServiceBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "getOrientationDefault":
                ICapabilitiesOrientation response0 = this.GetOrientationDefault();
                responseJSON = GetJSONProcessor().SerializeObject(response0);
                break;

            case "getOrientationsSupported":
                ICapabilitiesOrientation[] response1 = this.GetOrientationsSupported();
                if (response1 != null)
                {
                    responseJSON = GetJSONProcessor().SerializeObject(response1);
                }
                break;

            case "hasButtonSupport":
                ICapabilitiesButton type2 = GetJSONProcessor().DeserializeObject <ICapabilitiesButton>(request.GetParameters()[0]);
                bool response2            = this.HasButtonSupport(type2);
                responseJSON = GetJSONProcessor().SerializeObject(response2);
                break;

            case "hasCommunicationSupport":
                ICapabilitiesCommunication type3 = GetJSONProcessor().DeserializeObject <ICapabilitiesCommunication>(request.GetParameters()[0]);
                bool response3 = this.HasCommunicationSupport(type3);
                responseJSON = GetJSONProcessor().SerializeObject(response3);
                break;

            case "hasDataSupport":
                ICapabilitiesData type4 = GetJSONProcessor().DeserializeObject <ICapabilitiesData>(request.GetParameters()[0]);
                bool response4          = this.HasDataSupport(type4);
                responseJSON = GetJSONProcessor().SerializeObject(response4);
                break;

            case "hasMediaSupport":
                ICapabilitiesMedia type5 = GetJSONProcessor().DeserializeObject <ICapabilitiesMedia>(request.GetParameters()[0]);
                bool response5           = this.HasMediaSupport(type5);
                responseJSON = GetJSONProcessor().SerializeObject(response5);
                break;

            case "hasNetSupport":
                ICapabilitiesNet type6     = GetJSONProcessor().DeserializeObject <ICapabilitiesNet>(request.GetParameters()[0]);
                bool             response6 = this.HasNetSupport(type6);
                responseJSON = GetJSONProcessor().SerializeObject(response6);
                break;

            case "hasNotificationSupport":
                ICapabilitiesNotification type7 = GetJSONProcessor().DeserializeObject <ICapabilitiesNotification>(request.GetParameters()[0]);
                bool response7 = this.HasNotificationSupport(type7);
                responseJSON = GetJSONProcessor().SerializeObject(response7);
                break;

            case "hasOrientationSupport":
                ICapabilitiesOrientation orientation8 = GetJSONProcessor().DeserializeObject <ICapabilitiesOrientation>(request.GetParameters()[0]);
                bool response8 = this.HasOrientationSupport(orientation8);
                responseJSON = GetJSONProcessor().SerializeObject(response8);
                break;

            case "hasSensorSupport":
                ICapabilitiesSensor type9 = GetJSONProcessor().DeserializeObject <ICapabilitiesSensor>(request.GetParameters()[0]);
                bool response9            = this.HasSensorSupport(type9);
                responseJSON = GetJSONProcessor().SerializeObject(response9);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "CapabilitiesBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "createDatabase":
                Database database0 = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                IDatabaseResultCallback callback0 = new DatabaseResultCallbackImpl(request.GetAsyncId());
                this.CreateDatabase(database0, callback0);
                break;

            case "createTable":
                Database      database1                = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                DatabaseTable databaseTable1           = GetJSONProcessor().DeserializeObject <DatabaseTable>(request.GetParameters()[1]);
                IDatabaseTableResultCallback callback1 = new DatabaseTableResultCallbackImpl(request.GetAsyncId());
                this.CreateTable(database1, databaseTable1, callback1);
                break;

            case "deleteDatabase":
                Database database2 = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                IDatabaseResultCallback callback2 = new DatabaseResultCallbackImpl(request.GetAsyncId());
                this.DeleteDatabase(database2, callback2);
                break;

            case "deleteTable":
                Database      database3                = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                DatabaseTable databaseTable3           = GetJSONProcessor().DeserializeObject <DatabaseTable>(request.GetParameters()[1]);
                IDatabaseTableResultCallback callback3 = new DatabaseTableResultCallbackImpl(request.GetAsyncId());
                this.DeleteTable(database3, databaseTable3, callback3);
                break;

            case "executeSqlStatement":
                Database database4     = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                string   statement4    = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]);
                string[] replacements4 = GetJSONProcessor().DeserializeObject <string[]>(request.GetParameters()[2]);
                IDatabaseTableResultCallback callback4 = new DatabaseTableResultCallbackImpl(request.GetAsyncId());
                this.ExecuteSqlStatement(database4, statement4, replacements4, callback4);
                break;

            case "executeSqlTransactions":
                Database database5     = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                string[] statements5   = GetJSONProcessor().DeserializeObject <string[]>(request.GetParameters()[1]);
                bool     rollbackFlag5 = GetJSONProcessor().DeserializeObject <bool>(request.GetParameters()[2]);
                IDatabaseTableResultCallback callback5 = new DatabaseTableResultCallbackImpl(request.GetAsyncId());
                this.ExecuteSqlTransactions(database5, statements5, rollbackFlag5, callback5);
                break;

            case "existsDatabase":
                Database database6 = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                bool     response6 = this.ExistsDatabase(database6);
                responseJSON = GetJSONProcessor().SerializeObject(response6);
                break;

            case "existsTable":
                Database      database7      = GetJSONProcessor().DeserializeObject <Database>(request.GetParameters()[0]);
                DatabaseTable databaseTable7 = GetJSONProcessor().DeserializeObject <DatabaseTable>(request.GetParameters()[1]);
                bool          response7      = this.ExistsTable(database7, databaseTable7);
                responseJSON = GetJSONProcessor().SerializeObject(response7);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "DatabaseBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }
        /**
         * Invokes the given method specified in the API request object.
         *
         * @param request APIRequest object containing method name and parameters.
         * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions.
         */
        public new APIResponse Invoke(APIRequest request)
        {
            APIResponse response        = new APIResponse();
            int         responseCode    = 200;
            String      responseMessage = "OK";
            String      responseJSON    = "null";

            switch (request.GetMethodName())
            {
            case "getContact":
                ContactUid             contact0  = GetJSONProcessor().DeserializeObject <ContactUid>(request.GetParameters()[0]);
                IContactResultCallback callback0 = new ContactResultCallbackImpl(request.GetAsyncId());
                this.GetContact(contact0, callback0);
                break;

            case "getContactPhoto":
                ContactUid contact1 = GetJSONProcessor().DeserializeObject <ContactUid>(request.GetParameters()[0]);
                IContactPhotoResultCallback callback1 = new ContactPhotoResultCallbackImpl(request.GetAsyncId());
                this.GetContactPhoto(contact1, callback1);
                break;

            case "getContacts":
                IContactResultCallback callback2 = new ContactResultCallbackImpl(request.GetAsyncId());
                this.GetContacts(callback2);
                break;

            case "getContactsForFields":
                IContactResultCallback callback3 = new ContactResultCallbackImpl(request.GetAsyncId());
                IContactFieldGroup[]   fields3   = GetJSONProcessor().DeserializeObject <IContactFieldGroup[]>(request.GetParameters()[1]);
                this.GetContactsForFields(callback3, fields3);
                break;

            case "getContactsWithFilter":
                IContactResultCallback callback4 = new ContactResultCallbackImpl(request.GetAsyncId());
                IContactFieldGroup[]   fields4   = GetJSONProcessor().DeserializeObject <IContactFieldGroup[]>(request.GetParameters()[1]);
                IContactFilter[]       filter4   = GetJSONProcessor().DeserializeObject <IContactFilter[]>(request.GetParameters()[2]);
                this.GetContactsWithFilter(callback4, fields4, filter4);
                break;

            case "searchContacts":
                string term5 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                IContactResultCallback callback5 = new ContactResultCallbackImpl(request.GetAsyncId());
                this.SearchContacts(term5, callback5);
                break;

            case "searchContactsWithFilter":
                string term6 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[0]);
                IContactResultCallback callback6 = new ContactResultCallbackImpl(request.GetAsyncId());
                IContactFilter[]       filter6   = GetJSONProcessor().DeserializeObject <IContactFilter[]>(request.GetParameters()[2]);
                this.SearchContactsWithFilter(term6, callback6, filter6);
                break;

            case "setContactPhoto":
                ContactUid contact7  = GetJSONProcessor().DeserializeObject <ContactUid>(request.GetParameters()[0]);
                byte[]     pngImage7 = GetJSONProcessor().DeserializeObject <byte[]>(request.GetParameters()[1]);
                bool       response7 = this.SetContactPhoto(contact7, pngImage7);
                responseJSON = GetJSONProcessor().SerializeObject(response7);
                break;

            default:
                // 404 - response null.
                responseCode    = 404;
                responseMessage = "ContactBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15.";
                break;
            }
            response.SetResponse(responseJSON);
            response.SetStatusCode(responseCode);
            response.SetStatusMessage(responseMessage);
            return(response);
        }