Search in sources :

Example 6 with RecordableBourneEvent

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

the class UnManagedFilesystemService method recordBourneFileSystemEvent.

/**
 * Generate and Record a Bourne filesystem specific event
 *
 * @param dbClient
 * @param evtType
 * @param status
 * @param desc
 * @throws Exception
 */
public void recordBourneFileSystemEvent(DbClient dbClient, String evtType, Operation.Status status, String desc, URI id) throws Exception {
    RecordableEventManager eventManager = new RecordableEventManager();
    eventManager.setDbClient(dbClient);
    FileShare fileShareObj = dbClient.queryObject(FileShare.class, id);
    RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(fileShareObj, 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) APIException(com.emc.storageos.svcs.errorhandling.resources.APIException) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException) IOException(java.io.IOException)

Example 7 with RecordableBourneEvent

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

the class UnManagedVolumeService method recordBourneVolumeEvent.

/**
 * Generate and Record a Bourne volume specific event
 *
 * @param dbClient
 * @param evtType
 * @param status
 * @param desc
 * @throws Exception
 */
public void recordBourneVolumeEvent(DbClient dbClient, String evtType, Operation.Status status, String desc, URI id) throws Exception {
    RecordableEventManager eventManager = new RecordableEventManager();
    eventManager.setDbClient(dbClient);
    BlockObject blockObject = null;
    if (URIUtil.isType(id, Volume.class)) {
        blockObject = dbClient.queryObject(Volume.class, id);
    } else if (URIUtil.isType(id, BlockMirror.class)) {
        blockObject = dbClient.queryObject(BlockMirror.class, id);
    } else if (URIUtil.isType(id, BlockSnapshot.class)) {
        blockObject = dbClient.queryObject(BlockSnapshot.class, id);
    }
    RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(blockObject, evtType, desc, "", dbClient, EVENT_SERVICE_TYPE, RecordType.Event.name(), EVENT_SERVICE_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 : BlockMirror(com.emc.storageos.db.client.model.BlockMirror) UnManagedVolume(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedVolume) MapUnmanagedVolume(com.emc.storageos.api.mapper.functions.MapUnmanagedVolume) Volume(com.emc.storageos.db.client.model.Volume) RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) BlockSnapshot(com.emc.storageos.db.client.model.BlockSnapshot) RecordableEventManager(com.emc.storageos.volumecontroller.impl.monitoring.RecordableEventManager) BlockObject(com.emc.storageos.db.client.model.BlockObject) APIException(com.emc.storageos.svcs.errorhandling.resources.APIException) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException)

Example 8 with RecordableBourneEvent

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

the class BlockDeviceController method recordBourneStorageEvent.

private void recordBourneStorageEvent(RecordableEventManager.EventType evtType, StorageSystem storage, String desc) {
    RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(storage, evtType.toString(), desc, "", _dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, RecordType.Event.name(), ControllerUtils.BLOCK_EVENT_SOURCE);
    try {
        _eventManager.recordEvents(event);
        _log.info("Bourne {} event recorded", evtType.name());
    } catch (Exception ex) {
        _log.error("Failed to record event. Event description: {}. Error: ", evtType.name(), ex);
    }
}
Also used : RecordableBourneEvent(com.emc.storageos.volumecontroller.impl.monitoring.RecordableBourneEvent) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) ControllerException(com.emc.storageos.volumecontroller.ControllerException) WorkflowException(com.emc.storageos.workflow.WorkflowException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) DataBindingException(javax.xml.bind.DataBindingException)

Example 9 with RecordableBourneEvent

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

the class BlockConsistencyGroupTaskCompleter method recordBourneBlockConsistencyGroupEvent.

public void recordBourneBlockConsistencyGroupEvent(DbClient dbClient, URI consistencyGroupURI, RecordableEventManager.EventType evtType, Operation.Status status, String desc) throws Exception {
    RecordableEventManager eventManager = new RecordableEventManager();
    eventManager.setDbClient(dbClient);
    BlockConsistencyGroup consistencyGroup = dbClient.queryObject(BlockConsistencyGroup.class, consistencyGroupURI);
    RecordableBourneEvent event = ControllerUtils.convertToRecordableBourneEvent(consistencyGroup, evtType.name(), desc, "", dbClient, ControllerUtils.BLOCK_EVENT_SERVICE, RecordType.Event.name(), ControllerUtils.BLOCK_EVENT_SOURCE);
    try {
        eventManager.recordEvents(event);
        _log.info("Bourne {} event recorded", evtType.name());
    } catch (Exception ex) {
        _log.error("Failed to record event. Event description: {}. Error: ", evtType.name(), 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) BlockConsistencyGroup(com.emc.storageos.db.client.model.BlockConsistencyGroup)

Example 10 with RecordableBourneEvent

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

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