[Architecture] [Carbon 5] Next-gen Command Line Interface for Carbon. - Meeting minutes 29/05/2104

2014-05-30 Thread Pubudu Dissanayake
Hi folks,

For Carbon 5.0, we are planning to improve our existing CLI tool. Please
find below notes from the meeting held regarding Carbon CLI on 29th May
2014.

​*Participants: *Azeez, SammeraJ, Manoj, Aruna, Jayanga and myself​
​.

Points discussed as follows ​


   - ​*What we learned from our Carbon 4.x.x CLI (Equinox OSGI console
   
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fconsole_shell.htm)*
   - Carbon 4.2.0 OSGI Console is based on equinox console. Therefore
  Eclipse equinox console has following dependencies
  - org.eclipse.equinox.console
 - org.apache.felix.gogo.command
 - org.apache.felix.gogo.runtime
 - org.apache.felix.gogo.shell
 - Due to apache felix dependency, equinox will inherit some of the
  gogo commands ( you will be able to see those under scope:gogo)
and custom
  commands were written using equinox *CommandProvider*
  
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fconsole_shell.htm
  interface.


   - *What we lack *?
   - UX is not straightforward and it has to be improved
  - ​NO tab completion nor history support
  - ​No in-line editing ​

  - NO UNIX command support
  - No extendability of the console nor custom commands


   - ​*Next-gen Carbon 5 CLI *
   - Carbon 5 runs on top of Eclipse equinox OSGI runtime and equinox
  console as command line interface. But it is the previous (
Carbon 4.2.0 )
  CLI which is needed an upgrade.Our main concern is to upgrade it
to provide
  more flexibility and rich user experience to end users and developers.
   Following requirements are considered as must to have
  - *Requirements*
- ​Tab Completions
- History support
- ​In-line editing​

- Descriptive help
- Extendability of Shell
- ​Solutions
  - ​Annotation based commands, arguments and options support ( e.g.
 introducing  @Command ​@Argument and @Option ) - On going PoC
 - JLine https://github.com/jline/jline2/wiki/JLine-2.x-Wiki 2.x
 based CLI approach - PoC done.
 - Milestone one will be based on two part
 - Extendable Framework
- Basic OSGI Commands ​and custom command support


​Please let us know about your thoughts on our new development, WDYT ? ​


​Thanks
- Pubudu Dissanayake ​

-- 
*Pubudu Dissanayake*
 Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
Mobile: 0775503304
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] ServletContainerInitializer for AS

2014-05-30 Thread Kasun Gajasinghe
Hi Sagara,

Denuwanthi is working on a solution for this problem using spi-fly. SPI Fly
provides a mechanism to expose Java Service Provider Interfaces via OSGi.
To make this work,

1. Add the following spi-fly and its dependency bundles to AS - Download
links are available at [1]. We need a make a Carbon feature out of this to
install in AS. @Denuwanthi, please note.

SPI Fly Dynamic Weaving Bundle 1.0.0
Aries Util 1.1.0
ASM 4.0.0

2. You need to make the Myfaces bundle a service provider of
javax.servlet.ServletContainerInitializer interface under the OSGi
environment. For that you need to add 'Require-Capability', and
'Provide-Capability' Manifest headers as follows.

  Require-Capability: osgi.extender;
filter:=(osgi.extender=osgi.serviceloader.registrar)

  Provide-Capability: osgi.serviceloader; osgi.serviceloader=
*javax.servlet.ServletContainerInitializer*

3. Since Tomcat uses a custom mechanism to load the service providers, you
do not need to add Consumer's manifest headers. Consumer part for webapps
is already handled by our solution.
[1] http://aries.apache.org/modules/spi-fly.html

Regards,
KasunG



On Fri, May 30, 2014 at 12:01 PM, Sagara Gunathunga sag...@wso2.com wrote:

 It looks like we need OSGI aware way to find ServletContainerInitializers.
 Myfaces use MyFacesContainerInitializer to register MyFaces Servlet but
 this is not pick up by the AS that's why JSF not work on ASTomEE.

 Thanks !
 --
 Sagara Gunathunga

 Senior Technical Lead; 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




-- 

*Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc.
email: kasung AT spamfree wso2.com
linked-in: http://lk.linkedin.com/in/gajasinghe
blog: http://kasunbg.org
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Connector:Gooddata

