Design: Limit Response Sizes: Difference between revisions
Line 11: | Line 11: | ||
In the ''libdap:ResponseBuilder'' class in the ''send_data()'' methods check this value against the computed/estimated response size. | In the ''libdap:ResponseBuilder'' class in the ''send_data()'' methods check this value against the computed/estimated response size. | ||
In DDS implement a ''get_estimated_response_size()'' method. When called, evaluated the DDS and return the estimated number of bytes if a response were to be requested with the given constraint (which may be null). Use this method in the ''ResponseBuilder::send_data()'' methods. | In DDS implement a ''get_estimated_response_size()'' method. When called, evaluated the DDS and return the estimated number of bytes if a response were to be requested with the given constraint (which may be null). Use this method in the ''ResponseBuilder::send_data()'' methods. To implement this, use the BaseType::width() method for scalars and vectors (Arrays). | ||
=== If a response is not allowed === | === If a response is not allowed === | ||
Return an Error. ''ResponseBuilder::send_data()'' can throw an exception just as for other errors. | Return an Error. ''ResponseBuilder::send_data()'' can throw an exception just as for other errors. |
Revision as of 20:03, 30 May 2011
Limiting the response sizes for different classes of users will need to be a configuration parameter. This will be set in the OLFS. Users will initially be divided into two groups: authenticated and unauthenticated. Authenticated users will have unlimited access capability while unauthenticated users will only be allowed to transfer up to N bytes of data.
OLFS and BES communication
Use a SetContext element in the GetData request.
libdap implementation
In the class DDS add set_ and get_response_limit() methods. The set-response_limit() method will be called by the BES in the void BESDataResponseHandler::execute( BESDataHandlerInterface &dhi ) or equivalent method.
In the libdap:ResponseBuilder class in the send_data() methods check this value against the computed/estimated response size.
In DDS implement a get_estimated_response_size() method. When called, evaluated the DDS and return the estimated number of bytes if a response were to be requested with the given constraint (which may be null). Use this method in the ResponseBuilder::send_data() methods. To implement this, use the BaseType::width() method for scalars and vectors (Arrays).
If a response is not allowed
Return an Error. ResponseBuilder::send_data() can throw an exception just as for other errors.