2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 package org.openecomp.sparky.synchronizer.entity;
28 import java.sql.Timestamp;
29 import java.text.SimpleDateFormat;
31 import org.openecomp.sparky.config.oxm.OxmModelLoader;
34 * The Class IndexableEntity.
36 public abstract class IndexableEntity {
37 protected String id; // generated, SHA-256 digest
38 protected String entityType;
39 protected String entityPrimaryKeyValue;
40 protected String lastmodTimestamp;
41 protected String link;
42 protected OxmModelLoader loader;
44 private static final String TIMESTAMP_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
47 * Instantiates a new indexable entity.
49 public IndexableEntity() {
50 SimpleDateFormat dateFormat = new SimpleDateFormat(TIMESTAMP_FORMAT);
51 Timestamp timestamp = new Timestamp(System.currentTimeMillis());
52 String currentFormattedTimeStamp = dateFormat.format(timestamp);
53 this.setEntityTimeStamp(currentFormattedTimeStamp);
57 * Instantiates a new indexable entity.
59 * @param loader the loader
61 public IndexableEntity(OxmModelLoader loader) {
66 public String getId() {
70 public String getEntityType() {
74 public String getEntityPrimaryKeyValue() {
75 return entityPrimaryKeyValue;
78 public String getEntityTimeStamp() {
79 return lastmodTimestamp;
82 public void setId(String id) {
86 public void setEntityType(String entityType) {
87 this.entityType = entityType;
90 public void setEntityPrimaryKeyValue(String fieldValue) {
91 this.entityPrimaryKeyValue = fieldValue;
94 public void setEntityTimeStamp(String lastmodTimestamp) {
95 this.lastmodTimestamp = lastmodTimestamp;
98 public String getLink() {
102 public void setLink(String link) {