1 /*******************************************************************************
\r
2 * ============LICENSE_START==================================================
\r
4 * * ===========================================================================
\r
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * * ===========================================================================
\r
7 * * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * * you may not use this file except in compliance with the License.
\r
9 * * You may obtain a copy of the License at
\r
11 * * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * * Unless required by applicable law or agreed to in writing, software
\r
14 * * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * * See the License for the specific language governing permissions and
\r
17 * * limitations under the License.
\r
18 * * ============LICENSE_END====================================================
\r
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 ******************************************************************************/
\r
25 package com.att.research.datarouter.node;
\r
28 * Information for a delivery destination that doesn't change from message to message
\r
30 public class DestInfo {
\r
31 private String name;
\r
32 private String spool;
\r
33 private String subid;
\r
34 private String logdata;
\r
36 private String authuser;
\r
37 private String authentication;
\r
38 private boolean metaonly;
\r
39 private boolean use100;
\r
41 * Create a destination information object.
\r
42 * @param name n:fqdn or s:subid
\r
43 * @param spool The directory where files are spooled.
\r
44 * @param subid The subscription ID (if applicable).
\r
45 * @param logdata Text to be included in log messages
\r
46 * @param url The URL to deliver to.
\r
47 * @param authuser The auth user for logging.
\r
48 * @param authentication The credentials.
\r
49 * @param metaonly Is this a metadata only delivery?
\r
50 * @param use100 Should I use expect 100-continue?
\r
52 public DestInfo(String name, String spool, String subid, String logdata, String url, String authuser, String authentication, boolean metaonly, boolean use100) {
\r
56 this.logdata = logdata;
\r
58 this.authuser = authuser;
\r
59 this.authentication = authentication;
\r
60 this.metaonly = metaonly;
\r
61 this.use100 = use100;
\r
63 public boolean equals(Object o) {
\r
64 return((o instanceof DestInfo) && ((DestInfo)o).spool.equals(spool));
\r
66 public int hashCode() {
\r
67 return(spool.hashCode());
\r
70 * Get the name of this destination
\r
72 public String getName() {
\r
76 * Get the spool directory for this destination.
\r
77 * @return The spool directory
\r
79 public String getSpool() {
\r
83 * Get the subscription ID.
\r
84 * @return Subscription ID or null if this is a node to node delivery.
\r
86 public String getSubId() {
\r
91 * @return Text to be included in a log message about delivery attempts.
\r
93 public String getLogData() {
\r
97 * Get the delivery URL.
\r
98 * @return The URL to deliver to (the primary URL).
\r
100 public String getURL() {
\r
105 * Get the user for authentication
\r
106 * @return The name of the user for logging
\r
108 public String getAuthUser() {
\r
112 * Get the authentication header
\r
113 * @return The string to use to authenticate to the recipient.
\r
115 public String getAuth() {
\r
116 return(authentication);
\r
119 * Is this a metadata only delivery?
\r
120 * @return True if this is a metadata only delivery
\r
122 public boolean isMetaDataOnly() {
\r
126 * Should I send expect 100-continue header?
\r
127 * @return True if I should.
\r
129 public boolean isUsing100() {
\r