com.stackmob.core.customcode
Interface CustomCodeMethod


public interface CustomCodeMethod

Defines an interface for a custom method within custom code. An object implementing CustomCodeMethod will provide the functionality necessary to properly respond to API calls.


Method Summary
 ResponseToProcess execute(ProcessedAPIRequest request, SDKServiceProvider serviceProvider)
          Generates a response for the given API request.
 String getMethodName()
          Gets the name of the custom method.
 List<String> getParams()
          Gets the list of query parameters for this custom method.
 

Method Detail

getMethodName

String getMethodName()
Gets the name of the custom method. This is required to correctly route API calls to this CustomCodeMethod.

Returns:
the name to which the custom method responds in the API

getParams

List<String> getParams()
Gets the list of query parameters for this custom method. This is required if the CustomCodeMethod uses query parameters.

Returns:
the list of valid query parameters used by this custom method

execute

ResponseToProcess execute(ProcessedAPIRequest request,
                          SDKServiceProvider serviceProvider)
Generates a response for the given API request.

Parameters:
request - represents the request sent to the API
serviceProvider - the service provider that exposes access to StackMob services
Returns:
the response containing a proper HTTP response code and JSON content


Copyright © 2012 StackMob. All Rights Reserved.