Skip to content

Commit 360a48b

Browse files
committed
More refactoring for decoupling
1 parent f640a41 commit 360a48b

127 files changed

Lines changed: 417 additions & 273 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎api/src/com/cloud/async/AsyncJob.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Date;
2323

2424
public interface AsyncJob extends Identity, InternalIdentity {
25+
/*
2526
public enum Type {
2627
None,
2728
VirtualMachine,
@@ -51,7 +52,7 @@ public enum Type {
5152
AutoScaleVmGroup,
5253
GlobalLoadBalancerRule
5354
}
54-
55+
*/
5556
Long getParentId();
5657

5758
String getType();
@@ -92,7 +93,7 @@ public enum Type {
9293

9394
Date getRemoved();
9495

95-
Type getInstanceType();
96+
String getInstanceType();
9697

9798
Long getInstanceId();
9899

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package org.apache.cloudstack.api;
19+
20+
public enum ApiCommandJobType {
21+
None,
22+
VirtualMachine,
23+
DomainRouter,
24+
Volume,
25+
ConsoleProxy,
26+
Snapshot,
27+
Template,
28+
Iso,
29+
SystemVm,
30+
Host,
31+
StoragePool,
32+
IpAddress,
33+
SecurityGroup,
34+
PhysicalNetwork,
35+
TrafficType,
36+
PhysicalNetworkServiceProvider,
37+
FirewallRule,
38+
Account,
39+
User,
40+
PrivateGateway,
41+
StaticRoute,
42+
Counter,
43+
Condition,
44+
AutoScalePolicy,
45+
AutoScaleVmProfile,
46+
AutoScaleVmGroup,
47+
GlobalLoadBalancerRule
48+
}

‎api/src/org/apache/cloudstack/api/BaseAsyncCmd.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public Long getInstanceId() {
8888
return null;
8989
}
9090

91-
public AsyncJob.Type getInstanceType() {
92-
return AsyncJob.Type.None;
91+
public ApiCommandJobType getInstanceType() {
92+
return ApiCommandJobType.None;
9393
}
9494

9595
public String getSyncObjType() {

‎api/src/org/apache/cloudstack/api/BaseListCmd.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public Long getStartIndex() {
109109
return startIndex;
110110
}
111111

112-
public AsyncJob.Type getInstanceType() {
113-
return AsyncJob.Type.None;
112+
public ApiCommandJobType getInstanceType() {
113+
return ApiCommandJobType.None;
114114
}
115115
}

‎api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import javax.inject.Inject;
2020

2121
import org.apache.cloudstack.api.APICommand;
22+
import org.apache.cloudstack.api.ApiCommandJobType;
2223
import org.apache.cloudstack.api.ApiConstants;
2324
import org.apache.cloudstack.api.ApiErrorCode;
2425
import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -107,7 +108,7 @@ public void execute(){
107108
}
108109

109110
@Override
110-
public AsyncJob.Type getInstanceType() {
111-
return AsyncJob.Type.Account;
111+
public ApiCommandJobType getInstanceType() {
112+
return ApiCommandJobType.Account;
112113
}
113114
}

‎api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import javax.inject.Inject;
2020

2121
import org.apache.cloudstack.api.APICommand;
22+
import org.apache.cloudstack.api.ApiCommandJobType;
2223
import org.apache.cloudstack.api.ApiConstants;
2324
import org.apache.cloudstack.api.ApiErrorCode;
2425
import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -128,7 +129,7 @@ public void execute() throws ConcurrentOperationException, ResourceUnavailableEx
128129
}
129130

130131
@Override
131-
public AsyncJob.Type getInstanceType() {
132-
return AsyncJob.Type.Account;
132+
public ApiCommandJobType getInstanceType() {
133+
return ApiCommandJobType.Account;
133134
}
134135
}

‎api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.cloudstack.api.command.admin.autoscale;
1919

2020
import org.apache.cloudstack.api.APICommand;
21+
import org.apache.cloudstack.api.ApiCommandJobType;
2122
import org.apache.cloudstack.api.ApiConstants;
2223
import org.apache.cloudstack.api.ApiErrorCode;
2324
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
@@ -95,8 +96,8 @@ public void execute() {
9596
}
9697

9798
@Override
98-
public AsyncJob.Type getInstanceType() {
99-
return AsyncJob.Type.Counter;
99+
public ApiCommandJobType getInstanceType() {
100+
return ApiCommandJobType.Counter;
100101
}
101102

102103
@Override

‎api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.cloudstack.api.command.admin.autoscale;
1919

2020
import org.apache.cloudstack.api.APICommand;
21+
import org.apache.cloudstack.api.ApiCommandJobType;
2122
import org.apache.cloudstack.api.ApiConstants;
2223
import org.apache.cloudstack.api.ApiErrorCode;
2324
import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -82,8 +83,8 @@ public Long getId() {
8283
}
8384

8485
@Override
85-
public AsyncJob.Type getInstanceType() {
86-
return AsyncJob.Type.Counter;
86+
public ApiCommandJobType getInstanceType() {
87+
return ApiCommandJobType.Counter;
8788
}
8889

8990
@Override

‎api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.cloudstack.api.command.admin.host;
1818

1919
import org.apache.cloudstack.api.APICommand;
20+
import org.apache.cloudstack.api.ApiCommandJobType;
2021
import org.apache.cloudstack.api.ApiConstants;
2122
import org.apache.cloudstack.api.ApiErrorCode;
2223
import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -87,8 +88,8 @@ public String getEventDescription() {
8788
}
8889

8990
@Override
90-
public AsyncJob.Type getInstanceType() {
91-
return AsyncJob.Type.Host;
91+
public ApiCommandJobType getInstanceType() {
92+
return ApiCommandJobType.Host;
9293
}
9394

9495
@Override

‎api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.List;
2222

2323
import org.apache.cloudstack.api.APICommand;
24+
import org.apache.cloudstack.api.ApiCommandJobType;
2425
import org.apache.cloudstack.api.ApiConstants;
2526
import org.apache.cloudstack.api.ApiConstants.HostDetails;
2627
import org.apache.cloudstack.api.BaseListCmd;
@@ -158,8 +159,8 @@ public String getCommandName() {
158159
return s_name;
159160
}
160161

161-
public AsyncJob.Type getInstanceType() {
162-
return AsyncJob.Type.Host;
162+
public ApiCommandJobType getInstanceType() {
163+
return ApiCommandJobType.Host;
163164
}
164165

165166
@Override

0 commit comments

Comments
 (0)