Re: [Dev] Clarification regarding BuilderMediator

2016-03-05 Thread Isuru Udana
On Sat, Mar 5, 2016 at 3:19 PM, Malintha Amarasinghe 
wrote:

> Hi Isuru,
>
> Thanks a lot for the input. I was able to get it working using a handler
> that replaces the content-type header with text/plain media type. Now a
> small problem is the client receives the response with text/plain media
> type. It seems the current PlainTextFormatter [1] has "text/plain" message
> format hardcoded in getContentType() method, so I guess we will have to use
> a custom message formatter in order to change it. WDYT?
>
+1. We may able to extend from existing formatter.

>
> Thanks,
> Malintha
>
> [1]
> https://github.com/wso2/wso2-axis2/blob/master/modules/transport/base/src/main/java/org/apache/axis2/format/PlainTextFormatter.java#L67
>
> On Sat, Mar 5, 2016 at 11:49 AM, Isuru Udana  wrote:
>
>> Hi Malintha,
>>
>> Builder mediator approach is adding lot of overhead to the configuration
>> as we have to add it for all the APIs in ESB which handles json.
>> Handling malformed json is a special case. For this special API which
>> handles malformed json, let's engage an API handler. At the handler in the
>> response path we can change the content-type.
>>
>>
>> On Saturday, March 5, 2016, Malintha Amarasinghe 
>> wrote:
>>
>>> Hi Isuru,
>>>
>>> Thanks for looking in to this.
>>>
>>> 1. We have an API and lets say it points to a backend which sometimes
>>> give invalid payloads with application/json content type.
>>> 2. We have added a content aware mediator along the mediation flow. (Ex:
>>> the API is response caching enabled)
>>> 3. If the backend gives an invalid payload the cache mediator will fail
>>> when it tries to build the message.
>>>
>>> If we had set the PlainTextBuilder/PlainTextFormatter for application/json
>>> mediatype in axis2.xml, we can overcome the above issue. But the problem
>>> is, that applies globally to all the APIs / Services etc in ESB. If we
>>> could set the PlainTextBuilder/PlainTextFormatter for application/json
>>> content type only to the API we have the problem with the backend while
>>> keeping default JsonBuilder/JsonFormatter, it would be a better
>>> solution IMO as our solution would not affect other APIs/Services.
>>>
>>> Thanks,
>>> Malintha
>>>
>>>
>>>
>>>
>>>
>>> On Sat, Mar 5, 2016 at 10:26 AM, Isuru Udana  wrote:
>>>
 Hi Malintha,

 Can you please explain the use case you are trying to implement using
 builder mediator.


 On Saturday, March 5, 2016, Malintha Amarasinghe 
 wrote:

> Hi,
>
> I was trying a sample for Builder Mediator [1] to override the default
> message formatter/builder and use PlainTextBuilder/PlainTextFormatter for
> application/json content type. As per the documentation [1] we should be
> enable BinaryRealyBuilder/ExpandingMessageFormatter for at least one
> content type in axis2.xml.
>
> 1. I tried enabling a different content-type for
> BinaryRealyBuilder/ExpandingMessageFormatter and kept the defaults for
> application/json type and then tried to override it using the builder
> mediator. But then the Builder mediator does not work as expected and it
> uses default JsonBuilder/JsonBuilder to build the message.
>
> 2. If I enable BinaryRealyBuilder/ExpandingMessageFormatter for
> application/json in axis2.xml, Builder mediator works as expected.
>
> Am I doing anything wrong when I am trying the first option? Or is (2)
> the correct behaviour and we should
> set BinaryRealyBuilder/ExpandingMessageFormatter for the same content type
> we are trying to override?
>
> Kindly appreciate your help on this.
>
> Thanks,
> Malintha
>
> [1] https://docs.wso2.com/display/ESB490/Builder+Mediator
>
> --
> Malintha Amarasinghe
> Software Engineer
> *WSO2, Inc. - lean | enterprise | middleware*
> http://wso2.com/
>
> Mobile : +94 712383306
>


 --
 Sent from Mobile

>>>
>>>
>>>
>>> --
>>> Malintha Amarasinghe
>>> Software Engineer
>>> *WSO2, Inc. - lean | enterprise | middleware*
>>> http://wso2.com/
>>>
>>> Mobile : +94 712383306
>>>
>>
>>
>> --
>> Sent from Mobile
>>
>
>
>
> --
> Malintha Amarasinghe
> Software Engineer
> *WSO2, Inc. - lean | enterprise | middleware*
> http://wso2.com/
>
> Mobile : +94 712383306
>



