com.amazonaws.mturk.service.axis
Class FilteredAWSService

java.lang.Object
  extended by com.amazonaws.mturk.service.axis.AWSService
      extended by com.amazonaws.mturk.service.axis.FilteredAWSService
Direct Known Subclasses:
RequesterServiceRaw

public abstract class FilteredAWSService
extends AWSService

This maintains the list of Filters which processes operation requests and replies It has methods to add, remove and clear filters. Also handles execution of the filters


Field Summary
 
Fields inherited from class com.amazonaws.mturk.service.axis.AWSService
config, HTTP_HEADER_AMAZON_SOFTWARE, httpHeaders
 
Constructor Summary
FilteredAWSService(ClientConfig config)
           
FilteredAWSService(ClientConfig config, java.util.List<Filter> filterList)
           
 
Method Summary
 void addFilter(Filter filter)
           
 void clearFilters()
          Clears all filters which are removable from the List of Filters
protected  AsyncReply executeAsyncRequest(java.lang.Object request, java.lang.String axisMethodName, java.lang.String resultAccessorName, AsyncCallback callback)
          Enqueues the request in the Axis worker queue for asynchronous sending.
protected  AsyncReply executeAsyncRequests(java.lang.Object requests, java.lang.String axisMethodName, java.lang.String resultAccessorName, AsyncCallback callback)
          Enqueues the request array in the Axis work queue for asynchronous sending.
protected  java.lang.Object executeRequest(java.lang.Object request, java.lang.String axisMethodName, java.lang.String resultAccessorName)
          Sends an AWS request to the service and returns results.
protected  java.lang.Object executeRequest(java.lang.Object request, java.lang.String axisMethodName, java.lang.String resultAccessorName, java.lang.String credential)
          Sends an AWS request to the service and returns results.
protected  java.lang.Object[] executeRequests(java.lang.Object requests, java.lang.String axisMethodName, java.lang.String resultAccessorName)
          Sets the common parameters, sends an array of AWS requests to the service, and returns results.
protected  java.lang.Object[] executeRequests(java.lang.Object requests, java.lang.String axisMethodName, java.lang.String resultAccessorName, java.lang.String credential)
          Sets the common parameters, sends an array of AWS requests to the service, and returns results.
 java.util.List<Filter> getFilterList()
           
 void removeFilter(Filter filter)
           
 
Methods inherited from class com.amazonaws.mturk.service.axis.AWSService
executeRequestMessage, getAWSAccessKeyId, getConfig, getPackagePrefix, getPort, getServiceName, getSigner, setAccessKeyId, setSigner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilteredAWSService

public FilteredAWSService(ClientConfig config,
                          java.util.List<Filter> filterList)
Parameters:
filterList - - List of Filters that should be executed. Also appends the FinalFilter, which makes the wsdl call, to the List

FilteredAWSService

public FilteredAWSService(ClientConfig config)
Method Detail

getFilterList

public java.util.List<Filter> getFilterList()
Returns:
- List of filters

addFilter

public void addFilter(Filter filter)
Parameters:
filter - - Adds the Filter implementaion to head of the List of Filters

removeFilter

public void removeFilter(Filter filter)
Parameters:
filter - - Removes the Filter from List of Filters, if it is remavable and found in the list Throws RuntimeException if filter not found in list or not removable

clearFilters

public void clearFilters()
Clears all filters which are removable from the List of Filters


executeRequest

protected java.lang.Object executeRequest(java.lang.Object request,
                                          java.lang.String axisMethodName,
                                          java.lang.String resultAccessorName)
                                   throws ServiceException
Sends an AWS request to the service and returns results.

Parameters:
request -
axisMethodName -
resultAccessorName -
Returns:
Result
Throws:
ServiceException

executeRequests

protected java.lang.Object[] executeRequests(java.lang.Object requests,
                                             java.lang.String axisMethodName,
                                             java.lang.String resultAccessorName)
                                      throws ServiceException
Sets the common parameters, sends an array of AWS requests to the service, and returns results.

Parameters:
requests -
axisMethodName -
resultAccessorName -
Returns:
Result
Throws:
ServiceException
See Also:
http://docs.amazonwebservices.com/AWSMechanicalTurkRequester/2006-10-31/ApiReference_CommonParametersArticle.html

executeRequest

protected java.lang.Object executeRequest(java.lang.Object request,
                                          java.lang.String axisMethodName,
                                          java.lang.String resultAccessorName,
                                          java.lang.String credential)
                                   throws ServiceException
Sends an AWS request to the service and returns results.

Parameters:
request -
axisMethodName -
resultAccessorName -
credential -
Returns:
Result
Throws:
ServiceException

executeRequests

protected java.lang.Object[] executeRequests(java.lang.Object requests,
                                             java.lang.String axisMethodName,
                                             java.lang.String resultAccessorName,
                                             java.lang.String credential)
Sets the common parameters, sends an array of AWS requests to the service, and returns results.

Parameters:
requests -
axisMethodName -
resultAccessorName -
credential -
Returns:
Result
Throws:
ServiceException
See Also:
http://docs.amazonwebservices.com/AWSMechanicalTurkRequester/2006-10-31/ApiReference_CommonParametersArticle.html

executeAsyncRequest

protected AsyncReply executeAsyncRequest(java.lang.Object request,
                                         java.lang.String axisMethodName,
                                         java.lang.String resultAccessorName,
                                         AsyncCallback callback)
Enqueues the request in the Axis worker queue for asynchronous sending. The result can be obtained through the future contained in the AsyncReply The work queue is using a pool of daemon threads to process the submitted tasks. To guarantee that all work submitted to the queue was processed before the JVM exits, this requires to wait for all future results of the submitted work items. This can conveniently be done using the getResult() method of the AsyncReply object returned by this method. A typical usage pattern would be to first submit all requests to the work queue, store the AsyncReply objects in an array and then call getResult() for each of the objects in the array.

Parameters:
request -
axisMethodName -
resultAccessorName -
callback - Callback interface to invoke when the request has been processed (optional)
Returns:

executeAsyncRequests

protected AsyncReply executeAsyncRequests(java.lang.Object requests,
                                          java.lang.String axisMethodName,
                                          java.lang.String resultAccessorName,
                                          AsyncCallback callback)
Enqueues the request array in the Axis work queue for asynchronous sending. The result can be obtained through the future contained in the AsyncReply The work queue is using a pool of daemon threads to process the submitted tasks. To guarantee that all work submitted to the queue was processed before the JVM exits, this requires to wait for all future results of the submitted work items. This can conveniently be done using the getResult() method of the AsyncReply object returned by this method. A typical usage pattern would be to first submit all requests to the work queue, store the AsyncReply objects in an array and then call getResult() for each of the objects in the array.

Parameters:
requests -
axisMethodName -
resultAccessorName -
callback - Callback interface to invoke when the request has been processed (optional)
Returns: