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;
24 import lombok.NoArgsConstructor;
26 import org.openecomp.sdc.versioning.dao.types.Version;
28 import java.util.Date;
33 @Table(keyspace = "dox", name = "activity_log")
34 public class ActivityLogEntity {
36 @Column(name = "item_id")
37 private String itemId;
38 @ClusteringColumn(value = 1)
39 @Column(name = "version_id")
40 private String versionId;
42 @Column(name = "activity_id")
44 private ActivityType type;
46 private Date timestamp;
47 private boolean success;
48 private String message;
49 private String comment;
51 public ActivityLogEntity(String itemId, Version version) {
53 this.versionId = version == null ? null : version.getId();
56 public ActivityLogEntity(String itemId, Version version, ActivityType type, String user,
57 boolean success, String message, String comment) {
58 this(itemId, version);
61 this.success = success;
62 this.message = message;
63 this.comment = comment;
64 this.timestamp = new Date();