How to configure Guard in restlet and Spring integration env

4 messages Options
Embed this post
Permalink
webpost

How to configure Guard in restlet and Spring integration env

Reply Threaded More More options
Print post
Permalink
Hi,

I am using restlet1.1.5 with Spring, now I had a try with Digest with Guard. I would like do that like:

        <bean id="component" class="org.restlet.ext.spring.SpringComponent">
                <property name="defaultTarget" ref="guard" />
        </bean>
       
        <bean id="guard" class="org.mycompany.myGurad">
                <property name="next" ref="restRoute">
        </bean>
       
        <bean id="restRoute" class="org.restlet.ext.spring.SpringRouter">
                <property name="attachments">
                .....

the problem I am facing is system ask the guard class to have a init method and a empty constructor. but it seems Guard class in restlet doesn't support that.

if what I understood is wrong, what is right?

best regards,

Johnson

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2368640
jlouvel

RE: How to configure Guard in restlet and Spring integration env

Reply Threaded More More options
Print post
Permalink
Hi Johnson,

Your "org.mycompany.myGurad" class could have a default constructor that
would invoke its parent Guard's constructor with the proper parameters. For
the context, just pass the result of the static Context.getCurrent() method.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]]
Envoyé : mardi 7 juillet 2009 06:33
À : [hidden email]
Objet : How to configure Guard in restlet and Spring integration env

Hi,

I am using restlet1.1.5 with Spring, now I had a try with Digest with Guard.
I would like do that like:

        <bean id="component" class="org.restlet.ext.spring.SpringComponent">
                <property name="defaultTarget" ref="guard" />
        </bean>
       
        <bean id="guard" class="org.mycompany.myGurad">
                <property name="next" ref="restRoute">
        </bean>
       
        <bean id="restRoute" class="org.restlet.ext.spring.SpringRouter">
                <property name="attachments">
                .....

the problem I am facing is system ask the guard class to have a init method
and a empty constructor. but it seems Guard class in restlet doesn't support
that.

if what I understood is wrong, what is right?

best regards,

Johnson

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=23686
40

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2368710
webpost

RE: How to configure Guard in restlet and Spring integration env

Reply Threaded More More options
Print post
Permalink
Hi Jerome,

Thanks for your quick response, yes, I can have a default constructor as what you said, but I have to hardcode something like realm, serverKey etc, I can not put them into spring configuration file as properties. that's not what I want to see.

on the other hand, regarding baseUris, if the protection url is http://....../customers/{custId}/orders/{orderId}

then what should be put into baseUrils which type is Collection?

I always feel there is problem in Guard class in the integration between Restlet and Spring. hope i am wrong.

Best Regards,

Johnson

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2369028
Johnson Jiang

RE: How to configure Guard in restlet and Spring integration env

Reply Threaded More More options
Print post
Permalink
In reply to this post by jlouvel
Hi Jerome,

Thanks for your quick reponse

I have reply to the mail list, but I can not access it. so I have to describe my question here again.

yes, I can have a default constructor as what you said. but I have to hardcode something like realm, serverKey etc just because I must invoke another constructor in the default constructor.

i can not put these parameters into spring configuration file. am I right?

another question, if I want to specify some base uris like /customers/{custId}/orders/{orderId} as the protection uris. what should be put into baseUris which type is Collection?

Best Regards,

Johnson


jlouvel wrote:
Hi Johnson,

Your "org.mycompany.myGurad" class could have a default constructor that
would invoke its parent Guard's constructor with the proper parameters. For
the context, just pass the result of the static Context.getCurrent() method.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-----Message d'origine-----
De : webpost@tigris.org [mailto:webpost@tigris.org]
Envoyé : mardi 7 juillet 2009 06:33
À : code@restlet.tigris.org
Objet : How to configure Guard in restlet and Spring integration env

Hi,

I am using restlet1.1.5 with Spring, now I had a try with Digest with Guard.
I would like do that like:

        <bean id="component" class="org.restlet.ext.spring.SpringComponent">
                <property name="defaultTarget" ref="guard" />
        </bean>
       
        <bean id="guard" class="org.mycompany.myGurad">
                <property name="next" ref="restRoute">
        </bean>
       
        <bean id="restRoute" class="org.restlet.ext.spring.SpringRouter">
                <property name="attachments">
                .....

the problem I am facing is system ask the guard class to have a init method
and a empty constructor. but it seems Guard class in restlet doesn't support
that.

if what I understood is wrong, what is right?

best regards,

Johnson

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=23686
40

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2368710