You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wink.apache.org by "Tsadok, Shay" <sh...@hp.com> on 2009/11/18 18:45:42 UTC
Writing a user handler
Hi,
I would like to write my own User handler that will be part of the "Request's handlers".
Two questions:
1. What is the best way to integrate this kind of handler to the "default request handlers chain"?
2. In this handler I need access to the requested resource (I'm going to make some validation in my handler for some specific resources). Do you know if I can have this information at the stage that my handler is invoked?
Thanks in advance!
Shay
Re: Writing a user handler
Posted by raghuwarrier <wa...@gmail.com>.
Hi,
Has there been a JIRA raised for making the SearchResult class available as
a documented / supported feature?
The getAttributes method in SearchResult holds important information which
can reused for validation purposes, logging purposes etc.
Is there an alternative to derive the below information from SearchResult:
invocationParameters and
methodRecord.getMetadata().getReflectionMethod()
Thanks.
Regards,
Raghu.
--
View this message in context: http://apache-wink-users.3471013.n2.nabble.com/Writing-a-user-handler-tp4027073p7572763.html
Sent from the Apache Wink Users mailing list archive at Nabble.com.
Re: Writing a user handler
Posted by Bryant Luk <br...@gmail.com>.
Hi,
For your first question, I'm assuming that it's part of the server
side request handler. You should look into subclassing
org.apache.wink.server.handlers.HandlersFactory
(http://hudson.zones.apache.org/hudson/view/Wink/job/Wink-Trunk-JDK1.5-Deploy/javadoc/)
. Specify the name of the subclass as a property in the configuration
properties file
(http://cwiki.apache.org/WINK/51-registration-and-configuration.html)
For the second, you can try getting the matching resources by getting
the UriInfo in the handler via
context.getUriInfo()/context.getAttribute(UriInfo.class). Then
calling some of the UriInfo.getMatchedResources() and other methods.
Also, you could look at the
org.apache.wink.server.internal.handlers.SearchResult. SearchResult
is an internal class which means it may still be subject to change in
future releases but if the information in SearchResult is more useful
to you, please let us know and we can open a JIRA for improvement.
On Wed, Nov 18, 2009 at 11:45 AM, Tsadok, Shay <sh...@hp.com> wrote:
> Hi,
>
>
>
> I would like to write my own User handler that will be part of the
> “Request’s handlers”.
>
>
>
> Two questions:
>
> 1. What is the best way to integrate this kind of handler to the
> “default request handlers chain”?
>
> 2. In this handler I need access to the requested resource (I’m going
> to make some validation in my handler for some specific resources). Do you
> know if I can have this information at the stage that my handler is invoked?
>
>
>
> Thanks in advance!
>
> Shay
>
>