2014-05-30 Thread Rasika Hettige
Hi Shevan,

createLogin is needed to authenticate the API as it returns a token which we
can used to generate a TT token in getAuthenticationToken method. Hence this
2 methods will be called in all other methods to do the authentication.

Yes agreed, following methods are related to ETL processes. Hence we can
remove these from the first version.
listProcesses - List Processes in a project.
createProcessWithMultipart - Create new data loading process with one single
multipart http request.
listProcessExecution - List Processes of the given User in all Projects.
executeProcess - Execute a Process.

Please confirm on above changes.

Thanks  Regards
Rasika



--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/Connector-Gooddata-tp97207p97497.html
Sent from the WSO2 Architecture mailing list archive at Nabble.com.
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] ServletContainerInitializer for AS

2014-05-30 Thread Kasun Gajasinghe
On Fri, May 30, 2014 at 1:39 PM, Denuwanthi De Silva denuwan...@wso2.com
wrote:

 Hi,

 As Kasun mentioned we can use the specified bundles and
 Require-Capabilityosgi.extender;
 filter:=(osgi.extender=osgi.serviceloader.registrar)/Require-Capability
 Provide-Capabilityosgi.serviceloader;
 osgi.serviceloader=javax.servlet.ServletContainerInitializer/Provide-Capability

 to expose the  ServletContainerInitializer implementations via OSGi.

 When we create the OSGI bundle out of the said implementation, we can find
 those ServletContainerInitializers using,
 getOSGiServices(ServletContainerInitializer.class), method provided by
 PrivilegedCarbonContext class


Could you send this particular fix to 4.3.0 trunk/GitHub?


 Thanks  Regards,
 Denuwanthi.


 On Fri, May 30, 2014 at 12:20 PM, Kasun Gajasinghe kas...@wso2.com
 wrote:

 Hi Sagara,

 Denuwanthi is working on a solution for this problem using spi-fly. SPI
 Fly provides a mechanism to expose Java Service Provider Interfaces via
 OSGi. To make this work,

 1. Add the following spi-fly and its dependency bundles to AS - Download
 links are available at [1]. We need a make a Carbon feature out of this to
 install in AS. @Denuwanthi, please note.

 SPI Fly Dynamic Weaving Bundle 1.0.0
 Aries Util 1.1.0
 ASM 4.0.0

 2. You need to make the Myfaces bundle a service provider of
 javax.servlet.ServletContainerInitializer interface under the OSGi
 environment. For that you need to add 'Require-Capability', and
 'Provide-Capability' Manifest headers as follows.

   Require-Capability: osgi.extender;
 filter:=(osgi.extender=osgi.serviceloader.registrar)

   Provide-Capability: osgi.serviceloader; osgi.serviceloader=
 *javax.servlet.ServletContainerInitializer*

 3. Since Tomcat uses a custom mechanism to load the service providers,
 you do not need to add Consumer's manifest headers. Consumer part for
 webapps is already handled by our solution.
 [1] http://aries.apache.org/modules/spi-fly.html

 Regards,
 KasunG



 On Fri, May 30, 2014 at 12:01 PM, Sagara Gunathunga sag...@wso2.com
 wrote:

 It looks like we need OSGI aware way to
 find ServletContainerInitializers. Myfaces use MyFacesContainerInitializer
 to register MyFaces Servlet but this is not pick up by the AS that's why
 JSF not work on ASTomEE.

 Thanks !
 --
 Sagara Gunathunga

 Senior Technical Lead; 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




 --

 *Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc.
 email: kasung AT spamfree wso2.com
 linked-in: http://lk.linkedin.com/in/gajasinghe
 blog: http://kasunbg.org






 --
 Denuwanthi De Silva
 Software Engineer;
 WSO2 Inc.; http://wso2.com,
 Email: denuwan...@wso2.com





-- 

*Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc.
email: kasung AT spamfree wso2.com
linked-in: http://lk.linkedin.com/in/gajasinghe
blog: http://kasunbg.org
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] ServletContainerInitializer for AS

