+/*******************************************************************************\r
+ * ============LICENSE_START==================================================\r
+ * * org.onap.dmaap\r
+ * * ===========================================================================\r
+ * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
+ * * ===========================================================================\r
+ * * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * * you may not use this file except in compliance with the License.\r
+ * * You may obtain a copy of the License at\r
+ * * \r
+ * * http://www.apache.org/licenses/LICENSE-2.0\r
+ * * \r
+ * * Unless required by applicable law or agreed to in writing, software\r
+ * * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * * See the License for the specific language governing permissions and\r
+ * * limitations under the License.\r
+ * * ============LICENSE_END====================================================\r
+ * *\r
+ * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
+ * *\r
+ ******************************************************************************/\r
+\r
+\r
+package com.att.research.datarouter.node;\r
+\r
+/**\r
+ * Information for a delivery destination that doesn't change from message to message\r
+ */\r
+public class DestInfo {\r
+ private String name;\r
+ private String spool;\r
+ private String subid;\r
+ private String logdata;\r
+ private String url;\r
+ private String authuser;\r
+ private String authentication;\r
+ private boolean metaonly;\r
+ private boolean use100;\r
+ /**\r
+ * Create a destination information object.\r
+ * @param name n:fqdn or s:subid\r
+ * @param spool The directory where files are spooled.\r
+ * @param subid The subscription ID (if applicable).\r
+ * @param logdata Text to be included in log messages\r
+ * @param url The URL to deliver to.\r
+ * @param authuser The auth user for logging.\r
+ * @param authentication The credentials.\r
+ * @param metaonly Is this a metadata only delivery?\r
+ * @param use100 Should I use expect 100-continue?\r
+ */\r
+ public DestInfo(String name, String spool, String subid, String logdata, String url, String authuser, String authentication, boolean metaonly, boolean use100) {\r
+ this.name = name;\r
+ this.spool = spool;\r
+ this.subid = subid;\r
+ this.logdata = logdata;\r
+ this.url = url;\r
+ this.authuser = authuser;\r
+ this.authentication = authentication;\r
+ this.metaonly = metaonly;\r
+ this.use100 = use100;\r
+ }\r
+ public boolean equals(Object o) {\r
+ return((o instanceof DestInfo) && ((DestInfo)o).spool.equals(spool));\r
+ }\r
+ public int hashCode() {\r
+ return(spool.hashCode());\r
+ }\r
+ /**\r
+ * Get the name of this destination\r
+ */\r
+ public String getName() {\r
+ return(name);\r
+ }\r
+ /**\r
+ * Get the spool directory for this destination.\r
+ * @return The spool directory\r
+ */\r
+ public String getSpool() {\r
+ return(spool);\r
+ }\r
+ /**\r
+ * Get the subscription ID.\r
+ * @return Subscription ID or null if this is a node to node delivery.\r
+ */\r
+ public String getSubId() {\r
+ return(subid);\r
+ }\r
+ /**\r
+ * Get the log data.\r
+ * @return Text to be included in a log message about delivery attempts.\r
+ */\r
+ public String getLogData() {\r
+ return(logdata);\r
+ }\r
+ /**\r
+ * Get the delivery URL.\r
+ * @return The URL to deliver to (the primary URL).\r
+ */\r
+ public String getURL() {\r
+ return(url);\r
+\r
+ }\r
+ /**\r
+ * Get the user for authentication\r
+ * @return The name of the user for logging\r
+ */\r
+ public String getAuthUser() {\r
+ return(authuser);\r
+ }\r
+ /**\r
+ * Get the authentication header\r
+ * @return The string to use to authenticate to the recipient.\r
+ */\r
+ public String getAuth() {\r
+ return(authentication);\r
+ }\r
+ /**\r
+ * Is this a metadata only delivery?\r
+ * @return True if this is a metadata only delivery\r
+ */\r
+ public boolean isMetaDataOnly() {\r
+ return(metaonly);\r
+ }\r
+ /**\r
+ * Should I send expect 100-continue header?\r
+ * @return True if I should.\r
+ */\r
+ public boolean isUsing100() {\r
+ return(use100);\r
+ }\r
+}\r