// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
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);
}