-- 
*Isuru Udana*
Associate Technical Lead
WSO2 Inc.; http://wso2.com
email: isu...@wso2.com cell: +94 77 3791887
blog: http://mytecheye.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WS02 [CDMF] Calculate Device Health Status using Analytics and API Calls GSOC Project

2016-03-05 Thread Kasun Dananjaya Delgolla
Hi Ulrich,

Thank you for your interest in this project. CDMF is a framework that is
used for device management and one of the requirement is for the user to
monitor the device status. There are two ways to check the status of a
device,

1) Send a device health check ping to the device and then depict the status.
2) Get the device to server communication data and then co-relate with past
communication to find the status of the device.

In here we are focusing with a generalized solution that incorporates the
idea from the second approach. In the first approach we are limiting the
capability by asking the device manufacture to incorporate the capability.

You can find the source code for CDMF in
https://github.com/wso2/carbon-device-mgt

You can find the source code for device type implementation such as
android, windows and few IoT device samples in :
https://github.com/wso2/carbon-device-mgt-plugins

We have two products that are built on CDMF
1) EMM -
https://docs.wso2.com/display/EMM200/WSO2+Enterprise+Mobility+Manager
https://github.com/wso2/product-mdm - You can find the official release EMM
2.0.0 in the product listing page

2) IoT Server - https://docs.wso2.com/display/IoTS100/About+IoT+Server
https://github.com/wso2-incubator/product-iot-server - This is still under
development.

Please go through the documentation and try to build EMM to understand the
behavior of the product.

Thanks

On Fri, Mar 4, 2016 at 12:18 PM, tchuenkam ulrich 
wrote:

> Hi Developer,
>
> While looking for a GSOC project to keep myself busy during the upcoming
> GSOC, i felt on *WS02 [CDMF] Calculate Device Health Status using
> Analytics and API Calls GSOC* Project which i find very interesting and
> will like to work on that.
>
> I am Tchuenkam Ulrich, a 4th year Software Engineering Student from
> Cameroon.
>
> I found your email address mentioned under the list of potential mentors
> for this project on the project idea page
>
>
> https://docs.wso2.com/display/GSoC/Project+Proposals+for+2016#ProjectProposalsfor2016-Proposal27:[CDMF]CalculateDeviceHealthStatususingAnalyticsandAPICalls
> 
>
> I contact you so that you can give me directives on what I can be doing
> while preparing my proposals should in case they are some issues that I
> could be solving while preparing.
>
> Thanks.
>
> --
> ulrich tchuenkam
>



-- 
Kasun Dananjaya Delgolla

Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
Tel:  +94 11 214 5345
Fax: +94 11 2145300
Mob: + 94 771 771 015
Blog: http://kddcodingparadise.blogspot.com
Linkedin: *http://lk.linkedin.com/in/kasundananjaya
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Regarding GSOC 2016 project 21

2016-03-05 Thread Asantha Thilina
Hi,

I done the practice tasks 1 - 5 and i shared  what i have been done so
far  in github, below i put the link to my repository
waiting for feedback...

https://github.com/asanthamax/customuserstoremanager

Thanks,
Regards,
Asantha



On Mon, Feb 29, 2016 at 7:41 PM, Tharindu Edirisinghe 
wrote:

