use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent in project coprhd-controller by CoprHD.
the class FileDeviceController method recordSnapshotEvent.
/**
* Create a nice event based on the FileShare
*
* @param snap
* Snapshot for which the event is about
* @param fs
* FileShare from which the snapshot was created
* @param type
* Type of event such as FileShareCreated or FileShareDeleted
* @param description
* Description for the event if needed
*/
public static void recordSnapshotEvent(DbClient dbClient, Snapshot snap, FileShare fs, String type, String description, String extensions) {
if (snap == null || fs == null) {
_log.error("Invalid Snapshot event");
return;
}
RecordableEventManager eventManager = new RecordableEventManager();
eventManager.setDbClient(dbClient);
// fix the bogus user ID once we have AuthZ working
RecordableBourneEvent event = new RecordableBourneEvent(type, fs.getTenant().getURI(), // user ID when AAA fixed
URI.create("ViPR-User"), fs.getProject().getURI(), fs.getVirtualPool(), EVENT_SERVICE_TYPE, snap.getId(), description, System.currentTimeMillis(), extensions, snap.getNativeGuid(), RecordType.Event.name(), EVENT_SERVICE_SOURCE, "", "");
try {
eventManager.recordEvents(event);
} catch (Exception ex) {
_log.error("Failed to record event. Event description: {}.", description, ex);
}
}
use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent in project coprhd-controller by CoprHD.
the class FileDeviceController method recordQuotaDirectoryEvent.
public static void recordQuotaDirectoryEvent(DbClient dbClient, QuotaDirectory quotaDir, FileShare fs, String type, String description, String extensions) {
if (quotaDir == null || fs == null) {
_log.error("Invalid quota directory event");
return;
}
RecordableEventManager eventManager = new RecordableEventManager();
eventManager.setDbClient(dbClient);
// fix the bogus user ID once we have AuthZ working
RecordableBourneEvent event = new RecordableBourneEvent(type, fs.getTenant().getURI(), // user ID when AAA fixed
URI.create("ViPR-User"), fs.getProject().getURI(), fs.getVirtualPool(), EVENT_SERVICE_TYPE, quotaDir.getId(), description, System.currentTimeMillis(), extensions, quotaDir.getNativeGuid(), RecordType.Event.name(), EVENT_SERVICE_SOURCE, "", "");
try {
eventManager.recordEvents(event);
} catch (Exception ex) {
_log.error("Failed to record event. Event description: {}.", description, ex);
}
}
use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent in project coprhd-controller by CoprHD.
the class StoragePortService method recordStoragePortEvent.
/**
* Record Bourne Event for the completed operations
*
* @param type
* @param type
* @param description
* @param storagePort
*/
private void recordStoragePortEvent(OperationTypeEnum opType, String description, URI storagePort) {
String evType;
evType = opType.getEvType(true);
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 */
storagePort, /* 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 ProjectService method recordProjectEvent.
/**
* Create an event based on the project
*
* @param project for which the event is about
* @param opType Type of event such as ProjectCreated, ProjectDeleted
* @param opStatus
*/
public void recordProjectEvent(Project project, OperationTypeEnum opType, Boolean opStatus) {
String type = opType.getEvType(opStatus);
String description = opType.getDescription();
_log.info("opType: {} detail: {}", opType.toString(), type + ':' + description);
RecordableBourneEvent event = new RecordableBourneEvent(type, project.getTenantOrg().getURI(), URI.create(getUserFromContext().getName()), project.getId(), null, EVENT_SERVICE_TYPE, project.getId(), description, System.currentTimeMillis(), // extensions
"", "", RecordType.Event.name(), EVENT_SERVICE_SOURCE, "", "");
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 StoragePoolService method recordStoragePoolEvent.
/**
* Record Bourne Event for the completed operations
*
* @param type
* @param type
* @param description
* @param storagePort
*/
private void recordStoragePoolEvent(OperationTypeEnum opType, String description, URI storagePool) {
String evType;
evType = opType.getEvType(true);
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 */
storagePool, /* 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);
}
}
Aggregations