e84a2be40af54dfec4e3fff632684fb6e5805b1d
[sdc.git] /
1 /*
2  * Copyright © 2016-2017 European Support Limited
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.openecomp.sdc.activitylog.dao.type;
18
19 import com.datastax.driver.mapping.annotations.*;
20 import org.openecomp.sdc.versioning.dao.types.Version;
21
22 import java.util.Calendar;
23 import java.util.Date;
24
25 @Table(keyspace = "dox", name = "activity_log")
26 public class ActivityLogEntity {
27     @PartitionKey
28     @Column(name = "item_id")
29     private String itemId;
30     @ClusteringColumn(value = 1)
31     @Column(name = "version_id")
32     private String versionId;
33     @ClusteringColumn
34     @Column(name = "activity_id")
35     private String id;
36     private String type;
37     private String user;
38     private Date timestamp;
39     private boolean success;
40     private String message;
41     private String comment;
42
43     public ActivityLogEntity() {}
44
45     public ActivityLogEntity(String itemId, String versionId, String type, String user, boolean success, String message, String comment) {
46         this.itemId = itemId;
47         this.versionId = versionId;
48         this.type = type;
49         this.user = user;
50         this.success = success;
51         this.message = message;
52         this.comment = comment;
53         Calendar now = Calendar.getInstance();
54         this.timestamp = now.getTime();
55     }
56
57     public String getItemId() { return itemId; }
58
59     public void setItemId(String itemId) {
60         this.itemId = itemId;
61     }
62
63     public String getVersionId() {
64         return versionId;
65     }
66
67     public void setVersionId(String versionId) {
68         this.versionId = versionId;
69     }
70
71     public String getId() { return id; }
72
73     public void setId(String id) { this.id = id; }
74
75     public String getType() {
76         return type;
77     }
78
79     public void setType(String type) {
80         this.type = type;
81     }
82
83     public String getUser() {
84         return user;
85     }
86
87     public void setUser(String user) {
88         this.user = user;
89     }
90
91     public Date getTimestamp() {
92         return timestamp;
93     }
94
95     public void setTimestamp(Date timestamp) {
96         this.timestamp = timestamp;
97     }
98
99     public boolean isSuccess() {
100         return success;
101     }
102
103     public void setSuccess(boolean success) {
104         this.success = success;
105     }
106
107     public String getMessage() {
108         return message;
109     }
110
111     public void setMessage(String message) {
112         this.message = message;
113     }
114
115     public String getComment() {
116         return comment;
117     }
118
119     public void setComment(String comment) {
120         this.comment = comment;
121     }
122 }