use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager in project coprhd-controller by CoprHD.
the class MirrorFileTaskCompleter method recordBourneMirrorEvent.
/**
* @param dbClient
* @param evtType
* @param status
* @param desc
* @throws Exception
*/
public void recordBourneMirrorEvent(DbClient dbClient, URI fileUri, String evtType, Operation.Status status, String desc) throws Exception {
RecordableEventManager eventManager = new RecordableEventManager();
eventManager.setDbClient(dbClient);
FileShare fsObj = dbClient.queryObject(FileShare.class, fileUri);
RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(fsObj, evtType, desc, "", dbClient, EVENT_SERVICE_TYPE, RecordType.Event.name(), EVENT_SERVICE_SOURCE);
try {
eventManager.recordEvents(event);
_logger.info("ViPR {} event recorded", evtType);
} catch (Exception ex) {
_logger.error("Failed to record event. Event description: {}. Error: ", evtType, ex);
}
}
use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager in project coprhd-controller by CoprHD.
the class RPCGProtectionTaskCompleter method recordBourneRPEvent.
/**
* Record RP event
*
* @param dbClient db client
* @param uri volume/block consistency group operation performed on
* @param evtType event type
* @param status status of operation
* @param desc description
* @throws Exception
*/
private void recordBourneRPEvent(DbClient dbClient, URI uri, String evtType, Operation.Status status, String desc) {
RecordableEventManager eventManager = new RecordableEventManager();
eventManager.setDbClient(dbClient);
DataObject dataObj = null;
if (URIUtil.isType(uri, Volume.class)) {
dataObj = dbClient.queryObject(Volume.class, uri);
} else if (URIUtil.isType(uri, BlockConsistencyGroup.class)) {
dataObj = dbClient.queryObject(BlockConsistencyGroup.class, uri);
}
RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(dataObj, evtType, desc, "", dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, RecordType.Event.name(), ControllerUtils.BLOCK_EVENT_SOURCE);
try {
eventManager.recordEvents(event);
_log.info("Bourne {} event recorded", evtType);
} catch (Exception e) {
_log.error("Failed to record event. Event description: {}. Error: ", evtType, e);
}
}
use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager in project coprhd-controller by CoprHD.
the class VplexMirrorTaskCompleter method recordBourneVplexMirrorEvent.
public static void recordBourneVplexMirrorEvent(DbClient dbClient, URI mirrorUri, String evtType, Operation.Status status, String desc) throws Exception {
RecordableEventManager eventManager = new RecordableEventManager();
eventManager.setDbClient(dbClient);
VplexMirror mirror = dbClient.queryObject(VplexMirror.class, mirrorUri);
RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(mirror, evtType, desc, "", dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, RecordType.Event.name(), ControllerUtils.BLOCK_EVENT_SOURCE);
try {
eventManager.recordEvents(event);
_log.info("Bourne {} event recorded", evtType);
} catch (Exception ex) {
_log.error("Failed to record event. Event description: {}. Error: ", evtType, ex);
}
}
use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager in project coprhd-controller by CoprHD.
the class BlockSnapshotSessionCompleter method recordBlockSnapshotSessionEvent.
/**
* Records a ViPR event for a the BlockSnapshotSession operation.
*
* @param dbClient A reference to a database client.
* @param snapSession A reference to the snap shot session.
* @param evtType The event type.
* @param status The results of the request.
* @param description A description of the results.
*/
protected void recordBlockSnapshotSessionEvent(DbClient dbClient, BlockSnapshotSession snapSession, String evtType, Operation.Status status, String description) {
RecordableEventManager eventManager = new RecordableEventManager();
eventManager.setDbClient(dbClient);
RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(snapSession, evtType, description, "", dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, RecordType.Event.name(), ControllerUtils.BLOCK_EVENT_SOURCE);
try {
eventManager.recordEvents(event);
s_logger.info("Bourne {} event recorded", evtType);
} catch (Exception ex) {
s_logger.error("Failed to record event. Event description: {}. Error: ", evtType, ex);
}
}
use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager in project coprhd-controller by CoprHD.
the class FileDeviceController method recordFsEvent.
/**
* Create a nice event based on the File Share
*
* @param fs
* FileShare for which the event is about
* @param type
* Type of event such as FileShareCreated or FileShareDeleted
* @param description
* Description for the event if needed
*/
public static void recordFsEvent(DbClient dbClient, FileShare fs, String type, String description, String extensions) {
if (fs == null) {
_log.error("Invalid FileShare event");
return;
}
RecordableEventManager eventManager = new RecordableEventManager();
eventManager.setDbClient(dbClient);
// fix the bogus user ID once we have AuthZ working
RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(fs, type, description, extensions, dbClient, EVENT_SERVICE_TYPE, RecordType.Event.name(), EVENT_SERVICE_SOURCE);
try {
eventManager.recordEvents(event);
} catch (Exception th) {
_log.error("Failed to record event. Event description: {}.", description, th);
}
}
Aggregations