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