Re: [Dev] New device type for IOTS ( Laptop agent )

2017-07-05 Thread Waruna Jayaweera
Hi Lahiru,

Few Suggestions. You can also add alerts mechanism like [1] based on
analysed data. As an example if laptop cpu utilization is more than 90%
then send email to operation user.

As others said you can reuse most of existing components for dashboard and
analysis. Your sample use cases are applied for any device types as we can
use same way to do predicative maintenance in iot devices. If we have new
device type , send some attributes to server and take some decisions. So
you can come up with documentation as if as how we can reuse those
components to support similar use cases in any device type/agent.

[1]https://docs.wso2.com/display/DAS310/Creating+Alerts

Thanks,
Waruna



On Thu, Jul 6, 2017 at 11:04 AM, Lahiru Madushanka 
wrote:

> Hi Harshan,
>
> Sorry for the unclarity of my initial statement. This is a continuation of
> "Laptop" device type developed by Thisari.
> Yeah the process is same as you explained.
>
> Thanks
>
> On Thu, Jul 6, 2017 at 10:16 AM, Harshan Liyanage 
> wrote:
>
>> Hi Lahiru,
>>
>> Could you please clarify why we need a new device-type in this scenario?
>> It looks like a feature on-top of "PC" or "Laptop" device-type.
>> Analytics/ML part can be separated from the device-type. What we need to do
>> is to just get the required data like RAM, CPU, HDD usage etc from that
>> particular device type and push them into DAS. This is somewhat similar to
>> what we are currently doing with the Android device-type. I'm wondering why
>> we can't use the same approach here.
>>
>> Thanks,
>>
>> Harshan Liyanage
>> EMM/IoT TG
>> Mobile: *+94765672894*
>> Email: hars...@wso2.com
>> Blog : http://harshanliyanage.blogspot.com/
>> *WSO2, Inc. :** wso2.com *
>> lean.enterprise.middleware.
>>
>> On Wed, Jul 5, 2017 at 10:57 PM, Pasindu Jayaweera 
>> wrote:
>>
>>> Hi Lahiru,
>>> Q.) Other than pushing data from the laptop, will there be any
>>> operations or policies than can be applied from the server-side?
>>>
>>> Q) What could be the agent's behavior;
>>>
>>> a.) when the laptop is out of the network?
>>>
>>> b.) when the laptop has multiple operating systems?
>>>
>>>
>>> When designing analytics views and creating ML plans, I would like to
>>> suggest to make them in such a way that those units can be plugged not only
>>> with the laptops, but also with any device type that provide the same stats
>>> that you are planning to get from the laptops at this moment. Because the
>>> stats like RAM, CPU utilization can be fetched from most of the other
>>> devices as well.  So that upon the use case, those device types can reuse
>>> the same unit in future. WDYT?
>>>
>>> Thanks.
>>>
>>> On Wed, Jul 5, 2017 at 8:19 PM, Lahiru Madushanka 
>>> wrote:
>>>

 Hi all,

 Currently I am working on a new device type for IOTS which can collect
 stats from Laptops and use them for analytics and decision making process.
 This is achieved by an agent running on PC which pushes collected stats to
 the IOTS in given time intervals.

 Sample use case 1 :- Average ram / CPU utilization of team X can be use
 as a measurement when buying new PCs for team X.

 Sample use case 2 :- Prediction of average memory requirement of team X
 for next year

 Development Phases

 Phase 1
 Developing the initial agent which runs on PC and publish statistics to
 the IoTS through the MB.
 Creating event receivers / publishers and execution plans in DAS to
 handle data.
 Creating initial analytics and real time analytics views for a single
 device

 Phase 1 was already done by Thisari Patabendi.

 Phase 2
 Adding "Device profiles" to the device database.
 Data purging and summarization
 Implementing group analytics view for roles "team lead" and "infra
 level user".

 Phase 3
 Collect data by running agent on several test machines.
 Applying analytics on collected data and create ML plan.
 Creating analytic result dashboards

 Suggestions are highly appreciated.

 Thanks.




 --
 You received this message because you are subscribed to the Google
 Groups "WSO2 IoT Team Group" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to iot-group+unsubscr...@wso2.com.
 For more options, visit https://groups.google.com/a/wso2.com/d/optout.

>>>
>>>
>>>
>>> --
>>> *Pasindu Jayaweera*
>>> Software Engineer | WSO2 Inc
>>> Mobile: +94 718187375 <+94%2071%20818%207375>
>>> Blog: blog.pasindujayaweera.com
>>> 
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "WSO2 IoT Team Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to iot-group+unsubscr...@wso2.com.
>>> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>>>
>>
>>
> --
> You received this me

[Dev] [IS] Different logs for the account lock.

2017-07-05 Thread Menaka Jayawardena
Hi,

In IS 5.3.0, we can enable account lock in two methods.
1. The file based method, which applies the configuration globally for all
the tenants.
2. Enable through the management console.

But, the logs in those two cases are looks different.

When IS is configured using the method 1, the logs are as follows.
[2017-07-06 11:31:23,634]  WARN
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  Failed
Administrator login attempt 'menaka[-1234]' at [2017-07-06
11:31:23,634+0530]
[2017-07-06 11:31:30,817]  INFO
{org.wso2.carbon.identity.mgt.IdentityMgtEventListener} -  User, menaka has
exceed the max failed login attempts. User account would be locked
[2017-07-06 11:31:30,839]  WARN
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  Failed
Administrator login attempt 'menaka[-1234]' at [2017-07-06
11:31:30,839+0530]
[2017-07-06 11:31:36,746]  WARN
{org.wso2.carbon.identity.mgt.IdentityMgtEventListener} -  User account is
locked for user : menaka. cannot login until the account is unlocked
[2017-07-06 11:31:36,747] ERROR
{org.wso2.carbon.core.services.authentication.AuthenticationAdmin} -
 System error while Authenticating/Authorizing User : 17003 User account is
locked for user : menaka. cannot login until the account is unlocked
[2017-07-06 11:31:56,780]  WARN
{org.wso2.carbon.identity.mgt.IdentityMgtEventListener} -  User account is
locked for user : menaka. cannot login until the account is unlocked
[2017-07-06 11:31:56,785] ERROR
{org.wso2.carbon.core.services.authentication.AuthenticationAdmin} -
 System error while Authenticating/Authorizing User : 17003 User account is
locked for user : menaka. cannot login until the account is unlocked

This clearly says that the number of login attempts has exceeded and the
account is locked.

But, when configured from the Management Console, the logs do not say
anything about locked account.

[2017-07-06 11:25:23,395]  WARN
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  Failed
Administrator login attempt 'menaka[-1234]' at [2017-07-06
11:25:23,395+0530]
[2017-07-06 11:25:34,532]  WARN
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  Failed
Administrator login attempt 'menaka[-1234]' at [2017-07-06
11:25:34,532+0530]
[2017-07-06 11:25:45,019]  WARN
{org.wso2.carbon.identity.handler.event.account.lock.AccountLockHandler} -
 Error occurred while calling triggerNotification, detail : Email
notification sending failed. Sending email address is not configured for
the user.
[2017-07-06 11:25:45,021]  WARN
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  Failed
Administrator login attempt 'menaka[-1234]' at [2017-07-06
11:25:45,021+0530]
[2017-07-06 11:26:08,792] ERROR
{org.wso2.carbon.core.services.authentication.AuthenticationAdmin} -
 System error while Authenticating/Authorizing User : Error when handling
event : PRE_AUTHENTICATION

Can we use the same log for both the scenarios or more specific logs for
the second one?

Thanks and Regards,
Menaka

-- 
*Menaka Jayawardena*
*Software Engineer - WSO2 Inc*
*Tel : 071 350 5470*
*LinkedIn: https://lk.linkedin.com/in/menakajayawardena
*
*Blog: https://menakamadushanka.wordpress.com/
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] New device type for IOTS ( Laptop agent )

2017-07-05 Thread Lahiru Madushanka
Hi Harshan,

Sorry for the unclarity of my initial statement. This is a continuation of
"Laptop" device type developed by Thisari.
Yeah the process is same as you explained.

Thanks

On Thu, Jul 6, 2017 at 10:16 AM, Harshan Liyanage  wrote:

> Hi Lahiru,
>
> Could you please clarify why we need a new device-type in this scenario?
> It looks like a feature on-top of "PC" or "Laptop" device-type.
> Analytics/ML part can be separated from the device-type. What we need to do
> is to just get the required data like RAM, CPU, HDD usage etc from that
> particular device type and push them into DAS. This is somewhat similar to
> what we are currently doing with the Android device-type. I'm wondering why
> we can't use the same approach here.
>
> Thanks,
>
> Harshan Liyanage
> EMM/IoT TG
> Mobile: *+94765672894*
> Email: hars...@wso2.com
> Blog : http://harshanliyanage.blogspot.com/
> *WSO2, Inc. :** wso2.com *
> lean.enterprise.middleware.
>
> On Wed, Jul 5, 2017 at 10:57 PM, Pasindu Jayaweera 
> wrote:
>
>> Hi Lahiru,
>> Q.) Other than pushing data from the laptop, will there be any operations
>> or policies than can be applied from the server-side?
>>
>> Q) What could be the agent's behavior;
>>
>> a.) when the laptop is out of the network?
>>
>> b.) when the laptop has multiple operating systems?
>>
>>
>> When designing analytics views and creating ML plans, I would like to
>> suggest to make them in such a way that those units can be plugged not only
>> with the laptops, but also with any device type that provide the same stats
>> that you are planning to get from the laptops at this moment. Because the
>> stats like RAM, CPU utilization can be fetched from most of the other
>> devices as well.  So that upon the use case, those device types can reuse
>> the same unit in future. WDYT?
>>
>> Thanks.
>>
>> On Wed, Jul 5, 2017 at 8:19 PM, Lahiru Madushanka 
>> wrote:
>>
>>>
>>> Hi all,
>>>
>>> Currently I am working on a new device type for IOTS which can collect
>>> stats from Laptops and use them for analytics and decision making process.
>>> This is achieved by an agent running on PC which pushes collected stats to
>>> the IOTS in given time intervals.
>>>
>>> Sample use case 1 :- Average ram / CPU utilization of team X can be use
>>> as a measurement when buying new PCs for team X.
>>>
>>> Sample use case 2 :- Prediction of average memory requirement of team X
>>> for next year
>>>
>>> Development Phases
>>>
>>> Phase 1
>>> Developing the initial agent which runs on PC and publish statistics to
>>> the IoTS through the MB.
>>> Creating event receivers / publishers and execution plans in DAS to
>>> handle data.
>>> Creating initial analytics and real time analytics views for a single
>>> device
>>>
>>> Phase 1 was already done by Thisari Patabendi.
>>>
>>> Phase 2
>>> Adding "Device profiles" to the device database.
>>> Data purging and summarization
>>> Implementing group analytics view for roles "team lead" and "infra level
>>> user".
>>>
>>> Phase 3
>>> Collect data by running agent on several test machines.
>>> Applying analytics on collected data and create ML plan.
>>> Creating analytic result dashboards
>>>
>>> Suggestions are highly appreciated.
>>>
>>> Thanks.
>>>
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "WSO2 IoT Team Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to iot-group+unsubscr...@wso2.com.
>>> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>>>
>>
>>
>>
>> --
>> *Pasindu Jayaweera*
>> Software Engineer | WSO2 Inc
>> Mobile: +94 718187375 <+94%2071%20818%207375>
>> Blog: blog.pasindujayaweera.com
>> 
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "WSO2 IoT Team Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to iot-group+unsubscr...@wso2.com.
>> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>>
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] New device type for IOTS ( Laptop agent )

2017-07-05 Thread Lahiru Madushanka
Hi Pasidu,

Q1) We are planning to apply policies like restricting the removal of agent
from the laptop. However these capabilities will be saved for another phase
after the core functionalities are done. I will update this thread once we
start those implementations.

Q2) a) We can save data in the client side until the connection established
again. However exact implementation will change with the data purging plain
in DAS.
   b) This will depend on the use case. If infra team installing OS
behalf of the users they can install agent in all operating systems. If
users are allowed the change / add operating systems they have to install
agent by them-self. We will have a unified agent for all 3 operating
systems.

Yeah, that's possible. For this device type also we can reuse some units
from Android Sense dashboard.

Thank you very much for for pointing out these information.

On Wed, Jul 5, 2017 at 10:57 PM, Pasindu Jayaweera 
wrote:

> Hi Lahiru,
> Q.) Other than pushing data from the laptop, will there be any operations
> or policies than can be applied from the server-side?
>
> Q) What could be the agent's behavior;
>
> a.) when the laptop is out of the network?
>
> b.) when the laptop has multiple operating systems?
>
>
> When designing analytics views and creating ML plans, I would like to
> suggest to make them in such a way that those units can be plugged not only
> with the laptops, but also with any device type that provide the same stats
> that you are planning to get from the laptops at this moment. Because the
> stats like RAM, CPU utilization can be fetched from most of the other
> devices as well.  So that upon the use case, those device types can reuse
> the same unit in future. WDYT?
>
> Thanks.
>
> On Wed, Jul 5, 2017 at 8:19 PM, Lahiru Madushanka 
> wrote:
>
>>
>> Hi all,
>>
>> Currently I am working on a new device type for IOTS which can collect
>> stats from Laptops and use them for analytics and decision making process.
>> This is achieved by an agent running on PC which pushes collected stats to
>> the IOTS in given time intervals.
>>
>> Sample use case 1 :- Average ram / CPU utilization of team X can be use
>> as a measurement when buying new PCs for team X.
>>
>> Sample use case 2 :- Prediction of average memory requirement of team X
>> for next year
>>
>> Development Phases
>>
>> Phase 1
>> Developing the initial agent which runs on PC and publish statistics to
>> the IoTS through the MB.
>> Creating event receivers / publishers and execution plans in DAS to
>> handle data.
>> Creating initial analytics and real time analytics views for a single
>> device
>>
>> Phase 1 was already done by Thisari Patabendi.
>>
>> Phase 2
>> Adding "Device profiles" to the device database.
>> Data purging and summarization
>> Implementing group analytics view for roles "team lead" and "infra level
>> user".
>>
>> Phase 3
>> Collect data by running agent on several test machines.
>> Applying analytics on collected data and create ML plan.
>> Creating analytic result dashboards
>>
>> Suggestions are highly appreciated.
>>
>> Thanks.
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "WSO2 IoT Team Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to iot-group+unsubscr...@wso2.com.
>> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>>
>
>
>
> --
> *Pasindu Jayaweera*
> Software Engineer | WSO2 Inc
> Mobile: +94 718187375 <+94%2071%20818%207375>
> Blog: blog.pasindujayaweera.com
> 
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [Config Provider Non-OSGI Mode] Make secure-vault related configuration files optional when using Config Provider

2017-07-05 Thread Mohanadarshan Vivekanandalingam
Hi Team,

At the moment, we have to add secure vault related configuration files
(around 3-4 files) when using Config Provider in non-osgi mode even though
I don't want secure vault (and only need config-provide features). Can we
make these files mandatory only when secure vault is enabled. Can we
consider fixing this for next release of Carbon-Config ?

I have created an issue in [1].

[1] https://github.com/wso2/carbon-config/issues/40

Thanks,
Mohan

-- 
*V. Mohanadarshan*
*Associate Tech Lead,*
*Data Technologies Team,*
*WSO2, Inc. http://wso2.com  *
*lean.enterprise.middleware.*

email: mo...@wso2.com
phone:(+94) 771117673
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] New device type for IOTS ( Laptop agent )

2017-07-05 Thread Harshan Liyanage
Hi Lahiru,

Could you please clarify why we need a new device-type in this scenario? It
looks like a feature on-top of "PC" or "Laptop" device-type. Analytics/ML
part can be separated from the device-type. What we need to do is to just
get the required data like RAM, CPU, HDD usage etc from that particular
device type and push them into DAS. This is somewhat similar to what we are
currently doing with the Android device-type. I'm wondering why we can't
use the same approach here.

Thanks,

Harshan Liyanage
EMM/IoT TG
Mobile: *+94765672894*
Email: hars...@wso2.com
Blog : http://harshanliyanage.blogspot.com/
*WSO2, Inc. :** wso2.com *
lean.enterprise.middleware.

On Wed, Jul 5, 2017 at 10:57 PM, Pasindu Jayaweera 
wrote:

