2 * Copyright © 2016-2017 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdc.activitylog.dao.type;
19 import com.datastax.driver.mapping.annotations.ClusteringColumn;
20 import com.datastax.driver.mapping.annotations.Column;
21 import com.datastax.driver.mapping.annotations.PartitionKey;
22 import com.datastax.driver.mapping.annotations.Table;
23 import org.openecomp.sdc.versioning.dao.types.Version;
25 import java.util.Date;
28 @Table(keyspace = "dox", name = "activity_log")
29 public class ActivityLogEntity {
31 @Column(name = "item_id")
32 private String itemId;
33 @ClusteringColumn(value = 1)
34 @Column(name = "version_id")
35 private String versionId;
37 @Column(name = "activity_id")
39 private ActivityType type;
41 private Date timestamp;
42 private boolean success;
43 private String message;
44 private String comment;
47 * Every entity class must have a default constructor according to
48 * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
49 * Definition of mapped classes</a>.
51 public ActivityLogEntity() {
52 // Don't delete! Default constructor is required by DataStax driver
55 public ActivityLogEntity(String itemId, Version version) {
57 this.versionId = version == null ? null : version.getId();
60 public ActivityLogEntity(String itemId, Version version, ActivityType type, String user,
61 boolean success, String message, String comment) {
62 this(itemId, version);
65 this.success = success;
66 this.message = message;
67 this.comment = comment;
68 this.timestamp = new Date();
71 public String getItemId() {
75 public void setItemId(String itemId) {
79 public String getVersionId() {
83 public void setVersionId(String versionId) {
84 this.versionId = versionId;
87 public String getId() {
91 public void setId(String id) {
95 public ActivityType getType() {
99 public void setType(ActivityType type) {
103 public String getUser() {
107 public void setUser(String user) {
111 public Date getTimestamp() {
115 public void setTimestamp(Date timestamp) {
116 this.timestamp = timestamp;
119 public boolean isSuccess() {
123 public void setSuccess(boolean success) {
124 this.success = success;
127 public String getMessage() {
131 public void setMessage(String message) {
132 this.message = message;
135 public String getComment() {
139 public void setComment(String comment) {
140 this.comment = comment;