Hello,

I have started to develop quota using Listener and Events (following your advice - thank you again), and I would like to be sure that I am on the good way.
I have built a new class that extends the ContentListener class.
I can get parameters of the current request (content length...) and access resources metadata (quota-available-bytes quota-used-bytes).
I override all of the methods of the ContentListener class, except the "retrieve" method (it does not seem to be necessary - not yet).


According to the draft, every resource on the server should contain quota properties.
So, when an event is caught by my Listener, for example in the create method :
1. getting the content lenght of the resource to be created
2. getting the quota properties (quota-available-bytes quota-used-bytes) of the parent node (ie. directory where the resource will be stored)
> if no quota properties are found, quota are supposed to be unlimited (?)
3. if (request_contentLength + quota-used-bytes > quota-available-bytes) throw new VetoException(...quota exceeded...)
4. else updating quota-available-bytes properties (quota-available-bytes = quota-available-bytes + request-contentLength) up to the root node
#Note : it does not seem to be very suitable do to that here, because the current action (create) is not performed yet - How can we do better ?


For the store method, apparently called only when the resource already exists, the calculation at the point 3 is a bit different

I wanted to use the WebDavListener interface but I could not find any way to retrieve request parameters and it looked easier to use a ContentListener (and event).

So can I follow this idea ?

Thank you very much.

Thomas (still a beginner Slide-based product developer but still motivated ! ;-) )

--
BELLEMBOIS Thomas
CRI, Université de Rennes 1
Campus de beaulieu
Avenue du Général Leclerc
35042 RENNES Cedex
Tél.: 02.23.23.69.60
Mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to