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.Enumerated;
22 import com.datastax.driver.mapping.annotations.PartitionKey;
23 import com.datastax.driver.mapping.annotations.Table;
24 import org.openecomp.sdc.versioning.dao.types.Version;
26 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")
40 private ActivityType type;
42 private Date timestamp;
43 private boolean success;
44 private String message;
45 private String comment;
47 public ActivityLogEntity() {
50 public ActivityLogEntity(String itemId, Version version) {
55 public ActivityLogEntity(String itemId, Version version, ActivityType type, String user,
56 boolean success, String message, String comment) {
57 this(itemId, version);
60 this.success = success;
61 this.message = message;
62 this.comment = comment;
63 this.timestamp = new Date();
66 public String getItemId() {
70 public void setItemId(String itemId) {
74 public Version getVersion() {
75 return versionId == null ? null : new Version(versionId);
78 public void setVersion(Version version) {
79 this.versionId = version == null ? null : version.getId();
82 public String getVersionId() {
86 public void setVersionId(String versionId) {
87 this.versionId = versionId;
90 public String getId() {
94 public void setId(String id) {
98 public ActivityType getType() {
102 public void setType(ActivityType type) {
106 public String getUser() {
110 public void setUser(String user) {
114 public Date getTimestamp() {
118 public void setTimestamp(Date timestamp) {
119 this.timestamp = timestamp;
122 public boolean isSuccess() {
126 public void setSuccess(boolean success) {
127 this.success = success;
130 public String getMessage() {
134 public void setMessage(String message) {
135 this.message = message;
138 public String getComment() {
142 public void setComment(String comment) {
143 this.comment = comment;