forked from apache/cloudstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResourceListener.java
More file actions
executable file
·106 lines (95 loc) · 3.22 KB
/
Copy pathResourceListener.java
File metadata and controls
executable file
·106 lines (95 loc) · 3.22 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
// 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 com.cloud.resource;
import java.net.URI;
import java.util.List;
import java.util.Map;
import com.cloud.host.HostVO;
public interface ResourceListener {
static final Integer EVENT_DISCOVER_BEFORE = 0x1;
static final Integer EVENT_DISCOVER_AFTER = 0x1 << 1;
static final Integer EVENT_DELETE_HOST_BEFORE = 0x1 << 2;
static final Integer EVENT_DELETE_HOST_AFTER = 0x1 << 3;
static final Integer EVENT_CANCEL_MAINTENANCE_BEFORE = 0x1 << 4;
static final Integer EVENT_CANCEL_MAINTENANCE_AFTER = 0x1 << 5;
static final Integer EVENT_PREPARE_MAINTENANCE_BEFORE = 0x1 << 6;
static final Integer EVENT_PREPARE_MAINTENANCE_AFTER = 0x1 << 7;
static final Integer EVENT_ALL = (EVENT_DISCOVER_BEFORE | EVENT_DISCOVER_AFTER | EVENT_DELETE_HOST_BEFORE | EVENT_DELETE_HOST_AFTER
| EVENT_CANCEL_MAINTENANCE_BEFORE | EVENT_CANCEL_MAINTENANCE_AFTER | EVENT_PREPARE_MAINTENANCE_BEFORE | EVENT_PREPARE_MAINTENANCE_AFTER);
/**
*
* @param dcid
* @param podId
* @param clusterId
* @param uri
* @param username
* @param password
* @param hostTags
*
* Called before Discover.find()
*/
void processDiscoverEventBefore(Long dcid, Long podId, Long clusterId, URI uri, String username, String password, List<String> hostTags);
/**
*
* @param resources
*
* Called after Discover.find()
*/
void processDiscoverEventAfter(Map<? extends ServerResource, Map<String, String>> resources);
/**
*
* @param host
*
* Called before host delete
*/
void processDeleteHostEventBefore(HostVO host);
/**
*
* @param host
*
* Called after host delete. NOTE param host includes stale data which has been removed from database
*/
void processDeletHostEventAfter(HostVO host);
/**
*
* @param hostId
*
* Called before AgentManager.cancelMaintenance
*/
void processCancelMaintenaceEventBefore(Long hostId);
/**
*
* @param hostId
*
* Called after AgentManager.cancelMaintenance
*/
void processCancelMaintenaceEventAfter(Long hostId);
/**
*
* @param hostId
*
* Called before AgentManager.main
*/
void processPrepareMaintenaceEventBefore(Long hostId);
/**
*
* @param hostId
*
* Called after AgentManager.main
*/
void processPrepareMaintenaceEventAfter(Long hostId);
}