Search in sources :

Example 11 with RecordableBourneEvent

use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent in project coprhd-controller by CoprHD.

the class BlockSnapshotTaskCompleter method recordBourneBlockSnapshotEvent.

/**
 * @param dbClient
 * @param evtType
 * @param status
 * @param desc
 * @throws Exception
 */
public void recordBourneBlockSnapshotEvent(DbClient dbClient, URI snapUri, String evtType, Operation.Status status, String desc) throws Exception {
    RecordableEventManager eventManager = new RecordableEventManager();
    eventManager.setDbClient(dbClient);
    BlockSnapshot snapObj = dbClient.queryObject(BlockSnapshot.class, snapUri);
    RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(snapObj, evtType, desc, "", dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, RecordType.Event.name(), ControllerUtils.BLOCK_EVENT_SOURCE);
    try {
        eventManager.recordEvents(event);
        _logger.info("Bourne {} event recorded", evtType);
    } catch (Exception ex) {
        _logger.error("Failed to record event. Event description: {}. Error: ", evtType, ex);
    }
}
Also used : RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) BlockSnapshot(com.emc.storageos.db.client.model.BlockSnapshot) RecordableEventManager(com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager)

Example 12 with RecordableBourneEvent

use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent in project coprhd-controller by CoprHD.

the class ExportTaskCompleter method recordBlockExportEvent.

/**
 * @param dbClient
 * @param evtType
 * @param status
 * @param desc
 * @throws Exception
 */
public void recordBlockExportEvent(DbClient dbClient, URI uri, String evtType, Operation.Status status, String desc) throws Exception {
    RecordableEventManager eventManager = new RecordableEventManager();
    eventManager.setDbClient(dbClient);
    ExportGroup exportGroup = dbClient.queryObject(ExportGroup.class, uri);
    RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(exportGroup, evtType, desc, "", dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, RecordType.Event.name(), ControllerUtils.BLOCK_EVENT_SOURCE);
    try {
        eventManager.recordEvents(event);
        _logger.info("Bourne {} event recorded", evtType);
    } catch (Exception ex) {
        _logger.error("Failed to record event. Event description: {}. Error: ", evtType, ex);
    }
}
Also used : ExportGroup(com.emc.storageos.db.client.model.ExportGroup) RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) RecordableEventManager(com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException)

Example 13 with RecordableBourneEvent

use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent in project coprhd-controller by CoprHD.

the class SRDFTaskCompleter method recordBourneSRDFEvent.

/**
 * @param dbClient
 * @param evtType
 * @param status
 * @param desc
 * @throws Exception
 */
public void recordBourneSRDFEvent(DbClient dbClient, URI volumeUri, String evtType, Operation.Status status, String desc) throws Exception {
    RecordableEventManager eventManager = new RecordableEventManager();
    eventManager.setDbClient(dbClient);
    Volume volObj = dbClient.queryObject(Volume.class, volumeUri);
    RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(volObj, evtType, desc, "", dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, RecordType.Event.name(), ControllerUtils.BLOCK_EVENT_SOURCE);
    try {
        eventManager.recordEvents(event);
        _logger.info("Bourne {} event recorded", evtType);
    } catch (Exception ex) {
        _logger.error("Failed to record event. Event description: {}. Error: ", evtType, ex);
    }
}
Also used : Volume(com.emc.storageos.db.client.model.Volume) RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) RecordableEventManager(com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException)

Example 14 with RecordableBourneEvent

use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent in project coprhd-controller by CoprHD.

the class VolumeTaskCompleter method recordBourneVolumeEvent.

/**
 * Generate and Record a Bourne volume specific event
 *
 * @param dbClient
 * @param id
 * @param evtType
 * @param status
 * @param desc
 * @throws Exception
 */
public static void recordBourneVolumeEvent(DbClient dbClient, URI id, String evtType, Operation.Status status, String desc) throws Exception {
    RecordableEventManager eventManager = new RecordableEventManager();
    eventManager.setDbClient(dbClient);
    Volume volumeObj = dbClient.queryObject(Volume.class, id);
    RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(volumeObj, evtType, desc, "", dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, RecordType.Event.name(), ControllerUtils.BLOCK_EVENT_SOURCE);
    try {
        eventManager.recordEvents(event);
        _logger.info("Bourne {} event recorded for Volume {}", evtType, id);
    } catch (Exception ex) {
        _logger.error("Failed to record event. Event description: {}. Error: ", evtType, ex);
    }
}
Also used : Volume(com.emc.storageos.db.client.model.Volume) RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) RecordableEventManager(com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException)

Example 15 with RecordableBourneEvent

use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent in project coprhd-controller by CoprHD.

the class StoragePoolProcessor method recordBourneStoragePoolEvent.

/**
 * Record storage pool alert/event
 *
 * @param storagePoolEventType
 * @param pool
 * @param description
 * @param eventType
 */
private static void recordBourneStoragePoolEvent(RecordableEventManager.EventType storagePoolEventType, StoragePool pool, String description, RecordType eventType, DbClient dbClient, RecordableEventManager eventManager) {
    RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(pool, storagePoolEventType.toString(), description, "", dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, eventType.toString(), ControllerUtils.BLOCK_EVENT_SOURCE);
    try {
        eventManager.recordEvents(event);
        _logger.info("ViPR {} event recorded. Description: {}", event.getType(), event.getDescription());
    } catch (Exception ex) {
        _logger.error(String.format("Failed to record event %s. Event description: %s.", event.getType(), event.getDescription()), ex);
    }
}
Also used : RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) WBEMException(javax.wbem.WBEMException) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Aggregations

RecordableBourneEvent (com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent)24 RecordableEventManager (com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager)15 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)13 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)12 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)10 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)7 Volume (com.emc.storageos.db.client.model.Volume)5 ControllerException (com.emc.storageos.volumecontroller.ControllerException)5 WorkflowException (com.emc.storageos.workflow.WorkflowException)4 IOException (java.io.IOException)4 URISyntaxException (java.net.URISyntaxException)4 BlockConsistencyGroup (com.emc.storageos.db.client.model.BlockConsistencyGroup)3 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)3 FileShare (com.emc.storageos.db.client.model.FileShare)3 BlockMirror (com.emc.storageos.db.client.model.BlockMirror)2 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)2 VplexMirror (com.emc.storageos.db.client.model.VplexMirror)2 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)2 BadRequestException (com.emc.storageos.svcs.errorhandling.resources.BadRequestException)2 WBEMException (javax.wbem.WBEMException)2