Refactor code to support no AAF requests
[dmaap/dbcapi.git] / src / main / java / org / onap / dmaap / dbcapi / model / MR_Client.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * org.onap.dmaap
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.dmaap.dbcapi.model;
22
23 import java.util.Date;
24
25 import javax.xml.bind.annotation.XmlRootElement;
26
27 import org.onap.dmaap.dbcapi.database.DatabaseClass;
28
29 @XmlRootElement
30 public class MR_Client extends DmaapObject {
31
32         private String dcaeLocationName;
33         private String  topicURL;
34         private String fqtn;
35         private String clientRole;
36         private String[] action;
37         private String mrClientId;
38         
39
40         public MR_Client() {
41                 this.mrClientId = DatabaseClass.getNextClientId();
42                 this.lastMod = new Date();
43                 this.setLastMod();
44                 debugLogger.debug( "MR_Client constructor " + this.lastMod );
45                         
46         }
47         
48         public MR_Client( String dLN,
49                                         String f,
50                                         String cR,
51                                         String[] a ) {
52                 this.dcaeLocationName = dLN;
53                 this.fqtn = f;
54                 this.clientRole = cR;
55                 int i = 0;
56                 
57                 if ( this.action == null ) {
58                         this.action = new String[a.length];
59                 }
60                 for( String aa : a ) {
61                         this.action[i++] = new String( aa );
62                 }
63                 this.setStatus( DmaapObject_Status.NEW );
64                 this.mrClientId = DatabaseClass.getNextClientId();
65                 this.setLastMod();
66                 debugLogger.debug( "MR_Client constructor w initialization " + this.lastMod );
67         }
68
69         public String getDcaeLocationName() {
70                 return dcaeLocationName;
71         }
72
73         public void setDcaeLocationName(String dcaeLocationName) {
74                 this.dcaeLocationName = dcaeLocationName;
75         }
76
77         public String getFqtn() {
78                 return fqtn;
79         }
80
81         public void setFqtn(String fqtn) {
82                 this.fqtn = fqtn;
83         }
84
85         public String getClientRole() {
86                 return clientRole;
87         }
88
89         public void setClientRole(String clientRole) {
90                 this.clientRole = clientRole;
91         }
92
93         public String[] getAction() {
94                 return action;
95         }
96
97         public void setAction(String[] action) {
98                 this.action = action;
99         }
100
101         public String getMrClientId() {
102                 return mrClientId;
103         }
104
105         public void setMrClientId(String mrClientId) {
106                 this.mrClientId = mrClientId;
107         }
108
109
110
111         public String getTopicURL() {
112                 return topicURL;
113         }
114
115         public void setTopicURL(String topicURL) {
116                 this.topicURL = topicURL;
117         }
118         
119 }