1 /*******************************************************************************
2 * ============LICENSE_START==================================================
4 * * ===========================================================================
5 * * Copyright © 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====================================================
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 ******************************************************************************/
25 package org.onap.dmaap.datarouter.node;
28 * Information for a delivery destination that doesn't change from message to message
30 public class DestInfo {
34 private String logdata;
36 private String authuser;
37 private String authentication;
38 private boolean metaonly;
39 private boolean use100;
42 * Create a destination information object.
44 * @param name n:fqdn or s:subid
45 * @param spool The directory where files are spooled.
46 * @param subid The subscription ID (if applicable).
47 * @param logdata Text to be included in log messages
48 * @param url The URL to deliver to.
49 * @param authuser The auth user for logging.
50 * @param authentication The credentials.
51 * @param metaonly Is this a metadata only delivery?
52 * @param use100 Should I use expect 100-continue?
54 public DestInfo(String name, String spool, String subid, String logdata, String url, String authuser, String authentication, boolean metaonly, boolean use100) {
58 this.logdata = logdata;
60 this.authuser = authuser;
61 this.authentication = authentication;
62 this.metaonly = metaonly;
66 public boolean equals(Object o) {
67 return ((o instanceof DestInfo) && ((DestInfo) o).spool.equals(spool));
70 public int hashCode() {
71 return (spool.hashCode());
75 * Get the name of this destination
77 public String getName() {
82 * Get the spool directory for this destination.
84 * @return The spool directory
86 public String getSpool() {
91 * Get the subscription ID.
93 * @return Subscription ID or null if this is a node to node delivery.
95 public String getSubId() {
102 * @return Text to be included in a log message about delivery attempts.
104 public String getLogData() {
109 * Get the delivery URL.
111 * @return The URL to deliver to (the primary URL).
113 public String getURL() {
119 * Get the user for authentication
121 * @return The name of the user for logging
123 public String getAuthUser() {
128 * Get the authentication header
130 * @return The string to use to authenticate to the recipient.
132 public String getAuth() {
133 return (authentication);
137 * Is this a metadata only delivery?
139 * @return True if this is a metadata only delivery
141 public boolean isMetaDataOnly() {
146 * Should I send expect 100-continue header?
148 * @return True if I should.
150 public boolean isUsing100() {