Search in sources :

Example 6 with RecordableEventManager

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

the class BlockMirrorTaskCompleter method recordBourneBlockMirrorEvent.

public void recordBourneBlockMirrorEvent(DbClient dbClient, URI mirrorUri, String evtType, Operation.Status status, String desc) throws Exception {
    RecordableEventManager eventManager = new RecordableEventManager();
    eventManager.setDbClient(dbClient);
    BlockMirror mirror = dbClient.queryObject(BlockMirror.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);
    }
}
Also used : BlockMirror(com.emc.storageos.db.client.model.BlockMirror) RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) RecordableEventManager(com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException)

Example 7 with RecordableEventManager

use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager 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 8 with RecordableEventManager

use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager 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 9 with RecordableEventManager

use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager 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 10 with RecordableEventManager

use of com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager 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)

Aggregations

RecordableBourneEvent (com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent)15 RecordableEventManager (com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager)15 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)12 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)5 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)5 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)5 Volume (com.emc.storageos.db.client.model.Volume)4 ControllerException (com.emc.storageos.volumecontroller.ControllerException)3 WorkflowException (com.emc.storageos.workflow.WorkflowException)3 URISyntaxException (java.net.URISyntaxException)3 BlockConsistencyGroup (com.emc.storageos.db.client.model.BlockConsistencyGroup)2 BlockMirror (com.emc.storageos.db.client.model.BlockMirror)2 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)2 FileShare (com.emc.storageos.db.client.model.FileShare)2 MapUnmanagedVolume (com.emc.storageos.api.mapper.functions.MapUnmanagedVolume)1 BlockObject (com.emc.storageos.db.client.model.BlockObject)1 DataObject (com.emc.storageos.db.client.model.DataObject)1 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)1 UnManagedVolume (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedVolume)1 VplexMirror (com.emc.storageos.db.client.model.VplexMirror)1