> [Adding Dev mailing list]
>
> Hi Asantha,
>
> In order to make you familiar with this project with regard to WSO2
> platform, we would like you to complete the following task which would
> provide an understanding on how the userstore managers are used in WSO2
> products.
>
>
> 1. Refer [1] and understand how a userstore manager can be written and
> used in a product like WSO2 Identity Server [2].
>
> 2. Refer [3] and understand more about Claims and Claim Management.
>
> 3. Referring [1], extend the
> org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager class and write your
> own JDBC userstore manaager. (MySQL is preferred).
>
> 4. Introduce a new claim called lastPasswordResetTimestamp which tracks
> the timestamp of each user's last successful password reset attempt. (in
> WSO2 Identity Server). For this you can refer [1] and override the
> doUpdateCredential, doUpdateCredentialByAdmin methods in the custom
> userstore manager you wrote in previous step. Inside these methods after
> successful password reset, set the current timestemp as a user claim. For
> this you can refer [4].
>
> 5. In the JDBC userstore manager you have written in above step, override
> the doAuthenticate method. Inside the method, after performing
> authentication, compare the timestamp of the last time the user updated the
> credentials with current timestamp. If it is greater than 60 days (you can
> hardcode this value for the moment) return an exception with a message
> saying the user has to reset the password as it is expired. (For the users
> where the claim for password reset timestamp is empty, you can let the
> users successfully authenticate)
>
> When performing above tasks, if you face any difficulty, you can ask for
> help from this mail thread. You can use GitHub to share your source code
> and after completing a deliverable from above steps, you can share your
> progress with us.
>
> If you need further clarifications, please get back.
>
> [1]
> https://docs.wso2.com/display/IS510/Writing+a+Custom+User+Store+Manager
> [2] http://wso2.com/products/identity-server/
> [3]
> http://tharindue.blogspot.com/2015/08/claim-management-operations-in-wso2.html
> [4]
> http://tharindue.blogspot.com/2015/12/tracking-last-successful-login-attempt.html
> [5]
> http://tharindue.blogspot.com/2015/05/a-workaround-for-renaming-username-of.html
>
> Regards,
> TharinduE
>
>
>
> On Mon, Feb 29, 2016 at 9:35 PM, Asantha Thilina  > wrote:
>
>> Dear Sir,
>> first of all thanks a lot for the quick response and references ,I
>> studying the references that you sent  and that are really helpful for me
>> to understand the procedure and prepare a proposal. i am really interest in
>> take part of this project in GSoC.
>> I understand the circumstances and willing to take part it in
>> individually.
>> As you mentioned I would be really grateful on behalf of my team if you
>> can support us to find a project which will suits for our research also and
>> it would be really helpful if we can extend this same project for suits to
>> our research as well.
>> Thanks,
>> Regards,
>> Asantha
>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Fwd: GSOC2016: Proposal 6: [ML]

2016-03-05 Thread Mahesh Dananjaya
Hi maheshakya,
as we concerned to use WSO2 CEP to handle streaming data and implement the
machine learning algorithms with Spark MLLib, does data stream is taken to
ML as the event publisher's format through event publisher. Or  we can use
direct traffic that comes to event receiver, or else as streams. referring
to https://docs.wso2.com/display/CEP410/User+Guide
1.) Those data coming from wso2 DAS to ML are coming as streams?
2.) Are there any incremental learning algorithms currently active in
ML?you mentioned that there are and they are with scala API. So there is a
streaming support with that Scala API. In that API which format the data is
aquired to ML?

thank you.
BR,
Mahesh.

On Fri, Mar 4, 2016 at 2:03 PM, Maheshakya Wijewardena 
wrote:

