Skip to content

Commit 5729e84

Browse files
committed
General refactoring
1 parent bd0bc0f commit 5729e84

File tree

12 files changed

+678
-636
lines changed

12 files changed

+678
-636
lines changed

plugins/backup/backroll/src/main/java/org/apache/cloudstack/backup/BackrollBackupProvider.java

Lines changed: 82 additions & 75 deletions
Large diffs are not rendered by default.

plugins/backup/backroll/src/main/java/org/apache/cloudstack/backup/backroll/BackrollClient.java

Lines changed: 88 additions & 525 deletions
Large diffs are not rendered by default.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
package org.apache.cloudstack.backup.backroll.model.response;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
21+
public abstract class BackrollAsyncResponse {
22+
@JsonProperty("state")
23+
public String state;
24+
}
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
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.
171
package org.apache.cloudstack.backup.backroll.model.response.archive;
182

19-
import com.fasterxml.jackson.annotation.JsonProperty;
3+
import org.apache.cloudstack.backup.backroll.model.response.BackrollAsyncResponse;
204

21-
public class BackrollBackupsFromVMResponse {
22-
@JsonProperty("state")
23-
public String state;
5+
import com.fasterxml.jackson.annotation.JsonProperty;
246

7+
public class BackrollBackupsFromVMResponse extends BackrollAsyncResponse {
258
@JsonProperty("info")
269
public BackrollArchivesResponse archives;
27-
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
package org.apache.cloudstack.backup.backroll.model.response.backup;
18+
19+
import org.apache.cloudstack.backup.backroll.model.response.BackrollAsyncResponse;
20+
21+
public class BackrollBackupResponse extends BackrollAsyncResponse{
22+
23+
}

plugins/backup/backroll/src/main/java/org/apache/cloudstack/backup/backroll/model/response/metrics/backup/BackrollBackupMetricsResponse.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
// under the License.
1717
package org.apache.cloudstack.backup.backroll.model.response.metrics.backup;
1818

19-
import com.fasterxml.jackson.annotation.JsonProperty;
19+
import org.apache.cloudstack.backup.backroll.model.response.BackrollAsyncResponse;
2020

21-
public class BackrollBackupMetricsResponse {
22-
@JsonProperty("state")
23-
public String state;
21+
import com.fasterxml.jackson.annotation.JsonProperty;
2422

23+
public class BackrollBackupMetricsResponse extends BackrollAsyncResponse {
2524
@JsonProperty("info")
2625
public BackupMetricsInfo info;
2726
}

plugins/backup/backroll/src/main/java/org/apache/cloudstack/backup/backroll/model/response/metrics/virtualMachine/BackrollVmMetricsResponse.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
// under the License.
1717
package org.apache.cloudstack.backup.backroll.model.response.metrics.virtualMachine;
1818

19-
import com.fasterxml.jackson.annotation.JsonProperty;
19+
import org.apache.cloudstack.backup.backroll.model.response.BackrollAsyncResponse;
2020

21-
public class BackrollVmMetricsResponse {
22-
@JsonProperty("state")
23-
public String state;
21+
import com.fasterxml.jackson.annotation.JsonProperty;
2422

23+
public class BackrollVmMetricsResponse extends BackrollAsyncResponse{
2524
@JsonProperty("info")
2625
public MetricsInfos infos;
2726
}

plugins/backup/backroll/src/main/java/org/apache/cloudstack/backup/backroll/model/response/metrics/virtualMachineBackups/VirtualMachineBackupsResponse.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
// under the License.
1717
package org.apache.cloudstack.backup.backroll.model.response.metrics.virtualMachineBackups;
1818

19-
import com.fasterxml.jackson.annotation.JsonProperty;
19+
import org.apache.cloudstack.backup.backroll.model.response.BackrollAsyncResponse;
2020

21-
public class VirtualMachineBackupsResponse {
22-
@JsonProperty("state")
23-
public String state;
21+
import com.fasterxml.jackson.annotation.JsonProperty;
2422

23+
public class VirtualMachineBackupsResponse extends BackrollAsyncResponse {
2524
@JsonProperty("info")
2625
public Archives info;
2726
}

plugins/backup/backroll/src/main/java/org/apache/cloudstack/backup/backroll/model/response/policy/BackupPoliciesResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
import java.util.List;
2020

21+
import org.apache.cloudstack.backup.backroll.model.response.BackrollAsyncResponse;
22+
2123
import com.fasterxml.jackson.annotation.JsonFormat;
2224
import com.fasterxml.jackson.annotation.JsonProperty;
2325

24-
public class BackupPoliciesResponse {
25-
@JsonProperty("state")
26-
public String state;
26+
public class BackupPoliciesResponse extends BackrollAsyncResponse {
2727

2828
@JsonProperty("info")
2929
@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
package org.apache.cloudstack.backup.backroll.model.response.restore;
18+
19+
import org.apache.cloudstack.backup.backroll.model.response.BackrollAsyncResponse;
20+
21+
import com.fasterxml.jackson.annotation.JsonInclude;
22+
import com.fasterxml.jackson.annotation.JsonProperty;
23+
24+
@JsonInclude(JsonInclude.Include.NON_NULL)
25+
public class BackrollRestoreResponse extends BackrollAsyncResponse {
26+
@JsonProperty("info")
27+
public String info;
28+
}

0 commit comments

Comments
 (0)