Skip to content

Commit 5ce631e

Browse files
author
Alex Huang
committed
Separated resource management and agent management code. It's not all done but at least we make a first step
1 parent c3c15b8 commit 5ce631e

14 files changed

Lines changed: 802 additions & 737 deletions

‎server/src/com/cloud/agent/AgentManager.java‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@
2323

2424
import com.cloud.agent.api.Answer;
2525
import com.cloud.agent.api.Command;
26+
import com.cloud.agent.manager.AgentAttache;
2627
import com.cloud.agent.manager.Commands;
28+
import com.cloud.api.commands.UpdateHostPasswordCmd;
2729
import com.cloud.dc.DataCenterVO;
2830
import com.cloud.dc.HostPodVO;
2931
import com.cloud.dc.PodCluster;
3032
import com.cloud.exception.AgentUnavailableException;
31-
import com.cloud.exception.DiscoveryException;
32-
import com.cloud.exception.InvalidParameterValueException;
3333
import com.cloud.exception.OperationTimedoutException;
3434
import com.cloud.host.Host;
3535
import com.cloud.host.Host.Type;
3636
import com.cloud.host.HostStats;
37-
import com.cloud.host.HostVO;
3837
import com.cloud.host.Status;
3938
import com.cloud.host.Status.Event;
4039
import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -137,16 +136,16 @@ public enum OnError {
137136
* @return id to unregister if needed.
138137
*/
139138
int registerForHostEvents(Listener listener, boolean connections, boolean commands, boolean priority);
140-
141-
139+
140+
142141
/**
143-
* Register to listen for initial agent connections.
142+
* Register to listen for initial agent connections.
144143
* @param creator
145144
* @param priority in listening for events.
146145
* @return id to unregister if needed.
147146
*/
148147
int registerForInitialConnects(StartupCommandProcessor creator, boolean priority);
149-
148+
150149
/**
151150
* Unregister for listening to host events.
152151
*
@@ -253,14 +252,16 @@ public enum OnError {
253252

254253
public boolean reconnect(final long hostId) throws AgentUnavailableException;
255254

256-
public List<HostVO> discoverHosts(Long dcId, Long podId, Long clusterId, String clusterName, String url, String username, String password, String hypervisor, List<String> hostTags)
257-
throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
258-
259255
Answer easySend(Long hostId, Command cmd, int timeout);
260256

261257
boolean isHostNativeHAEnabled(long hostId);
262258

263259
Answer sendTo(Long dcId, HypervisorType type, Command cmd);
264260

265261
void notifyAnswersToMonitors(long agentId, long seq, Answer[] answers);
262+
263+
AgentAttache simulateStart(Long id, ServerResource resource, Map<String, String> details, boolean old, List<String> hostTags, String allocationState) throws IllegalArgumentException;
264+
265+
boolean updateHostPassword(UpdateHostPasswordCmd upasscmd);
266+
266267
}

0 commit comments

Comments
 (0)