Design: Limit Response Sizes

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽

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.

If a response is not allowed

Return an Error. ResponseBuilder::send_data() can throw an exception just as for other errors.