Hi Malaka,

We do not have added this feature in the 4.9.0 release. But we have added
this feature for the new release onward.

Thanks.

*Nadeeshaan Gunasinghe*
Software Engineer, WSO2 Inc. http://wso2.com
+94770596754 | [email protected] | Skype: nadeeshaan.gunasinghe <#>
<http://www.facebook.com/nadeeshaan.gunasinghe>
<http://lk.linkedin.com/in/nadeeshaan>  <http://twitter.com/Nadeeshaan>
<http://nadeeshaan.blogspot.com/>
Get a signature like this: Click here!
<http://ws-promos.appspot.com/r?rdata=eyJydXJsIjogImh0dHA6Ly93d3cud2lzZXN0YW1wLmNvbS9lbWFpbC1pbnN0YWxsP3dzX25jaWQ9NjcyMjk0MDA4JnV0bV9zb3VyY2U9ZXh0ZW5zaW9uJnV0bV9tZWRpdW09ZW1haWwmdXRtX2NhbXBhaWduPXByb21vXzU3MzI1Njg1NDg3Njk3OTIiLCAiZSI6ICI1NzMyNTY4NTQ4NzY5NzkyIn0=&ws_random_number=>

On Thu, Sep 3, 2015 at 12:50 PM, Malaka Silva <[email protected]> wrote:

> Hi Nadeeshaan,
>
> I think we have provided this feature in esb 490.
>
> Can you please send more details on this?
>
> On Thu, Sep 3, 2015 at 9:29 AM, Asitha Nanayakkara <[email protected]>
> wrote:
>
>> Hi Palamayuran,
>>
>> You can either write a class mediator[1] to do this or use the script
>> mediator[2],
>>
>> Java code for saving and retrieving a String to/from registry is as
>> follows
>>
>> Writing to registry
>>
>> String resourcePath = "conf/wsdl/myWSDL";
>>> mc.getConfiguration().getRegistry().newResource(resourcePath, false);
>>> mc.getConfiguration().getRegistry().updateResource(resourcePath,
>>> mc.getProperty("MyProperty").toString().getBytes());
>>
>>
>> Reading from registry
>>
>> Object resourceObj = mc.getConfiguration().getRegistry().getResource(new
>>> Entry(resourcePath), new Properties());
>>> if(resourceObj != null) {
>>>     mc.setProperty("MyProperty", ((OMTextImpl) resourceObj).getText());
>>> }
>>
>>
>> You can use something similar to following in Script mediator
>>
>> <script language="js"><![CDATA[
>>>     importPackage(Packages.org.apache.synapse.config);
>>>     mc.getConfiguration().getRegistry().newResource("conf/wsdl/myWSDL
>>> ",false);
>>>     mc.getConfiguration().getRegistry().updateResource("conf/wsdl/myWSDL
>>> ", mc.getProperty("MyProperty").toString());
>>> ]]></script>
>>
>>
>> As far as I know writing to registry using the property mediators
>> registry scope is supported from ESB 4.9.0.
>>
>> Hope this serves your purpose.
>>
>> [1] https://docs.wso2.com/display/ESB481/Class+Mediator
>> [2] https://docs.wso2.com/display/ESB481/Script+Mediator
>>
>> Regards,
>> Asitha
>>
>> On Wed, Sep 2, 2015 at 9:37 PM, Palamayuran <[email protected]>
>> wrote:
>>
>>> *Hi Guys,*
>>>
>>> I'm trying to develop a component that implements OAuth flow to
>>> supplement
>>> connectors that use the OAuth 2.0 for authentication.
>>>
>>> In order to accomplish the task I have a requirement where I have to
>>> persist
>>> certain API specific values (access token, refresh token etc) in the WSO2
>>> ESB registry so that any subsequent calls can access them. Also when any
>>> of
>>> them expires/changes they have to be updated appropriately using synapse
>>> code.
>>>
>>> Can someone please point out to me how to persist parameters (key/value
>>> pairs) onto the WSO2 registry using synapse mediators to achieve the
>>> above.
>>>
>>> *Thanks in Advance,*
>>> Palamayuran
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://wso2-oxygen-tank.10903.n7.nabble.com/OAuth-Flow-Persisting-configuration-parameters-in-WSO2-ESB-Registry-and-reading-writing-their-valuese-tp124630.html
>>> Sent from the WSO2 Development mailing list archive at Nabble.com.
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>
>>
>>
>> --
>> *Asitha Nanayakkara*
>> Software Engineer
>> WSO2, Inc. http://wso2.com/
>> Mob: + 94 77 85 30 682
>>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
> Best Regards,
>
> Malaka Silva
> Senior Tech Lead
> M: +94 777 219 791
> Tel : 94 11 214 5345
> Fax :94 11 2145300
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> http://www.wso2.com/
> http://www.wso2.com/about/team/malaka-silva/
> <http://wso2.com/about/team/malaka-silva/>
>
> Save a tree -Conserve nature & Save the world for your future. Print this
> email only if it is absolutely necessary.
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to