@Test public void setDao() { ZigBeeEndpoint endpoint = getEndpoint(); ZigBeeEndpointDao dao = new ZigBeeEndpointDao(); dao.setEndpointId(1); dao.setDeviceId(2); dao.setDeviceVersion(3); dao.setProfileId(4); endpoint.setDao(dao); assertEquals(1, endpoint.getEndpointId()); assertEquals(2, endpoint.getDeviceId()); assertEquals(3, endpoint.getDeviceVersion()); assertEquals(4, endpoint.getProfileId()); }
public void setDao(ZigBeeEndpointDao dao) { endpointId = dao.getEndpointId(); if (dao.getProfileId() != null) { profileId = dao.getProfileId(); } if (dao.getDeviceId() != null) { deviceId = dao.getDeviceId(); } if (dao.getDeviceVersion() != null) { deviceVersion = dao.getDeviceVersion(); } if (dao.getInputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getInputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); inputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown input cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } if (dao.getOutputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getOutputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); outputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown output cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } }
ZigBeeEndpoint { public void setDao(ZigBeeEndpointDao dao) { endpointId = dao.getEndpointId(); if (dao.getProfileId() != null) { profileId = dao.getProfileId(); } if (dao.getDeviceId() != null) { deviceId = dao.getDeviceId(); } if (dao.getDeviceVersion() != null) { deviceVersion = dao.getDeviceVersion(); } if (dao.getInputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getInputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); inputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown input cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } if (dao.getOutputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getOutputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); outputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown output cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } } }
ZigBeeEndpoint { public void setDao(ZigBeeEndpointDao dao) { endpointId = dao.getEndpointId(); if (dao.getProfileId() != null) { profileId = dao.getProfileId(); } if (dao.getDeviceId() != null) { deviceId = dao.getDeviceId(); } if (dao.getDeviceVersion() != null) { deviceVersion = dao.getDeviceVersion(); } if (dao.getInputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getInputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); inputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown input cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } if (dao.getOutputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getOutputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); outputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown output cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } } ZigBeeEndpoint(ZigBeeNode node, int endpoint); }
ZigBeeEndpoint { public void setDao(ZigBeeEndpointDao dao) { endpointId = dao.getEndpointId(); if (dao.getProfileId() != null) { profileId = dao.getProfileId(); } if (dao.getDeviceId() != null) { deviceId = dao.getDeviceId(); } if (dao.getDeviceVersion() != null) { deviceVersion = dao.getDeviceVersion(); } if (dao.getInputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getInputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); inputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown input cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } if (dao.getOutputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getOutputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); outputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown output cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } } ZigBeeEndpoint(ZigBeeNode node, int endpoint); int getDeviceId(); void setDeviceId(int deviceId); int getDeviceVersion(); void setDeviceVersion(int deviceVersion); int getEndpointId(); Collection<Integer> getInputClusterIds(); boolean addInputCluster(ZclCluster cluster); ZclCluster getInputCluster(int clusterId); ZclCluster getOutputCluster(int clusterId); void setInputClusterIds(List<Integer> inputClusterIds); IeeeAddress getIeeeAddress(); ZigBeeEndpointAddress getEndpointAddress(); Collection<Integer> getOutputClusterIds(); void setOutputClusterIds(Collection<Integer> outputClusterIds); boolean addOutputCluster(ZclCluster cluster); int getProfileId(); void setProfileId(int profileId); ZigBeeNode getParentNode(); ZigBeeStatus addApplication(ZigBeeApplication application); ZigBeeApplication getApplication(int clusterId); void commandReceived(ZclCommand command); boolean updateEndpoint(ZigBeeEndpoint endpoint); ZigBeeEndpointDao getDao(); void setDao(ZigBeeEndpointDao dao); void sendTransaction(ZigBeeCommand command); Future<CommandResult> sendTransaction(ZigBeeCommand command, ZigBeeTransactionMatcher responseMatcher); NotificationService getNotificationService(); @Override String toString(); }
ZigBeeEndpoint { public void setDao(ZigBeeEndpointDao dao) { endpointId = dao.getEndpointId(); if (dao.getProfileId() != null) { profileId = dao.getProfileId(); } if (dao.getDeviceId() != null) { deviceId = dao.getDeviceId(); } if (dao.getDeviceVersion() != null) { deviceVersion = dao.getDeviceVersion(); } if (dao.getInputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getInputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); inputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown input cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } if (dao.getOutputClusterIds() != null) { for (ZclClusterDao clusterDao : dao.getOutputClusters()) { ZclCluster cluster = getClusterClass(clusterDao.getClusterId()); if (cluster != null) { cluster.setDao(clusterDao); outputClusters.put(clusterDao.getClusterId(), cluster); } else { logger.debug("{}: Endpoint {}. Unknown output cluster found with id={}, will skip it", getIeeeAddress(), getEndpointId(), String.format("%04X", clusterDao.getClusterId())); } } } } ZigBeeEndpoint(ZigBeeNode node, int endpoint); int getDeviceId(); void setDeviceId(int deviceId); int getDeviceVersion(); void setDeviceVersion(int deviceVersion); int getEndpointId(); Collection<Integer> getInputClusterIds(); boolean addInputCluster(ZclCluster cluster); ZclCluster getInputCluster(int clusterId); ZclCluster getOutputCluster(int clusterId); void setInputClusterIds(List<Integer> inputClusterIds); IeeeAddress getIeeeAddress(); ZigBeeEndpointAddress getEndpointAddress(); Collection<Integer> getOutputClusterIds(); void setOutputClusterIds(Collection<Integer> outputClusterIds); boolean addOutputCluster(ZclCluster cluster); int getProfileId(); void setProfileId(int profileId); ZigBeeNode getParentNode(); ZigBeeStatus addApplication(ZigBeeApplication application); ZigBeeApplication getApplication(int clusterId); void commandReceived(ZclCommand command); boolean updateEndpoint(ZigBeeEndpoint endpoint); ZigBeeEndpointDao getDao(); void setDao(ZigBeeEndpointDao dao); void sendTransaction(ZigBeeCommand command); Future<CommandResult> sendTransaction(ZigBeeCommand command, ZigBeeTransactionMatcher responseMatcher); NotificationService getNotificationService(); @Override String toString();  }