2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.resources.data;
23 import org.openecomp.sdc.be.dao.graph.datatype.GraphNode;
24 import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
25 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
27 import java.util.HashMap;
30 public class GraphNodeLock extends GraphNode {
32 private String uniqueId;
35 public GraphNodeLock() {
36 super(NodeTypeEnum.LockNode);
37 time = System.currentTimeMillis();
40 public GraphNodeLock(String uniqueId) {
42 this.uniqueId = uniqueId;
45 public GraphNodeLock(Map<String, Object> properties) {
46 super(NodeTypeEnum.LockNode);
48 setUniqueId((String) properties.get(GraphPropertiesDictionary.UNIQUE_ID.getProperty()));
49 setTime((Long) properties.get(GraphPropertiesDictionary.CREATION_DATE.getProperty()));
53 public String getUniqueId() {
58 public Map<String, Object> toGraphMap() {
60 Map<String, Object> map = new HashMap<>();
62 addIfExists(map, GraphPropertiesDictionary.UNIQUE_ID, uniqueId);
63 addIfExists(map, GraphPropertiesDictionary.CREATION_DATE, time);
67 public void setUniqueId(String uniqueId) {
68 this.uniqueId = uniqueId;
71 public Long getTime() {
75 public void setTime(Long time) {