You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Soheil Eizadi <se...@infoblox.com> on 2013/06/05 03:40:18 UTC

PhysicalNetworkServiceProviderDaoImpl.java / findByServiceProvider

I am looking at the code for findByServiceProvider in PhysicalNetworkServiceProviderDaoImpl.java:

    public PhysicalNetworkServiceProviderVO findByServiceProvider(long physicalNetworkId, String providerType) {
        SearchCriteria<PhysicalNetworkServiceProviderVO> sc = physicalNetworkServiceProviderSearch.create();
        sc.setParameters("physicalNetworkId", physicalNetworkId);
        sc.setParameters("serviceProvderType", providerType);
        return findOneBy(sc);
    }

I don't see a field serviceProvderType (even if I fix the typo!) Am I missing something, it seems like this code is being used by the Networking code in the plugins.

Seems like this should be changed to:
    public PhysicalNetworkServiceProviderVO findByServiceProvider(long physicalNetworkId, String providerName) {
......
        sc.setParameters("providerName", providerName);
        return findOneBy(sc);
    }



RE: PhysicalNetworkServiceProviderDaoImpl.java / findByServiceProvider

Posted by Soheil Eizadi <se...@infoblox.com>.
While we are tracking typos related to this, there is another one getNetworkServiceProvder() in ExternalNetworkDeviceManager.java
-Soheil
________________________________________
From: Hiroaki KAWAI [kawai@stratosphere.co.jp]
Sent: Wednesday, June 05, 2013 12:17 AM
To: dev@cloudstack.apache.org
Subject: Re: PhysicalNetworkServiceProviderDaoImpl.java / findByServiceProvider

And I'm +1 for fix (remove confusing naming)

(2013/06/05 14:13), Chiradeep Vittal wrote:
> The typo is there because the same typo exists when creating the search
> builder in the constructor. In the constructor, the string
> "serviceProvderType" is associated with the VO field 'providerName'. If
> you fix the method, you should fix the constructor (although there is no
> apparent logic error, just confused naming)
>
> On 6/4/13 6:40 PM, "Soheil Eizadi" <se...@infoblox.com> wrote:
>
>> I am looking at the code for findByServiceProvider in
>> PhysicalNetworkServiceProviderDaoImpl.java:
>>
>>     public PhysicalNetworkServiceProviderVO findByServiceProvider(long
>> physicalNetworkId, String providerType) {
>>         SearchCriteria<PhysicalNetworkServiceProviderVO> sc =
>> physicalNetworkServiceProviderSearch.create();
>>         sc.setParameters("physicalNetworkId", physicalNetworkId);
>>         sc.setParameters("serviceProvderType", providerType);
>>         return findOneBy(sc);
>>     }
>>
>> I don't see a field serviceProvderType (even if I fix the typo!) Am I
>> missing something, it seems like this code is being used by the
>> Networking code in the plugins.
>>
>> Seems like this should be changed to:
>>     public PhysicalNetworkServiceProviderVO findByServiceProvider(long
>> physicalNetworkId, String providerName) {
>> ......
>>         sc.setParameters("providerName", providerName);
>>         return findOneBy(sc);
>>     }
>>
>>
>


Re: PhysicalNetworkServiceProviderDaoImpl.java / findByServiceProvider

Posted by Hiroaki KAWAI <ka...@stratosphere.co.jp>.
And I'm +1 for fix (remove confusing naming)

(2013/06/05 14:13), Chiradeep Vittal wrote:
> The typo is there because the same typo exists when creating the search
> builder in the constructor. In the constructor, the string
> "serviceProvderType" is associated with the VO field 'providerName'. If
> you fix the method, you should fix the constructor (although there is no
> apparent logic error, just confused naming)
>
> On 6/4/13 6:40 PM, "Soheil Eizadi" <se...@infoblox.com> wrote:
>
>> I am looking at the code for findByServiceProvider in
>> PhysicalNetworkServiceProviderDaoImpl.java:
>>
>>     public PhysicalNetworkServiceProviderVO findByServiceProvider(long
>> physicalNetworkId, String providerType) {
>>         SearchCriteria<PhysicalNetworkServiceProviderVO> sc =
>> physicalNetworkServiceProviderSearch.create();
>>         sc.setParameters("physicalNetworkId", physicalNetworkId);
>>         sc.setParameters("serviceProvderType", providerType);
>>         return findOneBy(sc);
>>     }
>>
>> I don't see a field serviceProvderType (even if I fix the typo!) Am I
>> missing something, it seems like this code is being used by the
>> Networking code in the plugins.
>>
>> Seems like this should be changed to:
>>     public PhysicalNetworkServiceProviderVO findByServiceProvider(long
>> physicalNetworkId, String providerName) {
>> ......
>>         sc.setParameters("providerName", providerName);
>>         return findOneBy(sc);
>>     }
>>
>>
>


Re: PhysicalNetworkServiceProviderDaoImpl.java / findByServiceProvider

Posted by Chiradeep Vittal <Ch...@citrix.com>.
The typo is there because the same typo exists when creating the search
builder in the constructor. In the constructor, the string
"serviceProvderType" is associated with the VO field 'providerName'. If
you fix the method, you should fix the constructor (although there is no
apparent logic error, just confused naming)

On 6/4/13 6:40 PM, "Soheil Eizadi" <se...@infoblox.com> wrote:

>I am looking at the code for findByServiceProvider in
>PhysicalNetworkServiceProviderDaoImpl.java:
>
>    public PhysicalNetworkServiceProviderVO findByServiceProvider(long
>physicalNetworkId, String providerType) {
>        SearchCriteria<PhysicalNetworkServiceProviderVO> sc =
>physicalNetworkServiceProviderSearch.create();
>        sc.setParameters("physicalNetworkId", physicalNetworkId);
>        sc.setParameters("serviceProvderType", providerType);
>        return findOneBy(sc);
>    }
>
>I don't see a field serviceProvderType (even if I fix the typo!) Am I
>missing something, it seems like this code is being used by the
>Networking code in the plugins.
>
>Seems like this should be changed to:
>    public PhysicalNetworkServiceProviderVO findByServiceProvider(long
>physicalNetworkId, String providerName) {
>......
>        sc.setParameters("providerName", providerName);
>        return findOneBy(sc);
>    }
>
>