[Dev] [DSS/MySQL] Retrieve data from a MySQL table with or without stored procedure

2015-04-05 Thread Suhan Dharmasuriya
Hi,

I'm using WSO2 DSS 3.2.1 with local MySQL DB.

Please find the data service XML configuration below[1].

There are two ways to retrieve data from a mysql database table as I have
tested.

1. Using a stored procedure created as follows in MySQL DB.
Here the query logic is inside MySQL DB as stored procedures.
CREATE PROCEDURE GetAllEmployees() SELECT FirstName , LastName , Team FROM
Employee;
Refer Query "getAllEmployeesQuery" in below configuration[1].

2. Directly using the select statement inside data service configuration.
Here the query logic is embedded inside the data service configuration.
Refer Query "getAllEmployeesSQLQuery" in below configuration[1].

What is the recommended way/best practice to retrieve data from the above
given two alternatives?

Or is there a better third alternative?

[1]
http://org.wso2.securevault/configuration";
name="SampleDataSource" serviceNamespace="www.wso2.org/dss">
   test with or without stored procedure
   
  com.mysql.jdbc.Driver
  jdbc:mysql://127.0.0.1:3306/dss_sample
  root
  
   
   
  call GetAllEmployees;
  
 
 
 
  
   
   
  SELECT FirstName , LastName , Team FROM Employee;
  
 
 
 
  
   
   
  using a stored procedure
  
   
   
  without using a stored procedure
  
   


Thanks,
Suhan

-- 
Suhan Dharmasuriya
Software Engineer - Test Automation

*WSO2, Inc. *

lean . enterprise . middleware
Tel: +94 112 145345
Mob: +94 779 869138
Blog: http://suhan-opensource.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Some suggestions for ML

2015-04-05 Thread CD Athuraliya
Hi Lochana,

Thanks for your valuable suggestions and for pointing out some mistakes. We
will include dataset prediction feature in upcoming releases and correct
mistakes asap.

Regards,
CD

On Thu, Apr 2, 2015 at 6:33 PM, Lochana  wrote:

> I think it is better to give an option to upload a file (csv or tsv) for
> predictions (rather than asking user to  input values for features).
> https://docs.wso2.com/display/ML100/ML+UI+Workflow#
> MLUIWorkflow-Makingpredictions
>
> Found some mistakes in the documentation.. not sure whether this is the
> right place to discuss those..
>
> https://docs.wso2.com/display/ML100/Architecture
>
> Figure: Machine REST API
>
> The diabetes dataset used in examples has nothing to do with diabetes in
> India. It is about diabetes among certain group of native indians in the US.
> https://archive.ics.uci.edu/ml/datasets/Pima+Indians+Diabetes
>
> -Lochana
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
*CD Athuraliya*
Software Engineer
WSO2, Inc.
lean . enterprise . middleware
Mobile: +94 716288847 <94716288847>
LinkedIn  | Twitter
 | Blog 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Using renewal/cancel WS-Trust bindings to manage SAML tokens issued by SAML 2.0 Web SSO profile

2015-04-05 Thread Prabath Siriwardena
AFAIK the $subject is not working today.

Can we please get that fixed...? This would lead us to many more
useful integration patterns...

-- 
Thanks & Regards,
Prabath

Twitter : @prabath
LinkedIn : http://www.linkedin.com/in/prabathsiriwardena

Mobile : +1 650 625 7950

http://blog.facilelogin.com
http://blog.api-security.org
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] App Manager latest build pack - 05-04-2015

2015-04-05 Thread Dinusha Senanayaka
Hi,

Please find $subject in [1].

[1] http://builder1.us1.wso2.org/~appm/05-04-2015/

Regards,
Dinusha.

-- 
Dinusha Dilrukshi
Senior Software Engineer
WSO2 Inc.: http://wso2.com/
Mobile: +94725255071
Blog: http://dinushasblog.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] App Manager sample deployer

2015-04-05 Thread Sumedha Rubasinghe
Sachith,
Can you also send screenshots of following.
- Sample app deployer menu
- Deployed sample on publisher
- Deployed sample on store
- link to documentation
On Apr 5, 2015 10:21 AM, "Sachith Herath"  wrote:

> Hi Dinusha,
>
> I sent you a pull request[A] with above changes.
>   A. https://github.com/wso2/carbon-appmgt/pull/25
>
> But I didn't add the following changes,
>
>1.  Since NetworkUtil class is defined in org.wso2.carbon.utils
>package i didn't remove that method
>2. That key store thing because it needs to be discussed.
>
>
> *Sachith Ushan*
> Software Engineering  intern
> WSO2 : http://wso2 .com
> mobile :- +94 71 8853336
> sachi...@wso2.com
>
> On Fri, Apr 3, 2015 at 8:00 PM, Sachith Herath  wrote:
>
>> Hi Dinusha,
>>
>> OK.I will add those changes.
>>
>> Regards,
>>
>> *Sachith Ushan*
>> Software Engineering  intern
>> WSO2 : http://wso2 .com
>> mobile :- +94 71 8853336
>> sachi...@wso2.com
>>
>> On Fri, Apr 3, 2015 at 1:17 PM, Dinusha Senanayaka 
>> wrote:
>>
>>> Hi Sachith,
>>>
>>> Good work . I have merged your pull request [A] since pack need to be
>>> tested with this. Please do following changes to your next immediate pull
>>> request. Also schedule a code review for Monday.
>>>
>>> [A]. https://github.com/wso2/carbon-appmgt/pull/24
>>>
>>> 1. Update licence headers in all files
>>> 2. Add class level and method level comments and mentioned what each
>>> class/method is doing
>>> 3. Exception hanldling in all classes
>>>-Remove all "e.printStackTrace()"
>>>-Introduce new exception class like "AppMSampleDeployerException" and
>>> log the original exception and throw this exception.
>>>eg:  catch (IOException e) {
>>>  e.printStackTrace();
>>> }
>>>
>>>chnage it as,
>>>catch (IOException e) {
>>>  log.error("Error while building login html page", e);
>>>  throw new AppMSampleDeployerException("Error while building
>>> login html page", e);
>>>}
>>>
>>> 4. ApplicationController.java ->
>>>- Read ip address from carbon server properties instead of
>>> NetworkUtils.getLocalHostname()
>>>- Remove hardcoded 8280 port in accsesWebPages() method
>>>
>>> 5. HttpHandler.java ->
>>>- Is this correct "private final static String USER_AGENT =
>>> "Mozilla/5.0";"
>>>- Also this won't run if the default keystores get changed. Need to
>>> discuss whether we need to handle this
>>>
>>>   HttpsURLConnection.setDefaultHostnameVerifier(new
>>> HostnameVerifier() {
>>> public boolean verify(String hostname, SSLSession session) {
>>>  if (hostname.equals("localhost"))
>>>  return true;
>>>  return false;
>>>  }
>>>   });
>>>
>>> Regards,
>>> Dinusha.
>>>
>>>
>>> --
>>> Dinusha Dilrukshi
>>> Senior Software Engineer
>>> WSO2 Inc.: http://wso2.com/
>>> Mobile: +94725255071
>>> Blog: http://dinushasblog.blogspot.com/
>>>
>>
>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] API subscribe not working in tenant mode in test automation`

2015-04-05 Thread Shashika Karunatilaka
Thanks Tharindu,
After adding Api provider as amuser11-AT-wso2.com solved the issue.

On Sat, Apr 4, 2015 at 8:32 PM, Tharindu Dharmarathna 
wrote:

> Hi Saneth,
>
> I checked with Shashika regarding this issue  happen when give provider
> name incorrectly. Because We are replacing '@' mark in tenant domain
> seperation in provider in to '-AT-'  therefore we have to give provider
> name  by replacing @ mark from that '-AT-' mark .
>
>
> Thanks
> Tharindu
>
> On Sat, Apr 4, 2015 at 1:19 PM, Saneth Dharmakeerthi 
> wrote:
>
>> Hi Shashika,
>>
>> Is there any detail log available in server side about this error.
>>
>> Thanks and Best Regards,
>>
>> Saneth Dharmakeerthi
>> Senior Software Engineer
>> WSO2, Inc.
>> Mobile: +94772325511
>>
>> On Sat, Apr 4, 2015 at 12:50 PM, Shashika Karunatilaka <
>> shashi...@wso2.com> wrote:
>>
>>> Hi Saneth,
>>>
>>> yes, can do the same thing.it works from ui.
>>>
>>> On Sat, Apr 4, 2015 at 12:33 PM, Saneth Dharmakeerthi 
>>> wrote:
>>>
 HI Shashika,

 Can you manually do the subscription from the same user (
 amuse...@wso2.com)?
 Check whether the given user has subscription permition.

 Thanks and Best Regards,

 Saneth Dharmakeerthi
 Senior Software Engineer
 WSO2, Inc.
 Mobile: +94772325511

 On Sat, Apr 4, 2015 at 12:23 PM, Shashika Karunatilaka <
 shashi...@wso2.com> wrote:

> Hi,
>
> Currently i'm writing on a test case to publish a api through tenant
> and want to subscribe that api and need to invoke the api i have created,
> But im getting below error when calling
> org.wso2.carbon.am.tests.util.APIStoreRestClient's subscribe() method
> {"error" : true, "message" :
> "org.wso2.carbon.apimgt.api.APIManagementException: Error while adding the
> subscription for user: amuse...@wso2.com"}
>
> This process works fine when doing it using super tenant mode.
> Im using api manager 1.8.0.
>
> Thank you.
> --
> Shashika Prabath Karunatilaka,
> Software Engineer,
> WSO2, Inc: http://wso2.com/
> mobile : +94 77 7487792
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>

>>>
>>>
>>> --
>>> Shashika Prabath Karunatilaka,
>>> Software Engineer,
>>> WSO2, Inc: http://wso2.com/
>>> mobile : +94 77 7487792
>>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
> *Tharindu Dharmarathna*Associate Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: *+94779109091 <%2B94779109091>*
>



-- 
Shashika Prabath Karunatilaka,
Software Engineer,
WSO2, Inc: http://wso2.com/
mobile : +94 77 7487792
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] Evaluating a specific XACML policy passing the policy ID

2015-04-05 Thread Rushmin Fernando
Our requirement was to manage the relevant policy mapping in App Manager
side and pick policies based on that mapping to increase the re-usability
of the policies.

As per the offline chat with Asela, we implemented it by having a custom id
attribute in the target element.  This is what Farasath suggested too.

Thank you guys for your help !

Rushmin

On Mon, Mar 23, 2015 at 10:24 AM, Asela Pathberiya  wrote:

> On Sun, Mar 22, 2015 at 2:27 PM, Farasath Ahamed 
> wrote:
> > Hi Rushmin,
> >
> > I suppose you are planning to map the 'conditions' to policyIDs and reuse
> > them.
>
> Yes..  Policy target can be used to pick policies and rules..  But i
> do not think,  it is good idea to model to send the policy id in the
> XACML request.. Can't we use some other.. ?
>
> Thanks,
> Asela.
>
> >
> > AFAIK you can send the policyID as an attribute with the XACML request
> and
> > add the policyID as in the target within the XACML Policy Target to
> achieve
> > this. You can easily write an AttributeFinder module to get the policyID
> > from wherever you plan to get it from(PolicyID mapped to 'conditions').
> This
> > works if you are planning to have a mapping of PolicyID for 'conditions'
> as
> > you mentioned above.
> >
> > Alternatively you can also use  element to refer to a
> > policy by its ID [1]
> >
> > [1]
> >
> http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html#_Toc325047116
> > Adding @Asela for further opinion
> >
> > On Sun, Mar 22, 2015 at 7:47 AM, Rushmin Fernando 
> wrote:
> >>
> >> Thanks Farasath for your response.
> >>
> >> Yes, both would solve my problem.
> >>
> >> So you are saying that we can pass a policy id in the XACML request, so
> >> that the XACML engine will only consider that policy when it comes to
> >> evaluating ?
> >>
> >> Thanks
> >> Rushmin
> >>
> >> On Sat, Mar 21, 2015 at 10:21 PM, Farasath Ahamed 
> >> wrote:
> >>>
> >>> Hi Rushmin,
> >>>
> >>> So what you basically want is a XACML policy which becomes applicable
> >>> based on a policy ID?
> >>> or do you want to reuse 'conditions' generated by the user by say
> giving
> >>> them a referenceID or something?
> >>>
> >>> I think both of which is possible in XACML 3.0. Can you elaborate more
> on
> >>> the condition 'part' you have mentioned above?
> >>>
> >>> On Sat, Mar 21, 2015 at 1:16 PM, Rushmin Fernando 
> >>> wrote:
> 
>  Hi IS Team,
> 
>  In App Manager we have the following requirement.
> 
>  1) App creator need to associate authorization rules for URL pattern +
>  HTTP verb combinations
> 
>  2) They are given a UI to add a URL pattern, select an HTTP verb and
>  then apply an authorization rule.
> 
>  3) App Manager uses XACML for these authorization rules.
> 
>  4) Since the 'resource' and 'action' parts of the XACML policy is
>  determined the aforementioned UI inputs, user is only allowed to
> write the
>  'condition' part. And the actual XACML policy is generated using these
>  parts.
> 
>  5) But the thing is, we need to re-use these 'conditions'. We do it in
>  App Manager level. But we end up with generating XACML policies for
>  'resource' + 'action' combinations.
> 
>  Is there a way that we can have a single XACML policy which only has
> the
>  condition 'part' and evaluate the XACML request using that specific
> policy
>  (by giving the policy ID ) ?
> 
>  --
>  Rushmin Fernando
>  Technical Lead
> 
>  WSO2 Inc. - Lean . Enterprise . Middleware
> 
>  email : rush...@wso2.com
>  mobile : +94772310855
> 
> 
> 
>  ___
>  Dev mailing list
>  Dev@wso2.org
>  http://wso2.org/cgi-bin/mailman/listinfo/dev
> 
> >>>
> >>>
> >>>
> >>> --
> >>> Farasath Ahamed
> >>> Software Engineering Intern
> >>> WSO2 Inc.; http://wso2.com
> >>>
> >>> Mobile: +94 777 603 866
> >>> E-Mail:  farasa...@wso2.com
> >>> Blog: http://thepseudocode.blogspot.com/
> >>
> >>
> >>
> >>
> >> --
> >> Rushmin Fernando
> >> Technical Lead
> >>
> >> WSO2 Inc. - Lean . Enterprise . Middleware
> >>
> >> email : rush...@wso2.com
> >> mobile : +94772310855
> >>
> >>
> >
> >
> >
> > --
> > Farasath Ahamed
> > Software Engineering Intern
> > WSO2 Inc.; http://wso2.com
> >
> > Mobile: +94 777 603 866
> > E-Mail:  farasa...@wso2.com
> > Blog: http://thepseudocode.blogspot.com/
>
>
>
> --
> Thanks & Regards,
> Asela
>
> ATL
> Mobile : +94 777 625 933
>  +358 449 228 979
>



-- 
*Rushmin Fernando*
*Technical Lead*

WSO2 Inc.  - Lean . Enterprise . Middleware

email : rush...@wso2.com
mobile : +94772310855
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Set the FTP home to a different location except user home

2015-04-05 Thread Thilini Cooray
Hi Amalka,

Many articles have suggested to changes the home directory of the user
[1,2].
[3] has suggested of setting an anonymous FTP.

Please check whether any of those can be a help to you.

[1]
http://unix.stackexchange.com/questions/83221/how-to-create-a-ftp-user-with-specific-dir-access-only-on-a-centos-linux-ins
[2]
http://serverfault.com/questions/544850/create-new-vsftpd-user-and-lock-to-specify-home-login-directory
[3] http://serverfault.com/questions/145262/how-to-change-ftp-path

Thanks.

On Fri, Apr 3, 2015 at 9:19 AM, Amalka Subasinghe  wrote:

> Tried different articles but couldn't find a correct one
>
> On Fri, Apr 3, 2015 at 9:17 AM, Amalka Subasinghe  wrote:
>
>> Hi,
>>
>> Does anyone know how to do the $subject?
>>
>> Thanks
>> Amalka
>>
>
>
>
> --
>
> Amalka Subasinghe
> Senior Software Engineer
> WSO2 Inc.
> Mobile: +94 77 9401267
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Best Regards,

*Thilini Cooray*
Software Engineer
Mobile : +94 (0) 774 570 112 <%2B94%20%280%29%20773%20451194>
E-mail : thili...@wso2.com

WSO2 Inc. www.wso2.com
lean.enterprise.middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DSS/MySQL] Retrieve data from a MySQL table with or without stored procedure

2015-04-05 Thread Suhan Dharmasuriya
On Sun, Apr 5, 2015 at 8:13 PM, Suhan Dharmasuriya  wrote:

> Hi,
>
> I'm using WSO2 DSS 3.2.1 with local MySQL DB.
>
> Please find the data service XML configuration below[1].
>
> There are two ways to retrieve data from a mysql database table as I have
> tested.
>
> 1. Using a stored procedure created as follows in MySQL DB.
> Here the query logic is inside MySQL DB as stored procedures.
> CREATE PROCEDURE GetAllEmployees() SELECT FirstName , LastName , Team FROM
> Employee;
> Refer Query "getAllEmployeesQuery" in below configuration[1].
>
> 2. Directly using the select statement inside data service configuration.
> Here the query logic is embedded inside the data service configuration.
> Refer Query "getAllEmployeesSQLQuery" in below configuration[1].
>
> What is the recommended way/best practice to retrieve data from the above
> given two alternatives?
>
> Or is there a better third alternative?
>
> [1]
> http://org.wso2.securevault/configuration";
> name="SampleDataSource" serviceNamespace="www.wso2.org/dss">
>test with or without stored procedure
>
>   com.mysql.jdbc.Driver
>   jdbc:mysql://127.0.0.1:3306/dss_sample
> 
>   root
>   
>
>
>   call GetAllEmployees;
>   
>   xsdType="string"/>
>  
>  
>   
>
>
>   SELECT FirstName , LastName , Team FROM Employee;
>   
>   xsdType="string"/>
>  
>  
>   
>
>
>   using a stored procedure
>   
>
>
>   without using a stored procedure
>   
>
> 
>
> Thanks,
> Suhan
>
> --
> Suhan Dharmasuriya
> Software Engineer - Test Automation
>
> *WSO2, Inc. *
>
> lean . enterprise . middleware
> Tel: +94 112 145345
> Mob: +94 779 869138
> Blog: http://suhan-opensource.blogspot.com/
>



-- 
Suhan Dharmasuriya
Software Engineer - Test Automation

*WSO2, Inc. *

lean . enterprise . middleware
Tel: +94 112 145345
Mob: +94 779 869138
Blog: http://suhan-opensource.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Orbit bundles and transitive dependencies in the compile time

2015-04-05 Thread Niranda Perera
Hi Sameera,

I agree with you on the compilation scenario. It was mistake on my part.

But recently I came across with this issue. Pls consider the following
scenario.

a non-OSGI jar say, 'foo.jar' depends on the 'a.jar' and 'b.jar' which are
OSGI bundles.

foo (non-OSGI)
|_ a (OSGI)
|_ b (OSGI)

I OSGIfy foo.jar designating a & b as import-packages to make the
"foo-orbit.jar".

when I compile my component using foo-orbit.jar it compiles without an
issue. but when I run the unit tests of the component, in the run-time I
encounter classnotfound exceptions in the classes of a.jar and b.jar. so, I
have to specify a and b as dependencies in the component along with the
foo-orbit.
when I compile the component using the original foo, compilation and
testing (run-time) happens seamlessly without having to specify a & b
dependencies individually.
Is this the expected behavior?

this issue occurred to me while I was testing the spark components with the
spark orbits. and the classnotfound exceptions are thrown in the spark
server start-up.

Gokul also told me that he encountered a similar problem with the hadoop
client orbit.

look forward to know your thoughts in this regard.

rgds


On Wed, Mar 25, 2015 at 4:36 PM, Sameera Jayasoma  wrote:

> We are in the process of getting rid of transitive dependencies from
> orbits, carbon components etc.
>
> If your component requires the original Spark libraries for compilation
> then there are obvious issues in your Spark orbit bundle. A component
> should be able compile using orbits and other component dependencies. If
> this is not possible, then your component dependencies are not properly
> "OSGified"
>
> A component shouldn't depend on transitive dependencies. Thats the plan.
> If you see issues with this approach, please explain.
>
> Thanks,
> Sameera.
>
>
>
> On Tue, Mar 24, 2015 at 11:00 AM, Gokul Balakrishnan 
> wrote:
>
>> Hi Kernel team,
>>
>> Any idea on $subject? Shouldn't the transitive dependencies of the orbit
>> bundle be visible to the component referring to the bundle at compile time?
>> Should we just refer to the 3rd party jar (the orbit bundle is wrapping) in
>> the component and use the orbit in the feature, or should we use the orbit
>> bundle for both? Would be great if you could clarify.
>>
>> Thanks,
>>
>> On 23 March 2015 at 14:59, Niranda Perera  wrote:
>>
>>> Hi,
>>>
>>> As of the current orbit bundle guideline [1], we have to mark the
>>> dependencies as optional. I believe this results in transitive dependencies
>>> of that particular bundle not being exposed.
>>>
>>> Because of this, I have experienced compilation failures, when I put
>>> orbit bundles as component dependencies.
>>> For an example, in carbon analytics components, when I import spark-core
>>> orbit, I encsounter dependency errors (But when I import the original spark
>>> dependency this does not occur)
>>>
>>> so, is it a good practice for us to say that, orbit bundles should be
>>> used in the runtime, where as in the compile time, use the original jars?
>>> essentially, is it okay to include original jars in the components and
>>> only include orbits in the features? (because earlier, I was under the
>>> impression that, once an orbit bundle is created, it should be used BOTH in
>>> the components and in the feature)
>>>
>>> would be great if you could clarify this matter.
>>>
>>> rgds
>>>
>>> [1]
>>> https://docs.google.com/a/wso2.com/document/d/1I3nWPnG6139YobZzQWPFOUxYEmHxqf9ieWykmQupPtc/edit#
>>>
>>> --
>>> *Niranda Perera*
>>> Software Engineer, WSO2 Inc.
>>> Mobile: +94-71-554-8430
>>> Twitter: @n1r44 
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Balakrishnan Gokulakrishnan*
>> Software Engineer,
>> WSO2, Inc. http://wso2.com
>> Mob: +94 77 593 5789 | +1 650 272 9927
>>
>
>
>
> --
> Sameera Jayasoma,
> Software Architect,
>
> WSO2, Inc. (http://wso2.com)
> email: same...@wso2.com
> blog: http://blog.sameera.org
> twitter: https://twitter.com/sameerajayasoma
> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
> Mobile: 0094776364456
>
> Lean . Enterprise . Middleware
>
>


-- 
*Niranda Perera*
Software Engineer, WSO2 Inc.
Mobile: +94-71-554-8430
Twitter: @n1r44 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Orbit bundles and transitive dependencies in the compile time

2015-04-05 Thread Sameera Jayasoma
Hi Niranda,

On Mon, Apr 6, 2015 at 10:25 AM, Niranda Perera  wrote:

> Hi Sameera,
>
> I agree with you on the compilation scenario. It was mistake on my part.
>
> But recently I came across with this issue. Pls consider the following
> scenario.
>
> a non-OSGI jar say, 'foo.jar' depends on the 'a.jar' and 'b.jar' which are
> OSGI bundles.
>
> foo (non-OSGI)
> |_ a (OSGI)
> |_ b (OSGI)
>
> I OSGIfy foo.jar designating a & b as import-packages to make the
> "foo-orbit.jar".
>
> when I compile my component using foo-orbit.jar it compiles without an
> issue. but when I run the unit tests of the component, in the run-time I
> encounter classnotfound exceptions in the classes of a.jar and b.jar. so, I
> have to specify a and b as dependencies in the component along with the
> foo-orbit.
> when I compile the component using the original foo, compilation and
> testing (run-time) happens seamlessly without having to specify a & b
> dependencies individually.
> Is this the expected behavior?
>

This is exactly the expected behavior. You need to declare all the
dependencies of a component in the pom.xml for compilation and testing. All
the dependencies of a carbon component should be OSGi bundles. There are
few exceptions though.

Thanks,
Sameera.

>
> this issue occurred to me while I was testing the spark components with
> the spark orbits. and the classnotfound exceptions are thrown in the spark
> server start-up.
>
> Gokul also told me that he encountered a similar problem with the hadoop
> client orbit.
>
> look forward to know your thoughts in this regard.
>
> rgds
>
>
> On Wed, Mar 25, 2015 at 4:36 PM, Sameera Jayasoma 
> wrote:
>
>> We are in the process of getting rid of transitive dependencies from
>> orbits, carbon components etc.
>>
>> If your component requires the original Spark libraries for compilation
>> then there are obvious issues in your Spark orbit bundle. A component
>> should be able compile using orbits and other component dependencies. If
>> this is not possible, then your component dependencies are not properly
>> "OSGified"
>>
>> A component shouldn't depend on transitive dependencies. Thats the plan.
>> If you see issues with this approach, please explain.
>>
>> Thanks,
>> Sameera.
>>
>>
>>
>> On Tue, Mar 24, 2015 at 11:00 AM, Gokul Balakrishnan 
>> wrote:
>>
>>> Hi Kernel team,
>>>
>>> Any idea on $subject? Shouldn't the transitive dependencies of the orbit
>>> bundle be visible to the component referring to the bundle at compile time?
>>> Should we just refer to the 3rd party jar (the orbit bundle is wrapping) in
>>> the component and use the orbit in the feature, or should we use the orbit
>>> bundle for both? Would be great if you could clarify.
>>>
>>> Thanks,
>>>
>>> On 23 March 2015 at 14:59, Niranda Perera  wrote:
>>>
 Hi,

 As of the current orbit bundle guideline [1], we have to mark the
 dependencies as optional. I believe this results in transitive dependencies
 of that particular bundle not being exposed.

 Because of this, I have experienced compilation failures, when I put
 orbit bundles as component dependencies.
 For an example, in carbon analytics components, when I import
 spark-core orbit, I encsounter dependency errors (But when I import the
 original spark dependency this does not occur)

 so, is it a good practice for us to say that, orbit bundles should be
 used in the runtime, where as in the compile time, use the original jars?
 essentially, is it okay to include original jars in the components and
 only include orbits in the features? (because earlier, I was under the
 impression that, once an orbit bundle is created, it should be used BOTH in
 the components and in the feature)

 would be great if you could clarify this matter.

 rgds

 [1]
 https://docs.google.com/a/wso2.com/document/d/1I3nWPnG6139YobZzQWPFOUxYEmHxqf9ieWykmQupPtc/edit#

 --
 *Niranda Perera*
 Software Engineer, WSO2 Inc.
 Mobile: +94-71-554-8430
 Twitter: @n1r44 

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


>>>
>>>
>>> --
>>> *Balakrishnan Gokulakrishnan*
>>> Software Engineer,
>>> WSO2, Inc. http://wso2.com
>>> Mob: +94 77 593 5789 | +1 650 272 9927
>>>
>>
>>
>>
>> --
>> Sameera Jayasoma,
>> Software Architect,
>>
>> WSO2, Inc. (http://wso2.com)
>> email: same...@wso2.com
>> blog: http://blog.sameera.org
>> twitter: https://twitter.com/sameerajayasoma
>> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
>> Mobile: 0094776364456
>>
>> Lean . Enterprise . Middleware
>>
>>
>
>
> --
> *Niranda Perera*
> Software Engineer, WSO2 Inc.
> Mobile: +94-71-554-8430
> Twitter: @n1r44 
>



-- 
Sameera Jayasoma,
Software Architect,

WSO2, Inc. (http://wso2.com)
email: same...@wso2.com
blog: http://blog.

Re: [Dev] [Orbit] pls merge the PR for protobuf-java v 2.5.0-spark

2015-04-05 Thread Sameera Jayasoma
Merged.

Maheshika, can you release this orbit bundle?

On Sat, Apr 4, 2015 at 5:44 PM, Niranda Perera  wrote:

> Hi,
>
> Kind reminder to look into this.
>
> Rgds
>
> On Mon, Mar 30, 2015 at 1:44 PM, Niranda Perera  wrote:
>
>> Hi Kasun,
>>
>> I created the orbit bundle for the $subject with the artifact ID
>> 'spark-protobuf-java'. could you please review it and merge? [1]
>>
>> this follows the discussion we had in this thread [2]
>>
>> rgds
>>
>> [1] https://github.com/wso2/orbit/pull/74
>> [2] [Dev] [Carbon] Carbon P2 Plugin issue - jars with different package
>> name BUT same artifact IDs
>>
>> rgds
>>
>> --
>> *Niranda Perera*
>> Software Engineer, WSO2 Inc.
>> Mobile: +94-71-554-8430
>> Twitter: @n1r44 
>>
>
>
>
> --
> *Niranda Perera*
> Software Engineer, WSO2 Inc.
> Mobile: +94-71-554-8430
> Twitter: @n1r44 
>



-- 
Sameera Jayasoma,
Software Architect,

WSO2, Inc. (http://wso2.com)
email: same...@wso2.com
blog: http://blog.sameera.org
twitter: https://twitter.com/sameerajayasoma
flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
Mobile: 0094776364456

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


[Dev] Admin Service in WSO2 AS for Web app deployment

2015-04-05 Thread Awanthika Senarath
Hi all,

I need to find $subject to develop the war-deploy facility in WSO2
developer studio.

I could observe that for the car-deployment we are using the Admin Service
"CarbonAppUploader".

By listing all the Admin services available in WSO2 AS I got the list at
[1], Can someone point out to me the Admin Service used for war file
deployment in AS?

Further is it possible to do exploded web app Deployment in AS? by admin
console uploading I observed that we are deploying the compressed war file.
The ultimate goal of Developer Studio is to enable web app deployment in
Carbon server in exploded format. Hence if such a service is not available
ATM, how should we proceed with this? IMO to enable this we have two
options.

[1] implement this completely on Dev Studio - as a file transfer

[2] get back-end support from Carbon and facilitate this via dev studio
using an admin service


** Exploded war deployment : deployment of the war file in extracted
format. Without deploying the .war file this copies the  folder
directly into the webapps folder in the server.


Appreciate your input


[1]
Admin services deployed on this server:
1. ProvisioningAdminService, ProvisioningAdminService,
https://10.100.5.110:9443/services/ProvisioningAdminService/
2. CarbonAppUploader, CarbonAppUploader,
https://10.100.5.110:9443/services/CarbonAppUploader/
3. OperationAdmin, OperationAdmin,
https://10.100.5.110:9443/services/OperationAdmin/
4. JaggeryAppAdmin, JaggeryAppAdmin,
https://10.100.5.110:9443/services/JaggeryAppAdmin/
5. JaxwsWebappAdmin, JaxwsWebappAdmin,
https://10.100.5.110:9443/services/JaxwsWebappAdmin/
6. StatisticsAdmin, StatisticsAdmin,
https://10.100.5.110:9443/services/StatisticsAdmin/
7. LoggedUserInfoAdmin, LoggedUserInfoAdmin,
https://10.100.5.110:9443/services/LoggedUserInfoAdmin/
8. WebappAdmin, WebappAdmin, https://10.100.5.110:9443/services/WebappAdmin/

9. TopicManagerAdminService, TopicManagerAdminService,
https://10.100.5.110:9443/services/TopicManagerAdminService/
10. ApplicationAdmin, ApplicationAdmin,
https://10.100.5.110:9443/services/ApplicationAdmin/
11. NDataSourceAdmin, NDataSourceAdmin,
https://10.100.5.110:9443/services/NDataSourceAdmin/
12. ServiceGroupAdmin, ServiceGroupAdmin,
https://10.100.5.110:9443/services/ServiceGroupAdmin/
13. DataServiceFileUploader, DataServiceFileUploader,
https://10.100.5.110:9443/services/DataServiceFileUploader/
14. CustomMeteringService, CustomMeteringService,
https://10.100.5.110:9443/services/CustomMeteringService/
15. STSAdminService, STSAdminService,
https://10.100.5.110:9443/services/STSAdminService/
16. RegistryAdminService, RegistryAdminService,
https://10.100.5.110:9443/services/RegistryAdminService/
17. JavaScriptStubGeneratorService, JavaScriptStubGeneratorService,
https://10.100.5.110:9443/services/JavaScriptStubGeneratorService/
http://10.100.5.110:9763/services/JavaScriptStubGeneratorService/
local:///services/JavaScriptStubGeneratorService/
18. JSServiceUploader, JSServiceUploader,
https://10.100.5.110:9443/services/JSServiceUploader/
19. FileDownloadService, FileDownloadService,
https://10.100.5.110:9443/services/FileDownloadService/
20. CachingAdminService, CachingAdminService,
https://10.100.5.110:9443/services/CachingAdminService/
21. MashupServiceAdmin, MashupServiceAdmin,
https://10.100.5.110:9443/services/MashupServiceAdmin/
22. JarServiceCreatorAdmin, JarServiceCreatorAdmin,
https://10.100.5.110:9443/services/JarServiceCreatorAdmin/
23. RMAdminGlobal, RMAdminGlobal,
https://10.100.5.110:9443/services/RMAdminGlobal/
24. ContentSearchAdminService, ContentSearchAdminService,
https://10.100.5.110:9443/services/ContentSearchAdminService/
25. LoginStatisticsAdmin, LoginStatisticsAdmin,
https://10.100.5.110:9443/services/LoginStatisticsAdmin/
26. CustomUIAdminService, CustomUIAdminService,
https://10.100.5.110:9443/services/CustomUIAdminService/
27. RMAdminService, RMAdminService,
https://10.100.5.110:9443/services/RMAdminService/
28. SearchAdminService, SearchAdminService,
https://10.100.5.110:9443/services/SearchAdminService/
29. JMSTransportAdmin, JMSTransportAdmin,
https://10.100.5.110:9443/services/JMSTransportAdmin/
30. ThrottleAdminService, ThrottleAdminService,
https://10.100.5.110:9443/services/ThrottleAdminService/
31. ModuleAdminService, ModuleAdminService,
https://10.100.5.110:9443/services/ModuleAdminService/
32. LoggingAdmin, LoggingAdmin,
https://10.100.5.110:9443/services/LoggingAdmin/
33. ExternalTryitService, ExternalTryitService,
https://10.100.5.110:9443/services/ExternalTryitService/
34. SampleDeployer, SampleDeployer,
https://10.100.5.110:9443/services/SampleDeployer/
35. SecurityAdminService, SecurityAdminService,
https://10.100.5.110:9443/services/SecurityAdminService/
36. KeyStoreAdminService, KeyStoreAdminService,
https://10.100.5.110:9443/services/KeyStoreAdminService/
37. WarApplicationAdmin, WarApplicationAdmin,
https://10.100.5.110:9443/services/WarApplicationAdmin/
38. DiscoveryAdmin, DiscoveryAdmin,
https

Re: [Dev] [Orbit] pls merge the PR for protobuf-java v 2.5.0-spark

2015-04-05 Thread Maheshika Goonetilleke
Hi Sameera

Successfully deployed.

On Mon, Apr 6, 2015 at 10:45 AM, Sameera Jayasoma  wrote:

> Merged.
>
> Maheshika, can you release this orbit bundle?
>
> On Sat, Apr 4, 2015 at 5:44 PM, Niranda Perera  wrote:
>
>> Hi,
>>
>> Kind reminder to look into this.
>>
>> Rgds
>>
>> On Mon, Mar 30, 2015 at 1:44 PM, Niranda Perera  wrote:
>>
>>> Hi Kasun,
>>>
>>> I created the orbit bundle for the $subject with the artifact ID
>>> 'spark-protobuf-java'. could you please review it and merge? [1]
>>>
>>> this follows the discussion we had in this thread [2]
>>>
>>> rgds
>>>
>>> [1] https://github.com/wso2/orbit/pull/74
>>> [2] [Dev] [Carbon] Carbon P2 Plugin issue - jars with different package
>>> name BUT same artifact IDs
>>>
>>> rgds
>>>
>>> --
>>> *Niranda Perera*
>>> Software Engineer, WSO2 Inc.
>>> Mobile: +94-71-554-8430
>>> Twitter: @n1r44 
>>>
>>
>>
>>
>> --
>> *Niranda Perera*
>> Software Engineer, WSO2 Inc.
>> Mobile: +94-71-554-8430
>> Twitter: @n1r44 
>>
>
>
>
> --
> Sameera Jayasoma,
> Software Architect,
>
> WSO2, Inc. (http://wso2.com)
> email: same...@wso2.com
> blog: http://blog.sameera.org
> twitter: https://twitter.com/sameerajayasoma
> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
> Mobile: 0094776364456
>
> Lean . Enterprise . Middleware
>
>


-- 

Thanks & Best Regards,

Maheshika Goonetilleke
Engineering Process Coordinator

*WSO2 Inc*
*email   : mahesh...@wso2.com *
*mobile : +94 773 596707*
*www: :http://wso2.com *lean . enterprise . middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Orbit] pls merge the PR for protobuf-java v 2.5.0-spark

2015-04-05 Thread Niranda Perera
Thanks.

On Mon, Apr 6, 2015 at 10:59 AM, Maheshika Goonetilleke 
wrote:

> Hi Sameera
>
> Successfully deployed.
>
> On Mon, Apr 6, 2015 at 10:45 AM, Sameera Jayasoma 
> wrote:
>
>> Merged.
>>
>> Maheshika, can you release this orbit bundle?
>>
>> On Sat, Apr 4, 2015 at 5:44 PM, Niranda Perera  wrote:
>>
>>> Hi,
>>>
>>> Kind reminder to look into this.
>>>
>>> Rgds
>>>
>>> On Mon, Mar 30, 2015 at 1:44 PM, Niranda Perera 
>>> wrote:
>>>
 Hi Kasun,

 I created the orbit bundle for the $subject with the artifact ID
 'spark-protobuf-java'. could you please review it and merge? [1]

 this follows the discussion we had in this thread [2]

 rgds

 [1] https://github.com/wso2/orbit/pull/74
 [2] [Dev] [Carbon] Carbon P2 Plugin issue - jars with different package
 name BUT same artifact IDs

 rgds

 --
 *Niranda Perera*
 Software Engineer, WSO2 Inc.
 Mobile: +94-71-554-8430
 Twitter: @n1r44 

>>>
>>>
>>>
>>> --
>>> *Niranda Perera*
>>> Software Engineer, WSO2 Inc.
>>> Mobile: +94-71-554-8430
>>> Twitter: @n1r44 
>>>
>>
>>
>>
>> --
>> Sameera Jayasoma,
>> Software Architect,
>>
>> WSO2, Inc. (http://wso2.com)
>> email: same...@wso2.com
>> blog: http://blog.sameera.org
>> twitter: https://twitter.com/sameerajayasoma
>> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
>> Mobile: 0094776364456
>>
>> Lean . Enterprise . Middleware
>>
>>
>
>
> --
>
> Thanks & Best Regards,
>
> Maheshika Goonetilleke
> Engineering Process Coordinator
>
> *WSO2 Inc*
> *email   : mahesh...@wso2.com *
> *mobile : +94 773 596707 <%2B94%20773%20596707>*
> *www: :http://wso2.com *lean . enterprise . middleware
>
>
>
>
>


-- 
*Niranda Perera*
Software Engineer, WSO2 Inc.
Mobile: +94-71-554-8430
Twitter: @n1r44 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DSS/MySQL] Retrieve data from a MySQL table with or without stored procedure

2015-04-05 Thread Sajith Kariyawasam
Hi Suhan,

IMO, whether to use stored procedure or not depends on how complex the
queries are.

For eg, to get a result if you have to do multiple database calls (a
complex query), better you create an SP in the database and expose, so that
from the service layer
you can avoid multiple database calls. For simple searches, better to use
direct SQL than SPs because if you are to create more SPs for simple
searches, it would not be manageable.

SPs are database specific so it would not be easily port an SP written in
MySQL to Oracle, but direct SQLs are portable provided that those are
written with ANSI complaint way.


Thanks,
Sajith

On Mon, Apr 6, 2015 at 9:43 AM, Suhan Dharmasuriya  wrote:

>
>
> On Sun, Apr 5, 2015 at 8:13 PM, Suhan Dharmasuriya 
> wrote:
>
>> Hi,
>>
>> I'm using WSO2 DSS 3.2.1 with local MySQL DB.
>>
>> Please find the data service XML configuration below[1].
>>
>> There are two ways to retrieve data from a mysql database table as I have
>> tested.
>>
>> 1. Using a stored procedure created as follows in MySQL DB.
>> Here the query logic is inside MySQL DB as stored procedures.
>> CREATE PROCEDURE GetAllEmployees() SELECT FirstName , LastName , Team
>> FROM Employee;
>> Refer Query "getAllEmployeesQuery" in below configuration[1].
>>
>> 2. Directly using the select statement inside data service configuration.
>> Here the query logic is embedded inside the data service configuration.
>> Refer Query "getAllEmployeesSQLQuery" in below configuration[1].
>>
>> What is the recommended way/best practice to retrieve data from the above
>> given two alternatives?
>>
>> Or is there a better third alternative?
>>
>> [1]
>> http://org.wso2.securevault/configuration";
>> name="SampleDataSource" serviceNamespace="www.wso2.org/dss">
>>test with or without stored procedure
>>
>>   com.mysql.jdbc.Driver
>>   jdbc:mysql://127.0.0.1:3306/dss_sample
>> 
>>   root
>>   
>>
>>
>>   call GetAllEmployees;
>>   
>>  > xsdType="string"/>
>>  > xsdType="string"/>
>>  
>>   
>>
>>
>>   SELECT FirstName , LastName , Team FROM Employee;
>>   
>>  > xsdType="string"/>
>>  > xsdType="string"/>
>>  
>>   
>>
>>
>>   using a stored procedure
>>   
>>
>>
>>   without using a stored procedure
>>   
>>
>> 
>>
>> Thanks,
>> Suhan
>>
>> --
>> Suhan Dharmasuriya
>> Software Engineer - Test Automation
>>
>> *WSO2, Inc. *
>>
>> lean . enterprise . middleware
>> Tel: +94 112 145345
>> Mob: +94 779 869138
>> Blog: http://suhan-opensource.blogspot.com/
>>
>
>
>
> --
> Suhan Dharmasuriya
> Software Engineer - Test Automation
>
> *WSO2, Inc. *
>
> lean . enterprise . middleware
> Tel: +94 112 145345
> Mob: +94 779 869138
> Blog: http://suhan-opensource.blogspot.com/
>
> ___
> 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] Orbit bundles and transitive dependencies in the compile time

2015-04-05 Thread Niranda Perera
Hi Sameera,

Noted.

returning back to where this issue occurred initially, when I include the
dependencies in the spark component, in the server start up, there was a
"java.lang.SecurityException: class "javax.servlet.FilterRegistration"'s
signer information does not match signer information of other classes in
the same package" exception for the classes that came from the jars
included as dependencies.

just wondering if you have any idea why such an exception might occur?

rgds

On Mon, Apr 6, 2015 at 10:43 AM, Sameera Jayasoma  wrote:

> Hi Niranda,
>
> On Mon, Apr 6, 2015 at 10:25 AM, Niranda Perera  wrote:
>
>> Hi Sameera,
>>
>> I agree with you on the compilation scenario. It was mistake on my part.
>>
>> But recently I came across with this issue. Pls consider the following
>> scenario.
>>
>> a non-OSGI jar say, 'foo.jar' depends on the 'a.jar' and 'b.jar' which
>> are OSGI bundles.
>>
>> foo (non-OSGI)
>> |_ a (OSGI)
>> |_ b (OSGI)
>>
>> I OSGIfy foo.jar designating a & b as import-packages to make the
>> "foo-orbit.jar".
>>
>> when I compile my component using foo-orbit.jar it compiles without an
>> issue. but when I run the unit tests of the component, in the run-time I
>> encounter classnotfound exceptions in the classes of a.jar and b.jar. so, I
>> have to specify a and b as dependencies in the component along with the
>> foo-orbit.
>> when I compile the component using the original foo, compilation and
>> testing (run-time) happens seamlessly without having to specify a & b
>> dependencies individually.
>> Is this the expected behavior?
>>
>
> This is exactly the expected behavior. You need to declare all the
> dependencies of a component in the pom.xml for compilation and testing. All
> the dependencies of a carbon component should be OSGi bundles. There are
> few exceptions though.
>
> Thanks,
> Sameera.
>
>>
>> this issue occurred to me while I was testing the spark components with
>> the spark orbits. and the classnotfound exceptions are thrown in the spark
>> server start-up.
>>
>> Gokul also told me that he encountered a similar problem with the hadoop
>> client orbit.
>>
>> look forward to know your thoughts in this regard.
>>
>> rgds
>>
>>
>> On Wed, Mar 25, 2015 at 4:36 PM, Sameera Jayasoma 
>> wrote:
>>
>>> We are in the process of getting rid of transitive dependencies from
>>> orbits, carbon components etc.
>>>
>>> If your component requires the original Spark libraries for compilation
>>> then there are obvious issues in your Spark orbit bundle. A component
>>> should be able compile using orbits and other component dependencies. If
>>> this is not possible, then your component dependencies are not properly
>>> "OSGified"
>>>
>>> A component shouldn't depend on transitive dependencies. Thats the plan.
>>> If you see issues with this approach, please explain.
>>>
>>> Thanks,
>>> Sameera.
>>>
>>>
>>>
>>> On Tue, Mar 24, 2015 at 11:00 AM, Gokul Balakrishnan 
>>> wrote:
>>>
 Hi Kernel team,

 Any idea on $subject? Shouldn't the transitive dependencies of the
 orbit bundle be visible to the component referring to the bundle at compile
 time? Should we just refer to the 3rd party jar (the orbit bundle is
 wrapping) in the component and use the orbit in the feature, or should we
 use the orbit bundle for both? Would be great if you could clarify.

 Thanks,

 On 23 March 2015 at 14:59, Niranda Perera  wrote:

> Hi,
>
> As of the current orbit bundle guideline [1], we have to mark the
> dependencies as optional. I believe this results in transitive 
> dependencies
> of that particular bundle not being exposed.
>
> Because of this, I have experienced compilation failures, when I put
> orbit bundles as component dependencies.
> For an example, in carbon analytics components, when I import
> spark-core orbit, I encsounter dependency errors (But when I import the
> original spark dependency this does not occur)
>
> so, is it a good practice for us to say that, orbit bundles should be
> used in the runtime, where as in the compile time, use the original jars?
> essentially, is it okay to include original jars in the components and
> only include orbits in the features? (because earlier, I was under the
> impression that, once an orbit bundle is created, it should be used BOTH 
> in
> the components and in the feature)
>
> would be great if you could clarify this matter.
>
> rgds
>
> [1]
> https://docs.google.com/a/wso2.com/document/d/1I3nWPnG6139YobZzQWPFOUxYEmHxqf9ieWykmQupPtc/edit#
>
> --
> *Niranda Perera*
> Software Engineer, WSO2 Inc.
> Mobile: +94-71-554-8430
> Twitter: @n1r44 
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 *Balakrishnan Gokulakr

Re: [Dev] [DSS/MySQL] Retrieve data from a MySQL table with or without stored procedure

2015-04-05 Thread Suhan Dharmasuriya
Thanks Sajith for sharing.

Thanks,
Suhan

On Mon, Apr 6, 2015 at 11:11 AM, Sajith Kariyawasam  wrote:

> Hi Suhan,
>
> IMO, whether to use stored procedure or not depends on how complex the
> queries are.
>
> For eg, to get a result if you have to do multiple database calls (a
> complex query), better you create an SP in the database and expose, so that
> from the service layer
> you can avoid multiple database calls. For simple searches, better to use
> direct SQL than SPs because if you are to create more SPs for simple
> searches, it would not be manageable.
>
> SPs are database specific so it would not be easily port an SP written in
> MySQL to Oracle, but direct SQLs are portable provided that those are
> written with ANSI complaint way.
>
>
> Thanks,
> Sajith
>
> On Mon, Apr 6, 2015 at 9:43 AM, Suhan Dharmasuriya 
> wrote:
>
>>
>>
>> On Sun, Apr 5, 2015 at 8:13 PM, Suhan Dharmasuriya 
>> wrote:
>>
>>> Hi,
>>>
>>> I'm using WSO2 DSS 3.2.1 with local MySQL DB.
>>>
>>> Please find the data service XML configuration below[1].
>>>
>>> There are two ways to retrieve data from a mysql database table as I
>>> have tested.
>>>
>>> 1. Using a stored procedure created as follows in MySQL DB.
>>> Here the query logic is inside MySQL DB as stored procedures.
>>> CREATE PROCEDURE GetAllEmployees() SELECT FirstName , LastName , Team
>>> FROM Employee;
>>> Refer Query "getAllEmployeesQuery" in below configuration[1].
>>>
>>> 2. Directly using the select statement inside data service configuration.
>>> Here the query logic is embedded inside the data service configuration.
>>> Refer Query "getAllEmployeesSQLQuery" in below configuration[1].
>>>
>>> What is the recommended way/best practice to retrieve data from the
>>> above given two alternatives?
>>>
>>> Or is there a better third alternative?
>>>
>>> [1]
>>> http://org.wso2.securevault/configuration";
>>> name="SampleDataSource" serviceNamespace="www.wso2.org/dss">
>>>test with or without stored procedure
>>>
>>>   com.mysql.jdbc.Driver
>>>   jdbc:mysql://127.0.0.1:3306/dss_sample
>>> 
>>>   root
>>>   
>>>
>>>
>>>   call GetAllEmployees;
>>>   
>>>  >> xsdType="string"/>
>>>  >> xsdType="string"/>
>>>  
>>>   
>>>
>>>
>>>   SELECT FirstName , LastName , Team FROM Employee;
>>>   
>>>  >> xsdType="string"/>
>>>  >> xsdType="string"/>
>>>  
>>>   
>>>
>>>
>>>   using a stored procedure
>>>   
>>>
>>>
>>>   without using a stored procedure
>>>   
>>>
>>> 
>>>
>>> Thanks,
>>> Suhan
>>>
>>> --
>>> Suhan Dharmasuriya
>>> Software Engineer - Test Automation
>>>
>>> *WSO2, Inc. *
>>>
>>> lean . enterprise . middleware
>>> Tel: +94 112 145345
>>> Mob: +94 779 869138
>>> Blog: http://suhan-opensource.blogspot.com/
>>>
>>
>>
>>
>> --
>> Suhan Dharmasuriya
>> Software Engineer - Test Automation
>>
>> *WSO2, Inc. *
>>
>> lean . enterprise . middleware
>> Tel: +94 112 145345
>> Mob: +94 779 869138
>> Blog: http://suhan-opensource.blogspot.com/
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>


-- 
Suhan Dharmasuriya
Software Engineer - Test Automation

*WSO2, Inc. *

lean . enterprise . middleware
Tel: +94 112 145345
Mob: +94 779 869138
Blog: http://suhan-opensource.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Admin Service in WSO2 AS for Web app deployment

2015-04-05 Thread Kasun Gajasinghe
It should be WebappAdmin. 

AS supports deploying exploded webapps. But the UI doesn't have the capability 
to upload webapps in exploded format since it's a folder structure. How do you 
propose to do it?

> On Apr 6, 2015, at 10:57 AM, Awanthika Senarath  wrote:
> 
> Hi all,
> 
> I need to find $subject to develop the war-deploy facility in WSO2 developer 
> studio.
> 
> I could observe that for the car-deployment we are using the Admin Service 
> "CarbonAppUploader".
> 
> By listing all the Admin services available in WSO2 AS I got the list at [1], 
> Can someone point out to me the Admin Service used for war file deployment in 
> AS?
> 
> Further is it possible to do exploded web app Deployment in AS? by admin 
> console uploading I observed that we are deploying the compressed war file. 
> The ultimate goal of Developer Studio is to enable web app deployment in 
> Carbon server in exploded format. Hence if such a service is not available 
> ATM, how should we proceed with this? IMO to enable this we have two options.
> 
> [1] implement this completely on Dev Studio - as a file transfer
> 
> [2] get back-end support from Carbon and facilitate this via dev studio using 
> an admin service
> 
> 
> ** Exploded war deployment : deployment of the war file in extracted format. 
> Without deploying the .war file this copies the  folder directly into 
> the webapps folder in the server.
> 
> 
> Appreciate your input
> 
> 
> [1] 
> Admin services deployed on this server:
> 1. ProvisioningAdminService, ProvisioningAdminService, 
> https://10.100.5.110:9443/services/ProvisioningAdminService/ 
> 2. CarbonAppUploader, CarbonAppUploader, 
> https://10.100.5.110:9443/services/CarbonAppUploader/ 
> 3. OperationAdmin, OperationAdmin, 
> https://10.100.5.110:9443/services/OperationAdmin/ 
> 4. JaggeryAppAdmin, JaggeryAppAdmin, 
> https://10.100.5.110:9443/services/JaggeryAppAdmin/ 
> 5. JaxwsWebappAdmin, JaxwsWebappAdmin, 
> https://10.100.5.110:9443/services/JaxwsWebappAdmin/ 
> 6. StatisticsAdmin, StatisticsAdmin, 
> https://10.100.5.110:9443/services/StatisticsAdmin/ 
> 7. LoggedUserInfoAdmin, LoggedUserInfoAdmin, 
> https://10.100.5.110:9443/services/LoggedUserInfoAdmin/ 
> 8. WebappAdmin, WebappAdmin, https://10.100.5.110:9443/services/WebappAdmin/ 
> 9. TopicManagerAdminService, TopicManagerAdminService, 
> https://10.100.5.110:9443/services/TopicManagerAdminService/ 
> 10. ApplicationAdmin, ApplicationAdmin, 
> https://10.100.5.110:9443/services/ApplicationAdmin/ 
> 11. NDataSourceAdmin, NDataSourceAdmin, 
> https://10.100.5.110:9443/services/NDataSourceAdmin/ 
> 12. ServiceGroupAdmin, ServiceGroupAdmin, 
> https://10.100.5.110:9443/services/ServiceGroupAdmin/ 
> 13. DataServiceFileUploader, DataServiceFileUploader, 
> https://10.100.5.110:9443/services/DataServiceFileUploader/ 
> 14. CustomMeteringService, CustomMeteringService, 
> https://10.100.5.110:9443/services/CustomMeteringService/ 
> 15. STSAdminService, STSAdminService, 
> https://10.100.5.110:9443/services/STSAdminService/ 
> 16. RegistryAdminService, RegistryAdminService, 
> https://10.100.5.110:9443/services/RegistryAdminService/ 
> 17. JavaScriptStubGeneratorService, JavaScriptStubGeneratorService, 
> https://10.100.5.110:9443/services/JavaScriptStubGeneratorService/ 
> http://10.100.5.110:9763/services/JavaScriptStubGeneratorService/ 
> local:///services/JavaScriptStubGeneratorService/ 
> 18. JSServiceUploader, JSServiceUploader, 
> https://10.100.5.110:9443/services/JSServiceUploader/ 
> 19. FileDownloadService, FileDownloadService, 
> https://10.100.5.110:9443/services/FileDownloadService/ 
> 20. CachingAdminService, CachingAdminService, 
> https://10.100.5.110:9443/services/CachingAdminService/ 
> 21. MashupServiceAdmin, MashupServiceAdmin, 
> https://10.100.5.110:9443/services/MashupServiceAdmin/ 
> 22. JarServiceCreatorAdmin, JarServiceCreatorAdmin, 
> https://10.100.5.110:9443/services/JarServiceCreatorAdmin/ 
> 23. RMAdminGlobal, RMAdminGlobal, 
> https://10.100.5.110:9443/services/RMAdminGlobal/ 
> 24. ContentSearchAdminService, ContentSearchAdminService, 
> https://10.100.5.110:9443/services/ContentSearchAdminService/ 
> 25. LoginStatisticsAdmin, LoginStatisticsAdmin, 
> https://10.100.5.110:9443/services/LoginStatisticsAdmin/ 
> 26. CustomUIAdminService, CustomUIAdminService, 
> https://10.100.5.110:9443/services/CustomUIAdminService/ 
> 27. RMAdminService, RMAdminService, 
> https://10.100.5.110:9443/services/RMAdminService/ 
> 28. SearchAdminService, SearchAdminService, 
> https://10.100.5.110:9443/services/SearchAdminService/ 
> 29. JMSTransportAdmin, JMSTransportAdmin, 
> https://10.100.5.110:9443/services/JMSTransportAdmin/ 
> 30. ThrottleAdminService, ThrottleAdminService, 
> https://10.100.5.110:9443/services/ThrottleAdminService/ 
> 31. ModuleAdminService, ModuleAdminService, 
> https://10.100.5.110:9443/services/ModuleAdminService/ 
> 32. LoggingAdmin, LoggingAdmin, 
> https://10.100.5.110:9443/services/LoggingAdmin/ 
> 3

Re: [Dev] Applying QOS from developer studio with ESB 4.9.0 release

2015-04-05 Thread Chanaka Fernando
Hi KasunG,

I have checked on the source code of the previous implementation and
according to that, when applying security through Management console and
through "allowRoles" service parameter, it executes the same code on the
Security side (please see below).

*SecurityConfigAdmin.java (Executes when applying through Management
Console)*

if (userGroups != null) {
for (String value : userGroups) {
AuthorizationManager acAdmin =
realm.getAuthorizationManager();

acAdmin.authorizeRole(value,
serviceGroupId+"/"+service.getName(),

UserCoreConstants.INVOKE_SERVICE_PERMISSION);
}
}



*SecurityDeploymentIntercepter.java (Executes when applying through
"allowRoles" parameter)*

Parameter allowRolesParameter =
service.getParameter("allowRoles");

if(allowRolesParameter!= null && allowRolesParameter.getValue()
!= null){

AuthorizationManager manager =
userRealm.getAuthorizationManager();
String resourceName = serviceGroupId + "/" + serviceName;
String[] roles =
manager.getAllowedRolesForResource(resourceName,

UserCoreConstants.INVOKE_SERVICE_PERMISSION);
if(roles != null){
for (String role : roles) {
manager.clearRoleAuthorization(role, resourceName,

UserCoreConstants.INVOKE_SERVICE_PERMISSION);
}
}

String value = (String) allowRolesParameter.getValue();
String[] allowRoles = value.split(",") ;
if(allowRoles != null){
for(String role : allowRoles){

userRealm.getAuthorizationManager().authorizeRole(role, resourceName,

UserCoreConstants.INVOKE_SERVICE_PERMISSION);
}
}
}


Since this is a service level parameter, we can use this for all axis2
services. If that is the case, we can go with this parameter instead of
having properties at registry resource level. WDYT?

@Sohani: I will look in the 4.9.0 related issue when using this parameter.


Thanks,
Chanaka


On Thu, Apr 2, 2015 at 5:25 PM, Chanaka Fernando  wrote:

> Hi Sohani,
>
> Please see my comments inline.
>
> AFAIK when we deploy a proxy which has allowRoles parameter, the
> 'UM_PERMISSION ' table is getting updated and an entry is created with that
> ID in the UM_ROLE_PERMISSION table. This works fine with ESB 4.8.1 but with
> ESB 4.9.0 the UM_PERMISSION table is not getting updated. Therefore, I
> think we need to modify the existing deployer to handle this task as we
> have discussed during the last meeting. Correct me if I am wrong.
>
> -- I have also checked in the code and this "allowRoles" property do the
> same operation in the JDBCAuthorizationManager class when we add the user
> roles from the management console. So it should work as expected. But
> KasunG's point is that this is a kind of a quick fix and this may not work
> for axis2 services.
>
> When concerning the new suggestion of including the user role information
> as a registry property of the registry resource, how can we handle updating
> the user role information in the database since we don't have the proxy
> information at the time we create the policy file? Can someone please
> advise on the way to proceed with this.
>
> -- Here you don't need to add this information to the database from DevS
> side. At the deployment time, deployer will check the user role from the
> resource properties and add that to the relevant database using the
> JDBCAuthorizationManager class.
>
> Shall we have a meeting to discuss about this further? WDYT?
>
> +1 for a meeting.
>
>
> Thanks,
> Chanaka
>
>
>
>
> On Thu, Apr 2, 2015 at 3:32 PM, Sohani Weerasinghe 
> wrote:
>
>> Hi All,
>>
>> AFAIK when we deploy a proxy which has allowRoles parameter, the
>> 'UM_PERMISSION ' table is getting updated and an entry is created with that
>> ID in the UM_ROLE_PERMISSION table. This works fine with ESB 4.8.1 but with
>> ESB 4.9.0 the UM_PERMISSION table is not getting updated. Therefore, I
>> think we need to modify the existing deployer to handle this task as we
>> have discussed during the last meeting. Correct me if I am wrong.
>>
>> When concerning the new suggestion of including the user role information
>> as a registry property of the registry resource, how can we handle updating
>> the user role information in the database since we don't have the proxy
>> information at the time we create the policy file? Can someone please
>> advise on the way to proceed with this.
>>
>> Shall we have a meeting to discuss about this further? WDYT?
>>
>> Thanks,
>> Sohani
>>
>>
>> Sohani Weerasinghe
>> Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>> On Tue, Mar 31, 2015 at 5:11 PM, KasunG Gajasinghe 
>> wrote:

Re: [Dev] Admin Service in WSO2 AS for Web app deployment

2015-04-05 Thread Awanthika Senarath
Thanks KasunG,

If the admin service supports war deployment in exploded format, it should
be possible for us to directly call the admin service via Dev Studio and
handle this, isn't it?

I will have to study the admin service and see how it supports this.

regards
Awanthika

On Mon, Apr 6, 2015 at 11:27 AM, Kasun Gajasinghe  wrote:

> It should be WebappAdmin.
>
> AS supports deploying exploded webapps. But the UI doesn't have the
> capability to upload webapps in exploded format since it's a folder
> structure. How do you propose to do it?
>
> On Apr 6, 2015, at 10:57 AM, Awanthika Senarath 
> wrote:
>
> Hi all,
>
> I need to find $subject to develop the war-deploy facility in WSO2
> developer studio.
>
> I could observe that for the car-deployment we are using the Admin Service
> "CarbonAppUploader".
>
> By listing all the Admin services available in WSO2 AS I got the list at
> [1], Can someone point out to me the Admin Service used for war file
> deployment in AS?
>
> Further is it possible to do exploded web app Deployment in AS? by admin
> console uploading I observed that we are deploying the compressed war file.
> The ultimate goal of Developer Studio is to enable web app deployment in
> Carbon server in exploded format. Hence if such a service is not available
> ATM, how should we proceed with this? IMO to enable this we have two
> options.
>
> [1] implement this completely on Dev Studio - as a file transfer
>
> [2] get back-end support from Carbon and facilitate this via dev studio
> using an admin service
>
>
> ** Exploded war deployment : deployment of the war file in extracted
> format. Without deploying the .war file this copies the  folder
> directly into the webapps folder in the server.
>
>
> Appreciate your input
>
>
> [1]
> Admin services deployed on this server:
> 1. ProvisioningAdminService, ProvisioningAdminService,
> https://10.100.5.110:9443/services/ProvisioningAdminService/
> 2. CarbonAppUploader, CarbonAppUploader,
> https://10.100.5.110:9443/services/CarbonAppUploader/
> 3. OperationAdmin, OperationAdmin,
> https://10.100.5.110:9443/services/OperationAdmin/
> 4. JaggeryAppAdmin, JaggeryAppAdmin,
> https://10.100.5.110:9443/services/JaggeryAppAdmin/
> 5. JaxwsWebappAdmin, JaxwsWebappAdmin,
> https://10.100.5.110:9443/services/JaxwsWebappAdmin/
> 6. StatisticsAdmin, StatisticsAdmin,
> https://10.100.5.110:9443/services/StatisticsAdmin/
> 7. LoggedUserInfoAdmin, LoggedUserInfoAdmin,
> https://10.100.5.110:9443/services/LoggedUserInfoAdmin/
> 8. WebappAdmin, WebappAdmin,
> https://10.100.5.110:9443/services/WebappAdmin/
> 9. TopicManagerAdminService, TopicManagerAdminService,
> https://10.100.5.110:9443/services/TopicManagerAdminService/
> 10. ApplicationAdmin, ApplicationAdmin,
> https://10.100.5.110:9443/services/ApplicationAdmin/
> 11. NDataSourceAdmin, NDataSourceAdmin,
> https://10.100.5.110:9443/services/NDataSourceAdmin/
> 12. ServiceGroupAdmin, ServiceGroupAdmin,
> https://10.100.5.110:9443/services/ServiceGroupAdmin/
> 13. DataServiceFileUploader, DataServiceFileUploader,
> https://10.100.5.110:9443/services/DataServiceFileUploader/
> 14. CustomMeteringService, CustomMeteringService,
> https://10.100.5.110:9443/services/CustomMeteringService/
> 15. STSAdminService, STSAdminService,
> https://10.100.5.110:9443/services/STSAdminService/
> 16. RegistryAdminService, RegistryAdminService,
> https://10.100.5.110:9443/services/RegistryAdminService/
> 17. JavaScriptStubGeneratorService, JavaScriptStubGeneratorService,
> https://10.100.5.110:9443/services/JavaScriptStubGeneratorService/
> http://10.100.5.110:9763/services/JavaScriptStubGeneratorService/
> local:///services/JavaScriptStubGeneratorService/
> 18. JSServiceUploader, JSServiceUploader,
> https://10.100.5.110:9443/services/JSServiceUploader/
> 19. FileDownloadService, FileDownloadService,
> https://10.100.5.110:9443/services/FileDownloadService/
> 20. CachingAdminService, CachingAdminService,
> https://10.100.5.110:9443/services/CachingAdminService/
> 21. MashupServiceAdmin, MashupServiceAdmin,
> https://10.100.5.110:9443/services/MashupServiceAdmin/
> 22. JarServiceCreatorAdmin, JarServiceCreatorAdmin,
> https://10.100.5.110:9443/services/JarServiceCreatorAdmin/
> 23. RMAdminGlobal, RMAdminGlobal,
> https://10.100.5.110:9443/services/RMAdminGlobal/
> 24. ContentSearchAdminService, ContentSearchAdminService,
> https://10.100.5.110:9443/services/ContentSearchAdminService/
> 25. LoginStatisticsAdmin, LoginStatisticsAdmin,
> https://10.100.5.110:9443/services/LoginStatisticsAdmin/
> 26. CustomUIAdminService, CustomUIAdminService,
> https://10.100.5.110:9443/services/CustomUIAdminService/
> 27. RMAdminService, RMAdminService,
> https://10.100.5.110:9443/services/RMAdminService/
> 28. SearchAdminService, SearchAdminService,
> https://10.100.5.110:9443/services/SearchAdminService/
> 29. JMSTransportAdmin, JMSTransportAdmin,
> https://10.100.5.110:9443/services/JMSTransportAdmin/
> 30. ThrottleAdminService, ThrottleAdmin

Re: [Dev] Applying QOS from developer studio with ESB 4.9.0 release

2015-04-05 Thread Chanaka Fernando
Hi Johann,

After looking through the new implementation of the
*SecurityDeploymentIntercepter.java
*file in the latest GIT source code[1] , I could find that this
"allowRoles" parameter related implementation has been removed. Entire
implementation of the *applySecurityParameters(AxisService service,
SecurityScenario secScenario)* method has been removed and that method is
blank. What is the reason for this?

@Sohani: This is the reason that this parameter is not working in the
latest 4.9.0 ESB pack.

[1]
https://github.com/wso2/carbon-identity/blob/master/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentInterceptor.java


Thanks,
Chanaka

On Mon, Apr 6, 2015 at 11:35 AM, Chanaka Fernando  wrote:

> Hi KasunG,
>
> I have checked on the source code of the previous implementation and
> according to that, when applying security through Management console and
> through "allowRoles" service parameter, it executes the same code on the
> Security side (please see below).
>
> *SecurityConfigAdmin.java (Executes when applying through Management
> Console)*
>
> if (userGroups != null) {
> for (String value : userGroups) {
> AuthorizationManager acAdmin =
> realm.getAuthorizationManager();
>
> acAdmin.authorizeRole(value,
> serviceGroupId+"/"+service.getName(),
>
> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
> }
> }
>
>
>
> *SecurityDeploymentIntercepter.java (Executes when applying through
> "allowRoles" parameter)*
>
> Parameter allowRolesParameter =
> service.getParameter("allowRoles");
>
> if(allowRolesParameter!= null &&
> allowRolesParameter.getValue() != null){
>
> AuthorizationManager manager =
> userRealm.getAuthorizationManager();
> String resourceName = serviceGroupId + "/" + serviceName;
> String[] roles =
> manager.getAllowedRolesForResource(resourceName,
>
> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
> if(roles != null){
> for (String role : roles) {
> manager.clearRoleAuthorization(role, resourceName,
>
> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
> }
> }
>
> String value = (String) allowRolesParameter.getValue();
> String[] allowRoles = value.split(",") ;
> if(allowRoles != null){
> for(String role : allowRoles){
>
> userRealm.getAuthorizationManager().authorizeRole(role, resourceName,
>
> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
> }
> }
> }
>
>
> Since this is a service level parameter, we can use this for all axis2
> services. If that is the case, we can go with this parameter instead of
> having properties at registry resource level. WDYT?
>
> @Sohani: I will look in the 4.9.0 related issue when using this parameter.
>
>
> Thanks,
> Chanaka
>
>
> On Thu, Apr 2, 2015 at 5:25 PM, Chanaka Fernando 
> wrote:
>
>> Hi Sohani,
>>
>> Please see my comments inline.
>>
>> AFAIK when we deploy a proxy which has allowRoles parameter, the
>> 'UM_PERMISSION ' table is getting updated and an entry is created with that
>> ID in the UM_ROLE_PERMISSION table. This works fine with ESB 4.8.1 but with
>> ESB 4.9.0 the UM_PERMISSION table is not getting updated. Therefore, I
>> think we need to modify the existing deployer to handle this task as we
>> have discussed during the last meeting. Correct me if I am wrong.
>>
>> -- I have also checked in the code and this "allowRoles" property do the
>> same operation in the JDBCAuthorizationManager class when we add the user
>> roles from the management console. So it should work as expected. But
>> KasunG's point is that this is a kind of a quick fix and this may not work
>> for axis2 services.
>>
>> When concerning the new suggestion of including the user role information
>> as a registry property of the registry resource, how can we handle updating
>> the user role information in the database since we don't have the proxy
>> information at the time we create the policy file? Can someone please
>> advise on the way to proceed with this.
>>
>> -- Here you don't need to add this information to the database from DevS
>> side. At the deployment time, deployer will check the user role from the
>> resource properties and add that to the relevant database using the
>> JDBCAuthorizationManager class.
>>
>> Shall we have a meeting to discuss about this further? WDYT?
>>
>> +1 for a meeting.
>>
>>
>> Thanks,
>> Chanaka
>>
>>
>>
>>
>> On Thu, Apr 2, 2015 at 3:32 PM, Sohani Weerasinghe 
>> wrote:
>>
>>> Hi All,
>>>
>>> AFAIK when we deploy a proxy which has allowRoles parameter, the
>>> 'UM_PERMISSION ' table is getting updated and an entry is created with that
>>> ID in the UM_ROLE_PERMISSION table. This works fine with ESB 4.8

Re: [Dev] Orbit bundles and transitive dependencies in the compile time

2015-04-05 Thread Sameera Jayasoma
You can embed the dependency jar as it is without unpacking the jar file.
One of the jars is singed. Thats why you get this exception.

On Mon, Apr 6, 2015 at 11:14 AM, Niranda Perera  wrote:

> Hi Sameera,
>
> Noted.
>
> returning back to where this issue occurred initially, when I include the
> dependencies in the spark component, in the server start up, there was a
> "java.lang.SecurityException: class "javax.servlet.FilterRegistration"'s
> signer information does not match signer information of other classes in
> the same package" exception for the classes that came from the jars
> included as dependencies.
>
> just wondering if you have any idea why such an exception might occur?
>
> rgds
>
> On Mon, Apr 6, 2015 at 10:43 AM, Sameera Jayasoma 
> wrote:
>
>> Hi Niranda,
>>
>> On Mon, Apr 6, 2015 at 10:25 AM, Niranda Perera  wrote:
>>
>>> Hi Sameera,
>>>
>>> I agree with you on the compilation scenario. It was mistake on my part.
>>>
>>> But recently I came across with this issue. Pls consider the following
>>> scenario.
>>>
>>> a non-OSGI jar say, 'foo.jar' depends on the 'a.jar' and 'b.jar' which
>>> are OSGI bundles.
>>>
>>> foo (non-OSGI)
>>> |_ a (OSGI)
>>> |_ b (OSGI)
>>>
>>> I OSGIfy foo.jar designating a & b as import-packages to make the
>>> "foo-orbit.jar".
>>>
>>> when I compile my component using foo-orbit.jar it compiles without an
>>> issue. but when I run the unit tests of the component, in the run-time I
>>> encounter classnotfound exceptions in the classes of a.jar and b.jar. so, I
>>> have to specify a and b as dependencies in the component along with the
>>> foo-orbit.
>>> when I compile the component using the original foo, compilation and
>>> testing (run-time) happens seamlessly without having to specify a & b
>>> dependencies individually.
>>> Is this the expected behavior?
>>>
>>
>> This is exactly the expected behavior. You need to declare all the
>> dependencies of a component in the pom.xml for compilation and testing. All
>> the dependencies of a carbon component should be OSGi bundles. There are
>> few exceptions though.
>>
>> Thanks,
>> Sameera.
>>
>>>
>>> this issue occurred to me while I was testing the spark components with
>>> the spark orbits. and the classnotfound exceptions are thrown in the spark
>>> server start-up.
>>>
>>> Gokul also told me that he encountered a similar problem with the hadoop
>>> client orbit.
>>>
>>> look forward to know your thoughts in this regard.
>>>
>>> rgds
>>>
>>>
>>> On Wed, Mar 25, 2015 at 4:36 PM, Sameera Jayasoma 
>>> wrote:
>>>
 We are in the process of getting rid of transitive dependencies from
 orbits, carbon components etc.

 If your component requires the original Spark libraries for compilation
 then there are obvious issues in your Spark orbit bundle. A component
 should be able compile using orbits and other component dependencies. If
 this is not possible, then your component dependencies are not properly
 "OSGified"

 A component shouldn't depend on transitive dependencies. Thats the
 plan. If you see issues with this approach, please explain.

 Thanks,
 Sameera.



 On Tue, Mar 24, 2015 at 11:00 AM, Gokul Balakrishnan 
 wrote:

> Hi Kernel team,
>
> Any idea on $subject? Shouldn't the transitive dependencies of the
> orbit bundle be visible to the component referring to the bundle at 
> compile
> time? Should we just refer to the 3rd party jar (the orbit bundle is
> wrapping) in the component and use the orbit in the feature, or should we
> use the orbit bundle for both? Would be great if you could clarify.
>
> Thanks,
>
> On 23 March 2015 at 14:59, Niranda Perera  wrote:
>
>> Hi,
>>
>> As of the current orbit bundle guideline [1], we have to mark the
>> dependencies as optional. I believe this results in transitive 
>> dependencies
>> of that particular bundle not being exposed.
>>
>> Because of this, I have experienced compilation failures, when I put
>> orbit bundles as component dependencies.
>> For an example, in carbon analytics components, when I import
>> spark-core orbit, I encsounter dependency errors (But when I import the
>> original spark dependency this does not occur)
>>
>> so, is it a good practice for us to say that, orbit bundles should be
>> used in the runtime, where as in the compile time, use the original jars?
>> essentially, is it okay to include original jars in the components
>> and only include orbits in the features? (because earlier, I was under 
>> the
>> impression that, once an orbit bundle is created, it should be used BOTH 
>> in
>> the components and in the feature)
>>
>> would be great if you could clarify this matter.
>>
>> rgds
>>
>> [1]
>> https://docs.google.com/a/wso2.com/document/d/1I3nWPnG6139YobZzQWPFOUxYEmHxqf9ieWykmQupPtc/edit#
>>
>>>

Re: [Dev] Applying QOS from developer studio with ESB 4.9.0 release

2015-04-05 Thread Sohani Weerasinghe
@Chanaka: Thanks for investigating on this issue.

Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine

On Mon, Apr 6, 2015 at 12:02 PM, Chanaka Fernando  wrote:

> Hi Johann,
>
> After looking through the new implementation of the 
> *SecurityDeploymentIntercepter.java
> *file in the latest GIT source code[1] , I could find that this
> "allowRoles" parameter related implementation has been removed. Entire
> implementation of the *applySecurityParameters(AxisService service,
> SecurityScenario secScenario)* method has been removed and that method is
> blank. What is the reason for this?
>
> @Sohani: This is the reason that this parameter is not working in the
> latest 4.9.0 ESB pack.
>
> [1]
> https://github.com/wso2/carbon-identity/blob/master/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentInterceptor.java
>
>
> Thanks,
> Chanaka
>
> On Mon, Apr 6, 2015 at 11:35 AM, Chanaka Fernando 
> wrote:
>
>> Hi KasunG,
>>
>> I have checked on the source code of the previous implementation and
>> according to that, when applying security through Management console and
>> through "allowRoles" service parameter, it executes the same code on the
>> Security side (please see below).
>>
>> *SecurityConfigAdmin.java (Executes when applying through Management
>> Console)*
>>
>> if (userGroups != null) {
>> for (String value : userGroups) {
>> AuthorizationManager acAdmin =
>> realm.getAuthorizationManager();
>>
>> acAdmin.authorizeRole(value,
>> serviceGroupId+"/"+service.getName(),
>>
>> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
>> }
>> }
>>
>>
>>
>> *SecurityDeploymentIntercepter.java (Executes when applying through
>> "allowRoles" parameter)*
>>
>> Parameter allowRolesParameter =
>> service.getParameter("allowRoles");
>>
>> if(allowRolesParameter!= null &&
>> allowRolesParameter.getValue() != null){
>>
>> AuthorizationManager manager =
>> userRealm.getAuthorizationManager();
>> String resourceName = serviceGroupId + "/" + serviceName;
>> String[] roles =
>> manager.getAllowedRolesForResource(resourceName,
>>
>> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
>> if(roles != null){
>> for (String role : roles) {
>> manager.clearRoleAuthorization(role, resourceName,
>>
>> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
>> }
>> }
>>
>> String value = (String) allowRolesParameter.getValue();
>> String[] allowRoles = value.split(",") ;
>> if(allowRoles != null){
>> for(String role : allowRoles){
>>
>> userRealm.getAuthorizationManager().authorizeRole(role, resourceName,
>>
>> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
>> }
>> }
>> }
>>
>>
>> Since this is a service level parameter, we can use this for all axis2
>> services. If that is the case, we can go with this parameter instead of
>> having properties at registry resource level. WDYT?
>>
>> @Sohani: I will look in the 4.9.0 related issue when using this parameter.
>>
>>
>> Thanks,
>> Chanaka
>>
>>
>> On Thu, Apr 2, 2015 at 5:25 PM, Chanaka Fernando 
>> wrote:
>>
>>> Hi Sohani,
>>>
>>> Please see my comments inline.
>>>
>>> AFAIK when we deploy a proxy which has allowRoles parameter, the
>>> 'UM_PERMISSION ' table is getting updated and an entry is created with that
>>> ID in the UM_ROLE_PERMISSION table. This works fine with ESB 4.8.1 but with
>>> ESB 4.9.0 the UM_PERMISSION table is not getting updated. Therefore, I
>>> think we need to modify the existing deployer to handle this task as we
>>> have discussed during the last meeting. Correct me if I am wrong.
>>>
>>> -- I have also checked in the code and this "allowRoles" property do the
>>> same operation in the JDBCAuthorizationManager class when we add the user
>>> roles from the management console. So it should work as expected. But
>>> KasunG's point is that this is a kind of a quick fix and this may not work
>>> for axis2 services.
>>>
>>> When concerning the new suggestion of including the user role
>>> information as a registry property of the registry resource, how can we
>>> handle updating the user role information in the database since we don't
>>> have the proxy information at the time we create the policy file? Can
>>> someone please advise on the way to proceed with this.
>>>
>>> -- Here you don't need to add this information to the database from DevS
>>> side. At the deployment time, deployer will check the user role from the
>>> resource properties and add that to the relevant database using the
>>> JDBCAuthorizationManager c

Re: [Dev] Applying QOS from developer studio with ESB 4.9.0 release

2015-04-05 Thread Johann Nallathamby
Hi Kasun/Kishanthan,

Any idea why this was removed ? I thought security-mgt is maintained by IS
team. But looks like others are also working on this component.

On Mon, Apr 6, 2015 at 12:05 PM, Sohani Weerasinghe  wrote:

> @Chanaka: Thanks for investigating on this issue.
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Mon, Apr 6, 2015 at 12:02 PM, Chanaka Fernando 
> wrote:
>
>> Hi Johann,
>>
>> After looking through the new implementation of the 
>> *SecurityDeploymentIntercepter.java
>> *file in the latest GIT source code[1] , I could find that this
>> "allowRoles" parameter related implementation has been removed. Entire
>> implementation of the *applySecurityParameters(AxisService service,
>> SecurityScenario secScenario)* method has been removed and that method
>> is blank. What is the reason for this?
>>
>> @Sohani: This is the reason that this parameter is not working in the
>> latest 4.9.0 ESB pack.
>>
>> [1]
>> https://github.com/wso2/carbon-identity/blob/master/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentInterceptor.java
>>
>>
>> Thanks,
>> Chanaka
>>
>> On Mon, Apr 6, 2015 at 11:35 AM, Chanaka Fernando 
>> wrote:
>>
>>> Hi KasunG,
>>>
>>> I have checked on the source code of the previous implementation and
>>> according to that, when applying security through Management console and
>>> through "allowRoles" service parameter, it executes the same code on the
>>> Security side (please see below).
>>>
>>> *SecurityConfigAdmin.java (Executes when applying through Management
>>> Console)*
>>>
>>> if (userGroups != null) {
>>> for (String value : userGroups) {
>>> AuthorizationManager acAdmin =
>>> realm.getAuthorizationManager();
>>>
>>> acAdmin.authorizeRole(value,
>>> serviceGroupId+"/"+service.getName(),
>>>
>>> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
>>> }
>>> }
>>>
>>>
>>>
>>> *SecurityDeploymentIntercepter.java (Executes when applying through
>>> "allowRoles" parameter)*
>>>
>>> Parameter allowRolesParameter =
>>> service.getParameter("allowRoles");
>>>
>>> if(allowRolesParameter!= null &&
>>> allowRolesParameter.getValue() != null){
>>>
>>> AuthorizationManager manager =
>>> userRealm.getAuthorizationManager();
>>> String resourceName = serviceGroupId + "/" + serviceName;
>>> String[] roles =
>>> manager.getAllowedRolesForResource(resourceName,
>>>
>>> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
>>> if(roles != null){
>>> for (String role : roles) {
>>> manager.clearRoleAuthorization(role,
>>> resourceName,
>>>
>>> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
>>> }
>>> }
>>>
>>> String value = (String) allowRolesParameter.getValue();
>>> String[] allowRoles = value.split(",") ;
>>> if(allowRoles != null){
>>> for(String role : allowRoles){
>>>
>>> userRealm.getAuthorizationManager().authorizeRole(role, resourceName,
>>>
>>> UserCoreConstants.INVOKE_SERVICE_PERMISSION);
>>> }
>>> }
>>> }
>>>
>>>
>>> Since this is a service level parameter, we can use this for all axis2
>>> services. If that is the case, we can go with this parameter instead of
>>> having properties at registry resource level. WDYT?
>>>
>>> @Sohani: I will look in the 4.9.0 related issue when using this
>>> parameter.
>>>
>>>
>>> Thanks,
>>> Chanaka
>>>
>>>
>>> On Thu, Apr 2, 2015 at 5:25 PM, Chanaka Fernando 
>>> wrote:
>>>
 Hi Sohani,

 Please see my comments inline.

 AFAIK when we deploy a proxy which has allowRoles parameter, the
 'UM_PERMISSION ' table is getting updated and an entry is created with that
 ID in the UM_ROLE_PERMISSION table. This works fine with ESB 4.8.1 but with
 ESB 4.9.0 the UM_PERMISSION table is not getting updated. Therefore, I
 think we need to modify the existing deployer to handle this task as we
 have discussed during the last meeting. Correct me if I am wrong.

 -- I have also checked in the code and this "allowRoles" property do
 the same operation in the JDBCAuthorizationManager class when we add the
 user roles from the management console. So it should work as expected. But
 KasunG's point is that this is a kind of a quick fix and this may not work
 for axis2 services.

 When concerning the new suggestion of including the user role
 information as a registry property of the registry resource, how can we
 handle updating the user role information in the database since we don't
 have the proxy in