use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent in project coprhd-controller by CoprHD.
the class CIMConnectionFactory method recordStorageProviderEvent.
public void recordStorageProviderEvent(OperationTypeEnum opType, String description, URI storageProvider) {
String evType;
evType = opType.getEvType(true);
_log.info("Recording {} event", evType);
RecordableBourneEvent event = new RecordableBourneEvent(/* String */
evType, /* tenant id */
null, /* user id ?? */
URI.create("ViPR-User"), /* project ID */
null, /* VirtualPool */
null, /* service */
EVENT_SERVICE_TYPE, /* resource id */
storageProvider, /* description */
description, /* timestamp */
System.currentTimeMillis(), /* extensions */
"", /* native guid */
null, /* record type */
RecordType.Event.name(), /* Event Source */
EVENT_SERVICE_SOURCE, /* Operational Status codes */
"", /* Operational Status Descriptions */
"");
try {
_evtMgr.recordEvents(event);
} catch (Exception ex) {
_log.error("Failed to record event. Event description: {}. Error: {}.", description, ex);
}
}
use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent 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.RecordableBourneEvent 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.RecordableBourneEvent 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.RecordableBourneEvent 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);
}
}
Aggregations