> Hi Mahesh,
>
> We had to modify a the project scope a little to suit best for the
> requirements. We will update the project idea with those concerns soon and
> let you know.
>
> We do not support streaming data in WSO2 Machine learner at the moment.
> The new concern is to use WSO2 CEP to handle streaming data and implement
> the machine learning algorithms with Spark MLLib. You can look at the
> streaming k-means and streaming linear regression implementations in MLLib.
> Currently, the API is only for scala. Our need is to get the Java APIs of
> k-means and generalized linear models to support incremental learning with
> streaming data. This has to be done as mini-batch learning since these
> algorithms operates as stochastic gradient descents so that any learning
> with new data can be done on top of the previously learned models. So
> please go through the those APIs[1][2][3] and try to get an idea.
> Also please try to understand how event streams work in WSO2 CEP [4][5].
>
> Best regards.
>
> [1]
> http://spark.apache.org/docs/latest/api/java/org/apache/spark/mllib/regression/LinearRegressionWithSGD.html
> [2]
> http://spark.apache.org/docs/latest/api/java/org/apache/spark/mllib/clustering/KMeans.html
> [3]
> http://spark.apache.org/docs/latest/api/java/org/apache/spark/mllib/classification/LogisticRegressionWithSGD.html
> [4] https://docs.wso2.com/display/CEP310/Working+with+Event+Streams
> [5] https://docs.wso2.com/display/CEP310/Working+with+Execution+Plans
>
> On Fri, Mar 4, 2016 at 11:26 AM, Mahesh Dananjaya <
> dananjayamah...@gmail.com> wrote:
>
>> Hi maheshakya,
>> give me sometime to go through your ML package. Do current product have
>> any stream data support?. i did some university projects related to machine
>> learning with regressions,modelling, factor analysis, cluster analysis and
>> classification problems (Discriminant Analysis) with SVM (Support Vector
>> machines), Neural networks, LS classification and ML(Maximum likelihood).
>> give me sometime to see how wso2 architecture works.then i can come up with
>> good architecture.thank you.
>> BR,
>> Mahesh.
>>
>> On Wed, Mar 2, 2016 at 2:41 PM, Mahesh Dananjaya <
>> dananjayamah...@gmail.com> wrote:
>>
>>> Hi Maheshakya,
>>> Thank you for the resources. I will go through this and looking forward
>>> to this proposed project.Thank you.
>>> BR,
>>> Mahesh.
>>>
>>> On Wed, Mar 2, 2016 at 1:52 PM, Maheshakya Wijewardena <
>>> mahesha...@wso2.com> wrote:
>>>
 Hi Mahesh,

 Thank you for the interest for this project.

 We would like to know what type of similar projects you have worked on.
 You may have seen that WSO2 Machine Learner supports several learning
 algorithms at the moment[1]. This project intends to leverage the existing
 algorithms in WSO2 Machine Learner to support streaming data. As an
 initiative, first you can get an idea about what WSO2 Machine Learner does
 and how it operates. You can download WSO2 Machine Learner from product
 page[2] and the the source code [3]. ML is using Apache Spark MLLib[4] for
 its' algorithms so it's better to read and understand what it does as well.

 In order to get an idea about the deliverables and the scope of this
 project, try to understand how Spark streaming[5] (see examples) handles
 streaming data. Also, have a look in the streaming algorithms[6][7]
 supported by MLLib. There are two approaches discussed to employ
 incremental learning in ML in the project proposals page. These streaming
 algorithms can be directly used in the first approach. For the other
 approach, the your implementation should contain a procedure to create mini
 batches from streaming data with relevant sizes (i.e. a moving window) and
 do periodic retraining of the same algorithm.

 To start with the project, you will need to come up with a suitable
 plan and an architecture first.

 Please watch the video referenced in the proposal (reference: 5). It
 will help you getting a better idea about machine learning algorithms with
 streaming data.

 Let us know if you need any help with these.

 Best regards

Re: [Dev] Clarification regarding BuilderMediator

2016-03-05 Thread Malintha Amarasinghe
Hi Isuru,

Thanks a lot for the input. I was able to get it working using a handler
that replaces the content-type header with text/plain media type. Now a
small problem is the client receives the response with text/plain media
type. It seems the current PlainTextFormatter [1] has "text/plain" message
format hardcoded in getContentType() method, so I guess we will have to use
a custom message formatter in order to change it. WDYT?

Thanks,
Malintha

[1]
https://github.com/wso2/wso2-axis2/blob/master/modules/transport/base/src/main/java/org/apache/axis2/format/PlainTextFormatter.java#L67

On Sat, Mar 5, 2016 at 11:49 AM, Isuru Udana  wrote:

> Hi Malintha,
>
> Builder mediator approach is adding lot of overhead to the configuration
> as we have to add it for all the APIs in ESB which handles json.
> Handling malformed json is a special case. For this special API which
> handles malformed json, let's engage an API handler. At the handler in the
> response path we can change the content-type.
>
>
> On Saturday, March 5, 2016, Malintha Amarasinghe 
> wrote:
>
>> Hi Isuru,
>>
>> Thanks for looking in to this.
>>
>> 1. We have an API and lets say it points to a backend which sometimes
>> give invalid payloads with application/json content type.
>> 2. We have added a content aware mediator along the mediation flow. (Ex:
>> the API is response caching enabled)
>> 3. If the backend gives an invalid payload the cache mediator will fail
>> when it tries to build the message.
>>
>> If we had set the PlainTextBuilder/PlainTextFormatter for application/json
>> mediatype in axis2.xml, we can overcome the above issue. But the problem
>> is, that applies globally to all the APIs / Services etc in ESB. If we
>> could set the PlainTextBuilder/PlainTextFormatter for application/json
>> content type only to the API we have the problem with the backend while
>> keeping default JsonBuilder/JsonFormatter, it would be a better solution
>> IMO as our solution would not affect other APIs/Services.
>>
>> Thanks,
>> Malintha
>>
>>
>>
>>
>>
>> On Sat, Mar 5, 2016 at 10:26 AM, Isuru Udana  wrote:
>>
>>> Hi Malintha,
>>>
>>> Can you please explain the use case you are trying to implement using
>>> builder mediator.
>>>
>>>
>>> On Saturday, March 5, 2016, Malintha Amarasinghe 
>>> wrote:
>>>
 Hi,

 I was trying a sample for Builder Mediator [1] to override the default
 message formatter/builder and use PlainTextBuilder/PlainTextFormatter for
 application/json content type. As per the documentation [1] we should be
 enable BinaryRealyBuilder/ExpandingMessageFormatter for at least one
 content type in axis2.xml.

 1. I tried enabling a different content-type for
 BinaryRealyBuilder/ExpandingMessageFormatter and kept the defaults for
 application/json type and then tried to override it using the builder
 mediator. But then the Builder mediator does not work as expected and it
 uses default JsonBuilder/JsonBuilder to build the message.

 2. If I enable BinaryRealyBuilder/ExpandingMessageFormatter for
 application/json in axis2.xml, Builder mediator works as expected.

 Am I doing anything wrong when I am trying the first option? Or is (2)
 the correct behaviour and we should
 set BinaryRealyBuilder/ExpandingMessageFormatter for the same content type
 we are trying to override?

 Kindly appreciate your help on this.

 Thanks,
 Malintha

 [1] https://docs.wso2.com/display/ESB490/Builder+Mediator

 --
 Malintha Amarasinghe
 Software Engineer
 *WSO2, Inc. - lean | enterprise | middleware*
 http://wso2.com/

 Mobile : +94 712383306

