- private void initNodeState() throws IOException {
- nodeState = new CmsState();
- bc.registerService(LangUtils.names(NodeState.class, ManagedService.class), nodeState,
- LangUtils.init(Constants.SERVICE_PID, NodeConstants.NODE_STATE_PID));
-
- Configuration nodeConf = configurationAdmin.getConfiguration(NodeConstants.NODE_STATE_PID);
- Dictionary<String, Object> props = nodeConf.getProperties();
- if (props == null) {
- if (log.isDebugEnabled())
- log.debug("Clean node state");
- Dictionary<String, Object> envProps = getStatePropertiesFromEnvironment();
- nodeConf.update(envProps);
+ private void initNode() throws IOException {
+ // Node state
+ Path stateUuidPath = bc.getDataFile("stateUuid").toPath();
+ String stateUuid;
+ if (Files.exists(stateUuidPath)) {
+ stateUuid = Files.readAllLines(stateUuidPath).get(0);