Test coverage : openecomp-sdc-notification-api
[sdc.git] / openecomp-be / lib / openecomp-sdc-notification-lib / openecomp-sdc-notification-api / src / main / java / org / openecomp / sdc / notification / dao / types / NotificationEntity.java
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.notification.dao.types;
18
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
24 import java.util.UUID;
25
26 import lombok.AllArgsConstructor;
27 import lombok.Data;
28 import lombok.NoArgsConstructor;
29
30 @Data
31 @NoArgsConstructor
32 @AllArgsConstructor
33 @Table(keyspace = "dox", name = "notifications")
34 public class NotificationEntity {
35
36     public static final String ENTITY_TYPE = "Event Notification";
37
38     @PartitionKey
39     @Column(name = "owner_id")
40     private String ownerId;
41
42     @Column(name = "read")
43     private boolean read;
44
45     @ClusteringColumn
46     @Column(name = "event_id")
47     private UUID eventId;
48
49     @Column(name = "event_type")
50     private String eventType;
51
52     @Column(name = "event_attributes")
53     private String eventAttributes;
54
55     @Column(name = "originator_id")
56     private String originatorId;
57
58     public NotificationEntity(String ownerId) {
59         this.ownerId = ownerId;
60     }
61
62     public NotificationEntity(String ownerId, UUID eventId, String eventType, String originatorId) {
63         this(ownerId, false, eventId, eventType, null, originatorId);
64     }
65
66     public NotificationEntity(String ownerId, UUID eventId) {
67         this(ownerId, eventId, null, null);
68     }
69 }