Search in sources :

Example 6 with GlusterGeoRepSessionConfiguration

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.

the class GlusterGeoRepDaoTest method getGlusterGeoRepSessionConfig.

private GlusterGeoRepSessionConfiguration getGlusterGeoRepSessionConfig() {
    GlusterGeoRepSessionConfiguration sessionConfig = new GlusterGeoRepSessionConfiguration();
    sessionConfig.setId(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
    sessionConfig.setKey(GEOREP_CONFIG_CRAWL);
    sessionConfig.setDescription("Geo-replication session  crawl");
    sessionConfig.setValue("changelog");
    return sessionConfig;
}
Also used : GlusterGeoRepSessionConfiguration(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration)

Example 7 with GlusterGeoRepSessionConfiguration

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.

the class GlusterGeoRepDaoTest method testGetGlusterGeoRepSessionUnSetConfig.

@Test
public void testGetGlusterGeoRepSessionUnSetConfig() {
    GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig();
    dao.saveConfig(sessionConfig);
    List<GlusterGeoRepSessionConfiguration> unsetSessionConfig = dao.getGlusterGeoRepSessionUnSetConfig(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
    assertEquals("use_meta_volume", unsetSessionConfig.get(0).getKey());
}
Also used : GlusterGeoRepSessionConfiguration(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration) Test(org.junit.Test)

Example 8 with GlusterGeoRepSessionConfiguration

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.

the class GlusterGeoRepDaoTest method testSaveConfig.

@Test
public void testSaveConfig() {
    GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig();
    dao.saveConfig(sessionConfig);
    List<GlusterGeoRepSessionConfiguration> fetchedSessionConfigList = dao.getGeoRepSessionConfig(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
    assertEquals(sessionConfig, fetchedSessionConfigList.get(0));
    GlusterGeoRepSessionConfiguration fetchedSessionConfig = dao.getGeoRepSessionConfigByKey(FixturesTool.GLUSTER_GEOREP_SESSION_ID, GEOREP_CONFIG_CRAWL);
    assertEquals(sessionConfig, fetchedSessionConfig);
}
Also used : GlusterGeoRepSessionConfiguration(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration) Test(org.junit.Test)

Example 9 with GlusterGeoRepSessionConfiguration

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.

the class GlusterGeoRepDaoTest method testUpdateConfig.

@Test
public void testUpdateConfig() {
    GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig();
    dao.saveConfig(sessionConfig);
    sessionConfig.setValue("NEW_VAL");
    dao.updateConfig(sessionConfig);
    List<GlusterGeoRepSessionConfiguration> fetchedSessionConfig = dao.getGeoRepSessionConfig(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
    assertEquals("NEW_VAL", fetchedSessionConfig.get(0).getValue());
}
Also used : GlusterGeoRepSessionConfiguration(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration) Test(org.junit.Test)

Example 10 with GlusterGeoRepSessionConfiguration

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration in project ovirt-engine by oVirt.

the class GlusterVolumeGeoReplicationSessionConfigPopupView method initConfigTable.

private void initConfigTable() {
    geoReplicationConfigTable = new EntityModelCellTable<>(false, true);
    geoReplicationConfigTable.setSelectionModel(new NoSelectionModel());
    geoReplicationConfigTable.addColumn(new AbstractEntityModelTextColumn<Pair<Boolean, GlusterGeoRepSessionConfiguration>>() {

        @Override
        protected String getText(Pair<Boolean, GlusterGeoRepSessionConfiguration> entity) {
            return entity.getSecond().getKey();
        }
    }, constants.optionKeyVolumeParameter(), // $NON-NLS-1$
    "150px");
    geoReplicationConfigTable.addColumn(new AbstractScrollableTextColumn<EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>>>() {

        @Override
        public String getValue(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
            return object.getEntity().getSecond().getDescription() == null ? constants.notAvailableLabel() : object.getEntity().getSecond().getDescription();
        }
    }, constants.descriptionVolumeParameter(), // $NON-NLS-1$
    "300px");
    geoReplicationConfigTable.addColumn(new GlusterConfigAwareColumn(), constants.optionValueVolumeParameter(), // $NON-NLS-1$
    "200px");
    geoReplicationConfigTable.addColumn(new AbstractCheckboxColumn<EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>>>(true, (index, object, value) -> object.getEntity().setFirst(value)) {

        @Override
        protected boolean canEdit(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
            return true;
        }

        @Override
        public Boolean getValue(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
            return object.getEntity().getFirst();
        }
    }, constants.resetGeoRepSessionConfig());
}
Also used : AbstractCheckboxColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractCheckboxColumn) EventBus(com.google.gwt.event.shared.EventBus) EntityModelCellTable(org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable) AbstractEntityModelTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn) AssetProvider(org.ovirt.engine.ui.webadmin.gin.AssetProvider) ElementIdHandler(org.ovirt.engine.ui.common.idhandler.ElementIdHandler) Inject(com.google.inject.Inject) UiCommonEditorDriver(org.ovirt.engine.ui.common.editor.UiCommonEditorDriver) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) AbstractModelBoundPopupView(org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView) GWT(com.google.gwt.core.client.GWT) GlusterConfigAwareColumn(org.ovirt.engine.ui.common.widget.table.column.GlusterConfigAwareColumn) GlusterVolumeGeoReplicationSessionConfigModel(org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeGeoReplicationSessionConfigModel) WithElementId(org.ovirt.engine.ui.common.idhandler.WithElementId) GlusterGeoRepSessionConfiguration(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) UiBinder(com.google.gwt.uibinder.client.UiBinder) ApplicationConstants(org.ovirt.engine.ui.webadmin.ApplicationConstants) SimpleDialogPanel(org.ovirt.engine.ui.common.widget.dialog.SimpleDialogPanel) GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget(org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget) UiField(com.google.gwt.uibinder.client.UiField) NoSelectionModel(com.google.gwt.view.client.NoSelectionModel) AbstractScrollableTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractScrollableTextColumn) Pair(org.ovirt.engine.core.common.utils.Pair) NoSelectionModel(com.google.gwt.view.client.NoSelectionModel) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) GlusterGeoRepSessionConfiguration(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration) GlusterConfigAwareColumn(org.ovirt.engine.ui.common.widget.table.column.GlusterConfigAwareColumn) Pair(org.ovirt.engine.core.common.utils.Pair)

Aggregations

GlusterGeoRepSessionConfiguration (org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration)10 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 Pair (org.ovirt.engine.core.common.utils.Pair)2 GWT (com.google.gwt.core.client.GWT)1 EventBus (com.google.gwt.event.shared.EventBus)1 UiBinder (com.google.gwt.uibinder.client.UiBinder)1 UiField (com.google.gwt.uibinder.client.UiField)1 NoSelectionModel (com.google.gwt.view.client.NoSelectionModel)1 Inject (com.google.inject.Inject)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionType (org.ovirt.engine.core.common.action.ActionType)1 GlusterGeoRepSession (org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession)1 GlusterVolumeOptionEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1 GlusterVolumeGeoRepConfigVdsParameters (org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepConfigVdsParameters)1 GlusterVolumeOptionVDSParameters (org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeOptionVDSParameters)1 UiCommonEditorDriver (org.ovirt.engine.ui.common.editor.UiCommonEditorDriver)1 ElementIdHandler (org.ovirt.engine.ui.common.idhandler.ElementIdHandler)1 WithElementId (org.ovirt.engine.ui.common.idhandler.WithElementId)1