Search in sources :

Example 11 with RecordableEventManager

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);
    }
}
Also used : RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) RecordableEventManager(com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager) FileShare(com.emc.storageos.db.client.model.FileShare) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException)

Example 12 with RecordableEventManager

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);
    }
}
Also used : DataObject(com.emc.storageos.db.client.model.DataObject) 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) BlockConsistencyGroup(com.emc.storageos.db.client.model.BlockConsistencyGroup)

Example 13 with RecordableEventManager

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);
    }
}
Also used : RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) RecordableEventManager(com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager) VplexMirror(com.emc.storageos.db.client.model.VplexMirror) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException)

Example 14 with RecordableEventManager

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);
    }
}
Also used : 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 RecordableEventManager

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);
    }
}
Also used : RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) RecordableEventManager(com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) ControllerException(com.emc.storageos.volumecontroller.ControllerException) URISyntaxException(java.net.URISyntaxException) APIException(com.emc.storageos.svcs.errorhandling.resources.APIException) WorkflowException(com.emc.storageos.workflow.WorkflowException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException) 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