\r
create a feed:\r
\r
-curl -v -X POST -H "Content-Type : application/vnd.att-dr.feed" -H "X-ATT-DR-ON-BEHALF-OF: rs873m" --data-ascii @/opt/app/datartr/addFeed3.txt --post301 --location-trusted -k https://dmaap-dr-prov:8443\r
+curl -v -X POST -H "Content-Type : application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF: rs873m" --data-ascii @/opt/app/datartr/addFeed3.txt --post301 --location-trusted -k https://dmaap-dr-prov:8443\r
\r
Subscribe to feed:\r
\r
-curl -v -X POST -H "Content-Type: application/vnd.att-dr.subscription" -H "X-ATT-DR-ON-BEHALF-OF: rs873m" --data-ascii @/opt/app/datartr/addSubscriber.txt --post301 --location-trusted -k https://dmaap-dr-prov:8443/subscribe/1\r
+curl -v -X POST -H "Content-Type: application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF: rs873m" --data-ascii @/opt/app/datartr/addSubscriber.txt --post301 --location-trusted -k https://dmaap-dr-prov:8443/subscribe/1\r
\r
Publish to feed:\r
\r
<parent>
<groupId>org.onap.dmaap.datarouter</groupId>
<artifactId>parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>datarouter-docker-compose</artifactId>
<parent>
<groupId>org.onap.dmaap.datarouter</groupId>
<artifactId>parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>datarouter-node</artifactId>
i = s.indexOf('\t');
String h = s.substring(0, i);
String v = s.substring(i + 1);
- if ("x-att-dr-routing".equalsIgnoreCase(h)) {
+ if ("x-dmaap-dr-routing".equalsIgnoreCase(h)) {
subid = v.replaceAll("[^ ]*/", "");
feedid = dth.getFeedId(subid.replaceAll(" .*", ""));
}
uc.setRequestMethod(method);
uc.setRequestProperty("Content-Length", Long.toString(length));
uc.setRequestProperty("Authorization", di.getAuth());
- uc.setRequestProperty("X-ATT-DR-PUBLISH-ID", pubid);
+ uc.setRequestProperty("X-DMAAP-DR-PUBLISH-ID", pubid);
for (String[] nv : hdrs) {
uc.addRequestProperty(nv[0], nv[1]);
}
InputStream is;
if (rc >= 200 && rc <= 299) {
is = uc.getInputStream();
- xpubid = uc.getHeaderField("X-ATT-DR-PUBLISH-ID");
+ xpubid = uc.getHeaderField("X-DMAAP-DR-PUBLISH-ID");
} else {
if (rc >= 300 && rc <= 399) {
rmsg = uc.getHeaderField("Location");
NodeUtils.setRequestIdAndInvocationId(req);
eelflogger.info(EelfMsgs.ENTRY);
try {
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-ATT-DR-ON-BEHALF-OF"),
+ eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-DMAAP-DR-ON-BEHALF-OF"),
getIdFromPath(req) + "");
try {
if (down(resp)) {
NodeUtils.setIpAndFqdnForEelf("doPut");
NodeUtils.setRequestIdAndInvocationId(req);
eelflogger.info(EelfMsgs.ENTRY);
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-ATT-DR-ON-BEHALF-OF"),
+ eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-DMAAP-DR-ON-BEHALF-OF"),
getIdFromPath(req) + "");
try {
common(req, resp, true);
NodeUtils.setIpAndFqdnForEelf("doDelete");
NodeUtils.setRequestIdAndInvocationId(req);
eelflogger.info(EelfMsgs.ENTRY);
- eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-ATT-DR-ON-BEHALF-OF"),
+ eelflogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_FEEDID, req.getHeader("X-DMAAP-DR-ON-BEHALF-OF"),
getIdFromPath(req) + "");
try {
common(req, resp, false);
feedid = fileid.substring(0, i);
fileid = fileid.substring(i + 1);
pubid = config.getPublishId();
- xpubid = req.getHeader("X-ATT-DR-PUBLISH-ID");
+ xpubid = req.getHeader("X-DMAAP-DR-PUBLISH-ID");
targets = config.getTargets(feedid);
} else if (fileid.startsWith("/internal/publish/")) {
if (!config.isAnotherNode(credentials, ip)) {
return;
}
fileid = fileid.substring(18);
- pubid = req.getHeader("X-ATT-DR-PUBLISH-ID");
- targets = config.parseRouting(req.getHeader("X-ATT-DR-ROUTING"));
+ pubid = req.getHeader("X-DMAAP-DR-PUBLISH-ID");
+ targets = config.parseRouting(req.getHeader("X-DMAAP-DR-ROUTING"));
} else {
logger.info("NODE0105 Rejecting bad URI for PUT or DELETE of " + req.getPathInfo() + " from " + req
.getRemoteAddr());
eelflogger.info(EelfMsgs.EXIT);
return;
}
- resp.setHeader("X-ATT-DR-PUBLISH-ID", pubid);
+ resp.setHeader("X-DMAAP-DR-PUBLISH-ID", pubid);
}
String fbase = config.getSpoolDir() + "/" + pubid;
File data = new File(fbase);
"content-language".equals(hnlc) ||
"content-md5".equals(hnlc) ||
"content-range".equals(hnlc))) ||
- "x-att-dr-meta".equals(hnlc) ||
- (feedid == null && "x-att-dr-received".equals(hnlc)) ||
- (hnlc.startsWith("x-") && !hnlc.startsWith("x-att-dr-"))) {
+ "x-dmaap-dr-meta".equals(hnlc) ||
+ (feedid == null && "x-dmaap-dr-received".equals(hnlc)) ||
+ (hnlc.startsWith("x-") && !hnlc.startsWith("x-dmaap-dr-"))) {
Enumeration hvals = req.getHeaders(hn);
while (hvals.hasMoreElements()) {
String hv = (String) hvals.nextElement();
if ("x-invocationid".equals(hnlc)) {
hasInvocationIdHeader = true;
}
- if ("x-att-dr-meta".equals(hnlc)) {
+ if ("x-dmaap-dr-meta".equals(hnlc)) {
if (hv.length() > 4096) {
logger.info(
"NODE0109 Rejecting publish attempt with metadata too long for feed " + feedid
if(!hasInvocationIdHeader){
mx.append("X-InvocationID\t").append(MDC.get("InvocationId")).append('\n');
}
- mx.append("X-ATT-DR-RECEIVED\t").append(rcvd).append('\n');
+ mx.append("X-DMAAP-DR-RECEIVED\t").append(rcvd).append('\n');
String metadata = mx.toString();
byte[] buf = new byte[1024 * 1024];
int i;
mw = new FileWriter(meta);
mw.write(metadata);
if (di.getSubId() == null) {
- mw.write("X-ATT-DR-ROUTING\t" + t.getRouting() + "\n");
+ mw.write("X-DMAAP-DR-ROUTING\t" + t.getRouting() + "\n");
}
mw.close();
meta.renameTo(new File(dbase + ".M"));
setUpConfig();
setUpNodeMainDelivery();
when(request.getHeader("Authorization")).thenReturn("User1");
- when(request.getHeader("X-ATT-DR-PUBLISH-ID")).thenReturn("User1");
+ when(request.getHeader("X-DMAAP-DR-PUBLISH-ID")).thenReturn("User1");
}
@Test
private void setBehalfHeader(String headerValue) {
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF")).thenReturn(headerValue);
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF")).thenReturn(headerValue);
}
private ListAppender<ILoggingEvent> setTestLogger() {
}
List<String> headers = new ArrayList<>();
headers.add("Content-Type");
- headers.add("X-ATT-DR-ON-BEHALF-OF");
- headers.add("X-ATT-DR-META");
+ headers.add("X-DMAAP-DR-ON-BEHALF-OF");
+ headers.add("X-DMAAP-DR-META");
Enumeration<String> headerNames = Collections.enumeration(headers);
when(request.getHeaderNames()).thenReturn(headerNames);
Enumeration<String> contentTypeHeader = Collections.enumeration(Arrays.asList("text/plain"));
Enumeration<String> behalfHeader = Collections.enumeration(Arrays.asList("User1"));
Enumeration<String> metaDataHeader = Collections.enumeration(Arrays.asList(metaDataString));
when(request.getHeaders("Content-Type")).thenReturn(contentTypeHeader);
- when(request.getHeaders("X-ATT-DR-ON-BEHALF-OF")).thenReturn(behalfHeader);
- when(request.getHeaders("X-ATT-DR-META")).thenReturn(metaDataHeader);
+ when(request.getHeaders("X-DMAAP-DR-ON-BEHALF-OF")).thenReturn(behalfHeader);
+ when(request.getHeaders("X-DMAAP-DR-META")).thenReturn(metaDataHeader);
}
}
<parent>\r
<groupId>org.onap.dmaap.datarouter</groupId>\r
<artifactId>parent</artifactId>\r
- <version>1.1.0-SNAPSHOT</version>\r
+ <version>2.0.0-SNAPSHOT</version>\r
<relativePath>../pom.xml</relativePath>\r
</parent>\r
<artifactId>datarouter-prov</artifactId>\r
private Logger log;
private ProvDataProvider provData;
- private static final String SUBJECT_HEADER = "X-ATT-DR-ON-BEHALF-OF"; // HTTP header carrying requester identity
- private static final String SUBJECT_HEADER_GROUP = "X-ATT-DR-ON-BEHALF-OF-GROUP"; // HTTP header carrying requester identity by group Rally : US708115
+ private static final String SUBJECT_HEADER = "X-DMAAP-DR-ON-BEHALF-OF"; // HTTP header carrying requester identity
+ private static final String SUBJECT_HEADER_GROUP = "X-DMAAP-DR-ON-BEHALF-OF-GROUP"; // HTTP header carrying requester identity by group Rally : US708115
/** Constructor. For the moment, do nothing special. Make it a singleton?
*
*/
@SuppressWarnings("serial")
public class BaseServlet extends HttpServlet implements ProvDataProvider {
- public static final String BEHALF_HEADER = "X-ATT-DR-ON-BEHALF-OF";
- static final String FEED_BASECONTENT_TYPE = "application/vnd.att-dr.feed";
- public static final String FEED_CONTENT_TYPE = "application/vnd.att-dr.feed; version=2.0";
- public static final String FEEDFULL_CONTENT_TYPE = "application/vnd.att-dr.feed-full; version=2.0";
- public static final String FEEDLIST_CONTENT_TYPE = "application/vnd.att-dr.feed-list; version=1.0";
- static final String SUB_BASECONTENT_TYPE = "application/vnd.att-dr.subscription";
- public static final String SUB_CONTENT_TYPE = "application/vnd.att-dr.subscription; version=2.0";
- public static final String SUBFULL_CONTENT_TYPE = "application/vnd.att-dr.subscription-full; version=2.0";
- static final String SUBLIST_CONTENT_TYPE = "application/vnd.att-dr.subscription-list; version=1.0";
+ public static final String BEHALF_HEADER = "X-DMAAP-DR-ON-BEHALF-OF";
+ static final String FEED_BASECONTENT_TYPE = "application/vnd.dmaap-dr.feed";
+ public static final String FEED_CONTENT_TYPE = "application/vnd.dmaap-dr.feed; version=2.0";
+ public static final String FEEDFULL_CONTENT_TYPE = "application/vnd.dmaap-dr.feed-full; version=2.0";
+ public static final String FEEDLIST_CONTENT_TYPE = "application/vnd.dmaap-dr.feed-list; version=1.0";
+ static final String SUB_BASECONTENT_TYPE = "application/vnd.dmaap-dr.subscription";
+ public static final String SUB_CONTENT_TYPE = "application/vnd.dmaap-dr.subscription; version=2.0";
+ public static final String SUBFULL_CONTENT_TYPE = "application/vnd.dmaap-dr.subscription-full; version=2.0";
+ static final String SUBLIST_CONTENT_TYPE = "application/vnd.dmaap-dr.subscription-list; version=1.0";
//Adding groups functionality, ...1610
- static final String GROUP_BASECONTENT_TYPE = "application/vnd.att-dr.group";
- static final String GROUPFULL_CONTENT_TYPE = "application/vnd.att-dr.group-full; version=2.0";
+ static final String GROUP_BASECONTENT_TYPE = "application/vnd.dmaap-dr.group";
+ static final String GROUPFULL_CONTENT_TYPE = "application/vnd.dmaap-dr.group-full; version=2.0";
- public static final String LOGLIST_CONTENT_TYPE = "application/vnd.att-dr.log-list; version=1.0";
- public static final String PROVFULL_CONTENT_TYPE1 = "application/vnd.att-dr.provfeed-full; version=1.0";
- public static final String PROVFULL_CONTENT_TYPE2 = "application/vnd.att-dr.provfeed-full; version=2.0";
+ public static final String LOGLIST_CONTENT_TYPE = "application/vnd.dmaap-dr.log-list; version=1.0";
+ public static final String PROVFULL_CONTENT_TYPE1 = "application/vnd.dmaap-dr.provfeed-full; version=1.0";
+ public static final String PROVFULL_CONTENT_TYPE2 = "application/vnd.dmaap-dr.provfeed-full; version=2.0";
public static final String CERT_ATTRIBUTE = "javax.servlet.request.X509Certificate";
static final String DB_PROBLEM_MSG = "There has been a problem with the DB. It is suggested you try the operation again.";
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
- feed.setPublisher(bhdr); // set from X-ATT-DR-ON-BEHALF-OF header
+ feed.setPublisher(bhdr); // set from X-DMAAP-DR-ON-BEHALF-OF header
// Check if this feed already exists
Feed feed2 = Feed.getFeedByNameVersion(feed.getName(), feed.getVersion());
return;
}
feed.setFeedid(feedid);
- feed.setPublisher(bhdr); // set from X-ATT-DR-ON-BEHALF-OF header
+ feed.setPublisher(bhdr); // set from X-DMAAP-DR-ON-BEHALF-OF header
- String subjectgroup = (req.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")); //Adding for group feature:Rally US708115
+ String subjectgroup = (req.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")); //Adding for group feature:Rally US708115
if (!oldFeed.getPublisher().equals(feed.getPublisher()) && subjectgroup == null) {
message = "This feed must be modified by the same publisher that created it.";
elr.setMessage(message);
return;
}
//gup.setFeedid(feedid);
- //sub.setSubscriber(bhdr); // set from X-ATT-DR-ON-BEHALF-OF header
+ //sub.setSubscriber(bhdr); // set from X-DMAAP-DR-ON-BEHALF-OF header
// Check if this group already exists; not an error (yet), just warn
Group gb2 = Group.getGroupMatching(gup);
return;
}
sub.setFeedid(feedid);
- sub.setSubscriber(bhdr); // set from X-ATT-DR-ON-BEHALF-OF header
+ sub.setSubscriber(bhdr); // set from X-DMAAP-DR-ON-BEHALF-OF header
// Check if this subscription already exists; not an error (yet), just warn
Subscription sub2 = Subscription.getSubscriptionMatching(sub);
@SuppressWarnings("serial")\r
public class SubscriptionServlet extends ProxyServlet {\r
\r
- public static final String SUBCNTRL_CONTENT_TYPE = "application/vnd.att-dr.subscription-control";\r
+ public static final String SUBCNTRL_CONTENT_TYPE = "application/vnd.dmaap-dr.subscription-control";\r
//Adding EELF Logger Rally:US664892\r
private static EELFLogger eelflogger = EELFManager.getInstance()\r
.getLogger(SubscriptionServlet.class);\r
}\r
sub.setSubid(oldsub.getSubid());\r
sub.setFeedid(oldsub.getFeedid());\r
- sub.setSubscriber(bhdr); // set from X-ATT-DR-ON-BEHALF-OF header\r
+ sub.setSubscriber(bhdr); // set from X-DMAAP-DR-ON-BEHALF-OF header\r
\r
- String subjectgroup = (req.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")); //Adding for group feature:Rally US708115\r
+ String subjectgroup = (req.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")); //Adding for group feature:Rally US708115\r
if (!oldsub.getSubscriber().equals(sub.getSubscriber()) && subjectgroup == null) {\r
message = "This subscriber must be modified by the same subscriber that created it.";\r
elr.setMessage(message);\r
\r
/**\r
* This class is used to log provisioning server events. Each event consists of a who\r
- * (who made the provisioning request including the IP address, the X-ATT-DR-ON-BEHALF-OF\r
+ * (who made the provisioning request including the IP address, the X-DMAAP-DR-ON-BEHALF-OF\r
* header value, and the client certificate), a what (what request was made; the method\r
* and servlet involved), and a how (how the request was handled; the result code and\r
* message returned to the client). EventLogRecords are logged using log4j at the INFO level.\r
public Feed(JSONObject jo) throws InvalidObjectException {\r
this("", "", "", "");\r
try {\r
- // The JSONObject is assumed to contain a vnd.att-dr.feed representation\r
+ // The JSONObject is assumed to contain a vnd.dmaap-dr.feed representation\r
this.feedid = jo.optInt("feedid", -1);\r
this.groupid = jo.optInt("groupid"); //New field is added - Groups feature Rally:US708115 - 1610\r
this.name = jo.getString("name");\r
public Group(JSONObject jo) throws InvalidObjectException {\r
this("", "", "");\r
try {\r
- // The JSONObject is assumed to contain a vnd.att-dr.group representation\r
+ // The JSONObject is assumed to contain a vnd.dmaap-dr.group representation\r
this.groupid = jo.optInt("groupid", -1);\r
String gname = jo.getString("name");\r
String gdescription = jo.getString("description");\r
public Subscription(JSONObject jo) throws InvalidObjectException {\r
this("", "", "");\r
try {\r
- // The JSONObject is assumed to contain a vnd.att-dr.subscription representation\r
+ // The JSONObject is assumed to contain a vnd.dmaap-dr.subscription representation\r
this.subid = jo.optInt(SUBID_KEY, -1);\r
this.feedid = jo.optInt(FEEDID_KEY, -1);\r
this.groupid = jo.optInt(GROUPID_KEY, -1); //New field is added - Groups feature Rally:US708115 - 1610\r
@Test
public void testNormalNoCtVersion() {
JSONObject jo = buildFeedRequest();
- testCommon(jo, HttpServletResponse.SC_CREATED, "application/vnd.att-dr.feed", "JUnit");
+ testCommon(jo, HttpServletResponse.SC_CREATED, "application/vnd.dmaap-dr.feed", "JUnit");
}
@Test
}
}
/*
-curl -v -X POST -H 'X-ATT-DR-ON-BEHALF-OF: tester' -H 'Content-type: application/vnd.att-dr.feed' \
+curl -v -X POST -H 'X-DMAAP-DR-ON-BEHALF-OF: tester' -H 'Content-type: application/vnd.dmaap-dr.feed' \
--user publisher:tomcat \
--data "$data" http://127.0.0.1:8080/prov/feed/
*/
@Test
public void Given_Request_Is_HTTP_POST_And_Content_Header_Is_Not_Supported_Type_Then_Unsupported_Media_Type_Response_Is_Generated()
throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.feed; version=1.1");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.feed; version=1.1");
when(request.getContentType()).thenReturn("stub_contentType");
drfeedsServlet.doPost(request, response);
verify(response)
@Test
public void Given_Request_Is_HTTP_POST_And_Feed_Is_Not_Valid_Object_Bad_Request_Response_Is_Generated()
throws Exception {
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn(null);
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn(null);
JSONObject JSObject = buildRequestJsonObject();
DRFeedsServlet drfeedsServlet = new DRFeedsServlet() {
}
private void setUpValidContentHeadersAndJSONOnHttpRequest() {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.feed; version=1.0");
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.feed; version=1.0");
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
}
}
@Test
public void Given_Request_Is_HTTP_PUT_And_Content_Header_Is_Not_Supported_Type_Then_Unsupported_Media_Type_Response_Is_Generated()
throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.feed-fail; version=2.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.feed-fail; version=2.0");
when(request.getContentType()).thenReturn("stub_contentType");
feedServlet.doPut(request, response);
verify(response)
@Test
public void Given_Request_Is_HTTP_PUT_And_Feed_Change_Is_Not_Publisher_Who_Requested_Feed_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn(null);
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn(null);
JSONObject JSObject = buildRequestJsonObject();
FeedServlet feedServlet = new FeedServlet() {
protected JSONObject getJSONfromInput(HttpServletRequest req) {
}
private void setUpValidContentHeadersAndJSONOnHttpRequest() {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.feed; version=1.0");
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.feed; version=1.0");
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
}
private void reinsertFeedIntoDb() throws SQLException {
@Test
public void Given_Request_Is_HTTP_PUT_And_Request_Contains_Badly_Formed_JSON_Then_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0");
ServletInputStream inStream = mock(ServletInputStream.class);
when(request.getInputStream()).thenReturn(inStream);
groupServlet.doPut(request, response);
@Test
public void Given_Request_Is_HTTP_PUT_And_Group_Name_Is_Too_Long_Then_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0");
GroupServlet groupServlet = overideGetJSONFromInputToReturnAnInvalidGroup(true);
groupServlet.doPut(request, response);
verify(response).sendError(eq(HttpServletResponse.SC_BAD_REQUEST), argThat(notNullValue(String.class)));
@Test
public void Given_Request_Is_HTTP_PUT_And_PUT_Fails_Then_Internal_Server_Error_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0");
GroupServlet groupServlet = overideGetJSONFromInputToReturnAValidGroupWithFail();
groupServlet.doPut(request, response);
verify(response).sendError(eq(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), argThat(notNullValue(String.class)));
@Test
public void Given_Request_Is_HTTP_PUT_And_Request_Succeeds() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0");
GroupServlet groupServlet = overideGetJSONFromInputToReturnGroupInDb();
ServletOutputStream outStream = mock(ServletOutputStream.class);
when(response.getOutputStream()).thenReturn(outStream);
@Test
public void Given_Request_Is_HTTP_POST_And_Request_Contains_Badly_Formed_JSON_Then_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0");
ServletInputStream inStream = mock(ServletInputStream.class);
when(request.getInputStream()).thenReturn(inStream);
groupServlet.doPost(request, response);
@Test
public void Given_Request_Is_HTTP_POST_And_Group_Description_Is_Too_Long_Then_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0");
GroupServlet groupServlet = overideGetJSONFromInputToReturnAnInvalidGroup(false);
groupServlet.doPost(request, response);
verify(response).sendError(eq(HttpServletResponse.SC_BAD_REQUEST), argThat(notNullValue(String.class)));
@Test
public void Given_Request_Is_HTTP_POST_And_Group_Name_Already_Exists_Then_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0");
GroupServlet groupServlet = overideGetJSONFromInputToReturnGroupInDb();
groupServlet.doPost(request, response);
verify(response).sendError(eq(HttpServletResponse.SC_BAD_REQUEST), argThat(notNullValue(String.class)));
@Test
public void Given_Request_Is_HTTP_POST_And_POST_Fails_Then_Internal_Server_Error_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0");
GroupServlet groupServlet = overideGetJSONFromInputToReturnAValidGroupWithFail();
groupServlet.doPost(request, response);
verify(response).sendError(eq(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), argThat(notNullValue(String.class)));
@Test
public void Given_Request_Is_HTTP_POST_And_Request_Succeeds() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.group; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.group; version=1.0");
GroupServlet groupServlet = overideGetJSONFromInputToReturnNewGroupToInsert();
ServletOutputStream outStream = mock(ServletOutputStream.class);
when(response.getOutputStream()).thenReturn(outStream);
@Test
public void Given_Request_Is_HTTP_POST_And_Content_Header_Is_Not_Supported_Type_Then_Unsupported_Media_Type_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.feed; version=1.1");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.feed; version=1.1");
when(request.getContentType()).thenReturn("stub_contentType");
subscribeServlet.doPost(request, response);
verify(response).sendError(eq(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE), argThat(notNullValue(String.class)));
}
private void setUpValidContentHeadersAndJSONOnHttpRequest() {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.subscription; version=1.0");
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.subscription; version=1.0");
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
}
}
@Test
public void Given_Request_Is_HTTP_PUT_And_Request_Contains_Badly_Formed_JSON_Then_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.subscription; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.subscription; version=1.0");
ServletInputStream inStream = mock(ServletInputStream.class);
when(request.getInputStream()).thenReturn(inStream);
subscriptionServlet.doPut(request, response);
@Test
public void Given_Request_Is_HTTP_PUT_And_Subscription_Object_Is_Invalid_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.subscription; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.subscription; version=1.0");
SubscriptionServlet subscriptionServlet = new SubscriptionServlet() {
protected JSONObject getJSONfromInput(HttpServletRequest req) {
JSONObject jo = new JSONObject();
@Test
public void Given_Request_Is_HTTP_PUT_And_Subscriber_Modified_By_Different_Creator_Then_Bad_Request_Is_Generated() throws Exception {
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn(null);
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.subscription; version=1.0");
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn(null);
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.subscription; version=1.0");
JSONObject JSObject = buildRequestJsonObject();
SubscriptionServlet subscriptionServlet = new SubscriptionServlet() {
protected JSONObject getJSONfromInput(HttpServletRequest req) {
@Test
public void Given_Request_Is_HTTP_PUT_And_Update_Fails() throws Exception {
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.subscription; version=1.0");
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.subscription; version=1.0");
JSONObject JSObject = buildRequestJsonObject();
SubscriptionServlet subscriptionServlet = new SubscriptionServlet() {
protected JSONObject getJSONfromInput(HttpServletRequest req) {
public void Given_Request_Is_HTTP_PUT_And_Update_Succeeds() throws Exception {
ServletOutputStream outStream = mock(ServletOutputStream.class);
when(response.getOutputStream()).thenReturn(outStream);
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.subscription; version=1.0");
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.subscription; version=1.0");
JSONObject JSObject = buildRequestJsonObject();
SubscriptionServlet subscriptionServlet = new SubscriptionServlet() {
protected JSONObject getJSONfromInput(HttpServletRequest req) {
@Test
public void Given_Request_Is_HTTP_POST_And_Request_Is_Not_Authorized_Then_Forbidden_Response_Is_Generated() throws Exception {
- when(request.getHeader(anyString())).thenReturn("application/vnd.att-dr.subscription-control");
+ when(request.getHeader(anyString())).thenReturn("application/vnd.dmaap-dr.subscription-control");
setAuthoriserToReturnRequestNotAuthorized();
subscriptionServlet.doPost(request, response);
verify(response).sendError(eq(HttpServletResponse.SC_FORBIDDEN), argThat(notNullValue(String.class)));
@Test
public void Given_Request_Is_HTTP_POST_And_Request_Contains_Badly_Formed_JSON_Then_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.subscription-control; version=1.0");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.subscription-control; version=1.0");
ServletInputStream inStream = mock(ServletInputStream.class);
when(request.getInputStream()).thenReturn(inStream);
subscriptionServlet.doPost(request, response);
@Test
public void Given_Request_Is_HTTP_POST_And_Post_Fails() throws Exception {
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.subscription-control; version=1.0");
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.subscription-control; version=1.0");
JSONObject JSObject = buildRequestJsonObject();
SubscriptionServlet subscriptionServlet = new SubscriptionServlet() {
protected JSONObject getJSONfromInput(HttpServletRequest req) {
public void Given_Request_Is_HTTP_POST_And_Post_Succeeds() throws Exception {
ServletOutputStream outStream = mock(ServletOutputStream.class);
when(response.getOutputStream()).thenReturn(outStream);
- when(request.getHeader("X-ATT-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
- when(request.getHeader("Content-Type")).thenReturn("application/vnd.att-dr.subscription-control; version=1.0");
+ when(request.getHeader("X-DMAAP-DR-ON-BEHALF-OF-GROUP")).thenReturn("stub_subjectGroup");
+ when(request.getHeader("Content-Type")).thenReturn("application/vnd.dmaap-dr.subscription-control; version=1.0");
JSONObject JSObject = buildRequestJsonObject();
SubscriptionServlet subscriptionServlet = new SubscriptionServlet() {
protected JSONObject getJSONfromInput(HttpServletRequest req) {
VALUES (2,2);
insert into LOG_RECORDS(RECORD_ID,TYPE,EVENT_TIME,PUBLISH_ID,FEEDID,REQURI,METHOD,CONTENT_TYPE,CONTENT_LENGTH,FEED_FILEID,REMOTE_ADDR,USER,STATUS,DELIVERY_SUBID,DELIVERY_FILEID,RESULT,ATTEMPTS,REASON)
-VALUES(1,'pub',2536159564422,'ID',1,'URL','GET','application/vnd.att-dr.log-list; version=1.0',100,1,'172.0.0.8','user',204,1,1,204,0,'other');
+VALUES(1,'pub',2536159564422,'ID',1,'URL','GET','application/vnd.dmaap-dr.log-list; version=1.0',100,1,'172.0.0.8','user',204,1,1,204,0,'other');
CREATE ALIAS IF NOT EXISTS `SUBSTRING_INDEX` AS $$
String Function(String one, String two, String three){
<parent>
<groupId>org.onap.dmaap.datarouter</groupId>
<artifactId>parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>datarouter-subscriber</artifactId>
if (queryString != null) {
fileid = fileid + "?" + queryString;
}
- String publishid = req.getHeader("X-ATT-DR-PUBLISH-ID");
+ String publishid = req.getHeader("X-DMAAP-DR-PUBLISH-ID");
String filename =
URLEncoder.encode(fileid, "UTF-8").replaceAll("^\\.", "%2E").replaceAll("\\*", "%2A");
String fullPath = outputDirectory + "/" + filename;
}
Files.move(Paths.get(tmpPath), Paths.get(fullPath), StandardCopyOption.REPLACE_EXISTING);
try (PrintWriter writer = new PrintWriter(new FileOutputStream(tmpMetaDataPath))) {
- String metaData = req.getHeader("X-ATT-DR-META");
+ String metaData = req.getHeader("X-DMAAP-DR-META");
writer.print(metaData);
}
Files.move(Paths.get(tmpMetaDataPath), Paths.get(fullMetaDataPath), StandardCopyOption.REPLACE_EXISTING);
private void setUpSuccessfulFlow() throws IOException {
when(request.getHeader("Authorization")).thenReturn("Basic TE9HSU46UEFTU1dPUkQ=");
when(request.getPathInfo()).thenReturn("/publish/1/testfile");
- when(request.getHeader("X-ATT-DR-PUBLISH-ID")).thenReturn("1");
- when(request.getHeader("X-ATT-DR-META")).thenReturn("{\"Key\":\"Value\"}");
+ when(request.getHeader("X-DMAAP-DR-PUBLISH-ID")).thenReturn("1");
+ when(request.getHeader("X-DMAAP-DR-META")).thenReturn("{\"Key\":\"Value\"}");
when(request.getQueryString()).thenReturn(null);
ServletInputStream inStream = mock(ServletInputStream.class);
when(request.getInputStream()).thenReturn(inStream);
Sample Request\r
==============\r
\r
-``curl -k -X POST -H "Content-Type:application/vnd.att-dr.feed" -H "X-ATT-DR-ON-BEHALF-OF:{user}" --data-ascii @createFeed.json https://{host}:{port}``\r
+``curl -k -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" --data-ascii @createFeed.json https://{host}:{port}``\r
\r
Request Parameters:\r
===================\r
| group-id | | Body | Integer | | Y | |\r
| | | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
-| content-type | To specify type of message | Header | String | | Y | application/vnd.att-dr.feed |\r
+| content-type | To specify type of message | Header | String | | Y | application/vnd.dmaap-dr.feed |\r
| | (feed,subscriber,publisher) | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
-| X-ATT-DR-ON-BEHALF-OF | User id of owner of feed | Header | String | <=8 | Y | username |\r
+| X-DMAAP-DR-ON-BEHALF-OF| User id of owner of feed | Header | String | <=8 | Y | username |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
\r
Response/Error Codes\r
| | IP address |\r
| | * Client certificate subject is not on |\r
| | the API’s authorized list. |\r
-| | * X-ATT-DR-ON-BEHALF-OF identity is not |\r
+| | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
| | authorized to perform |\r
+------------------------+-------------------------------------------+\r
| 404 | Not Found - The Request-URI does not point|\r
Sample Request\r
==============\r
\r
-``curl -k -X PUT -H "Content-Type: application/vnd.att-dr.feed" -H "X-ATT-DR-ON-BEHALF-OF: {user}" --data-ascii @updateFeed.json --location-trusted https://{host}:{port}/feed/{feedId}``\r
+``curl -k -X PUT -H "Content-Type: application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF: {user}" --data-ascii @updateFeed.json --location-trusted https://{host}:{port}/feed/{feedId}``\r
\r
Request Parameters:\r
===================\r
| group-id | | Body | Integer | | Y | |\r
| | | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
-| content-type | To specify type of message | Header | String | | Y | application/vnd.att-dr.feed |\r
+| content-type | To specify type of message | Header | String | | Y | application/vnd.dmaap-dr.feed |\r
| | (feed,subscriber,publisher) | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
-| X-ATT-DR-ON-BEHALF-OF | User id of owner of feed | Header | String | <=8 | Y | username |\r
+| X-DMAAP-DR-ON-BEHALF-OF| User id of owner of feed | Header | String | <=8 | Y | username |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
\r
Response/Error Codes\r
| | IP address |\r
| | * Client certificate subject is not on |\r
| | the API’s authorized list. |\r
-| | * X-ATT-DR-ON-BEHALF-OF identity is not |\r
+| | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
| | authorized to perform |\r
+------------------------+-------------------------------------------+\r
| 404 | Not Found - The Request-URI does not point|\r
Sample Request\r
==============\r
\r
-``curl -k -H "X-ATT-DR-ON-BEHALF-OF: {user}" https://{host}:{port}/feed/{feedId}``\r
+``curl -k -H "X-DMAAP-DR-ON-BEHALF-OF: {user}" https://{host}:{port}/feed/{feedId}``\r
\r
Response/Error Codes\r
====================\r
| | IP address |\r
| | * Client certificate subject is not on |\r
| | the API’s authorized list. |\r
-| | * X-ATT-DR-ON-BEHALF-OF identity is not |\r
+| | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
| | authorized to perform |\r
+------------------------+-------------------------------------------+\r
| 404 | Not Found - The Request-URI does not point|\r
Sample Request\r
==============\r
\r
-``curl -k -X DELETE -H "X-ATT-DR-ON-BEHALF-OF: {user}" https://{host}:{port}/feed/{feedId}``\r
+``curl -k -X DELETE -H "X-DMAAP-DR-ON-BEHALF-OF: {user}" https://{host}:{port}/feed/{feedId}``\r
\r
Response/Error Codes\r
====================\r
| | IP address |\r
| | * Client certificate subject is not on |\r
| | the API’s authorized list. |\r
-| | * X-ATT-DR-ON-BEHALF-OF identity is not |\r
+| | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
| | authorized to perform |\r
+------------------------+-------------------------------------------+\r
| 404 | Not Found - The Request-URI does not point|\r
Sample Request\r
==============\r
\r
-``curl -k -X POST -H "Content-Type:application/vnd.att-dr.subscription" -H "X-ATT-DR-ON-BEHALF-OF:{user}" --data-ascii @addSubscriber.json https://{host}:{port}/subscribe/{feedId}``\r
+``curl -k -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" --data-ascii @addSubscriber.json https://{host}:{port}/subscribe/{feedId}``\r
\r
Request Parameters:\r
===================\r
| group-id | | Body | Integer | | Y | |\r
| | | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
-| content-type | To specify type of message | Header | String | | Y | application/vnd.att-dr.subscription |\r
+| content-type | To specify type of message | Header | String | | Y | application/vnd.dmaap-dr.subscription|\r
| | (feed,subscriber,publisher) | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
-| X-ATT-DR-ON-BEHALF-OF | User id of subscriber | Header | String | <=8 | Y | username |\r
+| X-DMAAP-DR-ON-BEHALF-OF| User id of subscriber | Header | String | <=8 | Y | username |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
\r
Response/Error Codes\r
| | IP address |\r
| | * Client certificate subject is not on |\r
| | the API’s authorized list. |\r
-| | * X-ATT-DR-ON-BEHALF-OF identity is not |\r
+| | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
| | authorized to perform |\r
+------------------------+-------------------------------------------+\r
| 404 | Not Found - The Request-URI does not point|\r
Sample Request\r
==============\r
\r
-``curl -k -X PUT -H "Content-Type:application/vnd.att-dr.subscription" -H "X-ATT-DR-ON-BEHALF-OF:{user}" --data-ascii @updateSubscriber.json https://{host}:{port}/subs/{subId}``\r
+``curl -k -X PUT -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" --data-ascii @updateSubscriber.json https://{host}:{port}/subs/{subId}``\r
\r
Request Parameters:\r
===================\r
| group-id | | Body | Integer | | Y | |\r
| | | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
-| content-type | To specify type of message | Header | String | | Y | application/vnd.att-dr.subscription |\r
+| content-type | To specify type of message | Header | String | | Y | application/vnd.dmaap-dr.subscription|\r
| | (feed,subscriber,publisher) | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
-| X-ATT-DR-ON-BEHALF-OF | User id of subscriber | Header | String | 8 | Y | username |\r
+| X-DMAAP-DR-ON-BEHALF-OF| User id of subscriber | Header | String | 8 | Y | username |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
\r
Response/Error Codes\r
| | IP address |\r
| | * Client certificate subject is not on |\r
| | the API’s authorized list. |\r
-| | * X-ATT-DR-ON-BEHALF-OF identity is not |\r
+| | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
| | authorized to perform |\r
+------------------------+-------------------------------------------+\r
| 404 | Not Found - The Request-URI does not point|\r
Sample Request\r
==============\r
\r
-``curl -k -H "X-ATT-DR-ON-BEHALF-OF:{user}" https://{host}:{port}/subs/{subId}``\r
+``curl -k -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" https://{host}:{port}/subs/{subId}``\r
\r
Response/Error Codes\r
====================\r
| | IP address |\r
| | * Client certificate subject is not on |\r
| | the API’s authorized list. |\r
-| | * X-ATT-DR-ON-BEHALF-OF identity is not |\r
+| | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
| | authorized to perform |\r
+------------------------+-------------------------------------------+\r
| 404 | Not Found - The Request-URI does not point|\r
Sample Request\r
==============\r
\r
-``curl -k -X DELETE -H "X-ATT-DR-ON-BEHALF-OF:{user}" https://{host}:{port}/subs/{subId}``\r
+``curl -k -X DELETE -H "X-DMAAP-DR-ON-BEHALF-OF:{user}" https://{host}:{port}/subs/{subId}``\r
\r
Response/Error Codes\r
====================\r
| | IP address |\r
| | * Client certificate subject is not on |\r
| | the API’s authorized list. |\r
-| | * X-ATT-DR-ON-BEHALF-OF identity is not |\r
+| | * X-DMAAP-DR-ON-BEHALF-OF identity is not |\r
| | authorized to perform |\r
+------------------------+-------------------------------------------+\r
| 404 | Not Found - The Request-URI does not point|\r
Sample Request\r
==============\r
\r
-``curl -k -X PUT --user {user}:{password} -H "Content-Type:application/octet-stream" -H "X-ATT-DR-META:{\"filetype\":\"txt\"}" --data-binary @sampleFile.txt --post301 --location-trusted https://{host}:{port}/publish/{feedId}/sampleFile``\r
+``curl -k -X PUT --user {user}:{password} -H "Content-Type:application/octet-stream" -H "X-DMAAP-DR-META:{\"filetype\":\"txt\"}" --data-binary @sampleFile.txt --post301 --location-trusted https://{host}:{port}/publish/{feedId}/sampleFile``\r
\r
Request parameters\r
==================\r
| content-type | To specify type of message | Header | String | | Y | application/octet-stream |\r
| | format | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------------------------------------------+\r
-| X-ATT-DR-META | Metadata for the file. Accepts | Header | String | 4096 | N | '{"compressionType":"gzip","id": 1234, "transferred":true, "size":null}' |\r
+| X-DMAAP-DR-META | Metadata for the file. Accepts | Header | String | 4096 | N | '{"compressionType":"gzip","id": 1234, "transferred":true, "size":null}' |\r
| | only non nested json objects | | | | | |\r
| | of the following type : | | | | | |\r
| | -Numbers | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
| publishId | Select records with specified | Path | String | | N | |\r
| | publish id, carried in the | | | | | |\r
-| | X-ATT-DR-PUBLISH-ID header from | | | | | |\r
-| | original publish request | | | | | |\r
+| | X-DMAAP-DR-PUBLISH-ID header | | | | | |\r
+| | from original publish request | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
| start | Select records created at or | Path | String | | N | A date-time expressed in the format |\r
| | after specified date | | | | | specified by RFC 3339 |\r
Response Parameters\r
===================\r
\r
-+------------------------+-------------------------------------------+\r
-| Name | Description |\r
-+========================+===========================================+\r
-| type | Record type: |\r
-| | |\r
-| | * pub: publication attempt |\r
-| | * del: delivery attempt |\r
-| | * exp: delivery expiry |\r
-+------------------------+-------------------------------------------+\r
-| date | The UTC date and time at which the record |\r
-| | was generated, with millisecond resolution|\r
-| | in the format specified by RFC 3339 |\r
-+------------------------+-------------------------------------------+\r
-| publishId | The unique identifier assigned by the DR |\r
-| | at the time of the initial publication |\r
-| | request (carried in the X-ATT-DRPUBLISH-ID|\r
-| | header in the response to the original |\r
-| | publish request) |\r
-+------------------------+-------------------------------------------+\r
-| requestURI | The Request-URI associated with the |\r
-| | request |\r
-+------------------------+-------------------------------------------+\r
-| method | The HTTP method (PUT or DELETE) for the |\r
-| | request |\r
-+------------------------+-------------------------------------------+\r
-| contentType | The media type of the payload of the |\r
-| | request |\r
-+------------------------+-------------------------------------------+\r
-| contentLength | The size (in bytes) of the payload of |\r
-| | the request |\r
-+------------------------+-------------------------------------------+\r
-| sourceIp | The IP address from which the request |\r
-| | originated |\r
-+------------------------+-------------------------------------------+\r
-| endpointId | The identity used to submit a publish |\r
-| | request to the DR |\r
-+------------------------+-------------------------------------------+\r
-| deliveryId | The identity used to submit a delivery |\r
-| | request to a subscriber endpoint |\r
-+------------------------+-------------------------------------------+\r
-| statusCode | The HTTP status code in the response to |\r
-| | the request. A value of -1 indicates that |\r
-| | the DR was not able to obtain an HTTP |\r
-| | status code |\r
-+------------------------+-------------------------------------------+\r
-| expiryReason | The reason that delivery attempts were |\r
-| | discontinued: |\r
-| | |\r
-| | * notRetryable: The last delivery attempt |\r
-| | encountered an error condition for which|\r
-| | the DR does not make retries. |\r
-| | * retriesExhausted: The DR reached its |\r
-| | limit for making further retry attempts |\r
-+------------------------+-------------------------------------------+\r
-| attempts | Total number of attempts made before |\r
-| | delivery attempts were discontinued |\r
-+------------------------+-------------------------------------------+\r
++------------------------+----------------------------------------------+\r
+| Name | Description |\r
++========================+==============================================+\r
+| type | Record type: |\r
+| | |\r
+| | * pub: publication attempt |\r
+| | * del: delivery attempt |\r
+| | * exp: delivery expiry |\r
++------------------------+----------------------------------------------+\r
+| date | The UTC date and time at which the record |\r
+| | was generated, with millisecond resolution |\r
+| | in the format specified by RFC 3339 |\r
++------------------------+----------------------------------------------+\r
+| publishId | The unique identifier assigned by the DR |\r
+| | at the time of the initial publication |\r
+| | request (carried in the X-DMAAP-DR-PUBLISH-ID|\r
+| | header in the response to the original |\r
+| | publish request) |\r
++------------------------+----------------------------------------------+\r
+| requestURI | The Request-URI associated with the |\r
+| | request |\r
++------------------------+----------------------------------------------+\r
+| method | The HTTP method (PUT or DELETE) for the |\r
+| | request |\r
++------------------------+----------------------------------------------+\r
+| contentType | The media type of the payload of the |\r
+| | request |\r
++------------------------+----------------------------------------------+\r
+| contentLength | The size (in bytes) of the payload of |\r
+| | the request |\r
++------------------------+----------------------------------------------+\r
+| sourceIp | The IP address from which the request |\r
+| | originated |\r
++------------------------+----------------------------------------------+\r
+| endpointId | The identity used to submit a publish |\r
+| | request to the DR |\r
++------------------------+----------------------------------------------+\r
+| deliveryId | The identity used to submit a delivery |\r
+| | request to a subscriber endpoint |\r
++------------------------+----------------------------------------------+\r
+| statusCode | The HTTP status code in the response to |\r
+| | the request. A value of -1 indicates that |\r
+| | the DR was not able to obtain an HTTP |\r
+| | status code |\r
++------------------------+----------------------------------------------+\r
+| expiryReason | The reason that delivery attempts were |\r
+| | discontinued: |\r
+| | |\r
+| | * notRetryable: The last delivery attempt |\r
+| | encountered an error condition for which |\r
+| | the DR does not make retries. |\r
+| | * retriesExhausted: The DR reached its |\r
+| | limit for making further retry attempts |\r
++------------------------+----------------------------------------------+\r
+| attempts | Total number of attempts made before |\r
+| | delivery attempts were discontinued |\r
++------------------------+----------------------------------------------+\r
\r
Response/Error Codes\r
====================\r
| 406 | Not Acceptable - The request has an Accept|\r
| | header indicating that the requester will |\r
| | not accept a response with |\r
-| | application/vnd.att-dr.log-list content. |\r
+| | application/vnd.dmaap-dr.log-list content.|\r
+------------------------+-------------------------------------------+\r
| 500 | Internal Server Error - The DR API server |\r
| | encountered an internal error and could |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
| publishId | Select records with specified | Path | String | | N | |\r
| | publish id, carried in the | | | | | |\r
-| | X-ATT-DR-PUBLISH-ID header from | | | | | |\r
-| | original publish request | | | | | |\r
+| | X-DMAAP-DR-PUBLISH-ID header | | | | | |\r
+| | from original publish request | | | | | |\r
+------------------------+---------------------------------+------------------+------------+--------------+-------------+--------------------------------------+\r
| start | Select records created at or | Path | String | | N | A date-time expressed in the format |\r
| | after specified date | | | | | specified by RFC 3339 |\r
Response Parameters\r
===================\r
\r
-+------------------------+-------------------------------------------+\r
-| Name | Description |\r
-+========================+===========================================+\r
-| type | Record type: |\r
-| | |\r
-| | * pub: publication attempt |\r
-| | * del: delivery attempt |\r
-| | * exp: delivery expiry |\r
-+------------------------+-------------------------------------------+\r
-| date | The UTC date and time at which the record |\r
-| | was generated, with millisecond resolution|\r
-| | in the format specified by RFC 3339 |\r
-+------------------------+-------------------------------------------+\r
-| publishId | The unique identifier assigned by the DR |\r
-| | at the time of the initial publication |\r
-| | request(carried in the X-ATT-DR-PUBLISH-ID|\r
-| | header in the response to the original |\r
-| | publish request) to a feed log URL or |\r
-| | subscription log URL known to the system |\r
-+------------------------+-------------------------------------------+\r
-| requestURI | The Request-URI associated with the |\r
-| | request |\r
-+------------------------+-------------------------------------------+\r
-| method | The HTTP method (PUT or DELETE) for the |\r
-| | request |\r
-+------------------------+-------------------------------------------+\r
-| contentType | The media type of the payload of the |\r
-| | request |\r
-+------------------------+-------------------------------------------+\r
-| contentLength | The size (in bytes) of the payload of |\r
-| | the request |\r
-+------------------------+-------------------------------------------+\r
-| sourceIp | The IP address from which the request |\r
-| | originated |\r
-+------------------------+-------------------------------------------+\r
-| endpointId | The identity used to submit a publish |\r
-| | request to the DR |\r
-+------------------------+-------------------------------------------+\r
-| deliveryId | The identity used to submit a delivery |\r
-| | request to a subscriber endpoint |\r
-+------------------------+-------------------------------------------+\r
-| statusCode | The HTTP status code in the response to |\r
-| | the request. A value of -1 indicates that |\r
-| | the DR was not able to obtain an HTTP |\r
-| | status code |\r
-+------------------------+-------------------------------------------+\r
-| expiryReason | The reason that delivery attempts were |\r
-| | discontinued: |\r
-| | |\r
-| | * notRetryable: The last delivery attempt |\r
-| | encountered an error condition for which|\r
-| | the DR does not make retries. |\r
-| | * retriesExhausted: The DR reached its |\r
-| | limit for making further retry attempts |\r
-+------------------------+-------------------------------------------+\r
-| attempts | Total number of attempts made before |\r
-| | delivery attempts were discontinued |\r
-+------------------------+-------------------------------------------+\r
++------------------------+---------------------------------------------+\r
+| Name | Description |\r
++========================+=============================================+\r
+| type | Record type: |\r
+| | |\r
+| | * pub: publication attempt |\r
+| | * del: delivery attempt |\r
+| | * exp: delivery expiry |\r
++------------------------+---------------------------------------------+\r
+| date | The UTC date and time at which the record |\r
+| | was generated, with millisecond resolution |\r
+| | in the format specified by RFC 3339 |\r
++------------------------+---------------------------------------------+\r
+| publishId | The unique identifier assigned by the DR |\r
+| | at the time of the initial publication |\r
+| | request(carried in the X-DMAAP-DR-PUBLISH-ID|\r
+| | header in the response to the original |\r
+| | publish request) to a feed log URL or |\r
+| | subscription log URL known to the system |\r
++------------------------+---------------------------------------------+\r
+| requestURI | The Request-URI associated with the |\r
+| | request |\r
++------------------------+---------------------------------------------+\r
+| method | The HTTP method (PUT or DELETE) for the |\r
+| | request |\r
++------------------------+---------------------------------------------+\r
+| contentType | The media type of the payload of the |\r
+| | request |\r
++------------------------+---------------------------------------------+\r
+| contentLength | The size (in bytes) of the payload of |\r
+| | the request |\r
++------------------------+---------------------------------------------+\r
+| sourceIp | The IP address from which the request |\r
+| | originated |\r
++------------------------+---------------------------------------------+\r
+| endpointId | The identity used to submit a publish |\r
+| | request to the DR |\r
++------------------------+---------------------------------------------+\r
+| deliveryId | The identity used to submit a delivery |\r
+| | request to a subscriber endpoint |\r
++------------------------+---------------------------------------------+\r
+| statusCode | The HTTP status code in the response to |\r
+| | the request. A value of -1 indicates that |\r
+| | the DR was not able to obtain an HTTP |\r
+| | status code |\r
++------------------------+---------------------------------------------+\r
+| expiryReason | The reason that delivery attempts were |\r
+| | discontinued: |\r
+| | |\r
+| | * notRetryable: The last delivery attempt |\r
+| | encountered an error condition for which |\r
+| | the DR does not make retries. |\r
+| | * retriesExhausted: The DR reached its |\r
+| | limit for making further retry attempts |\r
++------------------------+---------------------------------------------+\r
+| attempts | Total number of attempts made before |\r
+| | delivery attempts were discontinued |\r
++------------------------+---------------------------------------------+\r
\r
Response/Error Codes\r
====================\r
| 406 | Not Acceptable - The request has an Accept|\r
| | header indicating that the requester will |\r
| | not accept a response with |\r
-| | application/vnd.att-dr.log-list content. |\r
+| | application/vnd.dmaap-dr.log-list content.|\r
+------------------------+-------------------------------------------+\r
| 500 | Internal Server Error - The DR API server |\r
| | encountered an internal error and could |\r
<groupId>org.onap.dmaap.datarouter</groupId>
<artifactId>parent</artifactId>
<name>dmaap-datarouter</name>
- <version>1.1.0-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<url>https://github.com/att/DMAAP_DATAROUTER</url>
<parent>
# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... )\r
# because they are used in Jenkins, whose plug-in doesn't support\r
\r
-major=1\r
-minor=1\r
+major=2\r
+minor=0\r
patch=0\r
\r
base_version=${major}.${minor}.${patch}\r