merge-requests/7/head
dilanua 8 years ago
commit e3256417a3

@ -18,12 +18,8 @@
package org.wso2.carbon.device.mgt.core.notification.mgt.dao.impl; package org.wso2.carbon.device.mgt.core.notification.mgt.dao.impl;
import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.mgt.common.notification.mgt.Notification; import org.wso2.carbon.device.mgt.common.notification.mgt.Notification;
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
import org.wso2.carbon.device.mgt.core.notification.mgt.dao.NotificationDAO; import org.wso2.carbon.device.mgt.core.notification.mgt.dao.NotificationDAO;
import org.wso2.carbon.device.mgt.core.notification.mgt.dao.NotificationManagementDAOFactory; import org.wso2.carbon.device.mgt.core.notification.mgt.dao.NotificationManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.notification.mgt.dao.util.NotificationDAOUtil; import org.wso2.carbon.device.mgt.core.notification.mgt.dao.util.NotificationDAOUtil;
@ -79,8 +75,8 @@ public abstract class AbstractNotificationDAOImpl implements NotificationDAO {
try { try {
conn = NotificationManagementDAOFactory.getConnection(); conn = NotificationManagementDAOFactory.getConnection();
String sql = String sql =
"SELECT NOTIFICATION_ID, OPERATION_ID, DESCRIPTION, STATUS FROM DM_NOTIFICATION WHERE " + "SELECT NOTIFICATION_ID, OPERATION_ID, DESCRIPTION, STATUS, DEVICE_IDENTIFICATION, DEVICE_NAME, " +
"TENANT_ID = ? AND NOTIFICATION_ID = ?"; "DEVICE TYPE FROM DM_NOTIFICATION WHERE TENANT_ID = ? AND NOTIFICATION_ID = ?";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);
stmt.setInt(2, notificationId); stmt.setInt(2, notificationId);

@ -33,8 +33,23 @@ import java.util.List;
*/ */
public interface DeviceManagementProviderService { public interface DeviceManagementProviderService {
/**
* Method to retrieve all the devices of a given device type.
*
* @param deviceType Device-type of the required devices
* @return List of devices of given device-type.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* devices.
*/
List<Device> getAllDevices(String deviceType) throws DeviceManagementException; List<Device> getAllDevices(String deviceType) throws DeviceManagementException;
/**
* Method to retrieve all the devices registered in the system.
*
* @return List of registered devices.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* devices.
*/
List<Device> getAllDevices() throws DeviceManagementException; List<Device> getAllDevices() throws DeviceManagementException;
/** /**

@ -84,29 +84,28 @@ public class DeviceTaskManagerImpl implements DeviceTaskManager {
@Override @Override
public void addOperations() throws DeviceMgtTaskException { public void addOperations() throws DeviceMgtTaskException {
DeviceManagementProviderService deviceManagementProviderService = DeviceManagementProviderService deviceManagementProviderService = DeviceManagementDataHolder.getInstance().
DeviceManagementDataHolder.getInstance().getDeviceManagementProvider(); getDeviceManagementProvider();
try { try {
List<Device> devices = deviceManagementProviderService.getAllDevices(); List<String> deviceTypes = deviceManagementProviderService.getAvailableDeviceTypes();
List<Device> devices;
List<String> operations = this.getValidOperationNames(); List<String> operations = this.getValidOperationNames();
if (!devices.isEmpty()) { for (String deviceType : deviceTypes) {
for (String str : operations) { devices = deviceManagementProviderService.getAllDevices(deviceType);
CommandOperation operation = new CommandOperation(); if (!devices.isEmpty()) {
operation.setEnabled(true); for (String str : operations) {
operation.setType(Operation.Type.COMMAND); CommandOperation operation = new CommandOperation();
operation.setCode(str); operation.setEnabled(true);
//TODO: Fix this properly later adding device type to be passed in when the task manage executes "addOperations()" operation.setType(Operation.Type.COMMAND);
String type = null; operation.setCode(str);
if (devices.size() > 0) { deviceManagementProviderService.addOperation(deviceType, operation,
type = devices.get(0).getType(); DeviceManagerUtil.getValidDeviceIdentifiers(devices));
}
} else {
if (log.isDebugEnabled()) {
log.debug("No devices are available to perform the operations.");
} }
deviceManagementProviderService.addOperation(type, operation,
DeviceManagerUtil.convertDevices(devices));
}
} else {
if (log.isDebugEnabled()) {
log.debug("No devices are available to perform the operations.");
} }
} }
} catch (InvalidDeviceException e) { } catch (InvalidDeviceException e) {

@ -184,6 +184,27 @@ public final class DeviceManagerUtil {
return deviceIdentifiers; return deviceIdentifiers;
} }
public static List<DeviceIdentifier> getValidDeviceIdentifiers(List<Device> devices) {
List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
for (Device device : devices) {
if (device.getEnrolmentInfo() != null) {
switch (device.getEnrolmentInfo().getStatus()) {
case BLOCKED:
case REMOVED:
case SUSPENDED:
break;
default:
DeviceIdentifier identifier = new DeviceIdentifier();
identifier.setId(device.getDeviceIdentifier());
identifier.setType(device.getType());
deviceIdentifiers.add(identifier);
}
}
}
return deviceIdentifiers;
}
public static String getServerBaseHttpsUrl() { public static String getServerBaseHttpsUrl() {
String hostName = "localhost"; String hostName = "localhost";
try { try {

@ -54,6 +54,8 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
policyAdministratorPoint = new PolicyAdministratorPointImpl(); policyAdministratorPoint = new PolicyAdministratorPointImpl();
monitoringManager = new MonitoringManagerImpl(); monitoringManager = new MonitoringManagerImpl();
policyManager = new PolicyManagerImpl(); policyManager = new PolicyManagerImpl();
PolicyManagementDataHolder.getInstance().setMonitoringManager(monitoringManager);
PolicyManagementDataHolder.getInstance().setPolicyManager(policyManager);
} }
@Override @Override

@ -23,6 +23,8 @@ import org.wso2.carbon.ntask.core.service.TaskService;
import org.wso2.carbon.policy.mgt.common.PolicyEvaluationPoint; import org.wso2.carbon.policy.mgt.common.PolicyEvaluationPoint;
import org.wso2.carbon.policy.mgt.common.PolicyInformationPoint; import org.wso2.carbon.policy.mgt.common.PolicyInformationPoint;
import org.wso2.carbon.policy.mgt.common.spi.PolicyMonitoringService; import org.wso2.carbon.policy.mgt.common.spi.PolicyMonitoringService;
import org.wso2.carbon.policy.mgt.core.mgt.MonitoringManager;
import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager;
import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.user.core.tenant.TenantManager; import org.wso2.carbon.user.core.tenant.TenantManager;
@ -36,6 +38,8 @@ public class PolicyManagementDataHolder {
private PolicyEvaluationPoint policyEvaluationPoint; private PolicyEvaluationPoint policyEvaluationPoint;
private PolicyInformationPoint policyInformationPoint; private PolicyInformationPoint policyInformationPoint;
private DeviceManagementProviderService deviceManagementService; private DeviceManagementProviderService deviceManagementService;
private MonitoringManager monitoringManager;
private PolicyManager policyManager;
private Map<String, PolicyMonitoringService> policyMonitoringServiceMap = new HashMap<>(); private Map<String, PolicyMonitoringService> policyMonitoringServiceMap = new HashMap<>();
private TaskService taskService; private TaskService taskService;
@ -47,6 +51,22 @@ public class PolicyManagementDataHolder {
return thisInstance; return thisInstance;
} }
public PolicyManager getPolicyManager() {
return policyManager;
}
public void setPolicyManager(PolicyManager policyManager) {
this.policyManager = policyManager;
}
public MonitoringManager getMonitoringManager() {
return monitoringManager;
}
public void setMonitoringManager(MonitoringManager monitoringManager) {
this.monitoringManager = monitoringManager;
}
public RealmService getRealmService() { public RealmService getRealmService() {
return realmService; return realmService;
} }

@ -21,7 +21,6 @@ package org.wso2.carbon.policy.mgt.core.mgt;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceData; import org.wso2.carbon.policy.mgt.common.monitor.ComplianceData;
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceFeature; import org.wso2.carbon.policy.mgt.common.monitor.ComplianceFeature;
import org.wso2.carbon.policy.mgt.common.monitor.PolicyComplianceException; import org.wso2.carbon.policy.mgt.common.monitor.PolicyComplianceException;
@ -40,6 +39,6 @@ public interface MonitoringManager {
void addMonitoringOperation(List<Device> devices) throws PolicyComplianceException; void addMonitoringOperation(List<Device> devices) throws PolicyComplianceException;
List<DeviceType> getDeviceTypes() throws PolicyComplianceException; List<String> getDeviceTypes() throws PolicyComplianceException;
} }

@ -21,7 +21,6 @@ package org.wso2.carbon.policy.mgt.core.mgt.impl;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
@ -30,12 +29,8 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
import org.wso2.carbon.device.mgt.core.config.policy.PolicyConfiguration; import org.wso2.carbon.device.mgt.core.config.policy.PolicyConfiguration;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.dao.DeviceTypeDAO;
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation; import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl;
import org.wso2.carbon.policy.mgt.common.Policy; import org.wso2.carbon.policy.mgt.common.Policy;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.common.ProfileFeature; import org.wso2.carbon.policy.mgt.common.ProfileFeature;
@ -56,8 +51,6 @@ import java.util.Map;
public class MonitoringManagerImpl implements MonitoringManager { public class MonitoringManagerImpl implements MonitoringManager {
private PolicyDAO policyDAO; private PolicyDAO policyDAO;
// private DeviceDAO deviceDAO;
private DeviceTypeDAO deviceTypeDAO;
private MonitoringDAO monitoringDAO; private MonitoringDAO monitoringDAO;
private ComplianceDecisionPoint complianceDecisionPoint; private ComplianceDecisionPoint complianceDecisionPoint;
private PolicyConfiguration policyConfiguration; private PolicyConfiguration policyConfiguration;
@ -69,8 +62,6 @@ public class MonitoringManagerImpl implements MonitoringManager {
public MonitoringManagerImpl() { public MonitoringManagerImpl() {
this.policyDAO = PolicyManagementDAOFactory.getPolicyDAO(); this.policyDAO = PolicyManagementDAOFactory.getPolicyDAO();
// this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
this.deviceTypeDAO = DeviceManagementDAOFactory.getDeviceTypeDAO();
this.monitoringDAO = PolicyManagementDAOFactory.getMonitoringDAO(); this.monitoringDAO = PolicyManagementDAOFactory.getMonitoringDAO();
this.complianceDecisionPoint = new ComplianceDecisionPointImpl(); this.complianceDecisionPoint = new ComplianceDecisionPointImpl();
this.policyConfiguration = this.policyConfiguration =
@ -84,8 +75,8 @@ public class MonitoringManagerImpl implements MonitoringManager {
List<ComplianceFeature> complianceFeatures = new ArrayList<>(); List<ComplianceFeature> complianceFeatures = new ArrayList<>();
try { try {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = PolicyManagementDataHolder.getInstance().getDeviceManagementService();
PolicyManager manager = new PolicyManagerImpl(); PolicyManager manager = PolicyManagementDataHolder.getInstance().getPolicyManager();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier);
Policy policy = manager.getAppliedPolicyToDevice(deviceIdentifier); Policy policy = manager.getAppliedPolicyToDevice(deviceIdentifier);
if (policy != null) { if (policy != null) {
@ -179,7 +170,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
@Override @Override
public boolean isCompliance(DeviceIdentifier deviceIdentifier) throws PolicyComplianceException { public boolean isCompliance(DeviceIdentifier deviceIdentifier) throws PolicyComplianceException {
try { try {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = PolicyManagementDataHolder.getInstance().getDeviceManagementService();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier);
PolicyManagementDAOFactory.openConnection(); PolicyManagementDAOFactory.openConnection();
ComplianceData complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo() ComplianceData complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo()
@ -209,7 +200,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
ComplianceData complianceData; ComplianceData complianceData;
try { try {
PolicyManagementDAOFactory.openConnection(); PolicyManagementDAOFactory.openConnection();
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = PolicyManagementDataHolder.getInstance().getDeviceManagementService();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier);
complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo().getId()); complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo().getId());
List<ComplianceFeature> complianceFeatures = List<ComplianceFeature> complianceFeatures =
@ -374,17 +365,13 @@ public class MonitoringManagerImpl implements MonitoringManager {
} }
@Override @Override
public List<DeviceType> getDeviceTypes() throws PolicyComplianceException { public List<String> getDeviceTypes() throws PolicyComplianceException {
List<DeviceType> deviceTypes = new ArrayList<>(); List<String> deviceTypes = new ArrayList<>();
try { try {
DeviceManagementDAOFactory.openConnection(); deviceTypes = PolicyManagementDataHolder.getInstance().getDeviceManagementService().getAvailableDeviceTypes();
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); } catch (DeviceManagementException e) {
deviceTypes = deviceTypeDAO.getDeviceTypes(tenantId); throw new PolicyComplianceException("Error occurred while getting the device types.", e);
} catch (Exception e) {
log.error("Error occurred while getting the device types.", e);
} finally {
DeviceManagementDAOFactory.closeConnection();
} }
return deviceTypes; return deviceTypes;
} }

@ -26,9 +26,6 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
import org.wso2.carbon.device.mgt.core.dao.DeviceDAO;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl;
import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService; import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService;
@ -50,14 +47,12 @@ public class PolicyManagerImpl implements PolicyManager {
private ProfileDAO profileDAO; private ProfileDAO profileDAO;
private FeatureDAO featureDAO; private FeatureDAO featureDAO;
private ProfileManager profileManager; private ProfileManager profileManager;
private DeviceDAO deviceDAO;
private static Log log = LogFactory.getLog(PolicyManagerImpl.class); private static Log log = LogFactory.getLog(PolicyManagerImpl.class);
public PolicyManagerImpl() { public PolicyManagerImpl() {
this.policyDAO = PolicyManagementDAOFactory.getPolicyDAO(); this.policyDAO = PolicyManagementDAOFactory.getPolicyDAO();
this.profileDAO = PolicyManagementDAOFactory.getProfileDAO(); this.profileDAO = PolicyManagementDAOFactory.getProfileDAO();
this.featureDAO = PolicyManagementDAOFactory.getFeatureDAO(); this.featureDAO = PolicyManagementDAOFactory.getFeatureDAO();
this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
this.profileManager = new ProfileManagerImpl(); this.profileManager = new ProfileManagerImpl();
} }

@ -40,7 +40,6 @@ import java.util.Map;
public class MonitoringTask implements Task { public class MonitoringTask implements Task {
private DeviceTypeDAO deviceTypeDAO;
private static Log log = LogFactory.getLog(MonitoringTask.class); private static Log log = LogFactory.getLog(MonitoringTask.class);
Map<String, String> properties; Map<String, String> properties;
@ -53,7 +52,6 @@ public class MonitoringTask implements Task {
@Override @Override
public void init() { public void init() {
deviceTypeDAO = DeviceManagementDAOFactory.getDeviceTypeDAO();
} }
@Override @Override
@ -63,9 +61,9 @@ public class MonitoringTask implements Task {
log.debug("Monitoring task started to run."); log.debug("Monitoring task started to run.");
} }
MonitoringManager monitoringManager = new MonitoringManagerImpl(); MonitoringManager monitoringManager = PolicyManagementDataHolder.getInstance().getMonitoringManager();
List<DeviceType> deviceTypes = new ArrayList<>(); List<String> deviceTypes = new ArrayList<>();
try { try {
deviceTypes = monitoringManager.getDeviceTypes(); deviceTypes = monitoringManager.getDeviceTypes();
} catch (PolicyComplianceException e) { } catch (PolicyComplianceException e) {
@ -79,15 +77,15 @@ public class MonitoringTask implements Task {
DeviceManagementProviderService deviceManagementProviderService = DeviceManagementProviderService deviceManagementProviderService =
PolicyManagementDataHolder.getInstance().getDeviceManagementService(); PolicyManagementDataHolder.getInstance().getDeviceManagementService();
for (DeviceType deviceType : deviceTypes) { for (String deviceType : deviceTypes) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Running task for device type : " + deviceType.getName()); log.debug("Running task for device type : " + deviceType);
} }
PolicyMonitoringService monitoringService = PolicyMonitoringService monitoringService =
PolicyManagementDataHolder.getInstance().getPolicyMonitoringService(deviceType.getName()); PolicyManagementDataHolder.getInstance().getPolicyMonitoringService(deviceType);
List<Device> devices = deviceManagementProviderService.getAllDevices(deviceType.getName()); List<Device> devices = deviceManagementProviderService.getAllDevices(deviceType);
if (monitoringService != null && !devices.isEmpty()) { if (monitoringService != null && !devices.isEmpty()) {
@ -95,7 +93,7 @@ public class MonitoringTask implements Task {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Removing inactive and blocked devices from the list for the device type : " + log.debug("Removing inactive and blocked devices from the list for the device type : " +
deviceType.getName()); deviceType);
} }
for (Device device : devices) { for (Device device : devices) {
EnrolmentInfo.Status status = device.getEnrolmentInfo().getStatus(); EnrolmentInfo.Status status = device.getEnrolmentInfo().getStatus();
@ -111,8 +109,7 @@ public class MonitoringTask implements Task {
} }
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Following devices selected to send the notification for " + log.debug("Following devices selected to send the notification for " + deviceType);
deviceType.getName());
for (Device device : notifiableDevices) { for (Device device : notifiableDevices) {
log.debug(device.getDeviceIdentifier()); log.debug(device.getDeviceIdentifier());
} }

@ -22,6 +22,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;

@ -370,7 +370,7 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
STATUS VARCHAR(10) NULL, STATUS VARCHAR(10) NULL,
DESCRIPTION VARCHAR(100) NULL, DESCRIPTION VARCHAR(1000) NULL,
PRIMARY KEY (NOTIFICATION_ID), PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,

@ -367,7 +367,7 @@ CREATE TABLE DM_NOTIFICATION (
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
STATUS VARCHAR(10) NULL, STATUS VARCHAR(10) NULL,
DESCRIPTION VARCHAR(100) NULL, DESCRIPTION VARCHAR(1000) NULL,
PRIMARY KEY (NOTIFICATION_ID), PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT FL_DM_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT FL_DM_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,

@ -428,7 +428,7 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
STATUS VARCHAR(10) NULL, STATUS VARCHAR(10) NULL,
DESCRIPTION VARCHAR(100) NULL, DESCRIPTION VARCHAR(1000) NULL,
PRIMARY KEY (NOTIFICATION_ID), PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,

@ -706,7 +706,7 @@ CREATE TABLE DM_NOTIFICATION (
OPERATION_ID NUMBER(10) NOT NULL, OPERATION_ID NUMBER(10) NOT NULL,
TENANT_ID NUMBER(10) NOT NULL, TENANT_ID NUMBER(10) NOT NULL,
STATUS VARCHAR2(10) NULL, STATUS VARCHAR2(10) NULL,
DESCRIPTION VARCHAR2(100) NULL, DESCRIPTION VARCHAR2(1000) NULL,
CONSTRAINT PK_DM_NOTIFICATION PRIMARY KEY (NOTIFICATION_ID), CONSTRAINT PK_DM_NOTIFICATION PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT FK_DM_DEVICE_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT FK_DM_DEVICE_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID), DM_DEVICE (ID),

@ -409,7 +409,7 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
STATUS VARCHAR(10) NULL, STATUS VARCHAR(10) NULL,
DESCRIPTION VARCHAR(100) NULL, DESCRIPTION VARCHAR(1000) NULL,
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES

Loading…
Cancel
Save