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