2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.dmaap.dbcapi.model;
23 import javax.xml.bind.annotation.XmlRootElement;
25 import org.onap.dmaap.dbcapi.util.RandomString;
28 public class DR_Pub extends DmaapObject {
30 private String dcaeLocationName;
31 private String username;
32 private String userpwd;
33 private String feedId;
38 status = DmaapObject_Status.EMPTY;
42 public DR_Pub( String dLN ) {
43 this.dcaeLocationName = dLN;
44 this.status = DmaapObject_Status.STAGED;
47 public DR_Pub( String dLN,
52 this.dcaeLocationName = dLN;
57 this.status = DmaapObject_Status.VALID;
61 public DR_Pub( String dLN,
65 this.dcaeLocationName = dLN;
69 this.pubId = fI + "." + DR_Pub.nextKey();
70 this.status = DmaapObject_Status.VALID;
74 public String getDcaeLocationName() {
75 return dcaeLocationName;
78 public void setDcaeLocationName(String dcaeLocationName) {
79 this.dcaeLocationName = dcaeLocationName;
82 public String getUsername() {
86 public void setUsername(String username) {
87 this.username = username;
90 public String getUserpwd() {
94 public void setUserpwd(String userpwd) {
95 this.userpwd = userpwd;
98 public String getFeedId() {
102 public void setFeedId(String feedId) {
103 this.feedId = feedId;
106 public String getPubId() {
110 public void setPubId(String pubId) {
114 public void setNextPubId() {
115 this.pubId = this.feedId + "." + DR_Pub.nextKey();
118 public DR_Pub setRandomUserName() {
119 RandomString r = new RandomString(15);
120 this.username = "tmp_" + r.nextString();
123 public DR_Pub setRandomPassword() {
124 RandomString r = new RandomString(15);
125 this.userpwd = r.nextString();
129 public static String nextKey() {
130 RandomString ri = new RandomString(5);
131 return ri.nextString();