2014-05-30 Thread Sagara Gunathunga
On Fri, May 30, 2014 at 1:48 PM, Kasun Gajasinghe kas...@wso2.com wrote:




 On Fri, May 30, 2014 at 1:39 PM, Denuwanthi De Silva denuwan...@wso2.com
 wrote:

 Hi,

 As Kasun mentioned we can use the specified bundles and
 Require-Capabilityosgi.extender;
 filter:=(osgi.extender=osgi.serviceloader.registrar)/Require-Capability
 Provide-Capabilityosgi.serviceloader;
 osgi.serviceloader=javax.servlet.ServletContainerInitializer/Provide-Capability

 to expose the  ServletContainerInitializer implementations via OSGi.

 When we create the OSGI bundle out of the said implementation, we can
 find those ServletContainerInitializers using,
 getOSGiServices(ServletContainerInitializer.class), method provided by
 PrivilegedCarbonContext class


 Could you send this particular fix to 4.3.0 trunk/GitHub?


I'm still not completely OK to go for this solution shall we review this
first ?  @Denuwanthi, for the time being you can continue with this
solution .

Thanks !

 Denuwanthi.


 On Fri, May 30, 2014 at 12:20 PM, Kasun Gajasinghe kas...@wso2.com
 wrote:

 Hi Sagara,

 Denuwanthi is working on a solution for this problem using spi-fly. SPI
 Fly provides a mechanism to expose Java Service Provider Interfaces via
 OSGi. To make this work,

 1. Add the following spi-fly and its dependency bundles to AS - Download
 links are available at [1]. We need a make a Carbon feature out of this to
 install in AS. @Denuwanthi, please note.

 SPI Fly Dynamic Weaving Bundle 1.0.0
 Aries Util 1.1.0
 ASM 4.0.0

 2. You need to make the Myfaces bundle a service provider of
 javax.servlet.ServletContainerInitializer interface under the OSGi
 environment. For that you need to add 'Require-Capability', and
 'Provide-Capability' Manifest headers as follows.

   Require-Capability: osgi.extender;
 filter:=(osgi.extender=osgi.serviceloader.registrar)

   Provide-Capability: osgi.serviceloader; osgi.serviceloader=
 *javax.servlet.ServletContainerInitializer*

 3. Since Tomcat uses a custom mechanism to load the service providers,
 you do not need to add Consumer's manifest headers. Consumer part for
 webapps is already handled by our solution.
 [1] http://aries.apache.org/modules/spi-fly.html

 Regards,
 KasunG



 On Fri, May 30, 2014 at 12:01 PM, Sagara Gunathunga sag...@wso2.com
 wrote:

 It looks like we need OSGI aware way to
 find ServletContainerInitializers. Myfaces use MyFacesContainerInitializer
 to register MyFaces Servlet but this is not pick up by the AS that's why
 JSF not work on ASTomEE.

 Thanks !
 --
 Sagara Gunathunga

 Senior Technical Lead; 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




 --

 *Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc.
 email: kasung AT spamfree wso2.com
 linked-in: http://lk.linkedin.com/in/gajasinghe
 blog: http://kasunbg.org






 --
 Denuwanthi De Silva
 Software Engineer;
 WSO2 Inc.; http://wso2.com,
 Email: denuwan...@wso2.com





 --

 *Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc.
 email: kasung AT spamfree wso2.com
 linked-in: http://lk.linkedin.com/in/gajasinghe
 blog: http://kasunbg.org






-- 
Sagara Gunathunga

Senior Technical Lead; 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
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


[Architecture] Automating API publishing and subscriptions in EMM

2014-05-30 Thread Dilshan Edirisuriya
Hi,

This is related to the API manager integration with EMM. To describe more
on the usecase we are trying to protect some of the EMM APIs (for now only
Android) using API manager. For this we have included the API manager
features to EMM pack along with the publisher and API store Jaggery apps.

We have discussed 2 approaches on this in Dev [1] other than the approach
discussed in [2]. After discussing with Shan we are going ahead with the
approach 1 which is discussed in thread [1]. Which is to have one consumer
key and consumer secret for super tenant space and make it available for
all other tenant. So at any time an EMM server instance will only contain
one consumer key and a consumer secret.

While progressing in the development I have faced some issues. Which needs
to be clearly defined and addressed.

Since above APIs are Android related these should be published and
subscribed in advance. What I was asked to do is to automatically publish
and subscribe APIs into the API manager. After disusing with Sumedha we
thought of doing it using API manager REST api.