> Hi Lahiru,
> Q.) Other than pushing data from the laptop, will there be any operations
> or policies than can be applied from the server-side?
>
> Q) What could be the agent's behavior;
>
> a.) when the laptop is out of the network?
>
> b.) when the laptop has multiple operating systems?
>
>
> When designing analytics views and creating ML plans, I would like to
> suggest to make them in such a way that those units can be plugged not only
> with the laptops, but also with any device type that provide the same stats
> that you are planning to get from the laptops at this moment. Because the
> stats like RAM, CPU utilization can be fetched from most of the other
> devices as well.  So that upon the use case, those device types can reuse
> the same unit in future. WDYT?
>
> Thanks.
>
> On Wed, Jul 5, 2017 at 8:19 PM, Lahiru Madushanka 
> wrote:
>
>>
>> Hi all,
>>
>> Currently I am working on a new device type for IOTS which can collect
>> stats from Laptops and use them for analytics and decision making process.
>> This is achieved by an agent running on PC which pushes collected stats to
>> the IOTS in given time intervals.
>>
>> Sample use case 1 :- Average ram / CPU utilization of team X can be use
>> as a measurement when buying new PCs for team X.
>>
>> Sample use case 2 :- Prediction of average memory requirement of team X
>> for next year
>>
>> Development Phases
>>
>> Phase 1
>> Developing the initial agent which runs on PC and publish statistics to
>> the IoTS through the MB.
>> Creating event receivers / publishers and execution plans in DAS to
>> handle data.
>> Creating initial analytics and real time analytics views for a single
>> device
>>
>> Phase 1 was already done by Thisari Patabendi.
>>
>> Phase 2
>> Adding "Device profiles" to the device database.
>> Data purging and summarization
>> Implementing group analytics view for roles "team lead" and "infra level
>> user".
>>
>> Phase 3
>> Collect data by running agent on several test machines.
>> Applying analytics on collected data and create ML plan.
>> Creating analytic result dashboards
>>
>> Suggestions are highly appreciated.
>>
>> Thanks.
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "WSO2 IoT Team Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to iot-group+unsubscr...@wso2.com.
>> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>>
>
>
>
> --
> *Pasindu Jayaweera*
> Software Engineer | WSO2 Inc
> Mobile: +94 718187375 <+94%2071%20818%207375>
> Blog: blog.pasindujayaweera.com
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "WSO2 IoT Team Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to iot-group+unsubscr...@wso2.com.
> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Handling required claims in ID Token

2017-07-05 Thread Sagara Gunathunga
On Thu, Jul 6, 2017 at 9:55 AM, Gayan Gunawardana  wrote:

> Hi Sagara, Denuwanthi,
>
> There are many ways to write custom grant type. Even ClientCredentials
> grant type can be extended to custom grant type where do not need to think
> about ID token. If can you point to exact example and explain the problem,
> it would be great.
>

You can try default sample mentioned  in our docs[1]

[1] -
https://docs.wso2.com/display/IS530/Writing+a+Custom+OAuth+2.0+Grant+Type

Thanks !

>
> Thanks,
> Gayan
>
> On Tue, Jul 4, 2017 at 9:37 PM, Denuwanthi De Silva 
> wrote:
>
>> Thank you Sagara for the response.
>> Yes, as you mentioned it means logical to use the server error response.
>> will proceed with that.
>>
>>
>> Thanks,
>>
>> On Tue, Jul 4, 2017 at 7:08 PM, Sagara Gunathunga 
>> wrote:
>>
>>>
>>>
>>> On Tue, Jul 4, 2017 at 6:54 PM, Denuwanthi De Silva >> > wrote:
>>>
 Hi,

 In OIDC spec,following claims are mentioned as mandatory.
 -iss
 -sub
 -aud
 -exp
 -iat

 Currently as mentioned in jira [1], it is possible to write custom
 OAuth2 grant type which returns IDToken without "sub" claim.

 When we handle this scenario, there is a small concern
  that need to be clarified.

 -When analyze the spec we could  not find any instance where it
 mentioned the error message to display in such a scenario.
 In that case, shall we come up with *new error message*?
 {"error_description":"custom description.","error":"custom_error"}

 - or throw a server exception and send the standard *server error*
 message ?
 ex:
 {"error_description":"Internal Server Error.","error":"server_error"}

>>>
>>> IMO what happen here is, server can not generate valid IDToken.
>>>  "Internal Server Error " can properly describe this behavior  so better to
>>> use that code, returning custom code may cause  interoperability  issues as
>>> well.
>>>
>>> Thanks !
>>>


 Appreciate any input on how to proceed with this.

 [1]https://wso2.org/jira/browse/IDENTITY-6088
 [2]http://openid.net/specs/openid-connect-core-1_0.html#IDToken

 Thanks,
 --
 Denuwanthi De Silva
 Senior Software Engineer;
 WSO2 Inc.; http://wso2.com,
 Email: denuwan...@wso2.com
 Blog: https://denuwanthi.wordpress.com/

>>>
>>>
>>>
>>> --
>>> Sagara Gunathunga
>>>
>>> Associate Director / Architect; WSO2, Inc.;  http://wso2.com
>>> V.P Apache Web Services;http://ws.apache.org/
>>> Linkedin; http://www.linkedin.com/in/ssagara
>>> Blog ;  http://ssagara.blogspot.com
>>>
>>>
>>
>>
>> --
>> Denuwanthi De Silva
>> Senior Software Engineer;
>> WSO2 Inc.; http://wso2.com,
>> Email: denuwan...@wso2.com
>> Blog: https://denuwanthi.wordpress.com/
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Gayan Gunawardana
> Senior Software Engineer; WSO2 Inc.; http://wso2.com/
> Email: ga...@wso2.com
> Mobile: +94 (71) 8020933
>



-- 
Sagara Gunathunga

Associate Director / Architect; WSO2, Inc.;  http://wso2.com
V.P Apache Web Services;http://ws.apache.org/
Linkedin; http://www.linkedin.com/in/ssagara
Blog ;  http://ssagara.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Handling required claims in ID Token

2017-07-05 Thread Gayan Gunawardana
Hi Sagara, Denuwanthi,

There are many ways to write custom grant type. Even ClientCredentials
grant type can be extended to custom grant type where do not need to think
about ID token. If can you point to exact example and explain the problem,
it would be great.

Thanks,
Gayan

On Tue, Jul 4, 2017 at 9:37 PM, Denuwanthi De Silva 
wrote:

> Thank you Sagara for the response.
> Yes, as you mentioned it means logical to use the server error response.
> will proceed with that.
>
>
> Thanks,
>
> On Tue, Jul 4, 2017 at 7:08 PM, Sagara Gunathunga  wrote:
>
>>
>>
>> On Tue, Jul 4, 2017 at 6:54 PM, Denuwanthi De Silva 
>> wrote:
>>
>>> Hi,
>>>
>>> In OIDC spec,following claims are mentioned as mandatory.
>>> -iss
>>> -sub
>>> -aud
>>> -exp
>>> -iat
>>>
>>> Currently as mentioned in jira [1], it is possible to write custom
>>> OAuth2 grant type which returns IDToken without "sub" claim.
>>>
>>> When we handle this scenario, there is a small concern
>>>  that need to be clarified.
>>>
>>> -When analyze the spec we could  not find any instance where it
>>> mentioned the error message to display in such a scenario.
>>> In that case, shall we come up with *new error message*?
>>> {"error_description":"custom description.","error":"custom_error"}
>>>
>>> - or throw a server exception and send the standard *server error*
>>> message ?
>>> ex:
>>> {"error_description":"Internal Server Error.","error":"server_error"}
>>>
>>
>> IMO what happen here is, server can not generate valid IDToken.
>>  "Internal Server Error " can properly describe this behavior  so better to
>> use that code, returning custom code may cause  interoperability  issues as
>> well.
>>
>> Thanks !
>>
>>>
>>>
>>> Appreciate any input on how to proceed with this.
>>>
>>> [1]https://wso2.org/jira/browse/IDENTITY-6088
>>> [2]http://openid.net/specs/openid-connect-core-1_0.html#IDToken
>>>
>>> Thanks,
>>> --
>>> Denuwanthi De Silva
>>> Senior Software Engineer;
>>> WSO2 Inc.; http://wso2.com,
>>> Email: denuwan...@wso2.com
>>> Blog: https://denuwanthi.wordpress.com/
>>>
>>
>>
>>
>> --
>> Sagara Gunathunga
>>
>> Associate Director / Architect; WSO2, Inc.;  http://wso2.com
>> V.P Apache Web Services;http://ws.apache.org/
>> Linkedin; http://www.linkedin.com/in/ssagara
>> Blog ;  http://ssagara.blogspot.com
>>
>>
>
>
> --
> Denuwanthi De Silva
> Senior Software Engineer;
> WSO2 Inc.; http://wso2.com,
> Email: denuwan...@wso2.com
> Blog: https://denuwanthi.wordpress.com/
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Gayan Gunawardana
Senior Software Engineer; WSO2 Inc.; http://wso2.com/
Email: ga...@wso2.com
Mobile: +94 (71) 8020933
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Fixing the cache mediator

2017-07-05 Thread Riyafa Abdul Hameed
Thank you for the suggestions Rajkumar.


On Thu, Jul 6, 2017 at 6:57 AM, Rajkumar Rajaratnam 
wrote:

> Also the existing cache mediator doesn't honor the cache ID as per my
> testing sometimes back (not sure it's fixed though). It means caching works
> globally, not at cache mediator instance level.
>
> If we can't correlate a finder with a collector (using cache mediator ID),
> then we are going to hit memory issues.
>
> Here is the reason.
>
> Let's say we have two APIs - location and exchange.
>
>1. /location API response size is 10 MB and we have 100 different
>responses
>2. /exchange API response size is 1MB and we have 1000 different
>responses
>
> If we want to enable response caching for these two APIs, if we can
> correlate a finder with a collector (i.e if we support caching at cache
> mediator instance level), then I can allocate 100*10 + 1000*1 = 2000 MB
> memory to the JVM in addition to our recommended memory settings, so that
> it will never go OOM.
>
> If we can't correlate a finder with a collector (i.e, if we support global
> caching), then I have to allocate 1100 * 10 = 11000 MB memory. See I have
> to use additional 9000 MB if we don't honor cache ID. It's not practical
> and efficient because memory is expensive - so it doesn't scale.
>
> Can we fix this issue and honor cache ID please in the next EI release?
>

Yes we need to honor this as you suggest and I shall include it in the
requirements document.

>
> On Wed, Jul 5, 2017 at 9:18 PM, Rajkumar Rajaratnam 
> wrote:
>
>> Is this going to be a rewrite or improvement to existing cache mediator?
>> If this is a rewrite, will it be included in next EI release?
>>
> Yes it's going to be a rewrite. We hope to include it in the EI 6.2.x
release.

>
>> Also can we also implement cache eviction as part of this effort?
>>
>> Ideally, we should be able to configure how many maximum responses we can
>> cache (not sure whether it's there already, it was not working sometimes
>> back) and what's the maximum message size (it's already there) we can cache
>> to avoid OOM. Then we need to have cache eviction in place to evict some
>> cached items when cache is full, in-order to give space for most recent
>> responses.
>>
>> I guess configuring the maximum responses is currently available and we
shall consider your suggestions in the rewrite.

> Thanks.
>>
>> On Wed, Jul 5, 2017 at 6:02 AM, Riyafa Abdul Hameed 
>> wrote:
>>
>>> Hi,
>>> Please find the requirements doc below:
>>> https://docs.google.com/document/d/1iPtArrW6C-VgzAzjjSsLmG9a
>>> qAFEubmFgNkQhoDvqz8/edit?usp=sharing
>>> Any suggestions would be highly appreciated.
>>> Thank you.
>>> Riyafa
>>>
>>> On Tue, Jul 4, 2017 at 5:37 PM, Riyafa Abdul Hameed 
>>> wrote:
>>>
 Hi all,

 Thank you for the suggestions. Yes the mediator should also work with
 the call mediator.

 Further on a discussion with the APIM team I have identified the
 following issues which points to requiring a rewrite of the cache mediator:

1.

Current cache mediator[1] caches responses for all the HTTP Request
Methods which include GET, POST, PUT and DELETE. Ideally a cache 
 mediator
should cache only the response for GET method and caching for POST 
 method
should be configurable (because POST is the only method used in SOAP
implementations). The caching for PUT and DELETE methods should be
completely omitted. The reason for caching responses only for GET is
because in the REST world other methods (POST, PUT and DELETE) are used 
 for
creating, modifying or deleting existing records and hence the response
would only mention the success or failure of the request. Caching these
responses is meaningless and error prone.
2.

Current cache mediator caches all the responses whether they are
success or failure responses. Ideally the mediator should cache only
success (200 OK) responses and not the failures
3.

Current mediator hashes the payload (both DOMHASHGenerator and
REQUESTHASHGenerator) which is a huge overhead for messages with larger
bodies. The mediator should hash only the recipient (To) address of the
request and the HTTP headers which can be easily handled when only
responses for GET methods are hashed. Payload should be hashed only if 
 PUT
method is configured.
4.

Current mediator does not allow configurations for omitting certain
headers when hashing. For example there’s no point in hashing the 
 timestamp
header--it will almost always be different from message to message.
5.

The current mediator does not honor the http headers[2]. For
example the max-age header specifies the maximum time in seconds that 
 the
fetched response is allowed to be reused from the time of the request.

Re: [Dev] API Manager Basic Auth

2017-07-05 Thread Pubudu Gunatilaka
Hi,

You can find the details for writing a custom handler in [1].

[1] - https://docs.wso2.com/display/AM210/Writing+Custom+Handlers

Thank you!

On Thu, Jul 6, 2017 at 7:40 AM, Júnior  wrote:

> I see, thank you for the very useful information.
>
> Thanks!
>
> 2017-07-05 21:56 GMT-03:00 Rajkumar Rajaratnam :
>
>> There is no out of the box way to secure your APIs with basic
>> authentication in WSO2 API Manager. But you can write a new authentication
>> handler for your requirement.
>>
>> However please note you need to evaluate the security mechanism and how
>> it is applied via a handler first. For example, when the current handler
>> receives an OAuth2 access token, it knows the user, application,
>> subscription information. That's how it knows how to throttle and publish
>> stats accordingly. You need to be able to find these information from your
>> new handler you introduce for the throttling and stats to work accurately.
>>
>> Thanks.
>>
>> On Wed, Jul 5, 2017 at 4:02 PM, Júnior  wrote:
>>
>>> Hello,
>>>
>>> I am trying to configure an API on WSO2AM 2.1.0, and the only
>>> authentication mechanism it supports is via OAuth. Is there any way to use
>>> Basic Auth for API Authentication?
>>>
>>> Thanks,
>>> --
>>> Francisco Ribeiro
>>> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Rajkumar Rajaratnam
>> Committer & PMC Member, Apache Stratos
>> Senior Software Engineer, WSO2
>>
>> LinkedIn: https://lk.linkedin.com/in/rajuu
>> Mobile: +1 408 791 7640 <(408)%20791-7640>
>> Blogs: http://wso2tech.blogspot.com/ | https://medium.com/@wso2tech
>>
>
>
>
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Pubudu Gunatilaka*
Committer and PMC Member - Apache Stratos
Software Engineer
WSO2, Inc.: http://wso2.com
mobile : +94774078049 <%2B94772207163>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] Role mapping through config file

2017-07-05 Thread Hasanthi Purnima Dissanayake
Hi Henan,

There is a sample command if the IDP is WSO2 Identity Server where you can
export the public certificate in PEM format.

keytool -exportcert -alias wso2carbon -keypass wso2carbon -keystore
wso2carbon.jks -storepass wso2carbon -rfc -file ispublic_crt.pem

Then, you can open the certificate file with a notepad so you see the
certificate value. You can copy this certificate value and put in the file
with in the  tag.

Please note that above is only if the IDP is WSO2 IS. If the IDP is a third
party IDP, then you can get the certificate in PEM format and read the
value. And the you need to copy the entire content of the PEM file and
place it between the tags.


Thanks,

Hasanthi.


Hasanthi Dissanayake

Software Engineer | WSO2

E: hasan...@wso2.com
M :0718407133| http://wso2.com 

On Wed, Jul 5, 2017 at 11:40 PM, Farasath Ahamed  wrote:

