Search in sources :

Example 1 with DataMatrix

use of com.alibaba.otter.shared.common.model.config.data.DataMatrix in project otter by alibaba.

the class DataMatrixInfo method execute.

public void execute(@Param("matrixId") Long matrixId, Context context) throws Exception {
    DataMatrix matrix = dataMatrixService.findById(matrixId);
    Map condition = new HashMap();
    condition.put("searchKey", "jdbc:mysql://groupKey=" + matrix.getGroupKey());
    List<DataMediaSource> dataSources = dataMediaSourceService.listByCondition(condition);
    context.put("dataMatrix", matrix);
    context.put("dataSources", dataSources);
}
Also used : HashMap(java.util.HashMap) DataMediaSource(com.alibaba.otter.shared.common.model.config.data.DataMediaSource) DataMatrix(com.alibaba.otter.shared.common.model.config.data.DataMatrix) Map(java.util.Map) HashMap(java.util.HashMap)

Example 2 with DataMatrix

use of com.alibaba.otter.shared.common.model.config.data.DataMatrix in project otter by alibaba.

the class DataMatrixAction method doSwitch.

public void doSwitch(@Param("matrixId") Long matrixId, Navigator nav) throws WebxException {
    DataMatrix matrix = dataMatrixService.findById(matrixId);
    String slave = matrix.getMaster();
    String master = matrix.getSlave();
    if (StringUtils.isNotEmpty(master) && StringUtils.isNotEmpty(slave)) {
        matrix.setMaster(master);
        matrix.setSlave(slave);
    }
    dataMatrixService.modify(matrix);
    nav.redirectToLocation("dataMatrixList.htm?matrixId=" + matrixId);
}
Also used : DataMatrix(com.alibaba.otter.shared.common.model.config.data.DataMatrix)

Example 3 with DataMatrix

use of com.alibaba.otter.shared.common.model.config.data.DataMatrix in project otter by alibaba.

the class DataMatrixAction method doAdd.

public void doAdd(@FormGroup("dataMatrixInfo") Group dataMatrixInfo, @FormField(name = "formDataMatrixError", group = "dataMatrixInfo") CustomErrors err, Navigator nav) throws Exception {
    DataMatrix matrix = new DataMatrix();
    dataMatrixInfo.setProperties(matrix);
    try {
        dataMatrixService.create(matrix);
    } catch (RepeatConfigureException rce) {
        err.setMessage("invalidDataMatrix");
        return;
    }
    nav.redirectTo(WebConstant.MATRIX_LIST_LINK);
}
Also used : RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException) DataMatrix(com.alibaba.otter.shared.common.model.config.data.DataMatrix)

Example 4 with DataMatrix

use of com.alibaba.otter.shared.common.model.config.data.DataMatrix in project otter by alibaba.

the class DataMatrixAction method doEdit.

public void doEdit(@FormGroup("dataMatrixInfo") Group dataMatrixInfo, @FormField(name = "formDataMatrixError", group = "dataMatrixInfo") CustomErrors err, Navigator nav) throws Exception {
    DataMatrix matrix = new DataMatrix();
    dataMatrixInfo.setProperties(matrix);
    try {
        dataMatrixService.modify(matrix);
    } catch (RepeatConfigureException rce) {
        err.setMessage("invalidDataMatrix");
        return;
    }
    nav.redirectToLocation("dataMatrixList.htm?matrixId=" + matrix.getId());
}
Also used : RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException) DataMatrix(com.alibaba.otter.shared.common.model.config.data.DataMatrix)

Example 5 with DataMatrix

use of com.alibaba.otter.shared.common.model.config.data.DataMatrix in project otter by alibaba.

the class EditDataMatrix method execute.

/**
 * @param context
 * @throws WebxException
 */
public void execute(@Param("matrixId") Long matrixId, Context context) throws Exception {
    DataMatrix matrix = dataMatrixService.findById(matrixId);
    context.put("dataMatrix", matrix);
}
Also used : DataMatrix(com.alibaba.otter.shared.common.model.config.data.DataMatrix)

Aggregations

DataMatrix (com.alibaba.otter.shared.common.model.config.data.DataMatrix)9 RepeatConfigureException (com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException)4 ManagerException (com.alibaba.otter.manager.biz.common.exceptions.ManagerException)2 DataMediaSource (com.alibaba.otter.shared.common.model.config.data.DataMediaSource)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Paginator (com.alibaba.citrus.util.Paginator)1 DataMatrixDO (com.alibaba.otter.manager.biz.config.datamatrix.dal.dataobject.DataMatrixDO)1 SeniorDataMatrix (com.alibaba.otter.manager.web.common.model.SeniorDataMatrix)1