>>>
>>>
>>> --
>>> Sent from Mobile
>>>
>>
>>
>>
>> --
>> Malintha Amarasinghe
>> Software Engineer
>> *WSO2, Inc. - lean | enterprise | middleware*
>> http://wso2.com/
>>
>> Mobile : +94 712383306
>>
>
>
> --
> Sent from Mobile
>



-- 
Malintha Amarasinghe
Software Engineer
*WSO2, Inc. - lean | enterprise | middleware*
http://wso2.com/

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


Re: [Dev] Native Cloud Support for Running WSO2 Middleware on Apache Mesos

2016-03-05 Thread Imesh Gunaratne
Can you please explain how you installed Mesos on a Ubuntu machine?

Thanks

On Saturday, March 5, 2016, Osura Rathnayake  wrote:

> Hi Sir,
>
> We were able to install mesos, docker and WSO2 carbon on a Ubuntu machine.
> Furthermore we installed wso2 ESB and AS through docker. Currently we are
> working on understanding how K8S works in this scenario. After that what
> would be the next step?
>
> thanks and regards,
> Osura Rathnayake, Sahan Wickramaarachchi, Vishwa Jayaratne, Allan Barthelot
>
> On Mon, Feb 29, 2016 at 12:38 PM, Imesh Gunaratne  > wrote:
>
>> Hi Osura,
>>
>> It's nice to hear your interest on this project. The starting point would
>> be to install Mesos and see how it works. Then try to deploy a WSO2 product
>> on Mesos using Docker. Then understand how Carbon clustering works
>> including K8S membership scheme [1] we have implemented for the same
>> purpose on K8S. Later on move to other native PaaS features needed.
>>
>> [1]
>> https://github.com/wso2/kubernetes-artifacts/tree/master/common/kubernetes-membership-scheme
>>
>> Thanks
>>
>> On Mon, Feb 29, 2016 at 12:29 PM, Osura Rathnayake > > wrote:
>>
>>> Dear Sir,
>>>
>>> We are a group of 4th year students following the Computer Systems and
>>> Networking degree program at SLIIT. We are interested in undertaking above
>>> mentioned project as our 4th year research project.
>>>
>>> As 4th year CSN students we have a fairly good understanding in PaaS
>>> concepts and Java language. We have a basic understanding of basic
>>> features of WSO2 Carbon.
>>>
>>> We were asked to contact you by Senior Lecturer Mr. Lakmal Rupasinghe.
>>> Please get back to us soon.
>>>
>>> Regards,
>>> Osura Rathnayake, Sahan Wickramaarachchi, Vishwa Jayaratne, Allan
>>> Barthelot
>>>
>>
>>
>>
>> --
>> *Imesh Gunaratne*
>> Senior Technical Lead
>> WSO2 Inc: http://wso2.com
>> T: +94 11 214 5345 M: +94 77 374 2057
>> W: http://imesh.io
>> Lean . Enterprise . Middleware
>>
>>
>

-- 
*Imesh Gunaratne*
Senior Technical Lead
WSO2 Inc: http://wso2.com
T: +94 11 214 5345 M: +94 77 374 2057
W: http://imesh.io
Lean . Enterprise . Middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev