Search in sources :

Example 16 with RecordableBourneEvent

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);
    }
}
Also used : RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) WBEMException(javax.wbem.WBEMException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException) ConnectionManagerException(com.emc.storageos.cimadapter.connections.ConnectionManagerException) IOException(java.io.IOException)

Example 17 with RecordableBourneEvent

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);
    }
}
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 18 with RecordableBourneEvent

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);
    }
}
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 19 with RecordableBourneEvent

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);
    }
}
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 20 with RecordableBourneEvent

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