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);
}
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);
}
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);
}
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());
}
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);
}
Aggregations