> Hi Hanen,
>
> I have attached a sample file based IDP file that demonstrates how to add
>  tag and the IDP role mapping as well.
>
>
> Thanks,
> Farasath
>
> Farasath Ahamed
> Software Engineer, WSO2 Inc.; http://wso2.com
> Mobile: +94777603866
> Blog: blog.farazath.com
> Twitter: @farazath619 
> 
>
>
>
> On Wed, Jul 5, 2017 at 9:09 PM, Hanen Ben Rhouma 
> wrote:
>
>> Same question for the tag  please. We're using a certificate
>> so what should we mention in the xml file.
>>
>>
>>
>> Regards,
>> Hanen
>>
>>
>>
>>
>>
>>
>> On Wed, Jul 5, 2017 at 5:36 PM, Hanen Ben Rhouma 
>> wrote:
>>
>>> Hello guys,
>>>
>>> Could you please tell me what are the xml tags I can use within an IDP
>>> xml config file for role mapping. I mean the properties I can add for
>>> mapping roles in the tag 
>>> in default.xml for example
>>>
>>>
>>> Rehards,
>>> Hanen
>>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] API Manager Basic Auth

2017-07-05 Thread Júnior
I see, thank you for the very useful information.

Thanks!

2017-07-05 21:56 GMT-03:00 Rajkumar Rajaratnam :

> There is no out of the box way to secure your APIs with basic
> authentication in WSO2 API Manager. But you can write a new authentication
> handler for your requirement.
>
> However please note you need to evaluate the security mechanism and how it
> is applied via a handler first. For example, when the current handler
> receives an OAuth2 access token, it knows the user, application,
> subscription information. That's how it knows how to throttle and publish
> stats accordingly. You need to be able to find these information from your
> new handler you introduce for the throttling and stats to work accurately.
>
> Thanks.
>
> On Wed, Jul 5, 2017 at 4:02 PM, Júnior  wrote:
>
>> Hello,
>>
>> I am trying to configure an API on WSO2AM 2.1.0, and the only
>> authentication mechanism it supports is via OAuth. Is there any way to use
>> Basic Auth for API Authentication?
>>
>> Thanks,
>> --
>> Francisco Ribeiro
>> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Rajkumar Rajaratnam
> Committer & PMC Member, Apache Stratos
> Senior Software Engineer, WSO2
>
> LinkedIn: https://lk.linkedin.com/in/rajuu
> Mobile: +1 408 791 7640 <(408)%20791-7640>
> Blogs: http://wso2tech.blogspot.com/ | https://medium.com/@wso2tech
>



-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Fixing the cache mediator

2017-07-05 Thread Rajkumar Rajaratnam
Also the existing cache mediator doesn't honor the cache ID as per my
testing sometimes back (not sure it's fixed though). It means caching works
globally, not at cache mediator instance level.

If we can't correlate a finder with a collector (using cache mediator ID),
then we are going to hit memory issues.

Here is the reason.

Let's say we have two APIs - location and exchange.

   1. /location API response size is 10 MB and we have 100 different
   responses
   2. /exchange API response size is 1MB and we have 1000 different
   responses

If we want to enable response caching for these two APIs, if we can
correlate a finder with a collector (i.e if we support caching at cache
mediator instance level), then I can allocate 100*10 + 1000*1 = 2000 MB
memory to the JVM in addition to our recommended memory settings, so that
it will never go OOM.

If we can't correlate a finder with a collector (i.e, if we support global
caching), then I have to allocate 1100 * 10 = 11000 MB memory. See I have
to use additional 9000 MB if we don't honor cache ID. It's not practical
and efficient because memory is expensive - so it doesn't scale.

Can we fix this issue and honor cache ID please in the next EI release?

On Wed, Jul 5, 2017 at 9:18 PM, Rajkumar Rajaratnam 
wrote:

> Is this going to be a rewrite or improvement to existing cache mediator?
> If this is a rewrite, will it be included in next EI release?
>
> Also can we also implement cache eviction as part of this effort?
>
> Ideally, we should be able to configure how many maximum responses we can
> cache (not sure whether it's there already, it was not working sometimes
> back) and what's the maximum message size (it's already there) we can cache
> to avoid OOM. Then we need to have cache eviction in place to evict some
> cached items when cache is full, in-order to give space for most recent
> responses.
>
> Thanks.
>
> On Wed, Jul 5, 2017 at 6:02 AM, Riyafa Abdul Hameed 
> wrote:
>
>> Hi,
>> Please find the requirements doc below:
>> https://docs.google.com/document/d/1iPtArrW6C-VgzAzjjSsLmG9a
>> qAFEubmFgNkQhoDvqz8/edit?usp=sharing
>> Any suggestions would be highly appreciated.
>> Thank you.
>> Riyafa
>>
>> On Tue, Jul 4, 2017 at 5:37 PM, Riyafa Abdul Hameed 
>> wrote:
>>
>>> Hi all,
>>>
>>> Thank you for the suggestions. Yes the mediator should also work with
>>> the call mediator.
>>>
>>> Further on a discussion with the APIM team I have identified the
>>> following issues which points to requiring a rewrite of the cache mediator:
>>>
>>>1.
>>>
>>>Current cache mediator[1] caches responses for all the HTTP Request
>>>Methods which include GET, POST, PUT and DELETE. Ideally a cache mediator
>>>should cache only the response for GET method and caching for POST method
>>>should be configurable (because POST is the only method used in SOAP
>>>implementations). The caching for PUT and DELETE methods should be
>>>completely omitted. The reason for caching responses only for GET is
>>>because in the REST world other methods (POST, PUT and DELETE) are used 
>>> for
>>>creating, modifying or deleting existing records and hence the response
>>>would only mention the success or failure of the request. Caching these
>>>responses is meaningless and error prone.
>>>2.
>>>
>>>Current cache mediator caches all the responses whether they are
>>>success or failure responses. Ideally the mediator should cache only
>>>success (200 OK) responses and not the failures
>>>3.
>>>
>>>Current mediator hashes the payload (both DOMHASHGenerator and
>>>REQUESTHASHGenerator) which is a huge overhead for messages with larger
>>>bodies. The mediator should hash only the recipient (To) address of the
>>>request and the HTTP headers which can be easily handled when only
>>>responses for GET methods are hashed. Payload should be hashed only if 
>>> PUT
>>>method is configured.
>>>4.
>>>
>>>Current mediator does not allow configurations for omitting certain
>>>headers when hashing. For example there’s no point in hashing the 
>>> timestamp
>>>header--it will almost always be different from message to message.
>>>5.
>>>
>>>The current mediator does not honor the http headers[2]. For example
>>>the max-age header specifies the maximum time in seconds that the fetched
>>>response is allowed to be reused from the time of the request. Although
>>>cache timeout is allowed to be configured this header is not honored when
>>>it is specified in a message.
>>>6.
>>>
>>>Although it is possible to set the maximum number of elements to be
>>>cached in bytes it might result in this set value exceeding the available
>>>memory at runtime.
>>>7.
>>>
>>>The current mediator does not invoke the handleResponseInFlow or
>>>handleResponseOutFlow methods in handlers[3]
>>>
>>>
>>>
>>> [1] https://docs.wso2.com/display/EI611/Cache+Mediator
>>>
>>> [2] https://dev

Re: [Dev] Fixing the cache mediator

2017-07-05 Thread Rajkumar Rajaratnam
Is this going to be a rewrite or improvement to existing cache mediator? If
this is a rewrite, will it be included in next EI release?

Also can we also implement cache eviction as part of this effort?

Ideally, we should be able to configure how many maximum responses we can
cache (not sure whether it's there already, it was not working sometimes
back) and what's the maximum message size (it's already there) we can cache
to avoid OOM. Then we need to have cache eviction in place to evict some
cached items when cache is full, in-order to give space for most recent
responses.

Thanks.

On Wed, Jul 5, 2017 at 6:02 AM, Riyafa Abdul Hameed  wrote:

> Hi,
> Please find the requirements doc below:
> https://docs.google.com/document/d/1iPtArrW6C-
> VgzAzjjSsLmG9aqAFEubmFgNkQhoDvqz8/edit?usp=sharing
> Any suggestions would be highly appreciated.
> Thank you.
> Riyafa
>
> On Tue, Jul 4, 2017 at 5:37 PM, Riyafa Abdul Hameed 
> wrote:
>
>> Hi all,
>>
>> Thank you for the suggestions. Yes the mediator should also work with the
>> call mediator.
>>
>> Further on a discussion with the APIM team I have identified the
>> following issues which points to requiring a rewrite of the cache mediator:
>>
>>1.
>>
>>Current cache mediator[1] caches responses for all the HTTP Request
>>Methods which include GET, POST, PUT and DELETE. Ideally a cache mediator
>>should cache only the response for GET method and caching for POST method
>>should be configurable (because POST is the only method used in SOAP
>>implementations). The caching for PUT and DELETE methods should be
>>completely omitted. The reason for caching responses only for GET is
>>because in the REST world other methods (POST, PUT and DELETE) are used 
>> for
>>creating, modifying or deleting existing records and hence the response
>>would only mention the success or failure of the request. Caching these
>>responses is meaningless and error prone.
>>2.
>>
>>Current cache mediator caches all the responses whether they are
>>success or failure responses. Ideally the mediator should cache only
>>success (200 OK) responses and not the failures
>>3.
>>
>>Current mediator hashes the payload (both DOMHASHGenerator and
>>REQUESTHASHGenerator) which is a huge overhead for messages with larger
>>bodies. The mediator should hash only the recipient (To) address of the
>>request and the HTTP headers which can be easily handled when only
>>responses for GET methods are hashed. Payload should be hashed only if PUT
>>method is configured.
>>4.
>>
>>Current mediator does not allow configurations for omitting certain
>>headers when hashing. For example there’s no point in hashing the 
>> timestamp
>>header--it will almost always be different from message to message.
>>5.
>>
>>The current mediator does not honor the http headers[2]. For example
>>the max-age header specifies the maximum time in seconds that the fetched
>>response is allowed to be reused from the time of the request. Although
>>cache timeout is allowed to be configured this header is not honored when
>>it is specified in a message.
>>6.
>>
>>Although it is possible to set the maximum number of elements to be
>>cached in bytes it might result in this set value exceeding the available
>>memory at runtime.
>>7.
>>
>>The current mediator does not invoke the handleResponseInFlow or
>>handleResponseOutFlow methods in handlers[3]
>>
>>
>>
>> [1] https://docs.wso2.com/display/EI611/Cache+Mediator
>>
>> [2] https://developers.google.com/web/fundamentals/performance/o
>> ptimizing-content-efficiency/http-caching
>>
>> [3] https://docs.wso2.com/display/EI611/Writing+a+Synapse+Handler
>>
>> On Tue, Jul 4, 2017 at 4:28 PM, Isuru Udana  wrote:
>>
>>> Hi,
>>>
>>> On Tue, Jul 4, 2017 at 3:10 PM, Vijitha Ekanayake 
>>> wrote:
>>>
 Hi Riyafa,

 Apart from the issues that you have mentioned, we may need to consider
 following points while refactoring the cache mediator implementation.

 1). Verify the cache mediator functionality with different
 configuration parameters and fix if there is anything broken.
 2). Implement a mechanism to support caching when using the call
 mediator.
 3). Feasibility to introduce native JSON caching support to cache
 mediator.
 4). Feasibility to introduce service level caching which isn't support
 at the moment.

>>> IMO, service level caching is not a requirement as long as we can
>>> achieve all the requirements through the Cache Mediator.
>>>
>>> Thanks.
>>>


 Thanks.


 On Tue, Jul 4, 2017 at 12:06 PM, Riyafa Abdul Hameed 
 wrote:

> Dear all,
>
> By going through the issues faced by the customers in the past I
> discovered the following issues:
>
>1. Continue the execution on cache hit. Reported as an issue in
>github[1]
>  

Re: [Dev] API Manager Basic Auth

2017-07-05 Thread Rajkumar Rajaratnam
There is no out of the box way to secure your APIs with basic
authentication in WSO2 API Manager. But you can write a new authentication
handler for your requirement.

However please note you need to evaluate the security mechanism and how it
is applied via a handler first. For example, when the current handler
receives an OAuth2 access token, it knows the user, application,
subscription information. That's how it knows how to throttle and publish
stats accordingly. You need to be able to find these information from your
new handler you introduce for the throttling and stats to work accurately.

Thanks.

On Wed, Jul 5, 2017 at 4:02 PM, Júnior  wrote:

> Hello,
>
> I am trying to configure an API on WSO2AM 2.1.0, and the only
> authentication mechanism it supports is via OAuth. Is there any way to use
> Basic Auth for API Authentication?
>
> Thanks,
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Rajkumar Rajaratnam
Committer & PMC Member, Apache Stratos
Senior Software Engineer, WSO2

LinkedIn: https://lk.linkedin.com/in/rajuu
Mobile: +1 408 791 7640
Blogs: http://wso2tech.blogspot.com/ | https://medium.com/@wso2tech
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] API Manager Basic Auth

2017-07-05 Thread Himasha Guruge
Hi,

Yes, when creating the API you can define endpoint authentication type.
Please refer [1] for your requirement.

[1] https://docs.wso2.com/display/AM210/Basic+Auth

Thanks,
Himasha

On Thu, Jul 6, 2017 at 1:32 AM, Júnior  wrote:

> Hello,
>
> I am trying to configure an API on WSO2AM 2.1.0, and the only
> authentication mechanism it supports is via OAuth. Is there any way to use
> Basic Auth for API Authentication?
>
> Thanks,
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Himasha Guruge
*Software Engineer*
WS*O2* *Inc.*
Mobile: +94 777459299
himas...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] API Manager Basic Auth

2017-07-05 Thread Júnior
Hello,

I am trying to configure an API on WSO2AM 2.1.0, and the only
authentication mechanism it supports is via OAuth. Is there any way to use
Basic Auth for API Authentication?

Thanks,
-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Should we refactor CarbonMessage

2017-07-05 Thread Chanaka Fernando
It seems there is room to improve the current CarbonMessage implementation.
Following are few main areas where we can improve its functionality.

   - At the moment there are too many ways to get the message body from the
   CarbonMessage
   - getMessageBody()
  - getInputStream() - This is a http specific impl.
  - getMessageDateSource()

The above 3 methods serve 3 different purposes. This design has been done
mainly thinking about the HTTP messages. In a message passthrough scenario,
content is kept in the content queue and accessed as a stream. When the
message content is accessed within intermediate layer (like ballerina), it
will be retrieved through messageDataSource.

   - There are too many types of CarbonMessages in carbon-messaging that
   are only used by a specific transport implementation
  - BinaryCarbonMessage
  - ControlCarbonMessage
  - DefaultCarbonMessage
  - MapCarbonMessage
  - SerializableCarbonMessage
  - StatusCarbonMessage
  - StreamingCarbonMessage
  - TextCarbonMessage


   - Most of above CarbonMessages do not adhere to the contract that is
   imposed by the CarbonMessage interface.

I agree on the fact that we need to refactor these different types of
CarbonMessage implementations. I think what Asitha suggested is a viable
approach to handle different types of messages.

Considering these facts, I believe we should refactor CarbonMessage before
others starting using it in their implementations. Please let us know your
thoughts as well :)

+1 for refactoring the carbon message and relevant implementations to
support non-HTTP use cases. In the meantime, we should support HTTP
messaging in an efficient manner since that will be the mostly used
scenario of ballerina.

On Wed, Jul 5, 2017 at 4:55 PM, Irunika Weeraratne  wrote:

