Commit cd7218e
committed
Merge pull request #714 from rafaelweingartner/master-lrg-cs-hackday-003
Changed variable s_logger to non-static and fixed its name in com.cloud.utils.component.ComponentLifecycleBase and its subclassesHi guys,
We have noticed that every single class that is a subclass of ComponentLifecycleBase instantiate their on logger manually and uses a nonstandard name. We fixed that by changing the variable in ComponentLifecycleBase to protected and non-static and instantiated it using the method getClass from Object class. Therefore, we can reduce the code in a few hundred lines and use a more intuitive name for the logger variable.
During that process we found a static method that used the s_logger variable in classes:
com.cloud.network.element.VirtualRouterElement
org.apache.cloudstack.network.element.InternalLoadBalancerElement
To fix that we had to create a new class com.cloud.network.element.HAProxyLBRule, instantiate it with @componente and inject into the aforementioned classes.
The class that we create is com.cloud.network.element.HAProxyLBRule and has the following methods:
com.cloud.network.element.HAProxyLBRule.containsOnlyNumbers(String, String)
com.cloud.network.element.HAProxyLBRule.validateHAProxyLBRule(LoadBalancingRule)
Sadly we could not write test cases to it; hence we did not fully understand those methods. However, if anyone out there understands it, we would appreciate some code to be added to it.
As minor this change may seem; we believe that it enhances a little bit the ACS code by using standard name to logger variable.
* pr/714:
Solved jira ticket: CLOUDSTACK-8750
Signed-off-by: Daan Hoogland <daan@onecht.net>File tree
361 files changed
+5859
-6550
lines changed- core/src/com/cloud/storage/template
- engine
- orchestration/src
- com/cloud
- agent/manager
- cluster/agentlb
- vm
- org/apache/cloudstack/engine
- datacenter/entity/api/db/dao
- orchestration
- schema/src
- com/cloud
- capacity/dao
- certificate/dao
- cluster/agentlb/dao
- dc/dao
- domain/dao
- event/dao
- gpu/dao
- host/dao
- hypervisor/dao
- network
- dao
- security/dao
- vpc/dao
- projects/dao
- storage/dao
- upgrade
- dao
- usage/dao
- user/dao
- vm
- dao
- snapshot/dao
- org/apache/cloudstack
- engine/cloud/entity/api/db/dao
- region/dao
- storage
- integration-test/test/org/apache/cloudstack/storage/test
- snapshot/src/org/apache/cloudstack/storage/vmsnapshot
- src/org/apache/cloudstack/storage
- allocator
- datastore/provider
- db
- image/db
- volume/db
- framework
- cluster/src/com/cloud/cluster
- dao
- config/src/org/apache/cloudstack/framework/config/dao
- db/src/com/cloud/utils/db
- jobs
- src/org/apache/cloudstack/framework/jobs
- dao
- impl
- test/org/apache/cloudstack/framework/jobs
- security/src/org/apache/cloudstack/framework/security/keystore
- spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry
- plugins
- acl/static-role-based/src/org/apache/cloudstack/acl
- affinity-group-processors
- explicit-dedication/src/org/apache/cloudstack/affinity
- host-anti-affinity/src/org/apache/cloudstack/affinity
- api
- discovery/src/org/apache/cloudstack/discovery
- rate-limit/src/org/apache/cloudstack/ratelimit
- deployment-planners
- implicit-dedication/src/com/cloud/deploy
- user-concentrated-pod/src/com/cloud/deploy
- user-dispersing/src/com/cloud/deploy
- event-bus
- inmemory/src/org/apache/cloudstack/mom/inmemory
- kafka/src/org/apache/cloudstack/mom/kafka
- rabbitmq/src/org/apache/cloudstack/mom/rabbitmq
- file-systems/netapp/src/com/cloud/netapp
- dao
- ha-planners/skip-heurestics/src/com/cloud/deploy
- host-allocators/random/src/com/cloud/agent/manager/allocator/impl
- hypervisors
- baremetal/src/com/cloud/baremetal
- manager
- networkservice
- hyperv/src/com/cloud
- ha
- hypervisor/hyperv/discoverer
- kvm/src/com/cloud/ha
- ovm3/src/main/java/com/cloud
- ha
- hypervisor/ovm3/resources
- ovm/src/com/cloud/ovm/hypervisor
- simulator/src/com/cloud
- agent/manager
- ha
- resource
- simulator/dao
- vmware/src/com/cloud
- hypervisor
- guru
- vmware
- dao
- manager
- network
- dao
- element
- xenserver/src/com/cloud
- ha
- hypervisor/xenserver/discoverer
- network-elements
- bigswitch/src/com/cloud/network
- element
- guru
- resource
- brocade-vcs/src/com/cloud/network
- element
- guru
- cisco-vnmc/src/com/cloud/network/element
- elastic-loadbalancer/src/com/cloud/network
- element
- lb
- f5/src/com/cloud/network/element
- globodns/src/com/globo/globodns/cloudstack
- element
- resource
- internal-loadbalancer
- src/org/apache/cloudstack/network
- element
- lb
- test/resources
- juniper-contrail
- src/org/apache/cloudstack/network/contrail/management
- test/org/apache/cloudstack/network/contrail/management
- juniper-srx/src/com/cloud/network/element
- midonet/src/com/cloud/network
- element
- guru
- netscaler/src/com/cloud/network/element
- nicira-nvp/src/main/java/com/cloud/network
- element
- guru
- nuage-vsp/src/com/cloud/network
- element
- guru
- manager
- resource
- opendaylight/src/main/java/org/apache/cloudstack/network/opendaylight
- ovs/src/com/cloud/network
- element
- guru
- ovs
- dao
- palo-alto/src/com/cloud/network/element
- stratosphere-ssp/src/org/apache/cloudstack/network
- dao
- element
- guru
- vxlan/src/com/cloud/network/guru
- storage-allocators/random/src/org/apache/cloudstack/storage/allocator
- storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util
- user-authenticators
- ldap/src/org/apache/cloudstack/ldap
- md5/src/com/cloud/server/auth
- pbkdf2/src/org/apache/cloudstack/server/auth
- plain-text/src/com/cloud/server/auth
- saml2/src/org/apache/cloudstack/saml
- sha256salted/src/com/cloud/server/auth
- server
- src
- com/cloud
- agent/manager
- allocator/impl
- authn/impl
- alert
- api
- auth
- query
- dao
- capacity
- configuration
- consoleproxy
- deploy
- event/dao
- ha
- dao
- hypervisor
- kvm/discoverer
- metadata
- network
- as
- element
- firewall
- guru
- lb
- router
- rules
- security
- vpc
- vpn
- projects
- resourcelimit
- resource
- server
- storage
- download
- snapshot
- upload
- tags
- template
- usage
- user
- vm
- snapshot
- org/apache/cloudstack
- affinity
- network/lb
- region
- test/com/cloud
- consoleproxy
- vpc
- dao
- services/secondary-storage
- controller/src/org/apache/cloudstack/secondarystorage
- server/src/org/apache/cloudstack/storage
- resource
- template
- usage/src/com/cloud/usage
- utils/src/main/java
- com/cloud/utils/component
- org/apache/cloudstack/utils/identity
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
361 files changed
+5859
-6550
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
43 | | - | |
| 41 | + | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | | - | |
| 48 | + | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
48 | | - | |
49 | | - | |
| 46 | + | |
| 47 | + | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
| 52 | + | |
55 | 53 | | |
56 | 54 | | |
57 | | - | |
58 | | - | |
| 55 | + | |
| 56 | + | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | | - | |
| 61 | + | |
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
67 | | - | |
| 65 | + | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
73 | | - | |
| 71 | + | |
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
| |||
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | | - | |
| 92 | + | |
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
| |||
105 | 103 | | |
106 | 104 | | |
107 | 105 | | |
108 | | - | |
| 106 | + | |
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
| |||
130 | 128 | | |
131 | 129 | | |
132 | 130 | | |
133 | | - | |
| 131 | + | |
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
| 45 | + | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
| 52 | + | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
| |||
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
69 | | - | |
| 67 | + | |
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
| |||
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | | - | |
| 51 | + | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
59 | | - | |
| 57 | + | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
67 | | - | |
| 65 | + | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | | - | |
| 39 | + | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
48 | | - | |
| 46 | + | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
| |||
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | | - | |
| 55 | + | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | | - | |
| 61 | + | |
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
| |||
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
77 | | - | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | | - | |
51 | | - | |
| 48 | + | |
| 49 | + | |
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
56 | | - | |
| 54 | + | |
57 | 55 | | |
58 | 56 | | |
59 | | - | |
60 | | - | |
| 57 | + | |
| 58 | + | |
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
| |||
77 | 75 | | |
78 | 76 | | |
79 | 77 | | |
80 | | - | |
| 78 | + | |
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
| |||
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
106 | | - | |
| 104 | + | |
107 | 105 | | |
108 | 106 | | |
109 | 107 | | |
110 | | - | |
| 108 | + | |
111 | 109 | | |
112 | 110 | | |
113 | 111 | | |
114 | | - | |
| 112 | + | |
115 | 113 | | |
116 | 114 | | |
117 | 115 | | |
| |||
0 commit comments