Remove unused methods

factory-mgt
Rushdi Mohamed 1 year ago
parent 91345ac9a1
commit 6ce845c647

@ -21,8 +21,8 @@ package io.entgra.device.mgt.core.factory.mgt.common.spi;
import io.entgra.device.mgt.core.factory.mgt.common.bean.PaginatedMeterRequestQuery; import io.entgra.device.mgt.core.factory.mgt.common.bean.PaginatedMeterRequestQuery;
import io.entgra.device.mgt.core.factory.mgt.common.dto.ProductionPlan; import io.entgra.device.mgt.core.factory.mgt.common.dto.ProductionPlan;
import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtException;
import io.entgra.device.mgt.core.factory.mgt.common.exception.BadRequestException; import io.entgra.device.mgt.core.factory.mgt.common.exception.BadRequestException;
import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtException;
import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtPluginException; import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtPluginException;
import io.entgra.device.mgt.core.factory.mgt.common.responses.BulkStatusResponse; import io.entgra.device.mgt.core.factory.mgt.common.responses.BulkStatusResponse;
import io.entgra.device.mgt.core.factory.mgt.common.wrapper.ProductionPlanWrapper; import io.entgra.device.mgt.core.factory.mgt.common.wrapper.ProductionPlanWrapper;
@ -31,8 +31,6 @@ import java.util.List;
public interface ProductionPlanService { public interface ProductionPlanService {
boolean addProductionPlan(ProductionPlan productionPlan) throws FactoryMgtPluginException;
BulkStatusResponse addProductionPlanBulk(List<ProductionPlan> productionPlans) throws FactoryMgtPluginException; BulkStatusResponse addProductionPlanBulk(List<ProductionPlan> productionPlans) throws FactoryMgtPluginException;
boolean updateProductionPlan(ProductionPlan productionPlan) throws FactoryMgtPluginException, FactoryMgtException; boolean updateProductionPlan(ProductionPlan productionPlan) throws FactoryMgtPluginException, FactoryMgtException;

@ -18,10 +18,10 @@
package io.entgra.device.mgt.core.factory.mgt.core.config; package io.entgra.device.mgt.core.factory.mgt.core.config;
import org.w3c.dom.Document;
import io.entgra.device.mgt.core.factory.mgt.common.util.FactoryMgtConstants; import io.entgra.device.mgt.core.factory.mgt.common.util.FactoryMgtConstants;
import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtException; import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtException;
import io.entgra.device.mgt.core.factory.mgt.core.util.FactoryMgtUtil; import io.entgra.device.mgt.core.factory.mgt.core.util.FactoryMgtUtil;
import org.w3c.dom.Document;
import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.CarbonUtils;
import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBContext;

@ -51,42 +51,6 @@ public class ProductionPlanServiceImpl implements ProductionPlanService {
this.factoryMgtDAO = FactoryMgtDAOFactory.getFactoryMgtDAO(); this.factoryMgtDAO = FactoryMgtDAOFactory.getFactoryMgtDAO();
} }
@Override
public boolean addProductionPlan(ProductionPlan productionPlan) throws FactoryMgtPluginException {
try {
FactoryMgtDAOFactory.beginTransaction();
boolean result = factoryMgtDAO.addProductionPlan(productionPlan);
if (result) {
String msg = "Factory Production plan added successfully, for productId: " + productionPlan.getProductId() +
" and machineId: " + productionPlan.getMachineId();
if (log.isDebugEnabled()) {
log.debug(msg);
}
} else {
FactoryMgtDAOFactory.rollbackTransaction();
String msg = "Production plan failed to add, for productId: " + productionPlan.getProductId() +
" and machineId: " + productionPlan.getMachineId();
throw new FactoryMgtPluginException(msg);
}
FactoryMgtDAOFactory.commitTransaction();
return true;
} catch (TransactionManagementException e) {
FactoryMgtDAOFactory.rollbackTransaction();
String msg = "Error occurred while obtaining the database connection to add production plan for productId: " +
productionPlan.getProductId() + " and machineId: " + productionPlan.getMachineId();
log.error(msg);
throw new FactoryMgtPluginException(msg, e);
} catch (FactoryMgtDAOException e) {
FactoryMgtDAOFactory.rollbackTransaction();
String msg = "Error occurred in the database level while adding production plan for productId: " +
productionPlan.getProductId() + " and machineId: " + productionPlan.getMachineId();
log.error(msg);
throw new FactoryMgtPluginException(msg, e);
} finally {
FactoryMgtDAOFactory.closeConnection();
}
}
@Override @Override
public BulkStatusResponse addProductionPlanBulk(List<ProductionPlan> productionPlans) throws FactoryMgtPluginException { public BulkStatusResponse addProductionPlanBulk(List<ProductionPlan> productionPlans) throws FactoryMgtPluginException {
List<String> successDevices = new ArrayList<>(); List<String> successDevices = new ArrayList<>();

Loading…
Cancel
Save