Search in sources :

Example 1 with GlusterStorageSyncCommandParameters

use of org.ovirt.engine.core.common.action.GlusterStorageSyncCommandParameters in project ovirt-engine by oVirt.

the class GlusterStorageDomainDRSyncJob method syncData.

@OnTimerMethodAnnotation("syncData")
public void syncData(String storageDomainId, String geoRepSessionId) {
    try {
        // Get storage domain and georep session
        StorageDomain storageDomain = storageDomainDao.get(new Guid(storageDomainId));
        if (storageDomain == null) {
            log.error("No storage domain found for id '{}'", storageDomainId);
            return;
        }
        GlusterGeoRepSession session = geoRepDao.getById(new Guid(geoRepSessionId));
        if (session == null) {
            log.error("No geo-replication session found for id '{}'", geoRepSessionId);
            return;
        }
        backend.runInternalAction(ActionType.GlusterStorageSync, new GlusterStorageSyncCommandParameters(storageDomain.getId(), session.getId()), ExecutionHandler.createInternalJobContext());
    } catch (Exception e) {
        log.error("Error running dr sync", e);
    }
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) GlusterGeoRepSession(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession) GlusterStorageSyncCommandParameters(org.ovirt.engine.core.common.action.GlusterStorageSyncCommandParameters) Guid(org.ovirt.engine.core.compat.Guid) OnTimerMethodAnnotation(org.ovirt.engine.core.utils.timer.OnTimerMethodAnnotation)

Aggregations

GlusterStorageSyncCommandParameters (org.ovirt.engine.core.common.action.GlusterStorageSyncCommandParameters)1 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)1 GlusterGeoRepSession (org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession)1 Guid (org.ovirt.engine.core.compat.Guid)1 OnTimerMethodAnnotation (org.ovirt.engine.core.utils.timer.OnTimerMethodAnnotation)1