forked from apache/cloudstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegionService.java
More file actions
152 lines (135 loc) · 4.68 KB
/
RegionService.java
File metadata and controls
152 lines (135 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.region;
import java.util.List;
import org.apache.cloudstack.api.command.admin.account.DeleteAccountCmd;
import org.apache.cloudstack.api.command.admin.account.DisableAccountCmd;
import org.apache.cloudstack.api.command.admin.account.EnableAccountCmd;
import org.apache.cloudstack.api.command.admin.account.UpdateAccountCmd;
import org.apache.cloudstack.api.command.admin.domain.DeleteDomainCmd;
import org.apache.cloudstack.api.command.admin.domain.UpdateDomainCmd;
import org.apache.cloudstack.api.command.admin.user.DeleteUserCmd;
import org.apache.cloudstack.api.command.admin.user.DisableUserCmd;
import org.apache.cloudstack.api.command.admin.user.EnableUserCmd;
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
import org.apache.cloudstack.api.command.user.region.ListRegionsCmd;
import com.cloud.domain.Domain;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
import com.cloud.user.UserAccount;
public interface RegionService {
/**
* Adds a Region to the local Region
* @param id
* @param name
* @param endPoint
* @return Return added Region object
*/
public Region addRegion(int id, String name, String endPoint);
/**
* Update details of the Region with specified Id
* @param id
* @param name
* @param endPoint
* @return Return updated Region object
*/
public Region updateRegion(int id, String name, String endPoint);
/**
* @param id
* @return True if region is successfully removed
*/
public boolean removeRegion(int id);
/** List all Regions or by Id/Name
* @param id
* @param name
* @return List of Regions
*/
public List<? extends Region> listRegions(ListRegionsCmd cmd);
/**
* Deletes a user by userId
* isPopagate flag is set to true if sent from peer Region
* @param cmd
*
* @return true if delete was successful, false otherwise
*/
boolean deleteUserAccount(DeleteAccountCmd cmd);
/**
* Updates an account
* isPopagate falg is set to true if sent from peer Region
*
* @param cmd
* - the parameter containing accountId or account nameand domainId
* @return updated account object
*/
Account updateAccount(UpdateAccountCmd cmd);
/**
* Disables an account by accountName and domainId or accountId
* @param cmd
* @return
* @throws ResourceUnavailableException
* @throws ConcurrentOperationException
*/
Account disableAccount(DisableAccountCmd cmd) throws ConcurrentOperationException, ResourceUnavailableException;
/**
* Enables an account by accountId
* @param cmd
* @return
*/
Account enableAccount(EnableAccountCmd cmd);
/**
* Deletes user by Id
* @param deleteUserCmd
* @return true if delete was successful, false otherwise
*/
boolean deleteUser(DeleteUserCmd deleteUserCmd);
/**
* update an existing domain
*
* @param cmd
* - the command containing domainId and new domainName
* @return Domain object if the command succeeded
*/
public Domain updateDomain(UpdateDomainCmd updateDomainCmd);
/**
* Deletes domain
* @param cmd
* @return true if delete was successful, false otherwise
*/
public boolean deleteDomain(DeleteDomainCmd cmd);
/**
* Update a user by userId
*
* @param userId
* @return UserAccount object
*/
public UserAccount updateUser(UpdateUserCmd updateUserCmd);
/**
* Disables a user by userId
*
* @param cmd
* @return UserAccount object
*/
public UserAccount disableUser(DisableUserCmd cmd);
/**
* Enables a user
*
* @param cmd
* @return UserAccount object
*/
public UserAccount enableUser(EnableUserCmd cmd);
}