In order to publish I went through the publisher APIs which appear in API
manager doc[3]. This requires login to the system in advance. I looked in
to the API manager code on this. As an example if you look at add publisher
API at location publisher/site/blocks/item-add/ajax/add.jag this has a
validation to check the current user  (session.get(logged.user)). So it
fails from this point. I see following issues on this.

1) API manager does not accept a SAML token hence we need to call the login
url first to get a valid session in API publisher. Is there any way we can
achieve this?

2) If we are to call the login API of API manager we should keep the
username or password in some place like configuration file. I know
AppFactory do this where they keep admin credentials in appfactory.xml for
the purpose of WSRequests. Is it ok to follow something like this?

3) If we keep username and password in a configuration file it should be
super admin credentials since we need to publish/subscribe using that
account to be available for all other users. What if someone change the
credentials from carbon console before logging into EMM?

4) Not sure whether there is Jaggery listeners for context initialization
as in servlet spec (I know they have implemented listeners for session
though). Otherwise have to publish/subscribe these at first time login
which is bit non standard way of doing things.

5) Since we have one consumer key and secret if it is compromised how do we
revoke it? How does mobile apps adhere to this change since it stores these
in sandbox securely at the first time. I believe dynamic consumer
key/secret generation minimize this issue and it affect only to minimal set
of devices rather than all the devices in the system.

Let me know your thoughts on these.


[1] - [Dev]Securing the APIs on EMM in multi tenant environment
[2] - [Dev]EMM OAuth Implementation - Android - Storing Consumer Secret
[3] - https://docs.wso2.org/display/AM170/Publisher+APIs


Regards,

Dilshan

-- 
Dilshan Edirisuriya
Senior Software Engineer - WSO2
Mob: + 94 777878905
http://wso2.com/
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Automating API publishing and subscriptions in EMM

2014-05-30 Thread Dilshan Edirisuriya
I am also -1 to that but not sure whether there is a solution if the point
1) is not fulfilling with the use of API manger APIs. Have to check this
with API manager team. I just have proposed a work around by looking at
AppFactory.


On Sat, May 31, 2014 at 12:52 AM, Chan duli...@wso2.com wrote:

 -1 for keeping passwords in files. They are evil cause people will change
 them from UI and behavior is unpredictable. Best is to authenticate with
 the identity token we have to the APIM. I am not sure whether APIM supports
 authenticating with SAML token?


 On Fri, May 30, 2014 at 11:30 AM, Dilshan Edirisuriya dils...@wso2.com
 wrote:

 Hi,

 This is related to the API manager integration with EMM. To describe more
 on the usecase we are trying to protect some of the EMM APIs (for now only
 Android) using API manager. For this we have included the API manager
 features to EMM pack along with the publisher and API store Jaggery apps.

 We have discussed 2 approaches on this in Dev [1] other than the approach
 discussed in [2]. After discussing with Shan we are going ahead with the
 approach 1 which is discussed in thread [1]. Which is to have one consumer
 key and consumer secret for super tenant space and make it available for
 all other tenant. So at any time an EMM server instance will only contain
 one consumer key and a consumer secret.

 While progressing in the development I have faced some issues. Which
 needs to be clearly defined and addressed.

 Since above APIs are Android related these should be published and
 subscribed in advance. What I was asked to do is to automatically publish
 and subscribe APIs into the API manager. After disusing with Sumedha we
 thought of doing it using API manager REST api.

 In order to publish I went through the publisher APIs which appear in API
 manager doc[3]. This requires login to the system in advance. I looked in
 to the API manager code on this. As an example if you look at add publisher
 API at location publisher/site/blocks/item-add/ajax/add.jag this has a
 validation to check the current user  (session.get(logged.user)). So it
 fails from this point. I see following issues on this.

 1) API manager does not accept a SAML token hence we need to call the
 login url first to get a valid session in API publisher. Is there any way
 we can achieve this?

 2) If we are to call the login API of API manager we should keep the
 username or password in some place like configuration file. I know
 AppFactory do this where they keep admin credentials in appfactory.xml for
 the purpose of WSRequests. Is it ok to follow something like this?

 3) If we keep username and password in a configuration file it should be
 super admin credentials since we need to publish/subscribe using that
 account to be available for all other users. What if someone change the
 credentials from carbon console before logging into EMM?

 4) Not sure whether there is Jaggery listeners for context initialization
 as in servlet spec (I know they have implemented listeners for session
 though). Otherwise have to publish/subscribe these at first time login
 which is bit non standard way of doing things.

 5) Since we have one consumer key and secret if it is compromised how do
 we revoke it? How does mobile apps adhere to this change since it stores
 these in sandbox securely at the first time. I believe dynamic consumer
 key/secret generation minimize this issue and it affect only to minimal set
 of devices rather than all the devices in the system.

 Let me know your thoughts on these.


 [1] - [Dev]Securing the APIs on EMM in multi tenant environment
 [2] - [Dev]EMM OAuth Implementation - Android - Storing Consumer Secret
 [3] - https://docs.wso2.org/display/AM170/Publisher+APIs


 Regards,

 Dilshan

 --
 Dilshan Edirisuriya
 Senior Software Engineer - WSO2
 Mob: + 94 777878905
 http://wso2.com/

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 Chan (Dulitha Wijewantha)
 Software Engineer - Mobile Development
 WSO2Mobile
 Lean.Enterprise.Mobileware
  * ~Email   duli...@wso2.com duli...@wso2mobile.com*
 *  ~Mobile +94712112165 %2B94712112165*
 *  ~Website   dulitha.me http://dulitha.me*
 *  ~Twitter @dulitharw https://twitter.com/dulitharw*
   *~Github @dulichan https://github.com/dulichan*
   *~SO @chan http://stackoverflow.com/users/813471/chan*

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