> Hi Shafreen and Asitha,
> In the first place, they were introduced after a long discussion in
> WebSocket scenarios. This was because when the WebSocket messages are
> arrived to transport level we already knew what kind of message it is.
> Eg: Text, Binary, Control, Status
>
> So I made sense to create the same type of carbon message in the
> transport. Then carbon message types were used to identify the scenarios we
> had to address in the application layer.
> Eg: If the carbon message is an instance of TextCarbonMessage we know what
> to do in the first place. Also converting text into byte buffer in the
> transport and then converting it again into text in the application layer
> doesn't make sense.
>
> Because of that, those message types were introduced. IMO while we reduce
> the no. of carbon message types we might need to keep some of the types
> because it will affect the performance.
> Also, we can always override the methods in default carbon message if in
> order to work with default scenarios.
>
> WDYT?
>
> Thanks,
> Irunika
>
> *Irunika Weeraratne*
> *Software Engineer | WSO2, Inc. *
> *Email : irun...@wso2.com *
> *LinkedIn : https://lk.linkedin.com/in/irunika
> *
> *Mobile : +94712403314 <071%20240%203314>*
> *Lean . Enterprise . Middleware*
>
>
> On Wed, Jul 5, 2017 at 3:54 PM, Asitha Nanayakkara 
> wrote:
>
>> Hi Shafreen,
>>
>> I would suggest having a single Carbon Message with the option to set
>> different types of data sources as the data source for the message. For
>> that, we might need to go through the existing other message types and
>> think what kind of functionality to be added to carbon message. If our
>> intention is not to extend carbon message, we can make it a final class. If
>> not we have to design it to be extended by other users.
>>
>> When reading the payload multiple times (building the message) we need to
>> clone messages (since data is represented as a stream). In pass through
>> scenarios, we should avoid cloning the message and use the stream once.
>> IMO we can implement this functionality by way of having package level
>> methods for transport to read from the internal blocking queue and write to
>> the output stream. If we invoke other public methods they will make a clone
>> of the message data and use. This way we avoid unnecessary cloning in a
>> pass-through scenario. And reading from the blocking queue can only be done
>> from the transport. Outside users have to use message data source to read
>> the content, which might clone the data.
>>
>> WDYT?
>>
>> Regards,
>> Asitha
>>
>> On Wed, Jul 5, 2017 at 3:14 PM, Shafreen Anfar  wrote:
>>
>>> Hi All,
>>>
>>> It seems there is room to improve the current CarbonMessage
>>> implementation. Following are few main areas where we can improve its
>>> functionality.
>>>
>>>- At the moment there are too many ways to get the message body from
>>>the CarbonMessage
>>>- getMessageBody()
>>>   - getInputStream() - This is a http specific impl.
>>>   - getMessageDateSource()
>>>
>>>
>>>- There are too many types of CarbonMessages in carbon-messaging
>>

Re: [Dev] [IS] Role mapping through config file

2017-07-05 Thread Farasath Ahamed
Hi Hanen,

I have attached a sample file based IDP file that demonstrates how to add
 tag and the IDP role mapping as well.


Thanks,
Farasath

Farasath Ahamed
Software Engineer, WSO2 Inc.; http://wso2.com
Mobile: +94777603866
Blog: blog.farazath.com
Twitter: @farazath619 




On Wed, Jul 5, 2017 at 9:09 PM, Hanen Ben Rhouma  wrote:

> Same question for the tag  please. We're using a certificate
> so what should we mention in the xml file.
>
>
>
> Regards,
> Hanen
>
>
>
>
>
>
> On Wed, Jul 5, 2017 at 5:36 PM, Hanen Ben Rhouma 
> wrote:
>
>> Hello guys,
>>
>> Could you please tell me what are the xml tags I can use within an IDP
>> xml config file for role mapping. I mean the properties I can add for
>> mapping roles in the tag 
>> in default.xml for example
>>
>>
>> Rehards,
>> Hanen
>>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>

FileBasedIDP


https://localhost:9453/oauth2/token
false
true


SAMLSSOAuthenticator
samlsso
true


IdpEntityId

localhost


SPEntityId

esb-ws02-dev


SSOUrl

https://localhost:9444/samlsso


IsAuthReqSigned
false


IsAssertionEncrypted
false


isAssertionSigned
false


IsLogoutEnabled
false


IsLogoutReqSigned
false


IsAuthnRespSigned
false


ForceAuthentication
as_request


IncludeNameIDPolicy
true


IncludeAuthnContext
yes


IncludeCert
true


RequestMethod
redirect


IncludeProtocolBinding
true


DigestAlgorithm
MD5


AuthnContextComparisonLevel
Exact




SAMLSSOAuthenticator

   


admin
PRIMARY

TestSubscriber


 

Re: [Dev] Problems on MB Cluster Enterprise Integrator 6.1.0

2017-07-05 Thread Júnior
Thank you Hasitha.

It thought leaving it as default, it would generate one.

The ports are open, I can see in the logs it saying the new member has
joined, but it keeps trying to get the node id of the other member, and
when it is not able to do, it shutdown the node.

I will try and let you know the results.

Thanks,

2017-07-05 8:52 GMT-03:00 Hasitha Hiranya :

> Hi,
>
> 
> 
> default
>
> Set a node id in broker.xml file at [EI_HOME]/wso2/broker/conf
>
> BTW, are necessary ports open for Hazelcast to communicate?
>
> Thanks
>
> On Mon, Jul 3, 2017 at 6:51 PM, Júnior  wrote:
>
>> Hello,
>>
>> I am trying to setup a cluster for the Broker Profile on AWS.
>>
>> I am able to start the first node without problem, but when we start the
>> second node, it doesn't start because it says it is not able to get the
>> node id of the other member:
>>
>> TID: [-1234] [] [2017-07-03 12:55:10,193] ERROR
>> {org.wso2.andes.server.registry.ApplicationRegistry} -
>>  org.wso2.andes.kernel.AndesException: Failed to read Node id of
>> hazelcast member Member [X.X.X.X]:5711
>>
>> On the nodes I have leave the nodeId on broker.xml as default, so it will
>> generate a random one.
>>
>> Do you have any clue on where should I set this node id?
>>
>> Thanks,
>>
>>
>>
>> --
>> Francisco Ribeiro
>> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Hasitha Abeykoon*
> Senior Software Engineer; WSO2, Inc.; http://wso2.com
> *cell:* *+94 719363063*
> *blog: **abeykoon.blogspot.com* 
>
>


-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] net.sf.saxon.om.NamePool$NamePoolLimitException: NamePool limit exceeded:

2017-07-05 Thread Júnior
Hi Vinod,

I am using EI 6.1. Very cool, I am going to try.

Thanks,

2017-07-05 8:52 GMT-03:00 Vinod Kavinda :

> Hi,
> What is the product version you are using?
> If you are using  EI 6.x, remove the xalan-2.7.2.wso2v2.jar file from the
> /wso2/lib/endorsed directory. This jar is required only if you are
> using business process profile.
>
> Regards,
> Vinod
>
> On Mon, Jul 3, 2017 at 2:54 AM, Júnior  wrote:
>
>> Hi Himasha,
>>
>> I will try to grab the logs, but as I could see from the JIRA there is no
>> fix for that?
>>
>> Is there any suggestion for this?
>>
>> Thanks,
>>
>> 2017-07-01 22:53 GMT-03:00 Himasha Guruge :
>>
>>> Hi Francisco,
>>>
>>> Could you provide the complete error log? Looks like the issue is as
>>> reported in [1].
>>>
>>>
>>> [1] https://wso2.org/jira/browse/ESBJAVA-3363
>>>
>>> Thanks,
>>> Himasha
>>>
>>> On Sat, Jul 1, 2017 at 5:18 AM, Júnior  wrote:
>>>
 Hello,

 I am facing this exception when doing XQuery or XSLT transformation:


 net.sf.saxon.om.NamePool$NamePoolLimitException: NamePool limit
 exceeded:



 Does anyone knows a workaround for this?

 Thanks,
 --
 Francisco Ribeiro
 *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> Himasha Guruge
>>> *Software Engineer*
>>> WS*O2* *Inc.*
>>> Mobile: +94 777459299 <+94%2077%20745%209299>
>>> himas...@wso2.com
>>>
>>
>>
>>
>> --
>> Francisco Ribeiro
>> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Vinod Kavinda
> Senior Software Engineer
> *WSO2 Inc. - lean . enterprise . middleware .*
> Mobile : +94 (0) 712 415544
> Blog : http://soatechflicks.blogspot.com/
> [image: http://wso2.com/signature]
> 
>
>


-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] New device type for IOTS ( Laptop agent )

2017-07-05 Thread Pasindu Jayaweera
Hi Lahiru,
Q.) Other than pushing data from the laptop, will there be any operations
or policies than can be applied from the server-side?

Q) What could be the agent's behavior;

a.) when the laptop is out of the network?

b.) when the laptop has multiple operating systems?


When designing analytics views and creating ML plans, I would like to
suggest to make them in such a way that those units can be plugged not only
with the laptops, but also with any device type that provide the same stats
that you are planning to get from the laptops at this moment. Because the
stats like RAM, CPU utilization can be fetched from most of the other
devices as well.  So that upon the use case, those device types can reuse
the same unit in future. WDYT?

Thanks.

On Wed, Jul 5, 2017 at 8:19 PM, Lahiru Madushanka 
wrote:

>
> Hi all,
>
> Currently I am working on a new device type for IOTS which can collect
> stats from Laptops and use them for analytics and decision making process.
> This is achieved by an agent running on PC which pushes collected stats to
> the IOTS in given time intervals.
>
> Sample use case 1 :- Average ram / CPU utilization of team X can be use as
> a measurement when buying new PCs for team X.
>
> Sample use case 2 :- Prediction of average memory requirement of team X
> for next year
>
> Development Phases
>
> Phase 1
> Developing the initial agent which runs on PC and publish statistics to
> the IoTS through the MB.
> Creating event receivers / publishers and execution plans in DAS to handle
> data.
> Creating initial analytics and real time analytics views for a single
> device
>
> Phase 1 was already done by Thisari Patabendi.
>
> Phase 2
> Adding "Device profiles" to the device database.
> Data purging and summarization
> Implementing group analytics view for roles "team lead" and "infra level
> user".
>
> Phase 3
> Collect data by running agent on several test machines.
> Applying analytics on collected data and create ML plan.
> Creating analytic result dashboards
>
> Suggestions are highly appreciated.
>
> Thanks.
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "WSO2 IoT Team Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to iot-group+unsubscr...@wso2.com.
> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>



-- 
*Pasindu Jayaweera*
Software Engineer | WSO2 Inc
Mobile: +94 718187375
Blog: blog.pasindujayaweera.com

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Override default log4.properties in MSF4J

2017-07-05 Thread Thusitha Thilina Dayaratne
Hi Jochen,

When you put your custom log4j.properties file, it should be correctly
picked up. Are you using the msf4j-core dependency or the msf4j-parent?
You can also refer dev mail thread [1]

[1] - "[Dev] Too much noise during MSF4J startup (master branch)"

Thanks
Thusitha

On Wed, Jul 5, 2017 at 8:31 PM, Jochen Traunecker <
jochen.traunec...@googlemail.com> wrote:

> Hi Godwin,
>
> thanks for pointing me to the this solution.
>
> Cheers
> Jochen
>
> 2017-06-28 20:27 GMT+02:00 Godwin Shrimal :
>
>> Hi Jochen,
>>
>> You can pass log4j commandline paramater when running the fat jar as
>> follows to apply the og4j.properties.
>>
>> -Dlog4j.configuration=file:"$CARBON_HOME"/conf/log4j.properties
>>
>>
>> Thanks
>> Godwin
>>
>>
>> On Tue, Jun 27, 2017 at 2:17 AM, Jochen Traunecker <
>> jochen.traunec...@googlemail.com> wrote:
>>
>>> Hi,
>>>
>>> thanks for the hints and it works adding a log4j.xml into /resources but
>>> log4j.properties seems to get ignored. Maybe I have some typo somewhere.
>>>
>>> Regards,
>>> Jochen
>>>
>>> 2017-06-27 9:09 GMT+02:00 Gottfried Szing :
>>>
 Hi Jochen

 Did you try the possibilities that come out-of-the-box with log4j?

 https://logging.apache.org/log4j/2.x/manual/configuration.ht
 ml#Automatic_Configuration

 br

 On 27/06/2017 09:02, Thomas LEGRAND wrote:

> Hello,
>
> Have you tried to put a log4j.xml configuration file in your
> src/main/resources directory? For example, here is mine to trigger the
> DEBUG mode:
>
> 
>  xmlns:log4j='http://jakarta.apache.org/log4j/'>
>
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
>
> 
>
> Regards,
>
> Thomas
>
> 2017-06-26 21:54 GMT+02:00 Jochen Traunecker <
> jochen.traunec...@googlemail.com  lemail.com>>:
>
> Hi,
>
> I'm wondering if there is a way to introduce a custom
> log4j.properties file instead of default one [1] for
> MSF4J in combination with fatjar?
>
> Thanks,
> Jochen
>
> [1] https://github.com/wso2/msf4j/tree/master/core/src/main/reso
> urces
>  >
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org 
> http://wso2.org/cgi-bin/mailman/listinfo/dev <
> http://wso2.org/cgi-bin/mailman/listinfo/dev>
>
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
>>>
>>>
>>> --
>>> Gruss / regards
>>>
>>> Jochen Traunecker
>>> mailto: jochen.traunec...@gmail.com
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Godwin Amila Shrimal*
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: *+94772264165*
>> linkedin: *http://lnkd.in/KUum6D *
>> twitter: https://twitter.com/godwinamila
>> 
>>
>
>
>
> --
> Gruss / regards
>
> Jochen Traunecker
> mailto: jochen.traunec...@gmail.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thusitha Dayaratne
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog  alokayasoya.blogspot.com
Abouthttp://about.me/thusithathilina

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] Role mapping through config file

2017-07-05 Thread Hanen Ben Rhouma
Same question for the tag  please. We're using a certificate
so what should we mention in the xml file.



Regards,
Hanen






On Wed, Jul 5, 2017 at 5:36 PM, Hanen Ben Rhouma  wrote:

> Hello guys,
>
> Could you please tell me what are the xml tags I can use within an IDP xml
> config file for role mapping. I mean the properties I can add for mapping
> roles in the tag 
> in default.xml for example
>
>
> Rehards,
> Hanen
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [IS] Role mapping through config file

2017-07-05 Thread Hanen Ben Rhouma
Hello guys,

Could you please tell me what are the xml tags I can use within an IDP xml
config file for role mapping. I mean the properties I can add for mapping
roles in the tag 
in default.xml for example


Rehards,
Hanen
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Override default log4.properties in MSF4J

2017-07-05 Thread Jochen Traunecker
Hi Godwin,

thanks for pointing me to the this solution.

Cheers
Jochen

2017-06-28 20:27 GMT+02:00 Godwin Shrimal :

> Hi Jochen,
>
> You can pass log4j commandline paramater when running the fat jar as
> follows to apply the og4j.properties.
>
> -Dlog4j.configuration=file:"$CARBON_HOME"/conf/log4j.properties
>
>
> Thanks
> Godwin
>
>
> On Tue, Jun 27, 2017 at 2:17 AM, Jochen Traunecker <
> jochen.traunec...@googlemail.com> wrote:
>
>> Hi,
>>
>> thanks for the hints and it works adding a log4j.xml into /resources but
>> log4j.properties seems to get ignored. Maybe I have some typo somewhere.
>>
>> Regards,
>> Jochen
>>
>> 2017-06-27 9:09 GMT+02:00 Gottfried Szing :
>>
>>> Hi Jochen
>>>
>>> Did you try the possibilities that come out-of-the-box with log4j?
>>>
>>> https://logging.apache.org/log4j/2.x/manual/configuration.ht
>>> ml#Automatic_Configuration
>>>
>>> br
>>>
>>> On 27/06/2017 09:02, Thomas LEGRAND wrote:
>>>
 Hello,

 Have you tried to put a log4j.xml configuration file in your
 src/main/resources directory? For example, here is mine to trigger the
 DEBUG mode:

 
 >>> xmlns:log4j='http://jakarta.apache.org/log4j/'>

 
 
 
 
 

 
 
 
 

 

 Regards,

 Thomas

 2017-06-26 21:54 GMT+02:00 Jochen Traunecker <
 jochen.traunec...@googlemail.com >:

 Hi,

 I'm wondering if there is a way to introduce a custom
 log4j.properties file instead of default one [1] for
 MSF4J in combination with fatjar?

 Thanks,
 Jochen

 [1] https://github.com/wso2/msf4j/tree/master/core/src/main/reso
 urces
 



 ___
 Dev mailing list
 Dev@wso2.org 
 http://wso2.org/cgi-bin/mailman/listinfo/dev <
 http://wso2.org/cgi-bin/mailman/listinfo/dev>




 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>
>>
>> --
>> Gruss / regards
>>
>> Jochen Traunecker
>> mailto: jochen.traunec...@gmail.com
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Godwin Amila Shrimal*
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: *+94772264165*
> linkedin: *http://lnkd.in/KUum6D *
> twitter: https://twitter.com/godwinamila
> 
>



-- 
Gruss / regards

Jochen Traunecker
mailto: jochen.traunec...@gmail.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Fixing the cache mediator

2017-07-05 Thread Madhawa Gunasekara
Hi Riyafa,

Can we have some kind of user level caching as well, something similar to a
session, since ei works in nhttp transport we don't have that feature in
EI. WDYT? I believe there are some valid use cases when it comes to user
level caching.

Thanks,
Madhawa

On Wed, Jul 5, 2017 at 3:32 PM, Riyafa Abdul Hameed  wrote:

> Hi,
> Please find the requirements doc below:
> https://docs.google.com/document/d/1iPtArrW6C-
> VgzAzjjSsLmG9aqAFEubmFgNkQhoDvqz8/edit?usp=sharing
> Any suggestions would be highly appreciated.
> Thank you.
> Riyafa
>
> On Tue, Jul 4, 2017 at 5:37 PM, Riyafa Abdul Hameed 
> wrote:
>
>> Hi all,
>>
>> Thank you for the suggestions. Yes the mediator should also work with the
>> call mediator.
>>
>> Further on a discussion with the APIM team I have identified the
>> following issues which points to requiring a rewrite of the cache mediator:
>>
>>1.
>>
>>Current cache mediator[1] caches responses for all the HTTP Request
>>Methods which include GET, POST, PUT and DELETE. Ideally a cache mediator
>>should cache only the response for GET method and caching for POST method
>>should be configurable (because POST is the only method used in SOAP
>>implementations). The caching for PUT and DELETE methods should be
>>completely omitted. The reason for caching responses only for GET is
>>because in the REST world other methods (POST, PUT and DELETE) are used 
>> for
>>creating, modifying or deleting existing records and hence the response
>>would only mention the success or failure of the request. Caching these
>>responses is meaningless and error prone.
>>2.
>>
>>Current cache mediator caches all the responses whether they are
>>success or failure responses. Ideally the mediator should cache only
>>success (200 OK) responses and not the failures
>>3.
>>
>>Current mediator hashes the payload (both DOMHASHGenerator and
>>REQUESTHASHGenerator) which is a huge overhead for messages with larger
>>bodies. The mediator should hash only the recipient (To) address of the
>>request and the HTTP headers which can be easily handled when only
>>responses for GET methods are hashed. Payload should be hashed only if PUT
>>method is configured.
>>4.
>>
>>Current mediator does not allow configurations for omitting certain
>>headers when hashing. For example there’s no point in hashing the 
>> timestamp
>>header--it will almost always be different from message to message.
>>5.
>>
>>The current mediator does not honor the http headers[2]. For example
>>the max-age header specifies the maximum time in seconds that the fetched
>>response is allowed to be reused from the time of the request. Although
>>cache timeout is allowed to be configured this header is not honored when
>>it is specified in a message.
>>6.
>>
>>Although it is possible to set the maximum number of elements to be
>>cached in bytes it might result in this set value exceeding the available
>>memory at runtime.
>>7.
>>
>>The current mediator does not invoke the handleResponseInFlow or
>>handleResponseOutFlow methods in handlers[3]
>>
>>
>>
>> [1] https://docs.wso2.com/display/EI611/Cache+Mediator
>>
>> [2] https://developers.google.com/web/fundamentals/performance/o
>> ptimizing-content-efficiency/http-caching
>>
>> [3] https://docs.wso2.com/display/EI611/Writing+a+Synapse+Handler
>>
>> On Tue, Jul 4, 2017 at 4:28 PM, Isuru Udana  wrote:
>>
>>> Hi,
>>>
>>> On Tue, Jul 4, 2017 at 3:10 PM, Vijitha Ekanayake 
>>> wrote:
>>>
 Hi Riyafa,

 Apart from the issues that you have mentioned, we may need to consider
 following points while refactoring the cache mediator implementation.

 1). Verify the cache mediator functionality with different
 configuration parameters and fix if there is anything broken.
 2). Implement a mechanism to support caching when using the call
 mediator.
 3). Feasibility to introduce native JSON caching support to cache
 mediator.
 4). Feasibility to introduce service level caching which isn't support
 at the moment.

>>> IMO, service level caching is not a requirement as long as we can
>>> achieve all the requirements through the Cache Mediator.
>>>
>>> Thanks.
>>>


 Thanks.


 On Tue, Jul 4, 2017 at 12:06 PM, Riyafa Abdul Hameed 
 wrote:

> Dear all,
>
> By going through the issues faced by the customers in the past I
> discovered the following issues:
>
>1. Continue the execution on cache hit. Reported as an issue in
>github[1]
>2. Issue in processing JSON array (payload) with a single element
>when response caching is enabled where expected response is:
>
> [
>{
>   "msg":"Hello",
>   "services":[
>  "elec",
>  "patrol"
>   ],
>   "test":"World."
>},
>   

Re: [Dev] [GSOC][DAS][DEV] Incorrect response from DAS 4.0 Event Simulator

2017-07-05 Thread Madhawa Vidanapathirana
Hi Ramindu,

Thank you for the postman samples and quick fix.
After following the procedure you mentioned, I am getting a proper JSON
response from DAS 4.

Regards,
Madhawa

On Wed, Jul 5, 2017 at 12:59 PM, Ramindu De Silva  wrote:

> Hi Madhawa,
>
> Please find some postman samples. In some you may have to change the
> "executionPlanName" to "siddhiAppName" is several JSON request bodies.
>
> Best Regards,
> Ramindu.
>
> On Wed, Jul 5, 2017 at 12:47 PM, Ramindu De Silva 
> wrote:
>
>> Hi Madhawa,
>>
>> You'll have to clone carbon analytics repo[1]. And then, in the root pom
>> file of product das[2], you will have to change the
>> carbon.analytics.version in the properties section.  eg:
>> 2.0.45-SNAPSHOT
>> You will be able to find the version in the carbon analytics from the
>> carbon analytics repo[1]'s root pom file.
>> Then build carbon analytics repo[1]. And then build product das[2].
>>
>>
>> [1] https://github.com/wso2/carbon-analytics
>> [2] https://github.com/wso2/product-das
>>
>> Best Regards,
>>
>>
>> On Wed, Jul 5, 2017 at 12:34 PM, Madhawa Vidanapathirana <
>> madhawavidanapathir...@gmail.com> wrote:
>>
>>> Hi Ramindu,
>>>
>>> I am working with the* product das *repository [1] and the* issue is
>>> still there*. I did a new clone from master branch and did a mvn
>>> install.
>>>
>>> The steps I took are as follows.
>>>
>>>1. Obtained a new clone of repository
>>>2. mvn install
>>>3. Unzipped wso2das-4.0.0-SNAPSHOT.zip created by maven build
>>>4. Started bin/worker.sh
>>>5. Saved a new configuration using POST http://:
>>>/simulation/feed/
>>>6. Waited for 5 seconds
>>>7. Retrieved the saved configuration using GET http://
>>>:/simulation/feed/{simulationName}
>>>
>>>
>>> [1] - https://github.com/wso2/product-das
>>>
>>>
>>>
>>> On Wed, Jul 5, 2017 at 11:01 AM, Ramindu De Silva 
>>> wrote:
>>>
 Hi Madhawa,

 We have fixed the issue. Please check and let us know.

 Thanks,
 Ramindu.

 On Wed, Jul 5, 2017 at 10:33 AM, Ramindu De Silva 
 wrote:

> Hi Madhawa,
>
> Yes, Simulation configuration should be within inverted commas. I
> will fix it and let you know.
>
> Best Regards,
> Ramindu.
>
> On Wed, Jul 5, 2017 at 9:49 AM, Madhawa Vidanapathirana <
> madhawavidanapathir...@gmail.com> wrote:
>
>> Hi,
>> Small correction to my previous mail, actually I was using *GET*
>> http://:/simulation/feed/{simulationName}, and
>> got the mentioned response from it. I was *not* using
>> /simulation/single endpoint.
>>
>> Any help you can provide is most welcome!
>>
>>
>> On Wed, Jul 5, 2017 at 9:41 AM, Sriskandarajah Suhothayan <
>> s...@wso2.com> wrote:
>>
>>> I don't think you can send a simulation config by calling http://
>>> :/simulation/single/
>>>
>>> @Mohan/Ramindu can you guide him on the API of DAS 4.0 Event
>>> Simulation
>>>
>>> On Tue, Jul 4, 2017 at 9:48 PM, Madhawa Vidanapathirana <
>>> madhawavidanapathir...@gmail.com> wrote:
>>>
 Hi,

 I am currently working on developing a Python Client for DAS 4.0
 Event Simulator as a part of my GSOC project with WSO2.

 When I used the REST endpoint *GET* http://:/s
 imulation/single/{simulationName}, I get a JSON response with an
 incorrect field value.

 The JSON response consist of two string fields "status" and
 "message" where the value of "message" is an *invalid JSON text*
 describing a Simulation Configuration. For example, the following is a
 message field I got from DAS 4.0.

 Simulation configuration : {"sources":[{"timeStampInterva
 l":"5","simulationType":"RANDOM_DATA_SIMULATION","attributeC
 onfiguration":[{"length":"10","type":"PRIMITIVE_BASED"},{"mi
 n":"3","max":"3","precision":"2","type":"PRIMITIVE_B
 ASED"},{"min":"300","max":"300","type":"PRIMITIVE_BASED"}],"
 streamName":"FooStream","siddhiAppName":"TestSiddhiApp"}],"p
 roperties":{"timestampStartTime":"1488615136958","simulation
 Name":"simulationPrimitive","timeInterval":"1000","timestamp
 EndTime":null,"noOfEvents":"8"}}

 In the above, Simulation configuration should be within inverted
 commas, such as "Simulation Configuration" to properly support
 JSON parsing. (tested with standard JSON parser of Python3)

 P.s. I am using DAS 4.0, latest version from master branch.

 Kind Regards,
 --
 *Madhawa Vidanapathirana*
 Student
 Department of Computer Science and Engineering
 University of Moratuwa
 Sri Lanka

 Mobile: (+94) 716874425 <071%20687%204425>
 Email: madhawavidanapathir...@gmail.com
 Linked-In: https://lk.linkedin.com/in/madhawa-vidanapathir

Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.17 RC1

2017-07-05 Thread Kishanthan Thangarajah
There is an L1 in axis2 level which we need to fix it properly -
https://github.com/wso2/wso2-axis2/issues/113

This has to go with the the kernel release, hence we need to cancel this
vote.

On Thu, Jun 29, 2017 at 3:36 PM, Chandana Napagoda 
wrote:

> Hi Devs,
>
> This is the 1st release candidate of WSO2 Carbon Kernel 4.4.17.
>
> This release fixes the following issues
> https://github.com/wso2/carbon-kernel/milestone/15?closed=1
>
> Please test your products with kernel 4.4.17 RC1 and vote. The vote will
> be open for 72 hours or as longer as needed.
>
> Maven staging repository
> https://maven.wso2.org/nexus/content/repositories/orgwso2carbon-1177/
>
> The tag to be voted upon :
> https://github.com/wso2/carbon-kernel/releases/tag/v4.4.17-rc1
>
> [ ] Broken - Do not release (explain why)
> [ ] Stable  - Go ahead and release
>
> Thank you
> Platform Team
>
> --
> *Chandana Napagoda*
> Associate Technical Lead
> WSO2 Inc. - http://wso2.org
>
> *Email  :  chand...@wso2.com **Mobile : +94718169299
> <+94%2071%20816%209299>*
>
> *Blog  :http://cnapagoda.blogspot.com 
> | http://chandana.napagoda.com *
>
> *Linkedin : http://www.linkedin.com/in/chandananapagoda
> *
>
>


-- 
*Kishanthan Thangarajah*
Technical Lead,
Platform Technologies Team,
WSO2, Inc.
lean.enterprise.middleware

Mobile - +94773426635
Blog - *http://kishanthan.wordpress.com *
Twitter - *http://twitter.com/kishanthan *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] net.sf.saxon.om.NamePool$NamePoolLimitException: NamePool limit exceeded:

2017-07-05 Thread Vinod Kavinda
Hi,
What is the product version you are using?
If you are using  EI 6.x, remove the xalan-2.7.2.wso2v2.jar file from the
/wso2/lib/endorsed directory. This jar is required only if you are
using business process profile.

Regards,
Vinod

On Mon, Jul 3, 2017 at 2:54 AM, Júnior  wrote:

> Hi Himasha,
>
> I will try to grab the logs, but as I could see from the JIRA there is no
> fix for that?
>
> Is there any suggestion for this?
>
> Thanks,
>
> 2017-07-01 22:53 GMT-03:00 Himasha Guruge :
>
>> Hi Francisco,
>>
>> Could you provide the complete error log? Looks like the issue is as
>> reported in [1].
>>
>>
>> [1] https://wso2.org/jira/browse/ESBJAVA-3363
>>
>> Thanks,
>> Himasha
>>
>> On Sat, Jul 1, 2017 at 5:18 AM, Júnior  wrote:
>>
>>> Hello,
>>>
>>> I am facing this exception when doing XQuery or XSLT transformation:
>>>
>>>
>>> net.sf.saxon.om.NamePool$NamePoolLimitException: NamePool limit
>>> exceeded:
>>>
>>>
>>>
>>> Does anyone knows a workaround for this?
>>>
>>> Thanks,
>>> --
>>> Francisco Ribeiro
>>> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Himasha Guruge
>> *Software Engineer*
>> WS*O2* *Inc.*
>> Mobile: +94 777459299 <+94%2077%20745%209299>
>> himas...@wso2.com
>>
>
>
>
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Vinod Kavinda
Senior Software Engineer
*WSO2 Inc. - lean . enterprise . middleware .*
Mobile : +94 (0) 712 415544
Blog : http://soatechflicks.blogspot.com/
[image: http://wso2.com/signature]

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Problems on MB Cluster Enterprise Integrator 6.1.0

2017-07-05 Thread Hasitha Hiranya
Hi,



default

Set a node id in broker.xml file at [EI_HOME]/wso2/broker/conf

BTW, are necessary ports open for Hazelcast to communicate?

Thanks

On Mon, Jul 3, 2017 at 6:51 PM, Júnior  wrote:

> Hello,
>
> I am trying to setup a cluster for the Broker Profile on AWS.
>
> I am able to start the first node without problem, but when we start the
> second node, it doesn't start because it says it is not able to get the
> node id of the other member:
>
> TID: [-1234] [] [2017-07-03 12:55:10,193] ERROR 
> {org.wso2.andes.server.registry.ApplicationRegistry}
> -  org.wso2.andes.kernel.AndesException: Failed to read Node id of
> hazelcast member Member [X.X.X.X]:5711
>
> On the nodes I have leave the nodeId on broker.xml as default, so it will
> generate a random one.
>
> Do you have any clue on where should I set this node id?
>
> Thanks,
>
>
>
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Hasitha Abeykoon*
Senior Software Engineer; WSO2, Inc.; http://wso2.com
*cell:* *+94 719363063*
*blog: **abeykoon.blogspot.com* 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Should we refactor CarbonMessage

2017-07-05 Thread Irunika Weeraratne
Hi Shafreen and Asitha,
In the first place, they were introduced after a long discussion in
WebSocket scenarios. This was because when the WebSocket messages are
arrived to transport level we already knew what kind of message it is.
Eg: Text, Binary, Control, Status

So I made sense to create the same type of carbon message in the transport.
Then carbon message types were used to identify the scenarios we had to
address in the application layer.
Eg: If the carbon message is an instance of TextCarbonMessage we know what
to do in the first place. Also converting text into byte buffer in the
transport and then converting it again into text in the application layer
doesn't make sense.

Because of that, those message types were introduced. IMO while we reduce
the no. of carbon message types we might need to keep some of the types
because it will affect the performance.
Also, we can always override the methods in default carbon message if in
order to work with default scenarios.

WDYT?

Thanks,
Irunika

*Irunika Weeraratne*
*Software Engineer | WSO2, Inc. *
*Email : irun...@wso2.com *
*LinkedIn : https://lk.linkedin.com/in/irunika
*
*Mobile : +94712403314*
*Lean . Enterprise . Middleware*


On Wed, Jul 5, 2017 at 3:54 PM, Asitha Nanayakkara  wrote:

> Hi Shafreen,
>
> I would suggest having a single Carbon Message with the option to set
> different types of data sources as the data source for the message. For
> that, we might need to go through the existing other message types and
> think what kind of functionality to be added to carbon message. If our
> intention is not to extend carbon message, we can make it a final class. If
> not we have to design it to be extended by other users.
>
> When reading the payload multiple times (building the message) we need to
> clone messages (since data is represented as a stream). In pass through
> scenarios, we should avoid cloning the message and use the stream once.
> IMO we can implement this functionality by way of having package level
> methods for transport to read from the internal blocking queue and write to
> the output stream. If we invoke other public methods they will make a clone
> of the message data and use. This way we avoid unnecessary cloning in a
> pass-through scenario. And reading from the blocking queue can only be done
> from the transport. Outside users have to use message data source to read
> the content, which might clone the data.
>
> WDYT?
>
> Regards,
> Asitha
>
> On Wed, Jul 5, 2017 at 3:14 PM, Shafreen Anfar  wrote:
>
>> Hi All,
>>
>> It seems there is room to improve the current CarbonMessage
>> implementation. Following are few main areas where we can improve its
>> functionality.
>>
>>- At the moment there are too many ways to get the message body from
>>the CarbonMessage
>>- getMessageBody()
>>   - getInputStream() - This is a http specific impl.
>>   - getMessageDateSource()
>>
>>
>>- There are too many types of CarbonMessages in carbon-messaging that
>>are only used by a specific transport implementation
>>   - BinaryCarbonMessage
>>   - ControlCarbonMessage
>>   - DefaultCarbonMessage
>>   - MapCarbonMessage
>>   - SerializableCarbonMessage
>>   - StatusCarbonMessage
>>   - StreamingCarbonMessage
>>   - TextCarbonMessage
>>
>>
>>- Most of above CarbonMessages do not adhere to the contract that is
>>imposed by the CarbonMessage interface.
>>
>> Considering these facts, I believe we should refactor CarbonMessage
>> before others starting using it in their implementations. Please let us
>> know your thoughts as well :)
>>
>> --
>> Regards,
>> *Shafreen*
>> Software Engineer
>> WSO2 Inc
>> Mobile : 077-556-395-1
>>
>
>
>
> --
> *Asitha Nanayakkara* 
> Senior Software Engineer
> WSO2, Inc. 
> Mob: +94 77 853 0682 <+94%2077%20853%200682>
> [image: https://wso2.com/signature] 
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Swagger] swagger2cxf-maven-plugin to generate server stub for CXF

2017-07-05 Thread Ruwan Abeykoon
Hi Sanjeewa,
+1, thanks for the explanation.

Cheers,
Ruwan


On Wed, Jul 5, 2017 at 3:49 PM, Sanjeewa Malalgoda 
wrote:

> I'm not sure you are talking about MSF4J converter or something else. If
> you are using my swagger to MSF4J converter(swagger2cxf-maven-plugin) it
> will generate gen directory and impl directory. From that gen directory is
> completely auto generated and we don't need to modify/update it. But if we
> consider impl then we must implement real logic there because we don't have
> any implementation there. So technically its skeleton.
>
> We are not just committing auto generated code to VCS. We will use auto
> generated skeletons to do implementation and commit it to VCS. This is how
> we use it. But you can decide what to do with your components.
>
> Thanks,
> sanjeewa.
>
>
> On Wed, Jul 5, 2017 at 2:51 PM, Ruwan Abeykoon  wrote:
>
>> Hi Sanjeewa,
>> Committing generated files into VCS is a debatable practice. Some argue
>> against it [1] [2]. I am in that camp :-)
>>
>> [1] https://homes.cs.washington.edu/~mernst/advice/version-
>> control.html#Dont_commit_generated_files
>> [2] https://perlmaven.com/dont-keep-generated-files-in-version-control
>>
>> Cheers,
>> Ruwan
>>
>>
>> On Wed, Jul 5, 2017 at 1:58 PM, Sanjeewa Malalgoda 
>> wrote:
>>
>>> Isura is correct IMO. Why do we need to automate code generation with
>>> component build? If we have API change then only we need to trigger code
>>> generation. If there are changes after code generate you can selectively
>>> commit them.
>>>
>>> Also we don't need to add class level comments to generated code(inside
>>> /gen directory). Further we can skip validations, code coverage etc for
>>> generated code. Each generated code will have mapped implementation(where
>>> we add our code). So we can add class comments there.
>>>
>>> On Wed, Jul 5, 2017 at 1:42 PM, Ruwan Abeykoon  wrote:
>>>
 Hi Isura,

 On Wed, Jul 5, 2017 at 1:04 PM, Isura Karunaratne 
 wrote:

> Hi Indunil,
>
> On Wed, Jul 5, 2017 at 11:35 AM, Indunil Upeksha Rathnayake <
> indu...@wso2.com> wrote:
>
>> Hi,
>>
>> I have used the Swagger Codegen to generation the server stubs from a
>> Swagger definition of a REST API for IS 5.4.0.
>>
>> In there I have added the following plugin to generate server stub
>> for CXF.
>>
>> 
>>> org.wso2.maven.plugins
>>> swagger2cxf-maven-plugin
>>> 1.0-SNAPSHOT
>>> 
>>> ${project.basedir}/src/main/resources/api.identit
>>> y.oauth2.scope.endpoint.yaml
>>> 
>>> 
>>>
>>
>>
>> Also add the following maven build helper plugin.
>>
>> 
>>> org.codehaus.mojo
>>> build-helper-maven-plugin
>>> 
>>> 
>>> add-source
>>> generate-sources
>>> 
>>> add-source
>>> 
>>> 
>>> 
>>> src/gen/java
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>
>> Then use "mvn swagger2cxf:generate" command to generate the server
>> stubs and in src/gen/java folder, set of factories are generated and in
>> main/Java folder, a set of impl files are generated.
>>
>> I have following concerns regarding server stubs generation from
>> Swagger.
>>
>>- Is this can be automated to do in component build?
>>
>>
> No.
>
>>
>>- Or normally this is the way it should handled and need to
>>commit all the generated files to git as well?
>>
>> We have to commit generated files.
>

 What are the reasons ?


>
>>
>>- If we are committing the generated files to git, is it
>>recommended to add class comments in those?
>>
>> I don't think we need to add class comments. But, we better to add
> licence headers.
>
> Thanks
> Isura.
>
>>
>> Thanks and Regards
>>
>> --
>> Indunil Upeksha Rathnayake
>> Software Engineer | WSO2 Inc
>> Emailindu...@wso2.com
>> Mobile   0772182255 <077%20218%202255>
>>
>
>
>
> --
>
> *Isura Dilhara Karunaratne*
> Senior Software Engineer | WSO2
> Email: is...@wso2.com
> Mob : +94 772 254 810 <+94%2077%20225%204810>
> Blog : http://isurad.blogspot.com/
>
>
>
>

 Cheers,
 Ruwan

>>>
>>>
>>>
>>> --
>>>
>>> *Sanjeewa Malalgoda*
>>> WSO2 Inc.
>>> Mobile : +94713068779 <+94%2071%20306%208779>
>>>
>>> blog
>>> :http://sanjeewamalalgoda.blogspot.com/
>>> 
>>>
>>>
>>>
>>
>>
>
>
> --
>
> *Sanjeewa Malalgoda*
> WSO2 Inc.
> Mobile : +94713068779 <+

Re: [Dev] Should we refactor CarbonMessage

2017-07-05 Thread Asitha Nanayakkara
Hi Shafreen,

I would suggest having a single Carbon Message with the option to set
different types of data sources as the data source for the message. For
that, we might need to go through the existing other message types and
think what kind of functionality to be added to carbon message. If our
intention is not to extend carbon message, we can make it a final class. If
not we have to design it to be extended by other users.

When reading the payload multiple times (building the message) we need to
clone messages (since data is represented as a stream). In pass through
scenarios, we should avoid cloning the message and use the stream once.
IMO we can implement this functionality by way of having package level
methods for transport to read from the internal blocking queue and write to
the output stream. If we invoke other public methods they will make a clone
of the message data and use. This way we avoid unnecessary cloning in a
pass-through scenario. And reading from the blocking queue can only be done
from the transport. Outside users have to use message data source to read
the content, which might clone the data.

WDYT?

Regards,
Asitha

On Wed, Jul 5, 2017 at 3:14 PM, Shafreen Anfar  wrote:

> Hi All,
>
> It seems there is room to improve the current CarbonMessage
> implementation. Following are few main areas where we can improve its
> functionality.
>
>- At the moment there are too many ways to get the message body from
>the CarbonMessage
>- getMessageBody()
>   - getInputStream() - This is a http specific impl.
>   - getMessageDateSource()
>
>
>- There are too many types of CarbonMessages in carbon-messaging that
>are only used by a specific transport implementation
>   - BinaryCarbonMessage
>   - ControlCarbonMessage
>   - DefaultCarbonMessage
>   - MapCarbonMessage
>   - SerializableCarbonMessage
>   - StatusCarbonMessage
>   - StreamingCarbonMessage
>   - TextCarbonMessage
>
>
>- Most of above CarbonMessages do not adhere to the contract that is
>imposed by the CarbonMessage interface.
>
> Considering these facts, I believe we should refactor CarbonMessage before
> others starting using it in their implementations. Please let us know your
> thoughts as well :)
>
> --
> Regards,
> *Shafreen*
> Software Engineer
> WSO2 Inc
> Mobile : 077-556-395-1
>



-- 
*Asitha Nanayakkara* 
Senior Software Engineer
WSO2, Inc. 
Mob: +94 77 853 0682
[image: https://wso2.com/signature] 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Swagger] swagger2cxf-maven-plugin to generate server stub for CXF

2017-07-05 Thread Sanjeewa Malalgoda
I'm not sure you are talking about MSF4J converter or something else. If
you are using my swagger to MSF4J converter(swagger2cxf-maven-plugin) it
will generate gen directory and impl directory. From that gen directory is
completely auto generated and we don't need to modify/update it. But if we
consider impl then we must implement real logic there because we don't have
any implementation there. So technically its skeleton.

We are not just committing auto generated code to VCS. We will use auto
generated skeletons to do implementation and commit it to VCS. This is how
we use it. But you can decide what to do with your components.

Thanks,
sanjeewa.


On Wed, Jul 5, 2017 at 2:51 PM, Ruwan Abeykoon  wrote:

> Hi Sanjeewa,
> Committing generated files into VCS is a debatable practice. Some argue
> against it [1] [2]. I am in that camp :-)
>
> [1] https://homes.cs.washington.edu/~mernst/advice/
> version-control.html#Dont_commit_generated_files
> [2] https://perlmaven.com/dont-keep-generated-files-in-version-control
>
> Cheers,
> Ruwan
>
>
> On Wed, Jul 5, 2017 at 1:58 PM, Sanjeewa Malalgoda 
> wrote:
>
>> Isura is correct IMO. Why do we need to automate code generation with
>> component build? If we have API change then only we need to trigger code
>> generation. If there are changes after code generate you can selectively
>> commit them.
>>
>> Also we don't need to add class level comments to generated code(inside
>> /gen directory). Further we can skip validations, code coverage etc for
>> generated code. Each generated code will have mapped implementation(where
>> we add our code). So we can add class comments there.
>>
>> On Wed, Jul 5, 2017 at 1:42 PM, Ruwan Abeykoon  wrote:
>>
>>> Hi Isura,
>>>
>>> On Wed, Jul 5, 2017 at 1:04 PM, Isura Karunaratne 
>>> wrote:
>>>
 Hi Indunil,

 On Wed, Jul 5, 2017 at 11:35 AM, Indunil Upeksha Rathnayake <
 indu...@wso2.com> wrote:

> Hi,
>
> I have used the Swagger Codegen to generation the server stubs from a
> Swagger definition of a REST API for IS 5.4.0.
>
> In there I have added the following plugin to generate server stub for
> CXF.
>
> 
>> org.wso2.maven.plugins
>> swagger2cxf-maven-plugin
>> 1.0-SNAPSHOT
>> 
>> ${project.basedir}/src/main/resources/api.identit
>> y.oauth2.scope.endpoint.yaml
>> 
>> 
>>
>
>
> Also add the following maven build helper plugin.
>
> 
>> org.codehaus.mojo
>> build-helper-maven-plugin
>> 
>> 
>> add-source
>> generate-sources
>> 
>> add-source
>> 
>> 
>> 
>> src/gen/java
>> 
>> 
>> 
>> 
>> 
>>
>
> Then use "mvn swagger2cxf:generate" command to generate the server
> stubs and in src/gen/java folder, set of factories are generated and in
> main/Java folder, a set of impl files are generated.
>
> I have following concerns regarding server stubs generation from
> Swagger.
>
>- Is this can be automated to do in component build?
>
>
 No.

>
>- Or normally this is the way it should handled and need to commit
>all the generated files to git as well?
>
> We have to commit generated files.

>>>
>>> What are the reasons ?
>>>
>>>

>
>- If we are committing the generated files to git, is it
>recommended to add class comments in those?
>
> I don't think we need to add class comments. But, we better to add
 licence headers.

 Thanks
 Isura.

>
> Thanks and Regards
>
> --
> Indunil Upeksha Rathnayake
> Software Engineer | WSO2 Inc
> Emailindu...@wso2.com
> Mobile   0772182255 <077%20218%202255>
>



 --

 *Isura Dilhara Karunaratne*
 Senior Software Engineer | WSO2
 Email: is...@wso2.com
 Mob : +94 772 254 810 <+94%2077%20225%204810>
 Blog : http://isurad.blogspot.com/




>>>
>>> Cheers,
>>> Ruwan
>>>
>>
>>
>>
>> --
>>
>> *Sanjeewa Malalgoda*
>> WSO2 Inc.
>> Mobile : +94713068779 <+94%2071%20306%208779>
>>
>> blog
>> :http://sanjeewamalalgoda.blogspot.com/
>> 
>>
>>
>>
>
>


-- 

*Sanjeewa Malalgoda*
WSO2 Inc.
Mobile : +94713068779

blog
:http://sanjeewamalalgoda.blogspot.com/

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Should we refactor CarbonMessage

2017-07-05 Thread Shafreen Anfar
Hi All,

It seems there is room to improve the current CarbonMessage implementation.
Following are few main areas where we can improve its functionality.

   - At the moment there are too many ways to get the message body from the
   CarbonMessage
   - getMessageBody()
  - getInputStream() - This is a http specific impl.
  - getMessageDateSource()


   - There are too many types of CarbonMessages in carbon-messaging that
   are only used by a specific transport implementation
  - BinaryCarbonMessage
  - ControlCarbonMessage
  - DefaultCarbonMessage
  - MapCarbonMessage
  - SerializableCarbonMessage
  - StatusCarbonMessage
  - StreamingCarbonMessage
  - TextCarbonMessage


   - Most of above CarbonMessages do not adhere to the contract that is
   imposed by the CarbonMessage interface.

Considering these facts, I believe we should refactor CarbonMessage before
others starting using it in their implementations. Please let us know your
thoughts as well :)

-- 
Regards,
*Shafreen*
Software Engineer
WSO2 Inc
Mobile : 077-556-395-1
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Fixing the cache mediator

2017-07-05 Thread Riyafa Abdul Hameed
Hi,
Please find the requirements doc below:
https://docs.google.com/document/d/1iPtArrW6C-VgzAzjjSsLmG9aqAFEubmFgNkQhoDvqz8/edit?usp=sharing
Any suggestions would be highly appreciated.
Thank you.
Riyafa

On Tue, Jul 4, 2017 at 5:37 PM, Riyafa Abdul Hameed  wrote:

> Hi all,
>
> Thank you for the suggestions. Yes the mediator should also work with the
> call mediator.
>
> Further on a discussion with the APIM team I have identified the following
> issues which points to requiring a rewrite of the cache mediator:
>
>1.
>
>Current cache mediator[1] caches responses for all the HTTP Request
>Methods which include GET, POST, PUT and DELETE. Ideally a cache mediator
>should cache only the response for GET method and caching for POST method
>should be configurable (because POST is the only method used in SOAP
>implementations). The caching for PUT and DELETE methods should be
>completely omitted. The reason for caching responses only for GET is
>because in the REST world other methods (POST, PUT and DELETE) are used for
>creating, modifying or deleting existing records and hence the response
>would only mention the success or failure of the request. Caching these
>responses is meaningless and error prone.
>2.
>
>Current cache mediator caches all the responses whether they are
>success or failure responses. Ideally the mediator should cache only
>success (200 OK) responses and not the failures
>3.
>
>Current mediator hashes the payload (both DOMHASHGenerator and
>REQUESTHASHGenerator) which is a huge overhead for messages with larger
>bodies. The mediator should hash only the recipient (To) address of the
>request and the HTTP headers which can be easily handled when only
>responses for GET methods are hashed. Payload should be hashed only if PUT
>method is configured.
>4.
>
>Current mediator does not allow configurations for omitting certain
>headers when hashing. For example there’s no point in hashing the timestamp
>header--it will almost always be different from message to message.
>5.
>
>The current mediator does not honor the http headers[2]. For example
>the max-age header specifies the maximum time in seconds that the fetched
>response is allowed to be reused from the time of the request. Although
>cache timeout is allowed to be configured this header is not honored when
>it is specified in a message.
>6.
>
>Although it is possible to set the maximum number of elements to be
>cached in bytes it might result in this set value exceeding the available
>memory at runtime.
>7.
>
>The current mediator does not invoke the handleResponseInFlow or
>handleResponseOutFlow methods in handlers[3]
>
>
>
> [1] https://docs.wso2.com/display/EI611/Cache+Mediator
>
> [2] https://developers.google.com/web/fundamentals/performance/
> optimizing-content-efficiency/http-caching
>
> [3] https://docs.wso2.com/display/EI611/Writing+a+Synapse+Handler
>
> On Tue, Jul 4, 2017 at 4:28 PM, Isuru Udana  wrote:
>
>> Hi,
>>
>> On Tue, Jul 4, 2017 at 3:10 PM, Vijitha Ekanayake 
>> wrote:
>>
>>> Hi Riyafa,
>>>
>>> Apart from the issues that you have mentioned, we may need to consider
>>> following points while refactoring the cache mediator implementation.
>>>
>>> 1). Verify the cache mediator functionality with different configuration
>>> parameters and fix if there is anything broken.
>>> 2). Implement a mechanism to support caching when using the call
>>> mediator.
>>> 3). Feasibility to introduce native JSON caching support to cache
>>> mediator.
>>> 4). Feasibility to introduce service level caching which isn't support
>>> at the moment.
>>>
>> IMO, service level caching is not a requirement as long as we can achieve
>> all the requirements through the Cache Mediator.
>>
>> Thanks.
>>
>>>
>>>
>>> Thanks.
>>>
>>>
>>> On Tue, Jul 4, 2017 at 12:06 PM, Riyafa Abdul Hameed 
>>> wrote:
>>>
 Dear all,

 By going through the issues faced by the customers in the past I
 discovered the following issues:

1. Continue the execution on cache hit. Reported as an issue in
github[1]
2. Issue in processing JSON array (payload) with a single element
when response caching is enabled where expected response is:

 [
{
   "msg":"Hello",
   "services":[
  "elec",
  "patrol"
   ],
   "test":"World."
},
{
   "msg":"Hi",
   "services":[
  "water"
   ],
   "test":"Sri Lanka."
}
 ]

 but received response is:

 [
 { "msg": "Hello", "services": [ "elec", "patrol" ], "test": "World." }

 ,
 { "msg": "Hi", "services": "water", "test": "Sri Lanka." }

 ]

 This issue has been fixed in the carbon mediation[2].

3.  When a xml body with processing instruct

Re: [Dev] [Swagger] swagger2cxf-maven-plugin to generate server stub for CXF

2017-07-05 Thread Sanjeewa Malalgoda
Isura is correct IMO. Why do we need to automate code generation with
component build? If we have API change then only we need to trigger code
generation. If there are changes after code generate you can selectively
commit them.

Also we don't need to add class level comments to generated code(inside
/gen directory). Further we can skip validations, code coverage etc for
generated code. Each generated code will have mapped implementation(where
we add our code). So we can add class comments there.

On Wed, Jul 5, 2017 at 1:42 PM, Ruwan Abeykoon  wrote:

> Hi Isura,
>
> On Wed, Jul 5, 2017 at 1:04 PM, Isura Karunaratne  wrote:
>
>> Hi Indunil,
>>
>> On Wed, Jul 5, 2017 at 11:35 AM, Indunil Upeksha Rathnayake <
>> indu...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> I have used the Swagger Codegen to generation the server stubs from a
>>> Swagger definition of a REST API for IS 5.4.0.
>>>
>>> In there I have added the following plugin to generate server stub for
>>> CXF.
>>>
>>> 
 org.wso2.maven.plugins
 swagger2cxf-maven-plugin
 1.0-SNAPSHOT
 
 ${project.basedir}/src/main/resources/api.identit
 y.oauth2.scope.endpoint.yaml
 
 

>>>
>>>
>>> Also add the following maven build helper plugin.
>>>
>>> 
 org.codehaus.mojo
 build-helper-maven-plugin
 
 
 add-source
 generate-sources
 
 add-source
 
 
 
 src/gen/java
 
 
 
 
 

>>>
>>> Then use "mvn swagger2cxf:generate" command to generate the server stubs
>>> and in src/gen/java folder, set of factories are generated and in main/Java
>>> folder, a set of impl files are generated.
>>>
>>> I have following concerns regarding server stubs generation from Swagger.
>>>
>>>- Is this can be automated to do in component build?
>>>
>>>
>> No.
>>
>>>
>>>- Or normally this is the way it should handled and need to commit
>>>all the generated files to git as well?
>>>
>>> We have to commit generated files.
>>
>
> What are the reasons ?
>
>
>>
>>>
>>>- If we are committing the generated files to git, is it recommended
>>>to add class comments in those?
>>>
>>> I don't think we need to add class comments. But, we better to add
>> licence headers.
>>
>> Thanks
>> Isura.
>>
>>>
>>> Thanks and Regards
>>>
>>> --
>>> Indunil Upeksha Rathnayake
>>> Software Engineer | WSO2 Inc
>>> Emailindu...@wso2.com
>>> Mobile   0772182255 <077%20218%202255>
>>>
>>
>>
>>
>> --
>>
>> *Isura Dilhara Karunaratne*
>> Senior Software Engineer | WSO2
>> Email: is...@wso2.com
>> Mob : +94 772 254 810 <+94%2077%20225%204810>
>> Blog : http://isurad.blogspot.com/
>>
>>
>>
>>
>
> Cheers,
> Ruwan
>



-- 

*Sanjeewa Malalgoda*
WSO2 Inc.
Mobile : +94713068779

blog
:http://sanjeewamalalgoda.blogspot.com/

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Swagger] swagger2cxf-maven-plugin to generate server stub for CXF

2017-07-05 Thread Ruwan Abeykoon
Hi Sanjeewa,
Committing generated files into VCS is a debatable practice. Some argue
against it [1] [2]. I am in that camp :-)

[1]
https://homes.cs.washington.edu/~mernst/advice/version-control.html#Dont_commit_generated_files
[2] https://perlmaven.com/dont-keep-generated-files-in-version-control

Cheers,
Ruwan


On Wed, Jul 5, 2017 at 1:58 PM, Sanjeewa Malalgoda 
wrote:

> Isura is correct IMO. Why do we need to automate code generation with
> component build? If we have API change then only we need to trigger code
> generation. If there are changes after code generate you can selectively
> commit them.
>
> Also we don't need to add class level comments to generated code(inside
> /gen directory). Further we can skip validations, code coverage etc for
> generated code. Each generated code will have mapped implementation(where
> we add our code). So we can add class comments there.
>
> On Wed, Jul 5, 2017 at 1:42 PM, Ruwan Abeykoon  wrote:
>
>> Hi Isura,
>>
>> On Wed, Jul 5, 2017 at 1:04 PM, Isura Karunaratne  wrote:
>>
>>> Hi Indunil,
>>>
>>> On Wed, Jul 5, 2017 at 11:35 AM, Indunil Upeksha Rathnayake <
>>> indu...@wso2.com> wrote:
>>>
 Hi,

 I have used the Swagger Codegen to generation the server stubs from a
 Swagger definition of a REST API for IS 5.4.0.

 In there I have added the following plugin to generate server stub for
 CXF.

 
> org.wso2.maven.plugins
> swagger2cxf-maven-plugin
> 1.0-SNAPSHOT
> 
> ${project.basedir}/src/main/resources/api.identit
> y.oauth2.scope.endpoint.yaml
> 
> 
>


 Also add the following maven build helper plugin.

 
> org.codehaus.mojo
> build-helper-maven-plugin
> 
> 
> add-source
> generate-sources
> 
> add-source
> 
> 
> 
> src/gen/java
> 
> 
> 
> 
> 
>

 Then use "mvn swagger2cxf:generate" command to generate the server
 stubs and in src/gen/java folder, set of factories are generated and in
 main/Java folder, a set of impl files are generated.

 I have following concerns regarding server stubs generation from
 Swagger.

- Is this can be automated to do in component build?


>>> No.
>>>

- Or normally this is the way it should handled and need to commit
all the generated files to git as well?

 We have to commit generated files.
>>>
>>
>> What are the reasons ?
>>
>>
>>>

- If we are committing the generated files to git, is it
recommended to add class comments in those?

 I don't think we need to add class comments. But, we better to add
>>> licence headers.
>>>
>>> Thanks
>>> Isura.
>>>

 Thanks and Regards

 --
 Indunil Upeksha Rathnayake
 Software Engineer | WSO2 Inc
 Emailindu...@wso2.com
 Mobile   0772182255 <077%20218%202255>

>>>
>>>
>>>
>>> --
>>>
>>> *Isura Dilhara Karunaratne*
>>> Senior Software Engineer | WSO2
>>> Email: is...@wso2.com
>>> Mob : +94 772 254 810 <+94%2077%20225%204810>
>>> Blog : http://isurad.blogspot.com/
>>>
>>>
>>>
>>>
>>
>> Cheers,
>> Ruwan
>>
>
>
>
> --
>
> *Sanjeewa Malalgoda*
> WSO2 Inc.
> Mobile : +94713068779 <+94%2071%20306%208779>
>
> blog :http://sanjeewamalalgoda.
> blogspot.com/ 
>
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Swagger] swagger2cxf-maven-plugin to generate server stub for CXF

2017-07-05 Thread Ruwan Abeykoon
Hi Isura,

On Wed, Jul 5, 2017 at 1:04 PM, Isura Karunaratne  wrote:

> Hi Indunil,
>
> On Wed, Jul 5, 2017 at 11:35 AM, Indunil Upeksha Rathnayake <
> indu...@wso2.com> wrote:
>
>> Hi,
>>
>> I have used the Swagger Codegen to generation the server stubs from a
>> Swagger definition of a REST API for IS 5.4.0.
>>
>> In there I have added the following plugin to generate server stub for
>> CXF.
>>
>> 
>>> org.wso2.maven.plugins
>>> swagger2cxf-maven-plugin
>>> 1.0-SNAPSHOT
>>> 
>>> ${project.basedir}/src/main/resources/api.identit
>>> y.oauth2.scope.endpoint.yaml
>>> 
>>> 
>>>
>>
>>
>> Also add the following maven build helper plugin.
>>
>> 
>>> org.codehaus.mojo
>>> build-helper-maven-plugin
>>> 
>>> 
>>> add-source
>>> generate-sources
>>> 
>>> add-source
>>> 
>>> 
>>> 
>>> src/gen/java
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>
>> Then use "mvn swagger2cxf:generate" command to generate the server stubs
>> and in src/gen/java folder, set of factories are generated and in main/Java
>> folder, a set of impl files are generated.
>>
>> I have following concerns regarding server stubs generation from Swagger.
>>
>>- Is this can be automated to do in component build?
>>
>>
> No.
>
>>
>>- Or normally this is the way it should handled and need to commit
>>all the generated files to git as well?
>>
>> We have to commit generated files.
>

What are the reasons ?


>
>>
>>- If we are committing the generated files to git, is it recommended
>>to add class comments in those?
>>
>> I don't think we need to add class comments. But, we better to add
> licence headers.
>
> Thanks
> Isura.
>
>>
>> Thanks and Regards
>>
>> --
>> Indunil Upeksha Rathnayake
>> Software Engineer | WSO2 Inc
>> Emailindu...@wso2.com
>> Mobile   0772182255
>>
>
>
>
> --
>
> *Isura Dilhara Karunaratne*
> Senior Software Engineer | WSO2
> Email: is...@wso2.com
> Mob : +94 772 254 810 <+94%2077%20225%204810>
> Blog : http://isurad.blogspot.com/
>
>
>
>

Cheers,
Ruwan
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Issue in the deployment of WSO2am docker image in to aws EC2 container service

2017-07-05 Thread Ayeshmantha Perera
Hi All

I tried to telnet in to the instance but it's not working.But it says
container started succefully.And all the ports are opend for the load
balancer.But still no luck.Any idea on this

Regards
Ayesh

On Tue, Jul 4, 2017 at 4:50 PM, Ayeshmantha Perera 
wrote:

>
>
> On Mon, Jul 3, 2017 at 8:17 PM, Pubudu Gunatilaka 
> wrote:
>
>> Hi,
>>
>> Server log looks okay. Can you check whether api manager is running in
>> the container? I guess you should be able to login to the container. Maybe
>> you can telnet and check 9443 port is up and running.
>>
>> Thank you!
>>
>> On Mon, Jul 3, 2017 at 6:35 PM, Ayeshmantha Perera <
>> akayeshman...@gmail.com> wrote:
>>
>>> Hi Pubudu
>>>
>>> Am using a self signed certificate is that a problem.Because always with
>>> that cert when I'm creating a http/s load blancer it says no healthy
>>> targets are found
>>>
>>> Thanks
>>> Regards
>>> Ayesh
>>>
>>> On Mon, Jul 3, 2017 at 5:02 PM, Ayeshmantha Perera <
>>> akayeshman...@gmail.com> wrote:
>>>
 Hi Pubudu

 The log shows that hthe apim is up and running
 Is there an issue with /echo/wso2 health check endpoint

 Here I attach the log with the mail

 On Wed, Jun 28, 2017 at 8:06 PM, Pubudu Gunatilaka 
 wrote:

> HI Ayesh,
>
> Do you see any errors in the container logs?
>
> Thank you!
>
> On Wed, Jun 28, 2017 at 12:13 PM, Ayeshmantha Perera <
> akayeshman...@gmail.com> wrote:
>
>> Hi All
>>
>> We deploy the wso2am 2.1.0 docker image which was taken from the wso2
>> docker hub in aws EC2 container service.And also followed the [1] as a
>> referece on deploying
>>
>> After creating the ECS service which is exposing the management
>> console outside.It gives a 504 bad gateway error.And also it shows that 
>> non
>> of the instances are healthy in the region.I deployed it on 4 regions in
>> all regions it was the same
>>
>> Appreciate if someone can help us to resolve this deployment issue
>>
>> Regards,
>> Ayeshmantha
>>
>> [1] https://medium.com/containermind/how-to-deploy-wso2-api-
>> manager-on-amazon-ecs-bdc5a8d22844
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Pubudu Gunatilaka*
> Committer and PMC Member - Apache Stratos
> Software Engineer
> WSO2, Inc.: http://wso2.com
> mobile : +94774078049 <%2B94772207163>
>
>

>>>
>>
>>
>> --
>> *Pubudu Gunatilaka*
>> Committer and PMC Member - Apache Stratos
>> Software Engineer
>> WSO2, Inc.: http://wso2.com
>> mobile : +94774078049 <%2B94772207163>
>>
>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [GSOC][DAS][DEV] Incorrect response from DAS 4.0 Event Simulator

2017-07-05 Thread Ramindu De Silva
Hi Madhawa,

You'll have to clone carbon analytics repo[1]. And then, in the root pom
file of product das[2], you will have to change the
carbon.analytics.version in the properties section.  eg:
2.0.45-SNAPSHOT
You will be able to find the version in the carbon analytics from the
carbon analytics repo[1]'s root pom file.
Then build carbon analytics repo[1]. And then build product das[2].


[1] https://github.com/wso2/carbon-analytics
[2] https://github.com/wso2/product-das

Best Regards,


On Wed, Jul 5, 2017 at 12:34 PM, Madhawa Vidanapathirana <
madhawavidanapathir...@gmail.com> wrote:

> Hi Ramindu,
>
> I am working with the* product das *repository [1] and the* issue is
> still there*. I did a new clone from master branch and did a mvn install.
>
> The steps I took are as follows.
>
>1. Obtained a new clone of repository
>2. mvn install
>3. Unzipped wso2das-4.0.0-SNAPSHOT.zip created by maven build
>4. Started bin/worker.sh
>5. Saved a new configuration using POST http://:/
>simulation/feed/
>6. Waited for 5 seconds
>7. Retrieved the saved configuration using GET http://
>:/simulation/feed/{simulationName}
>
>
> [1] - https://github.com/wso2/product-das
>
>
>
> On Wed, Jul 5, 2017 at 11:01 AM, Ramindu De Silva 
> wrote:
>
>> Hi Madhawa,
>>
>> We have fixed the issue. Please check and let us know.
>>
>> Thanks,
>> Ramindu.
>>
>> On Wed, Jul 5, 2017 at 10:33 AM, Ramindu De Silva 
>> wrote:
>>
>>> Hi Madhawa,
>>>
>>> Yes, Simulation configuration should be within inverted commas. I will
>>> fix it and let you know.
>>>
>>> Best Regards,
>>> Ramindu.
>>>
>>> On Wed, Jul 5, 2017 at 9:49 AM, Madhawa Vidanapathirana <
>>> madhawavidanapathir...@gmail.com> wrote:
>>>
 Hi,
 Small correction to my previous mail, actually I was using *GET*
 http://:/simulation/feed/{simulationName}, and got
 the mentioned response from it. I was *not* using /simulation/single
 endpoint.

 Any help you can provide is most welcome!


 On Wed, Jul 5, 2017 at 9:41 AM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> I don't think you can send a simulation config by calling http://
> :/simulation/single/
>
> @Mohan/Ramindu can you guide him on the API of DAS 4.0 Event
> Simulation
>
> On Tue, Jul 4, 2017 at 9:48 PM, Madhawa Vidanapathirana <
> madhawavidanapathir...@gmail.com> wrote:
>
>> Hi,
>>
>> I am currently working on developing a Python Client for DAS 4.0
>> Event Simulator as a part of my GSOC project with WSO2.
>>
>> When I used the REST endpoint *GET* http://:/s
>> imulation/single/{simulationName}, I get a JSON response with an
>> incorrect field value.
>>
>> The JSON response consist of two string fields "status" and "message"
>> where the value of "message" is an *invalid JSON text* describing a
>> Simulation Configuration. For example, the following is a message field I
>> got from DAS 4.0.
>>
>> Simulation configuration : {"sources":[{"timeStampInterva
>> l":"5","simulationType":"RANDOM_DATA_SIMULATION","attributeC
>> onfiguration":[{"length":"10","type":"PRIMITIVE_BASED"},{"mi
>> n":"3","max":"3","precision":"2","type":"PRIMITIVE_B
>> ASED"},{"min":"300","max":"300","type":"PRIMITIVE_BASED"}],"
>> streamName":"FooStream","siddhiAppName":"TestSiddhiApp"}],"p
>> roperties":{"timestampStartTime":"1488615136958","simulation
>> Name":"simulationPrimitive","timeInterval":"1000","timestamp
>> EndTime":null,"noOfEvents":"8"}}
>>
>> In the above, Simulation configuration should be within inverted
>> commas, such as "Simulation Configuration" to properly support JSON
>> parsing. (tested with standard JSON parser of Python3)
>>
>> P.s. I am using DAS 4.0, latest version from master branch.
>>
>> Kind Regards,
>> --
>> *Madhawa Vidanapathirana*
>> Student
>> Department of Computer Science and Engineering
>> University of Moratuwa
>> Sri Lanka
>>
>> Mobile: (+94) 716874425 <071%20687%204425>
>> Email: madhawavidanapathir...@gmail.com
>> Linked-In: https://lk.linkedin.com/in/madhawa-vidanapathirana-3430b94
>>
>
>
>
> --
>
> *S. Suhothayan*
> Associate Director / Architect
> *WSO2 Inc. *http://wso2.com
> * *
> lean . enterprise . middleware
>
>
> *cell: (+94) 779 756 757 <+94%2077%20975%206757> | blog:
> http://suhothayan.blogspot.com/ twitter:
> http://twitter.com/suhothayan  | linked-in:
> http://lk.linkedin.com/in/suhothayan 
> *
>



 --
 *Madhawa Vidanapathirana*
 Student
 Department of Computer Science and Engineering
 University of Moratuwa
 Sri Lanka

 Mobile: (+94) 716874425 <+94%2071%20687%204425>

Re: [Dev] [GSOC][DAS][DEV] Incorrect response from DAS 4.0 Event Simulator

2017-07-05 Thread Ramindu De Silva
Hi Madhawa,

Please find some postman samples. In some you may have to change the
"executionPlanName" to "siddhiAppName" is several JSON request bodies.

Best Regards,
Ramindu.

On Wed, Jul 5, 2017 at 12:47 PM, Ramindu De Silva  wrote:

> Hi Madhawa,
>
> You'll have to clone carbon analytics repo[1]. And then, in the root pom
> file of product das[2], you will have to change the
> carbon.analytics.version in the properties section.  eg:
> 2.0.45-SNAPSHOT
> You will be able to find the version in the carbon analytics from the
> carbon analytics repo[1]'s root pom file.
> Then build carbon analytics repo[1]. And then build product das[2].
>
>
> [1] https://github.com/wso2/carbon-analytics
> [2] https://github.com/wso2/product-das
>
> Best Regards,
>
>
> On Wed, Jul 5, 2017 at 12:34 PM, Madhawa Vidanapathirana <
> madhawavidanapathir...@gmail.com> wrote:
>
>> Hi Ramindu,
>>
>> I am working with the* product das *repository [1] and the* issue is
>> still there*. I did a new clone from master branch and did a mvn
>> install.
>>
>> The steps I took are as follows.
>>
>>1. Obtained a new clone of repository
>>2. mvn install
>>3. Unzipped wso2das-4.0.0-SNAPSHOT.zip created by maven build
>>4. Started bin/worker.sh
>>5. Saved a new configuration using POST http://:/s
>>imulation/feed/
>>6. Waited for 5 seconds
>>7. Retrieved the saved configuration using GET http://
>>:/simulation/feed/{simulationName}
>>
>>
>> [1] - https://github.com/wso2/product-das
>>
>>
>>
>> On Wed, Jul 5, 2017 at 11:01 AM, Ramindu De Silva 
>> wrote:
>>
>>> Hi Madhawa,
>>>
>>> We have fixed the issue. Please check and let us know.
>>>
>>> Thanks,
>>> Ramindu.
>>>
>>> On Wed, Jul 5, 2017 at 10:33 AM, Ramindu De Silva 
>>> wrote:
>>>
 Hi Madhawa,

 Yes, Simulation configuration should be within inverted commas. I will
 fix it and let you know.

 Best Regards,
 Ramindu.

 On Wed, Jul 5, 2017 at 9:49 AM, Madhawa Vidanapathirana <
 madhawavidanapathir...@gmail.com> wrote:

> Hi,
> Small correction to my previous mail, actually I was using *GET*
> http://:/simulation/feed/{simulationName}, and
> got the mentioned response from it. I was *not* using
> /simulation/single endpoint.
>
> Any help you can provide is most welcome!
>
>
> On Wed, Jul 5, 2017 at 9:41 AM, Sriskandarajah Suhothayan <
> s...@wso2.com> wrote:
>
>> I don't think you can send a simulation config by calling http://
>> :/simulation/single/
>>
>> @Mohan/Ramindu can you guide him on the API of DAS 4.0 Event
>> Simulation
>>
>> On Tue, Jul 4, 2017 at 9:48 PM, Madhawa Vidanapathirana <
>> madhawavidanapathir...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am currently working on developing a Python Client for DAS 4.0
>>> Event Simulator as a part of my GSOC project with WSO2.
>>>
>>> When I used the REST endpoint *GET* http://:/s
>>> imulation/single/{simulationName}, I get a JSON response with an
>>> incorrect field value.
>>>
>>> The JSON response consist of two string fields "status" and
>>> "message" where the value of "message" is an *invalid JSON text*
>>> describing a Simulation Configuration. For example, the following is a
>>> message field I got from DAS 4.0.
>>>
>>> Simulation configuration : {"sources":[{"timeStampInterva
>>> l":"5","simulationType":"RANDOM_DATA_SIMULATION","attributeC
>>> onfiguration":[{"length":"10","type":"PRIMITIVE_BASED"},{"mi
>>> n":"3","max":"3","precision":"2","type":"PRIMITIVE_B
>>> ASED"},{"min":"300","max":"300","type":"PRIMITIVE_BASED"}],"
>>> streamName":"FooStream","siddhiAppName":"TestSiddhiApp"}],"p
>>> roperties":{"timestampStartTime":"1488615136958","simulation
>>> Name":"simulationPrimitive","timeInterval":"1000","timestamp
>>> EndTime":null,"noOfEvents":"8"}}
>>>
>>> In the above, Simulation configuration should be within inverted
>>> commas, such as "Simulation Configuration" to properly support JSON
>>> parsing. (tested with standard JSON parser of Python3)
>>>
>>> P.s. I am using DAS 4.0, latest version from master branch.
>>>
>>> Kind Regards,
>>> --
>>> *Madhawa Vidanapathirana*
>>> Student
>>> Department of Computer Science and Engineering
>>> University of Moratuwa
>>> Sri Lanka
>>>
>>> Mobile: (+94) 716874425 <071%20687%204425>
>>> Email: madhawavidanapathir...@gmail.com
>>> Linked-In: https://lk.linkedin.com/in/madhawa-vidanapathiran
>>> a-3430b94
>>>
>>
>>
>>
>> --
>>
>> *S. Suhothayan*
>> Associate Director / Architect
>> *WSO2 Inc. *http://wso2.com
>> * *
>> lean . enterprise . middleware
>>
>>
>> *cell: (+94) 779 756 757 <+94%2077%20975%206757> | blog:
>> http://suhothayan.blogspot.com/ 

Re: [Dev] [Swagger] swagger2cxf-maven-plugin to generate server stub for CXF

2017-07-05 Thread Isura Karunaratne
Hi Indunil,

On Wed, Jul 5, 2017 at 11:35 AM, Indunil Upeksha Rathnayake <
indu...@wso2.com> wrote:

> Hi,
>
> I have used the Swagger Codegen to generation the server stubs from a
> Swagger definition of a REST API for IS 5.4.0.
>
> In there I have added the following plugin to generate server stub for CXF.
>
> 
>> org.wso2.maven.plugins
>> swagger2cxf-maven-plugin
>> 1.0-SNAPSHOT
>> 
>> ${project.basedir}/src/main/resources/api.
>> identity.oauth2.scope.endpoint.yaml
>> 
>> 
>>
>
>
> Also add the following maven build helper plugin.
>
> 
>> org.codehaus.mojo
>> build-helper-maven-plugin
>> 
>> 
>> add-source
>> generate-sources
>> 
>> add-source
>> 
>> 
>> 
>> src/gen/java
>> 
>> 
>> 
>> 
>> 
>>
>
> Then use "mvn swagger2cxf:generate" command to generate the server stubs
> and in src/gen/java folder, set of factories are generated and in main/Java
> folder, a set of impl files are generated.
>
> I have following concerns regarding server stubs generation from Swagger.
>
>- Is this can be automated to do in component build?
>
>
No.

>
>- Or normally this is the way it should handled and need to commit all
>the generated files to git as well?
>
> We have to commit generated files.


>
>- If we are committing the generated files to git, is it recommended
>to add class comments in those?
>
> I don't think we need to add class comments. But, we better to add licence
headers.

Thanks
Isura.

>
> Thanks and Regards
>
> --
> Indunil Upeksha Rathnayake
> Software Engineer | WSO2 Inc
> Emailindu...@wso2.com
> Mobile   0772182255
>



-- 

*Isura Dilhara Karunaratne*
Senior Software Engineer | WSO2
Email: is...@wso2.com
Mob : +94 772 254 810
Blog : http://isurad.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [GSOC][DAS][DEV] Incorrect response from DAS 4.0 Event Simulator

2017-07-05 Thread Madhawa Vidanapathirana
Hi Ramindu,

I am working with the* product das *repository [1] and the* issue is still
there*. I did a new clone from master branch and did a mvn install.

The steps I took are as follows.

   1. Obtained a new clone of repository
   2. mvn install
   3. Unzipped wso2das-4.0.0-SNAPSHOT.zip created by maven build
   4. Started bin/worker.sh
   5. Saved a new configuration using POST http://:
   /simulation/feed/
   6. Waited for 5 seconds
   7. Retrieved the saved configuration using GET http://
   :/simulation/feed/{simulationName}


[1] - https://github.com/wso2/product-das



On Wed, Jul 5, 2017 at 11:01 AM, Ramindu De Silva  wrote:

> Hi Madhawa,
>
> We have fixed the issue. Please check and let us know.
>
> Thanks,
> Ramindu.
>
> On Wed, Jul 5, 2017 at 10:33 AM, Ramindu De Silva 
> wrote:
>
>> Hi Madhawa,
>>
>> Yes, Simulation configuration should be within inverted commas. I will
>> fix it and let you know.
>>
>> Best Regards,
>> Ramindu.
>>
>> On Wed, Jul 5, 2017 at 9:49 AM, Madhawa Vidanapathirana <
>> madhawavidanapathir...@gmail.com> wrote:
>>
>>> Hi,
>>> Small correction to my previous mail, actually I was using *GET* http://
>>> :/simulation/feed/{simulationName}, and got the
>>> mentioned response from it. I was *not* using /simulation/single
>>> endpoint.
>>>
>>> Any help you can provide is most welcome!
>>>
>>>
>>> On Wed, Jul 5, 2017 at 9:41 AM, Sriskandarajah Suhothayan >> > wrote:
>>>
 I don't think you can send a simulation config by calling http://
 :/simulation/single/

 @Mohan/Ramindu can you guide him on the API of DAS 4.0 Event Simulation

 On Tue, Jul 4, 2017 at 9:48 PM, Madhawa Vidanapathirana <
 madhawavidanapathir...@gmail.com> wrote:

> Hi,
>
> I am currently working on developing a Python Client for DAS 4.0 Event
> Simulator as a part of my GSOC project with WSO2.
>
> When I used the REST endpoint *GET* http://:/s
> imulation/single/{simulationName}, I get a JSON response with an
> incorrect field value.
>
> The JSON response consist of two string fields "status" and "message"
> where the value of "message" is an *invalid JSON text* describing a
> Simulation Configuration. For example, the following is a message field I
> got from DAS 4.0.
>
> Simulation configuration : {"sources":[{"timeStampInterva
> l":"5","simulationType":"RANDOM_DATA_SIMULATION","attributeC
> onfiguration":[{"length":"10","type":"PRIMITIVE_BASED"},{"mi
> n":"3","max":"3","precision":"2","type":"PRIMITIVE_B
> ASED"},{"min":"300","max":"300","type":"PRIMITIVE_BASED"}],"
> streamName":"FooStream","siddhiAppName":"TestSiddhiApp"}],"
> properties":{"timestampStartTime":"1488615136958","simulatio
> nName":"simulationPrimitive","timeInterval":"1000","
> timestampEndTime":null,"noOfEvents":"8"}}
>
> In the above, Simulation configuration should be within inverted
> commas, such as "Simulation Configuration" to properly support JSON
> parsing. (tested with standard JSON parser of Python3)
>
> P.s. I am using DAS 4.0, latest version from master branch.
>
> Kind Regards,
> --
> *Madhawa Vidanapathirana*
> Student
> Department of Computer Science and Engineering
> University of Moratuwa
> Sri Lanka
>
> Mobile: (+94) 716874425 <071%20687%204425>
> Email: madhawavidanapathir...@gmail.com
> Linked-In: https://lk.linkedin.com/in/madhawa-vidanapathirana-3430b94
>



 --

 *S. Suhothayan*
 Associate Director / Architect
 *WSO2 Inc. *http://wso2.com
 * *
 lean . enterprise . middleware


 *cell: (+94) 779 756 757 <+94%2077%20975%206757> | blog:
 http://suhothayan.blogspot.com/ twitter:
 http://twitter.com/suhothayan  | linked-in:
 http://lk.linkedin.com/in/suhothayan 
 *

>>>
>>>
>>>
>>> --
>>> *Madhawa Vidanapathirana*
>>> Student
>>> Department of Computer Science and Engineering
>>> University of Moratuwa
>>> Sri Lanka
>>>
>>> Mobile: (+94) 716874425 <+94%2071%20687%204425>
>>> Email: madhawavidanapathir...@gmail.com
>>> Linked-In: https://lk.linkedin.com/in/madhawa-vidanapathirana-3430b94
>>>
>>
>>
>>
>> --
>> *Ramindu De Silva*
>> Software Engineer
>> WSO2 Inc.: http://wso2.com
>> lean.enterprise.middleware
>>
>> email: ramin...@wso2.com 
>> mob: +94 719678895
>>
>
>
>
> --
> *Ramindu De Silva*
> Software Engineer
> WSO2 Inc.: http://wso2.com
> lean.enterprise.middleware
>
> email: ramin...@wso2.com 
> mob: +94 719678895
>



-- 
*Madhawa Vidanapathirana*
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425
Email: madhawavidanapathir...@gmail.com
Linked-In: https://lk.linkedin.com/in/madhawa-vidanapathirana-3430b94
___
Dev m