Merge "Removed useless parentheses"
[policy/drools-pdp.git] / feature-active-standby-management / src / main / java / org / onap / policy / drools / activestandby / DroolsPdpImpl.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * feature-active-standby-management
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.onap.policy.drools.activestandby;
22
23 import java.util.Date;
24
25 public class DroolsPdpImpl extends DroolsPdpObject {
26
27         private boolean designated;
28         private int priority;
29         private Date updatedDate;
30         private Date designatedDate;
31         private String pdpId;
32         private String site;
33         
34         public DroolsPdpImpl(String pdpId, boolean designated, int priority, Date updatedDate){
35                 this.pdpId = pdpId;
36                 this.designated = designated;
37                 this.priority = priority;
38                 this.updatedDate = updatedDate;
39                 //When this is translated to a TimeStamp in MySQL, it assumes the date is relative
40                 //to the local timezone.  So, a value of Date(0) is actually Dec 31 18:00:00 CST 1969
41                 //which is an invalid value for the MySql TimeStamp 
42                 this.designatedDate = new Date(864000000);
43
44         }
45         @Override
46         public boolean isDesignated() {
47                 
48                 return designated;
49         }
50
51         @Override
52         public int getPriority() {              
53                 return priority;
54         }
55         @Override
56         public void setUpdatedDate(Date date){
57                 this.updatedDate = date;
58         }
59         @Override
60         public Date getUpdatedDate() {          
61                 return updatedDate;
62         }
63         
64         @Override
65         public String getPdpId() {              
66                 return pdpId;
67         }
68         @Override
69         public void setDesignated(boolean isDesignated) {               
70                 this.designated = isDesignated;
71                 
72         }
73
74         @Override
75         public String getSiteName() {
76                 return site;
77         }
78         @Override
79         public void setSiteName(String siteName) {
80                 this.site = siteName;
81                 
82         }
83         @Override
84         public Date getDesignatedDate() {
85                 return designatedDate;
86         }
87         @Override
88         public void setDesignatedDate(Date designatedDate) {
89                 this.designatedDate = designatedDate;
90                 
91         }
92 }