-- 
Dilshan Edirisuriya
Senior Software Engineer - WSO2
Mob: + 94 777878905
http://wso2.com/
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Spatial CEP - Overall Design

2014-05-30 Thread Chan
Hi Mifan,
Really interested about spatial CEP since this is important for Mobility
and IoT. As I understood - we send GeoJSON data to a stream in CEP. Are we
going to write an input adaptor for GeoJSON? Or how is it going to work?

Cheers~


On Fri, May 30, 2014 at 8:37 AM, Mifan Careem mi...@wso2.com wrote:

 *Input Stream:*
 GPX XML
 NMEA
 Simple Lat,lon

 *Processing*
 Use Geotools functions such as WITHIN, OVERLAY etc. These will be
 available as geo: constructs in CEP.

 *Configuration*
 The projection and CRS for both input streams and input geometries need to
 be specified, and need to be matching formats for pattern matching. These
 can be input in the query itself or as a conf value.

 *Input UI*
 Generic helper UI consisting of a set of maps, which provides functions
 such as

- Create a polygon for geo-fencing
- Create list of points and buffers for point-based alarms

 *Storage*

- The above will be converted to a standard format (e.g: GeoJSON) and
put to storage or will create queries in CEP directly.
- Since GeoJSON is the accepted input, users can directly input
GeoJSON as well which would be the case in most professional deployments.


 *Output UI/User UI*
 Generic UI, mostly included as a sample which includes

- Fleet management view - moving pointers, built using HTML5,
Openlayers and web-sockets

 *Example functions based on above*

- Geo-fencing - No fly zone - Detect whether an points in the stream
fall within a no-fly-zone
- Geo-fencing - Check whether tagged elephants are leaving the
protected area
- Point based alarms - Plot all bus halts on the map, and assign a
100m buffer to them. Alert if a certain bus is at a certain bus halt for
more than its allocated time
- Movement based alarms - Alert if 2 busses are moving in parallel
(like our busses racing each other on Galle Road!)


 Mifan

 --
 *Mifan Careem*
 Director - Solution Architecture, WSO2 Inc.
 Member, Sahana Software Foundation
 Consultant Spatial Architect
  M: +94 773 437 283
  LinkedIn: http://lk.linkedin.com/in/mifan
  Skype: mifan_skype

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




-- 
Chan (Dulitha Wijewantha)
Software Engineer - Mobile Development
WSO2Mobile
Lean.Enterprise.Mobileware
 * ~Email   duli...@wso2.com duli...@wso2mobile.com*
*  ~Mobile +94712112165 %2B94712112165*
*  ~Website   dulitha.me http://dulitha.me*
*  ~Twitter @dulitharw https://twitter.com/dulitharw*
  *~Github @dulichan https://github.com/dulichan*
  *~SO @chan http://stackoverflow.com/users/813471/chan*
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture