dac35ea3d627e1872803501414dbf30f9355582f
[policy/drools-pdp.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * feature-active-standby-management
4  * ================================================================================
5  * Copyright (C) 2017-2019, 2021 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.onap.policy.drools.activestandby;
22
23 import java.util.Date;
24 import lombok.EqualsAndHashCode;
25 import lombok.Getter;
26 import lombok.Setter;
27
28 @Getter
29 @Setter
30 @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)
31 public class DroolsPdpImpl extends DroolsPdpObject {
32
33     private boolean designated;
34     private int priority;
35     private Date updatedDate;
36     private Date designatedDate;
37     private String pdpId;
38     private String site;
39
40     /**
41      * Contructor.
42      *
43      * @param pdpId ID for the PDP
44      * @param designated is designated
45      * @param priority priority
46      * @param updatedDate date updated
47      */
48     public DroolsPdpImpl(String pdpId, boolean designated, int priority, Date updatedDate) {
49         this.pdpId = pdpId;
50         this.designated = designated;
51         this.priority = priority;
52         this.updatedDate = updatedDate;
53         //When this is translated to a TimeStamp in MySQL, it assumes the date is relative
54         //to the local timezone.  So, a value of Date(0) is actually Dec 31 18:00:00 CST 1969
55         //which is an invalid value for the MySql TimeStamp
56         this.designatedDate = new Date(864000000);
57     }
58 }