You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2016/12/04 01:11:43 UTC
[01/30] cxf git commit: [CXF-7119] Adding a test [Forced Update!]
Repository: cxf
Updated Branches:
refs/heads/CXF-6882.nio 98050b522 -> cfc994434 (forced update)
[CXF-7119] Adding a test
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4eacc1dc
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4eacc1dc
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4eacc1dc
Branch: refs/heads/CXF-6882.nio
Commit: 4eacc1dcc3ae0c0bb1dedf72db8db67b5464956b
Parents: 8fc9d78
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Nov 24 11:02:43 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Nov 24 11:02:43 2016 +0000
----------------------------------------------------------------------
.../jaxrs/JAXRSClientServerBookTest.java | 129 ++++++++-----------
1 file changed, 57 insertions(+), 72 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/4eacc1dc/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
index e7dd9b5..da1f046 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
@@ -407,10 +407,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
private void doTestUseParamBeanWebClient(String address) {
WebClient wc = WebClient.create(address);
- wc.path("100");
- wc.query("id_2", "20");
- wc.query("id3", "3");
- wc.query("id4", "123");
+ wc.path("100").query("id_2", "20").query("id3", "3").query("id4", "123");
Book book = wc.get(Book.class);
assertEquals(123L, book.getId());
}
@@ -426,8 +423,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetIntroChapterFromSelectedBook2() {
String address = "http://localhost:" + PORT + "/bookstore/";
WebClient wc = WebClient.create(address);
- wc.path("books[id=le=123]");
- wc.path("chapter");
+ wc.path("books[id=le=123]").path("chapter");
wc.accept("application/xml");
Chapter chapter = wc.get(Chapter.class);
assertEquals("chapter 1", chapter.getTitle());
@@ -488,7 +484,6 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
@Test
public void testProxyBeanParam2() throws Exception {
BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
- WebClient.getConfig(store).getHttpConduit().getClient().setReceiveTimeout(10000000L);
BookStore.BookBean2 bean = new BookStore.BookBean2();
bean.setId(100L);
bean.setId2(23L);
@@ -977,21 +972,21 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
+ "org.apache.cxf.systest.jaxrs.BookNotFoundFault: Book Exception</ns1:faultstring>"
+ "</ns1:XMLFault>";
getAndCompare("http://localhost:" + PORT + "/bookstore/propagate-exception2",
- data, "application/xml", 500);
+ data, "application/xml", null, 500);
}
@Test
public void testPropogateException3() throws Exception {
String data = "<nobook/>";
getAndCompare("http://localhost:" + PORT + "/bookstore/propagate-exception3",
- data, "application/xml", 500);
+ data, "application/xml", null, 500);
}
@Test
public void testPropogateException4() throws Exception {
String data = "<nobook/>";
getAndCompare("http://localhost:" + PORT + "/bookstore/propogateExceptionVar/1",
- data, "application/xml", 500);
+ data, "application/xml", null, 500);
}
@Test
@@ -1077,7 +1072,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testWebApplicationException() throws Exception {
getAndCompare("http://localhost:" + PORT + "/bookstore/webappexception",
"This is a WebApplicationException",
- "application/xml", 500);
+ "application/xml", null, 500);
}
@Test
@@ -1212,7 +1207,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
getAndCompareAsStrings("http://localhost:" + PORT
+ "/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -1429,21 +1424,21 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/bookquery?"
+ "urlid=http%3A%2F%2Ftest.com%2Frss%2F123",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
public void testGetGenericBook() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/genericbooks/123",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
public void testGetGenericResponseBook() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/genericresponse/123",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -1451,21 +1446,21 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/bookidarray?"
+ "id=1&id=2&id=3",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
public void testNoRootResourceException() throws Exception {
getAndCompare("http://localhost:" + PORT + "/nobookstore/webappexception",
"",
- "application/xml", 404);
+ "application/xml", null, 404);
}
@Test
public void testNoPathMatch() throws Exception {
getAndCompare("http://localhost:" + PORT + "/bookstore/bookqueries",
"",
- "application/xml", 404);
+ "application/xml", null, 404);
}
@Test
@@ -1485,13 +1480,13 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testWriteAndFailEarly() throws Exception {
getAndCompare("http://localhost:" + PORT + "/bookstore/books/fail-early",
"This is supposed to go on the wire",
- "application/bar, text/plain", 410);
+ "application/bar, text/plain", null, 410);
}
@Test
public void testWriteAndFailLate() throws Exception {
getAndCompare("http://localhost:" + PORT + "/bookstore/books/fail-late",
- "", "application/bar", 410);
+ "", "application/bar", null, 410);
}
@@ -1499,14 +1494,14 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testAcceptTypeMismatch() throws Exception {
getAndCompare("http://localhost:" + PORT + "/bookstore/booknames/123",
"",
- "foo/bar", 406);
+ "foo/bar", null, 406);
}
@Test
public void testWrongHttpMethod() throws Exception {
getAndCompare("http://localhost:" + PORT + "/bookstore/unsupportedcontenttype",
"",
- "foo/bar", 405);
+ "foo/bar", null, 405);
}
@Test
@@ -1514,7 +1509,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
getAndCompare("http://localhost:" + PORT + "/bookstore/wrongparametertype?p=1",
"Parameter Class java.util.Map has no constructor with single String "
+ "parameter, static valueOf(String) or fromString(String) methods",
- "*/*", 500);
+ "*/*", null, 500);
}
@Test
@@ -1535,14 +1530,14 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testExceptionDuringConstruction() throws Exception {
getAndCompare("http://localhost:" + PORT + "/bookstore/exceptionconstruction?p=1",
"",
- "foo/bar", 404);
+ "foo/bar", null, 404);
}
@Test
public void testSubresourceMethodNotFound() throws Exception {
getAndCompare("http://localhost:" + PORT + "/bookstore/interface/thesubresource",
"",
- "foo/bar", 404);
+ "foo/bar", null, 404);
}
@Test
@@ -1666,7 +1661,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetBookCustomExpression() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/custom/123",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -1772,7 +1767,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/search"
+ "?_s=name==CXF*;id=ge=123;id=lt=124",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -1801,7 +1796,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetBook123CGLIB() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123/cglib",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -1905,19 +1900,19 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetBook123() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/query?bookId=123",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/defaultquery",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/missingquery",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
"resources/expected_get_book123json.txt",
@@ -1943,36 +1938,36 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetBookBuffer() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/buffer",
"resources/expected_get_book123.txt",
- "application/bar", 200);
+ "application/bar", "application/bar", 200);
}
@Test
public void testGetBookBySegment() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/segment/matrix2;first=12;second=3",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore;bar/segment;foo/"
+ "matrix2;first=12;second=3;third",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
public void testGetBookByListOfSegments() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/segment/list/1/2/3",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
public void testGetBookByMatrixParameters() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/segment/matrix;first=12;second=3",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore;bar;first=12/segment;foo;"
+ "second=3/matrix;third",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -1980,7 +1975,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
getAndCompareAsStrings(
"http://localhost:" + PORT + "/bookstore/segment;first=12;second=3/matrix-middle",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -2051,7 +2046,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetBookElement() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/element",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -2090,7 +2085,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetBookAdapter() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/adapter",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -2127,7 +2122,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetBookAdapterInterface() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/interface/adapter",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -2166,7 +2161,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetBook123FromSub() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/interface/subresource",
"resources/expected_get_book123.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/books/123",
"resources/expected_get_book123json.txt",
@@ -2248,7 +2243,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
getAndCompareAsStrings("http://localhost:"
+ PORT + "/bookstore/booksubresource/123/chapters/sub/1/recurse",
"resources/expected_get_chapter1_utf.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
getAndCompareAsStrings("http://localhost:"
+ PORT + "/bookstore/booksubresource/123/chapters/sub/1/recurse2",
"resources/expected_get_chapter1.txt",
@@ -2268,7 +2263,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetBook123ReturnString() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/booknames/123",
"resources/expected_get_book123_returnstring.txt",
- "text/plain", 200);
+ "text/plain", "text/plain", 200);
}
@Test
@@ -2452,7 +2447,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cd/123",
"resources/expected_get_cdjson.txt",
- "application/json", 200);
+ "application/json", "application/json", 200);
}
@@ -2544,7 +2539,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cd/123",
"resources/expected_get_cd.txt",
- "application/xml", 200);
+ "application/xml", "application/xml", 200);
}
@Test
@@ -2567,7 +2562,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testGetCDWithMultiContentTypesJSON() throws Exception {
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cdwithmultitypes/123",
"resources/expected_get_cdjson.txt",
- "application/json", 200);
+ "application/json", "application/json", 200);
getAndCompareAsStrings("http://localhost:" + PORT + "/bookstore/cdwithmultitypes/123",
"resources/expected_get_cdjson.txt",
"*/*,application/xml;q=0.9,application/json", "application/json", 200);
@@ -2647,6 +2642,20 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
}
@Test
+ public void testNonExistentWithGetCustomEx() throws Exception {
+ String address = "http://localhostt/bookstore";
+ BookStore c = JAXRSClientFactory.create(address, BookStore.class);
+ WebClient.getConfig(c).getInFaultInterceptors().add(new CustomFaultInInterceptor());
+ try {
+ c.getBook("123");
+ fail("Exception expected");
+ } catch (ProcessingException ex) {
+ assertEquals("UnknownHostException: Microservice at http://localhostt/bookstore/bookstore/books/123/"
+ + " is not available", ex.getMessage());
+ }
+ }
+
+ @Test
public void testBadlyQuotedHeaders() throws Exception {
String endpointAddress =
@@ -2682,19 +2691,6 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
}
- private void getAndCompareAsStrings(String address,
- String resourcePath,
- String acceptType,
- int status) throws Exception {
- String expected = getStringFromInputStream(
- getClass().getResourceAsStream(resourcePath));
- getAndCompare(address,
- expected,
- acceptType,
- acceptType,
- status);
- }
-
private void getAndCompareAsStrings(String address,
String resourcePath,
String acceptType,
@@ -2712,17 +2708,6 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
private void getAndCompare(String address,
String expectedValue,
String acceptType,
- int expectedStatus) throws Exception {
- getAndCompare(address,
- expectedValue,
- acceptType,
- null,
- expectedStatus);
- }
-
- private void getAndCompare(String address,
- String expectedValue,
- String acceptType,
String expectedContentType,
int expectedStatus) throws Exception {
GetMethod get = new GetMethod(address);
[22/30] cxf git commit: [CXF-6836] More SwaggerUtils work
Posted by re...@apache.org.
[CXF-6836] More SwaggerUtils work
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/847216a3
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/847216a3
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/847216a3
Branch: refs/heads/CXF-6882.nio
Commit: 847216a39ba3639f3170b8ad939548788fff4eb6
Parents: 1d09de7
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Dec 1 13:56:14 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Dec 1 13:56:14 2016 +0000
----------------------------------------------------------------------
.../apache/cxf/jaxrs/model/UserApplication.java | 9 ++
.../apache/cxf/jaxrs/swagger/SwaggerUtils.java | 135 +++++++------------
.../cxf/jaxrs/swagger/SwaggerUtilsTest.java | 67 ++++-----
.../src/test/resources/swagger12.json | 27 ----
.../src/test/resources/swagger20.json | 90 +++++++------
.../AbstractSwagger2ServiceDescriptionTest.java | 16 ++-
.../jaxrs/description/group1/BookStore.java | 5 +-
.../systest/jaxrs/description/swagger2-json.txt | 1 -
.../jaxrs/description/swagger2-noano-json.txt | 1 -
9 files changed, 153 insertions(+), 198 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/847216a3/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/UserApplication.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/UserApplication.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/UserApplication.java
index 404416d..eec7e83 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/UserApplication.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/UserApplication.java
@@ -25,6 +25,7 @@ import java.util.Map;
public class UserApplication {
private String name;
+ private String basePath;
private List<UserResource> resources;
public UserApplication() {
@@ -62,4 +63,12 @@ public class UserApplication {
}
return map;
}
+
+ public String getBasePath() {
+ return basePath;
+ }
+
+ public void setBasePath(String basePath) {
+ this.basePath = basePath;
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/847216a3/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java
index c0d7c6b..477fc59 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java
@@ -20,22 +20,26 @@ package org.apache.cxf.jaxrs.swagger;
import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.logging.Logger;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.jaxrs.json.basic.JsonMapObjectReaderWriter;
import org.apache.cxf.jaxrs.model.Parameter;
import org.apache.cxf.jaxrs.model.ParameterType;
+import org.apache.cxf.jaxrs.model.UserApplication;
import org.apache.cxf.jaxrs.model.UserOperation;
import org.apache.cxf.jaxrs.model.UserResource;
import org.apache.cxf.jaxrs.utils.ResourceUtils;
@@ -61,66 +65,64 @@ public final class SwaggerUtils {
private SwaggerUtils() {
}
- public static UserResource getUserResource(String loc) {
- return getUserResource(loc, BusFactory.getThreadDefaultBus());
+ public static UserApplication getUserApplication(String loc) {
+ return getUserApplication(loc, BusFactory.getThreadDefaultBus());
}
- public static UserResource getUserResource(String loc, Bus bus) {
+ public static UserApplication getUserApplication(String loc, Bus bus) {
try {
InputStream is = ResourceUtils.getResourceStream(loc, bus);
if (is == null) {
return null;
}
- return getUserResourceFromStream(is);
+ return getUserApplicationFromStream(is);
} catch (Exception ex) {
LOG.warning("Problem with processing a user model at " + loc);
}
return null;
}
- public static UserResource getUserResourceFromStream(InputStream is) throws IOException {
- return getUserResourceFromJson(IOUtils.readStringFromStream(is));
+ public static UserApplication getUserApplicationFromStream(InputStream is) throws IOException {
+ return getUserApplicationFromJson(IOUtils.readStringFromStream(is));
}
- public static List<UserResource> getUserResourcesFromResourceObjects(List<String> jsonObjects) {
- List<UserResource> resources = new ArrayList<UserResource>();
- for (String json : jsonObjects) {
- resources.add(getUserResourceFromJson(json));
- }
- return resources;
- }
- public static UserResource getUserResourceFromJson(String json) {
+ public static UserApplication getUserApplicationFromJson(String json) {
JsonMapObjectReaderWriter reader = new JsonMapObjectReaderWriter();
Map<String, Object> map = reader.fromJson(json);
+
+ UserApplication app = new UserApplication();
+ String relativePath = (String)map.get("basePath");
+ app.setBasePath(StringUtils.isEmpty(relativePath) ? "/" : relativePath);
- if (map.containsKey("swaggerVersion")) {
- return getUserResourceFromSwagger12(map);
+
+ Map<String, List<UserOperation>> userOpsMap = new LinkedHashMap<String, List<UserOperation>>();
+ Set<String> tags = new HashSet<String>();
+ List<Map<String, Object>> tagsProp = CastUtils.cast((List<?>)map.get("tags"));
+ if (tagsProp != null) {
+ for (Map<String, Object> tagProp : tagsProp) {
+ tags.add((String)tagProp.get("name"));
+ }
} else {
- return getUserResourceFromSwagger20(map);
+ tags.add("");
+ }
+ for (String tag : tags) {
+ userOpsMap.put(tag, new LinkedList<UserOperation>());
}
- }
- private static UserResource getUserResourceFromSwagger20(Map<String, Object> map) {
- UserResource ur = new UserResource();
- String relativePath = (String)map.get("basePath");
- ur.setPath(relativePath == null ? "/" : relativePath);
-
- List<String> resourceProduces = CastUtils.cast((List<?>)map.get("produces"));
- ur.setProduces(listToString(resourceProduces));
-
- List<String> resourceConsumes = CastUtils.cast((List<?>)map.get("consumes"));
- ur.setConsumes(listToString(resourceConsumes));
- List<UserOperation> userOps = new LinkedList<UserOperation>();
Map<String, Map<String, Object>> paths = CastUtils.cast((Map<?, ?>)map.get("paths"));
for (Map.Entry<String, Map<String, Object>> pathEntry : paths.entrySet()) {
-
String operPath = pathEntry.getKey();
Map<String, Object> operations = pathEntry.getValue();
for (Map.Entry<String, Object> operEntry : operations.entrySet()) {
+
UserOperation userOp = new UserOperation();
userOp.setVerb(operEntry.getKey().toUpperCase());
- userOp.setPath(operPath);
Map<String, Object> oper = CastUtils.cast((Map<?, ?>)operEntry.getValue());
+ List<String> opTags = CastUtils.cast((List<?>)oper.get("tags"));
+ String opTag = opTags == null ? "" : opTags.get(0);
+
+ String realOpPath = operPath.equals("/" + opTag) ? "/" : operPath.substring(opTag.length() + 1);
+ userOp.setPath(realOpPath);
userOp.setName((String)oper.get("operationId"));
List<String> opProduces = CastUtils.cast((List<?>)oper.get("produces"));
@@ -146,68 +148,25 @@ public final class SwaggerUtils {
if (!userOpParams.isEmpty()) {
userOp.setParameters(userOpParams);
}
- userOps.add(userOp);
+ userOpsMap.get(opTag).add(userOp);
+
}
}
- ur.setOperations(userOps);
- return ur;
- }
- private static UserResource getUserResourceFromSwagger12(Map<String, Object> map) {
- UserResource ur = new UserResource();
- String relativePath = (String)map.get("resourcePath");
- ur.setPath(relativePath == null ? "/" : relativePath);
- List<String> resourceProduces = CastUtils.cast((List<?>)map.get("produces"));
- ur.setProduces(listToString(resourceProduces));
+ List<UserResource> resources = new LinkedList<UserResource>();
- List<String> resourceConsumes = CastUtils.cast((List<?>)map.get("consumes"));
- ur.setConsumes(listToString(resourceConsumes));
-
- List<UserOperation> userOps = new LinkedList<UserOperation>();
- List<Map<String, Object>> apis = CastUtils.cast((List<?>)map.get("apis"));
- for (Map<String, Object> api : apis) {
- String operPath = (String)api.get("path");
- if (relativePath != null && operPath.startsWith(relativePath)
- && operPath.length() > relativePath.length()) {
- // relative resource and operation paths overlap in Swagger 1.2
- operPath = operPath.substring(relativePath.length());
- }
-
- List<Map<String, Object>> operations = CastUtils.cast((List<?>)api.get("operations"));
- for (Map<String, Object> oper : operations) {
- UserOperation userOp = new UserOperation();
- userOp.setPath(operPath);
- userOp.setName((String)oper.get("nickname"));
- userOp.setVerb((String)oper.get("method"));
-
- List<String> opProduces = CastUtils.cast((List<?>)oper.get("produces"));
- userOp.setProduces(listToString(opProduces));
-
- List<String> opConsumes = CastUtils.cast((List<?>)oper.get("consumes"));
- userOp.setConsumes(listToString(opConsumes));
-
- List<Parameter> userOpParams = new LinkedList<Parameter>();
- List<Map<String, Object>> params = CastUtils.cast((List<?>)oper.get("parameters"));
- for (Map<String, Object> param : params) {
- String name = (String)param.get("name");
- //"path", "query", "body", "header", "form"
- String paramType = (String)param.get("paramType");
- ParameterType pType = "body".equals(paramType)
- ? ParameterType.REQUEST_BODY : ParameterType.valueOf(paramType.toUpperCase());
- Parameter userParam = new Parameter(pType, name);
- setJavaType(userParam, (String)param.get("type"));
-
- userOpParams.add(userParam);
- }
- if (!userOpParams.isEmpty()) {
- userOp.setParameters(userOpParams);
- }
- userOps.add(userOp);
- }
+ for (Map.Entry<String, List<UserOperation>> entry : userOpsMap.entrySet()) {
+ UserResource ur = new UserResource();
+ ur.setPath("/" + entry.getKey());
+ ur.setOperations(entry.getValue());
+ ur.setName(entry.getKey());
+ resources.add(ur);
}
- ur.setOperations(userOps);
- return ur;
+
+ app.setResources(resources);
+ return app;
}
+
private static void setJavaType(Parameter userParam, String typeName) {
String javaTypeName = SWAGGER_TYPE_MAP.get(typeName);
if (javaTypeName != null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/847216a3/rt/rs/description-swagger/src/test/java/org/apache/cxf/jaxrs/swagger/SwaggerUtilsTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/test/java/org/apache/cxf/jaxrs/swagger/SwaggerUtilsTest.java b/rt/rs/description-swagger/src/test/java/org/apache/cxf/jaxrs/swagger/SwaggerUtilsTest.java
index 5c3d6e9..4f97feb 100644
--- a/rt/rs/description-swagger/src/test/java/org/apache/cxf/jaxrs/swagger/SwaggerUtilsTest.java
+++ b/rt/rs/description-swagger/src/test/java/org/apache/cxf/jaxrs/swagger/SwaggerUtilsTest.java
@@ -18,8 +18,11 @@
*/
package org.apache.cxf.jaxrs.swagger;
+import java.util.Map;
+
import org.apache.cxf.jaxrs.model.Parameter;
import org.apache.cxf.jaxrs.model.ParameterType;
+import org.apache.cxf.jaxrs.model.UserApplication;
import org.apache.cxf.jaxrs.model.UserOperation;
import org.apache.cxf.jaxrs.model.UserResource;
@@ -29,46 +32,44 @@ import org.junit.Test;
public class SwaggerUtilsTest extends Assert {
@Test
- public void testConvertSwagger12ToUserResource() {
- UserResource ur = SwaggerUtils.getUserResource("/swagger12.json");
+ public void testConvertSwaggerToUserApp() {
+ UserApplication ap = SwaggerUtils.getUserApplication("/swagger20.json");
+ assertNotNull(ap);
+ assertEquals("/services/helloservice", ap.getBasePath());
+ Map<String, UserResource> map = ap.getResourcesAsMap();
+ assertEquals(2, map.size());
+
+ UserResource ur = map.get("sayHello");
assertNotNull(ur);
- assertEquals("/hello", ur.getPath());
+ assertEquals("/sayHello", ur.getPath());
assertEquals(1, ur.getOperations().size());
UserOperation op = ur.getOperations().get(0);
- assertEquals("helloSubject", op.getName());
- assertEquals("/{subject}", op.getPath());
+ assertEquals("sayHello", op.getName());
+ assertEquals("/{a}", op.getPath());
assertEquals("GET", op.getVerb());
- assertEquals(1, op.getParameters().size());
- Parameter param = op.getParameters().get(0);
- assertEquals("subject", param.getName());
- assertEquals(ParameterType.PATH, param.getType());
- assertEquals(String.class, param.getJavaType());
- }
- @Test
- public void testConvertSwagger20ToUserResource() {
- UserResource ur = SwaggerUtils.getUserResource("/swagger20.json");
- assertNotNull(ur);
- assertEquals("/base", ur.getPath());
- assertEquals(1, ur.getOperations().size());
- UserOperation op = ur.getOperations().get(0);
- assertEquals("postOp", op.getName());
- assertEquals("/somepath", op.getPath());
- assertEquals("POST", op.getVerb());
- assertEquals("application/x-www-form-urlencoded", op.getConsumes());
- assertEquals("application/json", op.getProduces());
+ assertEquals("text/plain", op.getProduces());
- assertEquals(3, op.getParameters().size());
+ assertEquals(1, op.getParameters().size());
Parameter param1 = op.getParameters().get(0);
- assertEquals("userName", param1.getName());
- assertEquals(ParameterType.FORM, param1.getType());
+ assertEquals("a", param1.getName());
+ assertEquals(ParameterType.PATH, param1.getType());
assertEquals(String.class, param1.getJavaType());
- Parameter param2 = op.getParameters().get(1);
- assertEquals("password", param2.getName());
- assertEquals(ParameterType.FORM, param2.getType());
+
+ UserResource ur2 = map.get("sayHello2");
+ assertNotNull(ur2);
+ assertEquals("/sayHello2", ur2.getPath());
+ assertEquals(1, ur2.getOperations().size());
+ UserOperation op2 = ur2.getOperations().get(0);
+ assertEquals("sayHello", op2.getName());
+ assertEquals("/{a}", op2.getPath());
+ assertEquals("GET", op2.getVerb());
+ assertEquals("text/plain", op2.getProduces());
+
+ assertEquals(1, op2.getParameters().size());
+ Parameter param2 = op.getParameters().get(0);
+ assertEquals("a", param2.getName());
+ assertEquals(ParameterType.PATH, param2.getType());
assertEquals(String.class, param2.getJavaType());
- Parameter param3 = op.getParameters().get(2);
- assertEquals("type", param3.getName());
- assertEquals(ParameterType.MATRIX, param3.getType());
- assertEquals(String.class, param3.getJavaType());
+
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/847216a3/rt/rs/description-swagger/src/test/resources/swagger12.json
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/test/resources/swagger12.json b/rt/rs/description-swagger/src/test/resources/swagger12.json
deleted file mode 100644
index d6b3bab..0000000
--- a/rt/rs/description-swagger/src/test/resources/swagger12.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "swaggerVersion": "1.2",
- "basePath": "http://localhost:8000/greetings",
- "resourcePath": "/hello",
- "apis": [
- {
- "path": "/hello/{subject}",
- "operations": [
- {
- "method": "GET",
- "summary": "Greet our subject with hello!",
- "type": "string",
- "nickname": "helloSubject",
- "parameters": [
- {
- "name": "subject",
- "description": "The subject to be greeted.",
- "required": true,
- "type": "string",
- "paramType": "path"
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/847216a3/rt/rs/description-swagger/src/test/resources/swagger20.json
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/test/resources/swagger20.json b/rt/rs/description-swagger/src/test/resources/swagger20.json
index f8f264d..6fce994 100644
--- a/rt/rs/description-swagger/src/test/resources/swagger20.json
+++ b/rt/rs/description-swagger/src/test/resources/swagger20.json
@@ -1,44 +1,48 @@
{
- "swagger": "2.0",
- "basePath": "/base",
- "paths":
- {
- "/somepath":
- {
- "post": {
- "operationId": "postOp",
- "consumes": [
- "application/x-www-form-urlencoded"
- ],
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "formData",
- "name": "userName",
- "type": "string"
- },
- {
- "in": "formData",
- "name": "password",
- "type": "string"
- },
- {
- "name": "type",
- "in": "matrix",
- "required": true,
- "type": "string",
- "enum": [
- "PROPAGATION",
- "NOTIFICATION",
- "SCHEDULED",
- "SYNCHRONIZATION",
- "PUSH"
- ]
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
+ "swagger":"2.0",
+ "info": {
+ "description":"The Application",
+ "version":"1.0.0",
+ "title":"Sample REST Application",
+ "contact": {"name":"users@cxf.apache.org"},
+ "license":{"name":"Apache 2.0 License","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}
+ },
+
+ basePath":"/services/helloservice",
+
+ "tags":[
+ {"name":"sayHello2"},
+ {"name":"sayHello"}
+ ],
+ "paths":
+ {
+ "/sayHello/{a}":
+ {
+ "get":
+ {
+ "tags":["sayHello"],
+ "operationId":"sayHello",
+ "produces":
+ ["text/plain"],
+ "parameters":
+ [
+ {"name":"a",
+ "in":"path",
+ "required":true,
+ "type":"string"
+ }
+ ],
+ "responses":
+ {
+ "200":
+ {
+ "description":"successful operation",
+ "schema":{"type":"string"},
+ "headers":{}
+ }
+ }
+ }
+ },
+ "/sayHello2/{a}":
+ {
+ "get":{"tags":["sayHello2"],"operationId":"sayHello","produces":["text/plain"],"parameters":[{"name":"a","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"},"headers":{}}}}}}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/847216a3/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
index bf758a7..3dfdb99 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
@@ -40,6 +40,7 @@ import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
import org.apache.cxf.jaxrs.model.Parameter;
import org.apache.cxf.jaxrs.model.ParameterType;
+import org.apache.cxf.jaxrs.model.UserApplication;
import org.apache.cxf.jaxrs.model.UserOperation;
import org.apache.cxf.jaxrs.model.UserResource;
import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
@@ -105,26 +106,33 @@ public abstract class AbstractSwagger2ServiceDescriptionTest extends AbstractBus
final WebClient client = createWebClient("/swagger.json");
try {
String swaggerJson = client.get(String.class);
- UserResource r = SwaggerUtils.getUserResourceFromJson(swaggerJson);
+ UserApplication ap = SwaggerUtils.getUserApplicationFromJson(swaggerJson);
+ assertNotNull(ap);
+
+ List<UserResource> urs = ap.getResources();
+ assertNotNull(urs);
+ assertEquals(1, urs.size());
+ UserResource r = urs.get(0);
+ assertEquals("/bookstore", r.getPath());
Map<String, UserOperation> map = r.getOperationsAsMap();
assertEquals(3, map.size());
UserOperation getBooksOp = map.get("getBooks");
assertEquals(HttpMethod.GET, getBooksOp.getVerb());
- assertEquals("/bookstore", getBooksOp.getPath());
+ assertEquals("/", getBooksOp.getPath());
assertEquals(MediaType.APPLICATION_JSON, getBooksOp.getProduces());
List<Parameter> getBooksOpParams = getBooksOp.getParameters();
assertEquals(1, getBooksOpParams.size());
assertEquals(ParameterType.QUERY, getBooksOpParams.get(0).getType());
UserOperation getBookOp = map.get("getBook");
assertEquals(HttpMethod.GET, getBookOp.getVerb());
- assertEquals("/bookstore/{id}", getBookOp.getPath());
+ assertEquals("/{id}", getBookOp.getPath());
assertEquals(MediaType.APPLICATION_JSON, getBookOp.getProduces());
List<Parameter> getBookOpParams = getBookOp.getParameters();
assertEquals(1, getBookOpParams.size());
assertEquals(ParameterType.PATH, getBookOpParams.get(0).getType());
UserOperation deleteOp = map.get("delete");
assertEquals(HttpMethod.DELETE, deleteOp.getVerb());
- assertEquals("/bookstore/{id}", deleteOp.getPath());
+ assertEquals("/{id}", deleteOp.getPath());
List<Parameter> delOpParams = deleteOp.getParameters();
assertEquals(1, delOpParams.size());
assertEquals(ParameterType.PATH, delOpParams.get(0).getType());
http://git-wip-us.apache.org/repos/asf/cxf/blob/847216a3/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java
index 492036b..aaada6f 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java
@@ -33,10 +33,13 @@ import javax.ws.rs.core.Response;
import org.apache.cxf.systest.jaxrs.Book;
+import io.swagger.annotations.Api;
+
//FIXME swagger-jaxrs 1.5.3 can't handle a self-recursive sub resource like Book. so hide Book for now
//import org.apache.cxf.systest.jaxrs.Book;
-@Path("/bookstore")
+@Path("/bookstore")
+@Api("/bookstore")
public class BookStore {
@Produces({ MediaType.APPLICATION_JSON })
@GET
http://git-wip-us.apache.org/repos/asf/cxf/blob/847216a3/systests/jaxrs/src/test/resources/org/apache/cxf/systest/jaxrs/description/swagger2-json.txt
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/resources/org/apache/cxf/systest/jaxrs/description/swagger2-json.txt b/systests/jaxrs/src/test/resources/org/apache/cxf/systest/jaxrs/description/swagger2-json.txt
deleted file mode 100644
index 0df74e4..0000000
--- a/systests/jaxrs/src/test/resources/org/apache/cxf/systest/jaxrs/description/swagger2-json.txt
+++ /dev/null
@@ -1 +0,0 @@
-{"swagger":"2.0","info":{"description":"The Application","version":"1.0.0","title":"Sample REST Application","contact":{"name":"users@cxf.apache.org"},"license":{"name":"Apache 2.0 License","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"host":"localhost:%s","basePath":"/","tags":[{"name":"bookstore"}],"paths":{"/bookstore":{"get":{"operationId":"getBooks","produces":["application/json"],"parameters":[{"name":"page","in":"query","required":false,"type":"integer","default":1,"format":"int32"}],"responses":{"default":{"description":"successful operation"}}}},"/bookstore/name/{id}":{"get":{"operationId":"getBookName","parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"},"headers":{}}}}},"/bookstore/names":{"get":{"operationId":"getBookNames","produces":["application/json"],"parameters":[{"name":"page","in":"query","required":false,"type":"integer","default":1,"format":"int3
2"}],"responses":{"default":{"description":"successful operation"}}}},"/bookstore/{id}":{"get":{"operationId":"getBook","produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Book"},"headers":{}}}},"delete":{"operationId":"delete","parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"default":{"description":"successful operation"}}}}},"definitions":{"Book":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer","format":"int64"}},"xml":{"name":"Book"}}}}
http://git-wip-us.apache.org/repos/asf/cxf/blob/847216a3/systests/jaxrs/src/test/resources/org/apache/cxf/systest/jaxrs/description/swagger2-noano-json.txt
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/resources/org/apache/cxf/systest/jaxrs/description/swagger2-noano-json.txt b/systests/jaxrs/src/test/resources/org/apache/cxf/systest/jaxrs/description/swagger2-noano-json.txt
deleted file mode 100644
index 1a92fcf..0000000
--- a/systests/jaxrs/src/test/resources/org/apache/cxf/systest/jaxrs/description/swagger2-noano-json.txt
+++ /dev/null
@@ -1 +0,0 @@
-{"swagger":"2.0","info":{"description":"The Application","version":"1.0.0","title":"Sample REST Application","contact":{"name":"users@cxf.apache.org"},"license":{"name":"Apache 2.0 License","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"host":"localhost:%s","basePath":"/","paths":{"/bookstore/name/{id}":{"get":{"operationId":"getBookName","parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"},"headers":{}}}}},"/bookstore/names":{"get":{"operationId":"getBookNames","parameters":[{"name":"page","in":"query","required":false,"type":"integer","default":1,"format":"int32"}],"responses":{"default":{"description":"successful operation"}}}},"/bookstore/{id}":{"delete":{"operationId":"delete","parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"default":{"description":"successful operation"}}}}}}
[12/30] cxf git commit: [CXF-7157] Support for the client side bean
validation for JAX-RS and JAX-WS (further minor updates might be needed for
JAX-WS)
Posted by re...@apache.org.
[CXF-7157] Support for the client side bean validation for JAX-RS and JAX-WS (further minor updates might be needed for JAX-WS)
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/75093fe6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/75093fe6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/75093fe6
Branch: refs/heads/CXF-6882.nio
Commit: 75093fe6a833af5c96b136005dc9d993123adc9e
Parents: 71376c2
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Mon Nov 28 15:00:12 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Mon Nov 28 15:00:12 2016 +0000
----------------------------------------------------------------------
.../AbstractBeanValidationInterceptor.java | 63 ++++++++++++++++++++
.../AbstractValidationInterceptor.java | 20 ++++---
.../cxf/validation/BeanValidationFeature.java | 5 +-
.../validation/BeanValidationInInterceptor.java | 39 +-----------
.../validation/ClientBeanValidationFeature.java | 50 ++++++++++++++++
.../ClientBeanValidationOutInterceptor.java | 30 ++++++++++
.../cxf/jaxrs/client/ClientProxyImpl.java | 21 ++++---
.../jaxrs/client/JAXRSClientFactoryBean.java | 1 +
.../JAXRSClientBeanValidationFeature.java | 40 +++++++++++++
...JAXRSClientBeanValidationOutInterceptor.java | 40 +++++++++++++
.../JAXRSClientServerValidationSpringTest.java | 24 ++++++++
11 files changed, 279 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/core/src/main/java/org/apache/cxf/validation/AbstractBeanValidationInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/validation/AbstractBeanValidationInterceptor.java b/core/src/main/java/org/apache/cxf/validation/AbstractBeanValidationInterceptor.java
new file mode 100644
index 0000000..a7b25e0
--- /dev/null
+++ b/core/src/main/java/org/apache/cxf/validation/AbstractBeanValidationInterceptor.java
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.validation;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import javax.validation.ValidationException;
+
+import org.apache.cxf.message.Message;
+
+public abstract class AbstractBeanValidationInterceptor extends AbstractValidationInterceptor {
+ protected AbstractBeanValidationInterceptor(String phase) {
+ super(phase);
+ }
+
+ protected Object getServiceObject(Message message) {
+ return checkNotNull(super.getServiceObject(message), "SERVICE_OBJECT_NULL");
+ }
+
+ protected Method getServiceMethod(Message message) {
+ return (Method)checkNotNull(super.getServiceMethod(message), "SERVICE_METHOD_NULL");
+ }
+
+ private Object checkNotNull(Object object, String name) {
+ if (object == null) {
+ String message = new org.apache.cxf.common.i18n.Message(name, BUNDLE).toString();
+ LOG.severe(message);
+ throw new ValidationException(message.toString());
+ }
+ return object;
+ }
+
+ @Override
+ protected void handleValidation(final Message message, final Object resourceInstance,
+ final Method method, final List<Object> arguments) {
+ if (arguments.size() > 0) {
+ BeanValidationProvider provider = getProvider(message);
+ provider.validateParameters(resourceInstance, method, unwrapArgs(arguments).toArray());
+ message.getExchange().put(BeanValidationProvider.class, provider);
+ }
+ }
+
+ protected List<Object> unwrapArgs(List<Object> arguments) {
+ return arguments;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java b/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java
index 266d2c9..821d7d1 100644
--- a/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java
@@ -96,15 +96,21 @@ public abstract class AbstractValidationInterceptor extends AbstractPhaseInterce
protected Method getServiceMethod(Message message) {
Message inMessage = message.getExchange().getInMessage();
- Method method = (Method)inMessage.get("org.apache.cxf.resource.method");
- if (method == null) {
- BindingOperationInfo bop = inMessage.getExchange().getBindingOperationInfo();
- if (bop != null) {
- MethodDispatcher md = (MethodDispatcher)
- inMessage.getExchange().getService().get(MethodDispatcher.class.getName());
- method = md.getMethod(bop);
+ Method method = null;
+ if (inMessage != null) {
+ method = (Method)inMessage.get("org.apache.cxf.resource.method");
+ if (method == null) {
+ BindingOperationInfo bop = inMessage.getExchange().getBindingOperationInfo();
+ if (bop != null) {
+ MethodDispatcher md = (MethodDispatcher)
+ inMessage.getExchange().getService().get(MethodDispatcher.class.getName());
+ method = md.getMethod(bop);
+ }
}
}
+ if (method == null) {
+ method = message.getExchange().get(Method.class);
+ }
return method;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/core/src/main/java/org/apache/cxf/validation/BeanValidationFeature.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/validation/BeanValidationFeature.java b/core/src/main/java/org/apache/cxf/validation/BeanValidationFeature.java
index e5516fc..f4f1ef1 100644
--- a/core/src/main/java/org/apache/cxf/validation/BeanValidationFeature.java
+++ b/core/src/main/java/org/apache/cxf/validation/BeanValidationFeature.java
@@ -19,10 +19,13 @@
package org.apache.cxf.validation;
import org.apache.cxf.Bus;
+import org.apache.cxf.annotations.Provider;
+import org.apache.cxf.annotations.Provider.Scope;
+import org.apache.cxf.annotations.Provider.Type;
import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.interceptor.InterceptorProvider;
-
+@Provider(value = Type.Feature, scope = Scope.Server)
public class BeanValidationFeature extends AbstractFeature {
private BeanValidationProvider validationProvider;
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java b/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java
index 15d1b67..2e87f96 100644
--- a/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java
@@ -18,50 +18,13 @@
*/
package org.apache.cxf.validation;
-import java.lang.reflect.Method;
-import java.util.List;
-
-import javax.validation.ValidationException;
-
-import org.apache.cxf.message.Message;
import org.apache.cxf.phase.Phase;
-public class BeanValidationInInterceptor extends AbstractValidationInterceptor {
+public class BeanValidationInInterceptor extends AbstractBeanValidationInterceptor {
public BeanValidationInInterceptor() {
super(Phase.PRE_INVOKE);
}
public BeanValidationInInterceptor(String phase) {
super(phase);
}
-
- protected Object getServiceObject(Message message) {
- return checkNotNull(super.getServiceObject(message), "SERVICE_OBJECT_NULL");
- }
-
- protected Method getServiceMethod(Message message) {
- return (Method)checkNotNull(super.getServiceMethod(message), "SERVICE_METHOD_NULL");
- }
-
- private Object checkNotNull(Object object, String name) {
- if (object == null) {
- String message = new org.apache.cxf.common.i18n.Message(name, BUNDLE).toString();
- LOG.severe(message);
- throw new ValidationException(message.toString());
- }
- return object;
- }
-
- @Override
- protected void handleValidation(final Message message, final Object resourceInstance,
- final Method method, final List<Object> arguments) {
- if (arguments.size() > 0) {
- BeanValidationProvider provider = getProvider(message);
- provider.validateParameters(resourceInstance, method, unwrapArgs(arguments).toArray());
- message.getExchange().put(BeanValidationProvider.class, provider);
- }
- }
-
- protected List<Object> unwrapArgs(List<Object> arguments) {
- return arguments;
- }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/core/src/main/java/org/apache/cxf/validation/ClientBeanValidationFeature.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/validation/ClientBeanValidationFeature.java b/core/src/main/java/org/apache/cxf/validation/ClientBeanValidationFeature.java
new file mode 100644
index 0000000..67caff2
--- /dev/null
+++ b/core/src/main/java/org/apache/cxf/validation/ClientBeanValidationFeature.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.validation;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.annotations.Provider;
+import org.apache.cxf.annotations.Provider.Scope;
+import org.apache.cxf.annotations.Provider.Type;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.interceptor.InterceptorProvider;
+
+@Provider(value = Type.Feature, scope = Scope.Client)
+public class ClientBeanValidationFeature extends AbstractFeature {
+
+ private BeanValidationProvider validationProvider;
+
+ @Override
+ protected void initializeProvider(InterceptorProvider interceptorProvider, Bus bus) {
+ ClientBeanValidationOutInterceptor out = new ClientBeanValidationOutInterceptor();
+ addInterceptor(interceptorProvider, out);
+ }
+
+ protected void addInterceptor(InterceptorProvider interceptorProvider, ClientBeanValidationOutInterceptor out) {
+ if (validationProvider != null) {
+ out.setProvider(validationProvider);
+ }
+ interceptorProvider.getOutInterceptors().add(out);
+
+ }
+
+ public void setProvider(BeanValidationProvider provider) {
+ this.validationProvider = provider;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/core/src/main/java/org/apache/cxf/validation/ClientBeanValidationOutInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/validation/ClientBeanValidationOutInterceptor.java b/core/src/main/java/org/apache/cxf/validation/ClientBeanValidationOutInterceptor.java
new file mode 100644
index 0000000..c8e0401
--- /dev/null
+++ b/core/src/main/java/org/apache/cxf/validation/ClientBeanValidationOutInterceptor.java
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.validation;
+
+import org.apache.cxf.phase.Phase;
+
+public class ClientBeanValidationOutInterceptor extends AbstractBeanValidationInterceptor {
+ public ClientBeanValidationOutInterceptor() {
+ super(Phase.PRE_LOGICAL);
+ }
+ public ClientBeanValidationOutInterceptor(String phase) {
+ super(phase);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index af3c015..221cbd4 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -96,8 +96,7 @@ public class ClientProxyImpl extends AbstractClient implements
private static final ResourceBundle BUNDLE = BundleUtils.getBundle(ClientProxyImpl.class);
private static final String SLASH = "/";
private static final String BUFFER_PROXY_RESPONSE = "buffer.proxy.response";
- private static final String METHOD_PARAM_BODY_INDEX = "method.parameter.body.index";
- private static final String METHOD_PARAMS = "method.parameters";
+ private static final String PROXY_METHOD_PARAM_BODY_INDEX = "proxy.method.parameter.body.index";
private ClassResourceInfo cri;
private ClassLoader proxyLoader;
@@ -105,6 +104,7 @@ public class ClientProxyImpl extends AbstractClient implements
private boolean isRoot;
private Map<String, Object> valuesMap = Collections.emptyMap();
private BodyWriter bodyWriter = new BodyWriter();
+ private Client proxy;
public ClientProxyImpl(URI baseURI,
ClassLoader loader,
ClassResourceInfo cri,
@@ -128,7 +128,9 @@ public class ClientProxyImpl extends AbstractClient implements
initValuesMap(varValues);
cfg.getInInterceptors().add(new ClientAsyncResponseInterceptor());
}
-
+ void setProxyClient(Client client) {
+ this.proxy = client;
+ }
private void initValuesMap(Object... varValues) {
if (isRoot) {
List<String> vars = cri.getURITemplate().getVariables();
@@ -732,15 +734,18 @@ public class ClientProxyImpl extends AbstractClient implements
outMessage.put(Annotation.class.getName(),
getMethodAnnotations(ori.getAnnotatedMethod(), bodyIndex));
- outMessage.put(METHOD_PARAMS, methodParams);
+ outMessage.getExchange().put(Message.SERVICE_OBJECT, proxy);
+ if (methodParams != null) {
+ outMessage.put(List.class, Arrays.asList(methodParams));
+ }
if (body != null) {
- outMessage.put(METHOD_PARAM_BODY_INDEX, bodyIndex);
+ outMessage.put(PROXY_METHOD_PARAM_BODY_INDEX, bodyIndex);
}
outMessage.getInterceptorChain().add(bodyWriter);
Map<String, Object> reqContext = getRequestContext(outMessage);
reqContext.put(OperationResourceInfo.class.getName(), ori);
- reqContext.put(METHOD_PARAM_BODY_INDEX, bodyIndex);
+ reqContext.put(PROXY_METHOD_PARAM_BODY_INDEX, bodyIndex);
// execute chain
InvocationCallback<Object> asyncCallback = checkAsyncCallback(ori, reqContext);
@@ -828,7 +833,7 @@ public class ClientProxyImpl extends AbstractClient implements
Map<String, Object> invContext) throws Throwable {
Map<String, Object> reqContext = CastUtils.cast((Map<?, ?>)invContext.get(REQUEST_CONTEXT));
- int bodyIndex = body != null ? (Integer)reqContext.get(METHOD_PARAM_BODY_INDEX) : -1;
+ int bodyIndex = body != null ? (Integer)reqContext.get(PROXY_METHOD_PARAM_BODY_INDEX) : -1;
OperationResourceInfo ori =
(OperationResourceInfo)reqContext.get(OperationResourceInfo.class.getName());
return doChainedInvocation(newRequestURI, headers, ori, null,
@@ -906,7 +911,7 @@ public class ClientProxyImpl extends AbstractClient implements
}
Method method = ori.getMethodToInvoke();
- int bodyIndex = (Integer)outMessage.get(METHOD_PARAM_BODY_INDEX);
+ int bodyIndex = (Integer)outMessage.get(PROXY_METHOD_PARAM_BODY_INDEX);
Annotation[] anns = customAnns != null ? customAnns
: getMethodAnnotations(ori.getAnnotatedMethod(), bodyIndex);
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
index 936c43d..79d8b04 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
@@ -323,6 +323,7 @@ public class JAXRSClientFactoryBean extends AbstractJAXRSFactoryBean {
ClassLoader theLoader = proxyLoader == null ? cri.getServiceClass().getClassLoader() : proxyLoader;
Class<?>[] ifaces = new Class[]{Client.class, InvocationHandlerAware.class, cri.getServiceClass()};
Client actualClient = (Client)ProxyHelper.getProxy(theLoader, ifaces, proxyImpl);
+ proxyImpl.setProxyClient(actualClient);
notifyLifecycleManager(actualClient);
this.getServiceFactory().sendEvent(FactoryBeanListener.Event.CLIENT_CREATED, actualClient, ep);
return actualClient;
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/validation/JAXRSClientBeanValidationFeature.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/validation/JAXRSClientBeanValidationFeature.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/validation/JAXRSClientBeanValidationFeature.java
new file mode 100644
index 0000000..9e45eab
--- /dev/null
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/validation/JAXRSClientBeanValidationFeature.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.client.validation;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.annotations.Provider;
+import org.apache.cxf.annotations.Provider.Scope;
+import org.apache.cxf.annotations.Provider.Type;
+import org.apache.cxf.interceptor.InterceptorProvider;
+import org.apache.cxf.validation.ClientBeanValidationFeature;
+
+@Provider(value = Type.Feature, scope = Scope.Client)
+public class JAXRSClientBeanValidationFeature extends ClientBeanValidationFeature {
+ private boolean wrapInProcessingException;
+ @Override
+ protected void initializeProvider(InterceptorProvider interceptorProvider, Bus bus) {
+ JAXRSClientBeanValidationOutInterceptor out = new JAXRSClientBeanValidationOutInterceptor();
+ out.setWrapInProcessingException(wrapInProcessingException);
+ super.addInterceptor(interceptorProvider, out);
+ }
+ public void setWrapInProcessingException(boolean wrapInProcessingException) {
+ this.wrapInProcessingException = wrapInProcessingException;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/validation/JAXRSClientBeanValidationOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/validation/JAXRSClientBeanValidationOutInterceptor.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/validation/JAXRSClientBeanValidationOutInterceptor.java
new file mode 100644
index 0000000..c2c155b
--- /dev/null
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/validation/JAXRSClientBeanValidationOutInterceptor.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.client.validation;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.cxf.message.Message;
+import org.apache.cxf.validation.ClientBeanValidationOutInterceptor;
+
+public class JAXRSClientBeanValidationOutInterceptor extends ClientBeanValidationOutInterceptor {
+ private boolean wrapInProcessingException;
+
+ @Override
+ protected void handleValidation(Message message, Object resourceInstance,
+ Method method, List<Object> arguments) {
+ message.getExchange().put("wrap.in.processing.exception", wrapInProcessingException);
+ super.handleValidation(message, resourceInstance, method, arguments);
+ }
+
+ public void setWrapInProcessingException(boolean wrapInProcessingException) {
+ this.wrapInProcessingException = wrapInProcessingException;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/75093fe6/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/spring/JAXRSClientServerValidationSpringTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/spring/JAXRSClientServerValidationSpringTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/spring/JAXRSClientServerValidationSpringTest.java
index b067b39..73cb899 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/spring/JAXRSClientServerValidationSpringTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/spring/JAXRSClientServerValidationSpringTest.java
@@ -18,6 +18,9 @@
*/
package org.apache.cxf.systest.jaxrs.validation.spring;
+import java.util.Arrays;
+
+import javax.validation.ConstraintViolationException;
import javax.ws.rs.BadRequestException;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.Response;
@@ -28,6 +31,8 @@ import javax.xml.ws.soap.SOAPBinding;
import javax.xml.ws.soap.SOAPFaultException;
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
+import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
+import org.apache.cxf.jaxrs.client.validation.JAXRSClientBeanValidationFeature;
import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
import org.apache.cxf.systest.jaxrs.AbstractSpringServer;
import org.apache.cxf.systest.jaxrs.validation.AbstractJAXRSValidationTest;
@@ -95,6 +100,25 @@ public class JAXRSClientServerValidationSpringTest extends AbstractJAXRSValidati
}
}
+
+ @Test
+ public void testHelloRestValidationFailsIfNameIsNullClient() throws Exception {
+ JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
+ bean.setAddress("http://localhost:" + PORT + "/bwrest");
+ bean.setServiceClass(BookWorld.class);
+ bean.setFeatures(Arrays.asList(new JAXRSClientBeanValidationFeature()));
+ BookWorld service = bean.create(BookWorld.class);
+ BookWithValidation bw = service.echoBook(new BookWithValidation("RS", "123"));
+ assertEquals("123", bw.getId());
+
+ try {
+ service.echoBook(new BookWithValidation(null, "123"));
+ fail("Validation failure expected");
+ } catch (ConstraintViolationException ex) {
+ // complete
+ }
+
+ }
@Test
public void testHelloSoapValidationFailsIfNameIsNull() throws Exception {
final QName serviceName = new QName("http://bookworld.com", "BookWorld");
[02/30] cxf git commit: [CXF-7119] Adding a test resource
Posted by re...@apache.org.
[CXF-7119] Adding a test resource
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/897e71a7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/897e71a7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/897e71a7
Branch: refs/heads/CXF-6882.nio
Commit: 897e71a7b5f406e275825e00828811641fb1ddb2
Parents: 4eacc1d
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Nov 24 11:03:26 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Nov 24 11:03:26 2016 +0000
----------------------------------------------------------------------
.../systest/jaxrs/CustomFaultInInterceptor.java | 41 ++++++++++++++++++++
1 file changed, 41 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/897e71a7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomFaultInInterceptor.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomFaultInInterceptor.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomFaultInInterceptor.java
new file mode 100644
index 0000000..bd29c08
--- /dev/null
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomFaultInInterceptor.java
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jaxrs;
+
+import javax.ws.rs.ProcessingException;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class CustomFaultInInterceptor extends AbstractPhaseInterceptor<Message> {
+ public CustomFaultInInterceptor() {
+ super(Phase.PRE_STREAM);
+ }
+
+ public void handleMessage(Message message) throws Fault {
+ Exception ex = message.getContent(Exception.class);
+ throw new ProcessingException(ex.getCause().getClass().getSimpleName()
+ + ": Microservice at "
+ + message.get(Message.REQUEST_URI)
+ + " is not available");
+ }
+
+}
[27/30] cxf git commit: Completing the NPE checking code in the basic
json writer
Posted by re...@apache.org.
Completing the NPE checking code in the basic json writer
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d99c9ad3
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d99c9ad3
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d99c9ad3
Branch: refs/heads/CXF-6882.nio
Commit: d99c9ad353894b95b6ae866a7e63b9dbb8a0665c
Parents: 4dcf512
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Fri Dec 2 16:50:13 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Fri Dec 2 16:50:13 2016 +0000
----------------------------------------------------------------------
.../apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/d99c9ad3/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java b/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
index d1fb1f5..abf6eef 100644
--- a/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
+++ b/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
@@ -305,6 +305,9 @@ public class JsonMapObjectReaderWriter {
@Override
public Output append(String str) {
try {
+ if (str == null) {
+ str = "null";
+ }
os.write(StringUtils.toBytesUTF8(str));
} catch (IOException ex) {
throw new RuntimeException(ex);
[15/30] cxf git commit: [CXF-6836] Starting converting the tests to
use SwaggerUtils
Posted by re...@apache.org.
[CXF-6836] Starting converting the tests to use SwaggerUtils
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5954d4ce
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5954d4ce
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5954d4ce
Branch: refs/heads/CXF-6882.nio
Commit: 5954d4ce3c9713c17c3bbb8b730fad210aebfb3a
Parents: 5226685
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Tue Nov 29 16:49:03 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Tue Nov 29 16:49:03 2016 +0000
----------------------------------------------------------------------
.../apache/cxf/jaxrs/swagger/SwaggerUtils.java | 7 ++-
systests/jaxrs/pom.xml | 5 ++
.../AbstractSwagger2ServiceDescriptionTest.java | 49 ++++++++++++++------
.../Swagger2FilterServiceDescriptionTest.java | 11 +++--
...gger2NonAnnotatedServiceDescriptionTest.java | 9 ++--
.../Swagger2RegularServiceDescriptionTest.java | 11 +++--
.../jaxrs/description/group1/BookStore.java | 37 ++++-----------
7 files changed, 72 insertions(+), 57 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/5954d4ce/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java
index 2438458..c0d7c6b 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerUtils.java
@@ -18,6 +18,7 @@
*/
package org.apache.cxf.jaxrs.swagger;
+import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
@@ -69,12 +70,15 @@ public final class SwaggerUtils {
if (is == null) {
return null;
}
- return getUserResourceFromJson(IOUtils.readStringFromStream(is));
+ return getUserResourceFromStream(is);
} catch (Exception ex) {
LOG.warning("Problem with processing a user model at " + loc);
}
return null;
}
+ public static UserResource getUserResourceFromStream(InputStream is) throws IOException {
+ return getUserResourceFromJson(IOUtils.readStringFromStream(is));
+ }
public static List<UserResource> getUserResourcesFromResourceObjects(List<String> jsonObjects) {
List<UserResource> resources = new ArrayList<UserResource>();
for (String json : jsonObjects) {
@@ -137,7 +141,6 @@ public final class SwaggerUtils {
Parameter userParam = new Parameter(pType, name);
setJavaType(userParam, (String)param.get("type"));
-
userOpParams.add(userParam);
}
if (!userOpParams.isEmpty()) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/5954d4ce/systests/jaxrs/pom.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/pom.xml b/systests/jaxrs/pom.xml
index fe9bc56..7dbb2f7 100644
--- a/systests/jaxrs/pom.xml
+++ b/systests/jaxrs/pom.xml
@@ -328,6 +328,11 @@
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-json-basic</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-rx</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/cxf/blob/5954d4ce/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
index c4bfd95..bf758a7 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
@@ -21,7 +21,10 @@ package org.apache.cxf.systest.jaxrs.description;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import javax.ws.rs.HttpMethod;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
@@ -35,17 +38,20 @@ import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
+import org.apache.cxf.jaxrs.model.Parameter;
+import org.apache.cxf.jaxrs.model.ParameterType;
+import org.apache.cxf.jaxrs.model.UserOperation;
+import org.apache.cxf.jaxrs.model.UserResource;
import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
+import org.apache.cxf.jaxrs.swagger.SwaggerUtils;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
import org.junit.Ignore;
import org.junit.Test;
-import org.skyscreamer.jsonassert.JSONAssert;
import org.yaml.snakeyaml.Yaml;
-
public abstract class AbstractSwagger2ServiceDescriptionTest extends AbstractBusClientServerTestBase {
@Ignore
@@ -93,21 +99,36 @@ public abstract class AbstractSwagger2ServiceDescriptionTest extends AbstractBus
protected abstract String getPort();
- protected abstract String getExpectedFileJson();
-
protected abstract String getExpectedFileYaml();
- @Test
- @Ignore
- public void testApiListingIsProperlyReturnedJSON() throws Exception {
+ protected void doTestApiListingIsProperlyReturnedJSON() throws Exception {
final WebClient client = createWebClient("/swagger.json");
try {
- final Response r = client.get();
- assertEquals(Status.OK.getStatusCode(), r.getStatus());
- JSONAssert.assertEquals(
- getExpectedValue(getExpectedFileJson(), getPort()),
- IOUtils.readStringFromStream((InputStream)r.getEntity()),
- false);
+ String swaggerJson = client.get(String.class);
+ UserResource r = SwaggerUtils.getUserResourceFromJson(swaggerJson);
+ Map<String, UserOperation> map = r.getOperationsAsMap();
+ assertEquals(3, map.size());
+ UserOperation getBooksOp = map.get("getBooks");
+ assertEquals(HttpMethod.GET, getBooksOp.getVerb());
+ assertEquals("/bookstore", getBooksOp.getPath());
+ assertEquals(MediaType.APPLICATION_JSON, getBooksOp.getProduces());
+ List<Parameter> getBooksOpParams = getBooksOp.getParameters();
+ assertEquals(1, getBooksOpParams.size());
+ assertEquals(ParameterType.QUERY, getBooksOpParams.get(0).getType());
+ UserOperation getBookOp = map.get("getBook");
+ assertEquals(HttpMethod.GET, getBookOp.getVerb());
+ assertEquals("/bookstore/{id}", getBookOp.getPath());
+ assertEquals(MediaType.APPLICATION_JSON, getBookOp.getProduces());
+ List<Parameter> getBookOpParams = getBookOp.getParameters();
+ assertEquals(1, getBookOpParams.size());
+ assertEquals(ParameterType.PATH, getBookOpParams.get(0).getType());
+ UserOperation deleteOp = map.get("delete");
+ assertEquals(HttpMethod.DELETE, deleteOp.getVerb());
+ assertEquals("/bookstore/{id}", deleteOp.getPath());
+ List<Parameter> delOpParams = deleteOp.getParameters();
+ assertEquals(1, delOpParams.size());
+ assertEquals(ParameterType.PATH, delOpParams.get(0).getType());
+
} finally {
client.close();
}
@@ -134,7 +155,7 @@ public abstract class AbstractSwagger2ServiceDescriptionTest extends AbstractBus
}
}
- private WebClient createWebClient(final String url) {
+ protected WebClient createWebClient(final String url) {
return WebClient
.create("http://localhost:" + getPort() + url,
Arrays.< Object >asList(new JacksonJsonProvider()),
http://git-wip-us.apache.org/repos/asf/cxf/blob/5954d4ce/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2FilterServiceDescriptionTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2FilterServiceDescriptionTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2FilterServiceDescriptionTest.java
index 2ca5455..699c7d0 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2FilterServiceDescriptionTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2FilterServiceDescriptionTest.java
@@ -19,6 +19,7 @@
package org.apache.cxf.systest.jaxrs.description;
import org.junit.BeforeClass;
+import org.junit.Test;
public class Swagger2FilterServiceDescriptionTest extends AbstractSwagger2ServiceDescriptionTest {
private static final String PORT = allocatePort(Swagger2FilterServiceDescriptionTest.class);
@@ -44,12 +45,12 @@ public class Swagger2FilterServiceDescriptionTest extends AbstractSwagger2Servic
}
@Override
- protected String getExpectedFileJson() {
- return "swagger2-json.txt";
- }
-
- @Override
protected String getExpectedFileYaml() {
return "swagger2-yaml.txt";
}
+
+ @Test
+ public void testApiListingIsProperlyReturnedJSON() throws Exception {
+ doTestApiListingIsProperlyReturnedJSON();
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5954d4ce/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2NonAnnotatedServiceDescriptionTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2NonAnnotatedServiceDescriptionTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2NonAnnotatedServiceDescriptionTest.java
index dd56fe2..f3cb800 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2NonAnnotatedServiceDescriptionTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2NonAnnotatedServiceDescriptionTest.java
@@ -28,6 +28,7 @@ import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
import org.apache.cxf.systest.jaxrs.description.group1.BookStore;
import org.junit.BeforeClass;
+import org.junit.Test;
public class Swagger2NonAnnotatedServiceDescriptionTest extends AbstractSwagger2ServiceDescriptionTest {
private static final String PORT = allocatePort(Swagger2NonAnnotatedServiceDescriptionTest.class);
@@ -70,11 +71,11 @@ public class Swagger2NonAnnotatedServiceDescriptionTest extends AbstractSwagger2
return PORT;
}
- @Override
- protected String getExpectedFileJson() {
- return "swagger2-noano-json.txt";
+ @Test
+ public void testApiListingIsProperlyReturnedJSON() throws Exception {
+ doTestApiListingIsProperlyReturnedJSON();
}
-
+
@Override
protected String getExpectedFileYaml() {
return "swagger2-noano-yaml.txt";
http://git-wip-us.apache.org/repos/asf/cxf/blob/5954d4ce/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2RegularServiceDescriptionTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2RegularServiceDescriptionTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2RegularServiceDescriptionTest.java
index a95bfd6..23d5cfb 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2RegularServiceDescriptionTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2RegularServiceDescriptionTest.java
@@ -19,6 +19,7 @@
package org.apache.cxf.systest.jaxrs.description;
import org.junit.BeforeClass;
+import org.junit.Test;
public class Swagger2RegularServiceDescriptionTest extends AbstractSwagger2ServiceDescriptionTest {
private static final String PORT = allocatePort(Swagger2RegularServiceDescriptionTest.class);
@@ -44,12 +45,12 @@ public class Swagger2RegularServiceDescriptionTest extends AbstractSwagger2Servi
}
@Override
- protected String getExpectedFileJson() {
- return "swagger2-json.txt";
- }
-
- @Override
protected String getExpectedFileYaml() {
return "swagger2-yaml.txt";
}
+
+ @Test
+ public void testApiListingIsProperlyReturnedJSON() throws Exception {
+ doTestApiListingIsProperlyReturnedJSON();
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5954d4ce/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java
index f9bf4d7..492036b 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/group1/BookStore.java
@@ -31,47 +31,30 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.cxf.systest.jaxrs.Book;
+
//FIXME swagger-jaxrs 1.5.3 can't handle a self-recursive sub resource like Book. so hide Book for now
//import org.apache.cxf.systest.jaxrs.Book;
@Path("/bookstore")
public class BookStore {
-// @Produces({ MediaType.APPLICATION_JSON })
-// @GET
-// public Response getBooks(
-// @QueryParam("page") @DefaultValue("1") int page) {
-// return Response.ok(
-// Arrays.asList(
-// new Book("Book 1", 1),
-// new Book("Book 2", 2)
-// )
-// ).build();
-// }
-//
-// @Produces({ MediaType.APPLICATION_JSON })
-// @Path("/{id}")
-// @GET
-// public Book getBook(@PathParam("id") Long id) {
-// return new Book("Book", id);
-// }
-
@Produces({ MediaType.APPLICATION_JSON })
@GET
- @Path("/names")
- public Response getBookNames(
+ public Response getBooks(
@QueryParam("page") @DefaultValue("1") int page) {
return Response.ok(
Arrays.asList(
- "Book 1",
- "Book 2"
+ new Book("Book 1", 1),
+ new Book("Book 2", 2)
)
).build();
}
-
- @Path("/name/{id}")
+
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Path("/{id}")
@GET
- public String getBookName(@PathParam("id") String id) {
- return "Book of " + id;
+ public Book getBook(@PathParam("id") Long id) {
+ return new Book("Book", id);
}
@Path("/{id}")
[21/30] cxf git commit: More FindBugs work
Posted by re...@apache.org.
More FindBugs work
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1d09de7a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1d09de7a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1d09de7a
Branch: refs/heads/CXF-6882.nio
Commit: 1d09de7af81f2f85958fe284a87273b75e1d2340
Parents: 8d0e977
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Thu Dec 1 12:10:56 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Thu Dec 1 12:10:56 2016 +0000
----------------------------------------------------------------------
.../main/java/org/apache/cxf/ext/logging/osgi/Activator.java | 2 +-
.../java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java | 7 ++++---
.../org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java | 2 +-
.../main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java | 4 ++--
.../org/apache/cxf/jaxrs/provider/JAXBElementProvider.java | 2 +-
.../cxf/jaxrs/security/KerberosAuthenticationFilter.java | 2 +-
.../src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java | 2 +-
.../src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java | 2 +-
.../org/apache/cxf/jaxws/context/WrappedMessageContext.java | 1 -
.../handler/logical/LogicalHandlerFaultOutInterceptor.java | 2 +-
.../jaxws/handler/logical/LogicalHandlerOutInterceptor.java | 2 +-
.../transport/http_jaxws_spi/HttpServletRequestAdapter.java | 6 +++---
.../transport/http_jaxws_spi/HttpServletResponseAdapter.java | 2 +-
.../org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java | 4 ++--
.../org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java | 2 +-
15 files changed, 21 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java
index 814de9a..815f7b9 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java
@@ -49,7 +49,7 @@ public class Activator implements BundleActivator {
}
- private final class ConfigUpdater implements ManagedService {
+ private static final class ConfigUpdater implements ManagedService {
private BundleContext bundleContext;
private ServiceRegistration serviceReg;
private ServiceRegistration intentReg;
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java
index f1dfdce..c412dde 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Logger;
@@ -194,9 +195,9 @@ public class ConfigurationImpl implements Configuration {
metadata = new HashMap<Class<?>, Integer>();
providers.put(provider, metadata);
}
- for (Class<?> contract : contracts.keySet()) {
- if (contract.isAssignableFrom(provider.getClass())) {
- metadata.put(contract, contracts.get(contract));
+ for (Entry<Class<?>, Integer> entry : contracts.entrySet()) {
+ if (entry.getKey().isAssignableFrom(provider.getClass())) {
+ metadata.put(entry.getKey(), entry.getValue());
}
}
return true;
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java
index 601edb8..64b7a15 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java
@@ -179,7 +179,7 @@ public class NewCookieHeaderProvider implements HeaderDelegate<NewCookie> {
if (0 == len) {
return true;
}
- if ('"' == value.charAt(0) & '"' == value.charAt(len - 1)) {
+ if ('"' == value.charAt(0) && '"' == value.charAt(len - 1)) {
// already wrapped with quotes
return false;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
index b18eac3..624a1e7 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
@@ -913,7 +913,7 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
if (index != -1) {
String[] schemePair = uri.substring(0, index).split(":");
this.host = schemePair[0];
- this.port = schemePair.length == 2 ? Integer.valueOf(schemePair[1]) : -1;
+ this.port = schemePair.length == 2 ? Integer.parseInt(schemePair[1]) : -1;
}
uri = uri.substring(index);
@@ -1016,7 +1016,7 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
return map;
}
- private class UriParts {
+ private static class UriParts {
String path;
String query;
String fragment;
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
index a2593cf..c331492 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
@@ -521,7 +521,7 @@ public class JAXBElementProvider<T> extends AbstractJAXBProvider<T> {
Collection<Attachment> attachments = getAttachments(true);
if (attachments != null) {
Object value = getContext().getContextualProperty(Message.MTOM_THRESHOLD);
- Integer threshold = value != null ? Integer.valueOf(value.toString()) : 0;
+ Integer threshold = value != null ? Integer.valueOf(value.toString()) : Integer.valueOf(0);
ms.setAttachmentMarshaller(new JAXBAttachmentMarshaller(
attachments, threshold));
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/KerberosAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/KerberosAuthenticationFilter.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/KerberosAuthenticationFilter.java
index b5994d6..455083c 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/KerberosAuthenticationFilter.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/KerberosAuthenticationFilter.java
@@ -203,7 +203,7 @@ public class KerberosAuthenticationFilter implements ContainerRequestFilter {
this.callbackHandler = callbackHandler;
}
- private final class ValidateServiceTicketAction implements PrivilegedExceptionAction<byte[]> {
+ private static final class ValidateServiceTicketAction implements PrivilegedExceptionAction<byte[]> {
private final GSSContext context;
private final byte[] token;
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
index d38255b..778770b 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
@@ -264,7 +264,7 @@ public final class FormUtils {
return;
}
try {
- int maxPartsCount = Integer.valueOf(maxPartsCountProp);
+ int maxPartsCount = Integer.parseInt(maxPartsCountProp);
if (maxPartsCount != -1 && numberOfParts >= maxPartsCount) {
throw new WebApplicationException(413);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
index 1aa2f6b..321d5c5 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
@@ -305,7 +305,7 @@ public final class HttpUtils {
return -1;
}
try {
- int len = Integer.valueOf(value);
+ int len = Integer.parseInt(value);
return len >= 0 ? len : -1;
} catch (Exception ex) {
return -1;
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
index fa7cc77..a5db0e5 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
@@ -427,7 +427,6 @@ public class WrappedMessageContext implements MessageContext {
}
Object ret = null;
if ((MessageContext.HTTP_RESPONSE_HEADERS.equals(key)
- || MessageContext.HTTP_RESPONSE_CODE.equals(key)
|| MessageContext.HTTP_RESPONSE_CODE.equals(key))
&& !isResponse() && !isRequestor()) {
Message tmp = createResponseMessage();
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java
index bc7af9b..d8498b0 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java
@@ -83,7 +83,7 @@ public class LogicalHandlerFaultOutInterceptor
}
- private class LogicalHandlerFaultOutEndingInterceptor
+ private static class LogicalHandlerFaultOutEndingInterceptor
extends AbstractJAXWSHandlerInterceptor<Message> {
LogicalHandlerFaultOutEndingInterceptor(Binding binding) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
index 289a1e1..696eb75 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
@@ -100,7 +100,7 @@ public class LogicalHandlerOutInterceptor
}
}
- private class LogicalHandlerOutEndingInterceptor
+ private static class LogicalHandlerOutEndingInterceptor
extends AbstractJAXWSHandlerInterceptor<Message> {
LogicalHandlerOutEndingInterceptor(Binding binding) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java
index b4cbcf2..2886b4b 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java
@@ -274,7 +274,7 @@ class HttpServletRequestAdapter implements HttpServletRequest {
public long getDateHeader(String name) {
String s = this.getHeader(name);
- return s != null ? Long.valueOf(s) : 0;
+ return s != null ? Long.parseLong(s) : 0;
}
public String getHeader(String name) {
@@ -292,7 +292,7 @@ class HttpServletRequestAdapter implements HttpServletRequest {
public int getIntHeader(String name) {
String s = this.getHeader(name);
- return s != null ? Integer.valueOf(s) : 0;
+ return s != null ? Integer.parseInt(s) : 0;
}
public String getMethod() {
@@ -400,7 +400,7 @@ class HttpServletRequestAdapter implements HttpServletRequest {
throw new UnsupportedOperationException();
}
- private class ServletInputStreamAdapter extends ServletInputStream {
+ private static class ServletInputStreamAdapter extends ServletInputStream {
private InputStream delegate;
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletResponseAdapter.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletResponseAdapter.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletResponseAdapter.java
index df9f640..1abb66b 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletResponseAdapter.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/transport/http_jaxws_spi/HttpServletResponseAdapter.java
@@ -225,7 +225,7 @@ class HttpServletResponseAdapter implements HttpServletResponse {
this.setStatus(sc);
}
- private class ServletOutputStreamAdapter extends ServletOutputStream {
+ private static class ServletOutputStreamAdapter extends ServletOutputStream {
private OutputStream delegate;
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java b/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
index 768d8d9..2def391 100644
--- a/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
+++ b/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
@@ -713,7 +713,7 @@ public class DynamicClientFactory {
}
}
- class InnerErrorListener {
+ static class InnerErrorListener {
private String url;
private StringBuilder errors = new StringBuilder();
@@ -998,7 +998,7 @@ public class DynamicClientFactory {
}
return clone;
}
- public class LocationFilterReader extends StreamReaderDelegate {
+ public static class LocationFilterReader extends StreamReaderDelegate {
boolean isImport;
boolean isInclude;
int locIdx = -1;
http://git-wip-us.apache.org/repos/asf/cxf/blob/1d09de7a/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
----------------------------------------------------------------------
diff --git a/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java b/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
index 9d75953..9ba7563 100644
--- a/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
+++ b/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
@@ -183,7 +183,7 @@ public class TypeClassInitializer extends ServiceModelVisitor {
}
- private class ExceptionCreator extends ASMHelper {
+ private static class ExceptionCreator extends ASMHelper {
public Class<?> createExceptionClass(Class<?> bean) {
String newClassName = bean.getName() + "_Exception";
newClassName = newClassName.replaceAll("\\$", ".");
[30/30] cxf git commit: CXF-6882: Implement JAX-RS 2.1 NIO Proposal
Posted by re...@apache.org.
CXF-6882: Implement JAX-RS 2.1 NIO Proposal
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cfc99443
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cfc99443
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cfc99443
Branch: refs/heads/CXF-6882.nio
Commit: cfc9944348f35775e827cc39084336a08a01757b
Parents: 0891162
Author: reta <dr...@gmail.com>
Authored: Tue Oct 18 19:44:31 2016 -0400
Committer: reta <dr...@gmail.com>
Committed: Sat Dec 3 20:10:32 2016 -0500
----------------------------------------------------------------------
.../release/samples/jax_rs/nio_cdi/README.txt | 1 +
.../main/release/samples/jax_rs/nio_cdi/pom.xml | 125 ++
.../java/demo/jaxrs/nio/BooksApplication.java | 44 +
.../demo/jaxrs/nio/BooksRestServiceImpl.java | 69 +
.../main/java/demo/jaxrs/nio/BooksServer.java | 45 +
.../src/main/resources/META-INF/beans.xml | 10 +
.../META-INF/cxf/org.apache.cxf.Logger | 1 +
.../jax_rs/nio_cdi/src/main/resources/books.txt | 1270 ++++++++++++++++++
distribution/src/main/release/samples/pom.xml | 1 +
.../cxf/cdi/JAXRSCdiResourceExtension.java | 2 +-
.../cxf/jaxrs/impl/ResponseBuilderImpl.java | 11 +-
.../jaxrs/nio/DelegatingNioOutputStream.java | 57 +
.../nio/DelegatingNioServletOutputStream.java | 61 +
.../org/apache/cxf/jaxrs/nio/NioFeature.java | 40 +
.../apache/cxf/jaxrs/nio/NioInInterceptor.java | 91 ++
.../cxf/jaxrs/nio/NioMessageBodyWriter.java | 97 ++
.../apache/cxf/jaxrs/nio/NioWriteEntity.java | 40 +
.../org/apache/cxf/jaxrs/nio/NioWriterImpl.java | 68 +
.../transport/http/AbstractHTTPDestination.java | 23 +-
.../cxf/systest/jaxrs/nio/NioBookStore.java | 69 +
.../systest/jaxrs/nio/NioBookStoreServer.java | 69 +
.../cxf/systest/jaxrs/nio/NioBookStoreTest.java | 70 +
.../jaxrs/src/test/resources/files/books.txt | 1270 ++++++++++++++++++
23 files changed, 3526 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/README.txt
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/README.txt b/distribution/src/main/release/samples/jax_rs/nio_cdi/README.txt
new file mode 100644
index 0000000..048f01d
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/README.txt
@@ -0,0 +1 @@
+http://localhost:8282/rest/api/books
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/pom.xml b/distribution/src/main/release/samples/jax_rs/nio_cdi/pom.xml
new file mode 100644
index 0000000..a0727bb
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/pom.xml
@@ -0,0 +1,125 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <name>JAX-RS NIO/CDI Demo (Jetty 9)</name>
+ <description>JAX-RS NIO/CDI Demo (Jetty 9)</description>
+ <artifactId>jax_rs_nio_cdi</artifactId>
+
+ <parent>
+ <groupId>org.apache.cxf.samples</groupId>
+ <artifactId>cxf-samples</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <cxf.jetty9.version>9.3.5.v20151012</cxf.jetty9.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-integration-cdi</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ <version>2.2.16.Final</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <version>2.2.16.Final</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>apache-jsp</artifactId>
+ <version>${cxf.jetty9.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>server</id>
+ <build>
+ <defaultGoal>test</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>demo.jaxrs.nio.BooksServer</mainClass>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksApplication.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksApplication.java b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksApplication.java
new file mode 100644
index 0000000..9b0086c
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksApplication.java
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package demo.jaxrs.nio;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+
+import org.apache.cxf.jaxrs.nio.NioFeature;
+
+import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
+
+@ApplicationPath( "api" )
+public class BooksApplication extends Application {
+ @Inject private BooksRestServiceImpl booksRestService;
+
+ @Override
+ public Set<Object> getSingletons() {
+ final Set<Object> singletons = new HashSet<>();
+ singletons.add(new NioFeature());
+ singletons.add(booksRestService);
+ singletons.add(new JacksonJsonProvider());
+ return singletons;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksRestServiceImpl.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksRestServiceImpl.java b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksRestServiceImpl.java
new file mode 100644
index 0000000..7d644e2
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksRestServiceImpl.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package demo.jaxrs.nio;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.cxf.helpers.IOUtils;
+
+@Path("/books")
+public class BooksRestServiceImpl {
+ @GET
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ public Response readBooks(@QueryParam("path") String path) throws IOException {
+ final ByteArrayInputStream in = new ByteArrayInputStream(
+ IOUtils.readBytesFromStream(getClass().getResourceAsStream("/books.txt")));
+ final byte[] buffer = new byte[4096];
+
+ return Response.ok().entity(
+ out -> { // writer handler
+ try {
+ final int n = in.read(buffer);
+
+ if (n >= 0) {
+ out.write(buffer, 0, n);
+ return true;
+ }
+
+ return false;
+ } catch (IOException ex) {
+ throw new WebApplicationException(ex);
+ } finally {
+ try {
+ in.close();
+ } catch (IOException ex) {
+ /* do nothing */
+ }
+ }
+ },
+ throwable -> {
+ throw throwable;
+ }
+ ).build();
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksServer.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksServer.java b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksServer.java
new file mode 100644
index 0000000..c58da98
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/java/demo/jaxrs/nio/BooksServer.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package demo.jaxrs.nio;
+
+import org.apache.cxf.cdi.CXFCdiServlet;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.jboss.weld.environment.servlet.BeanManagerResourceBindingListener;
+import org.jboss.weld.environment.servlet.Listener;
+
+public class BooksServer {
+ public static void main( final String[] args ) throws Exception {
+ final Server server = new Server(8282);
+
+ // Register and map the dispatcher servlet
+ final ServletHolder servletHolder = new ServletHolder(new CXFCdiServlet());
+ final ServletContextHandler context = new ServletContextHandler();
+ context.setContextPath("/");
+ context.addEventListener(new Listener());
+ context.addEventListener(new BeanManagerResourceBindingListener());
+ context.addServlet(servletHolder, "/rest/*");
+
+ server.setHandler(context);
+ server.start();
+ server.join();
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/beans.xml b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..7e2559b
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_1.xsd"
+ version="1.1">
+
+ <scan>
+ <exclude name="org.apache.cxf.**" />
+ </scan>
+</beans>
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/cxf/org.apache.cxf.Logger
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/cxf/org.apache.cxf.Logger b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/cxf/org.apache.cxf.Logger
new file mode 100644
index 0000000..27dd788
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/META-INF/cxf/org.apache.cxf.Logger
@@ -0,0 +1 @@
+org.apache.cxf.common.logging.Slf4jLogger
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/books.txt
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/books.txt b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/books.txt
new file mode 100644
index 0000000..d830d91
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/nio_cdi/src/main/resources/books.txt
@@ -0,0 +1,1270 @@
+Molecular Breeding and Nutritional Aspects of Buckwheat
+{Progress in Heterocyclic Chemistry, Volume 28}
+Oral, Head and Neck Oncology and Reconstructive Surgery
+Pharmacology and Therapeutics for Dentistry
+Sedation
+Clinical Reasoning in Musculoskeletal Practice
+Maxillofacial Surgery
+A Practical Guide to Fascial Manipulation
+Case Studies in Clinical Cardiac Electrophysiology
+Liu, Volpe, and Galetta\u2019s Neuro-Ophthalmology
+Plotkin's Vaccines
+Hematology
+Integrative Medicine
+Gynecologic Pathology
+Swaiman's Pediatric Neurology
+Pathology of Melanocytic Tumors
+Zakim and Boyer's Hepatology
+Case Reviews in Ophthalmology
+Essential Echocardiography
+Evidence-Based Physical Diagnosis
+Pulmonary Pathology
+Manual for Pulmonary and Critical Care Medicine
+Nelson Pediatric Symptom-Based Diagnosis
+Arrhythmia Essentials
+Clinical Gynecologic Oncology
+Surgical Implantation of Cardiac Rhythm Devices
+Atlas of Image-Guided Spinal Procedures
+Goldberger's Clinical Electrocardiography
+Principles and Practice of Pediatric Infectious Diseases
+Kaufman's Clinical Neurology for Psychiatrists
+Cardiovascular Magnetic Resonance
+Practical Hepatic Pathology: A Diagnostic Approach
+Drugs for Pregnant and Lactating Women
+Volpe's Neurology of the Newborn
+Chronic Coronary Artery Disease
+Hypertension: A Companion to Braunwald's Heart Disease
+Practical Pulmonary Pathology: A Diagnostic Approach
+Obstetric Imaging: Expert Radiology
+Diagnostic Pathology of Infectious Disease
+Cardiac Electrophysiology: From Cell to Bedside
+Practical Surgical Neuropathology: A Diagnostic Approach
+The Interventional Cardiac Catheterization Handbook
+Imaging in Pediatrics
+Cardiology Secrets
+Nephrology Secrets
+Handbook of Liver Disease
+Braddom\u2019s Rehabilitation Care: A Clinical Handbook
+Interstitial Lung Disease
+Textbook of Clinical Hemodynamics
+Current Management of Diabetic Retinopathy
+Drug Allergy Testing
+Personalized Medicine in Asthma
+Urgent Care Dermatology: Symptom-Based Diagnosis
+Imaging in Spine Surgery
+Pediatric Cancer Genetics
+Handbook of Legal Medicine
+Sarcoidosis: A Specialist\u2019s Guide
+Heart Failure: Epidemiology and Research Methods
+Practical Guide to Obesity Medicine
+Music Therapy: Research and Evidence-Based Practice
+Human Milk Composition
+Skull Base Imaging
+Lung Cancer: Evidence-Based Clinical Evaluation and Management
+Challenging Neuropathic Pain Syndromes
+PET/CT in Cancer: An Interdisciplinary Approach to Individualized Imaging
+Arrhythmias in Adult Congenital Heart Disease
+State-of-the-Art Treatment of Osteoarthritis: A Practical Guide
+Peters' Atlas of Tropical Medicine and Parasitology
+Essentials of Global Health
+MacSween's Pathology of the Liver
+Diagnosis and Management of Adult Congenital Heart Disease
+Community Pharmacy
+Aulton's Pharmaceutics
+Medical Pharmacology and Therapeutics
+Diagnostic Atlas of Cutaneous Mesenchymal Neoplasia
+Disorders of the Rotator Cuff and Biceps Tendon
+Neurocritical Care Management of the Neurosurgical Patient
+Blumgart's Surgery of the Liver, Biliary Tract and Pancreas
+Master Techniques in Facial Rejuvenation
+The Anterior Cruciate Ligament
+Clinical Orthopaedic Rehabilitation: A Team Approach
+Cosmetic Facial Surgery
+Operative Techniques: Spine Surgery
+Operative Techniques: Hand and Wrist Surgery
+Aesthetic Surgery Techniques
+Principles of Gynecologic Oncology Surgery
+Principles of Neurological Surgery
+Operative Techniques: Knee Surgery
+Total Burn Care
+Lumbar Interbody Fusions
+Abernathy's Surgical Secrets
+Pediatric Head and Neck Masses
+Scaphoid Fractures: Evidence-Based Management
+Functional Neurosurgery and Neuromodulation
+Pathologic Basis of Veterinary Disease Expert Consult
+Rebhun's Diseases of Dairy Cattle
+Equine Internal Medicine
+Exotic Animal Formulary
+Textbook of Veterinary Diagnostic Radiology
+Small Animal Medical Differential Diagnosis
+Veterinary Medicine
+Soil Science Test Project
+Modern Detection Techniques for Food Safety and Quality
+Sweet potato processing technology
+Food Biosynthesis
+Food Bioconversion
+Soft Chemistry in Food Fermentation
+Ingredients Extraction by Physico-Chemical Methods
+Why Penguins Communicate
+ISTE topics in Agriculture 1
+Plant Macro-Nutrient Use Efficiency
+A Practical Guide to Sensory and Consumer Evaluation
+Food Processing Technology
+Kent\u2019s Technology of Cereals
+New Aspects of Meat Quality
+Chemical Contaminants and Residues in Food
+Regulatory Impact on Food Product Development in the European Union
+Lawrie�s Meat Science
+Advances in Sheep Welfare
+Cereal Grains
+Improving the Sensory and Nutritional Quality of Fresh Meat
+Proteins in Food Processing
+Poultry Quality Evaluation
+Food Microstructure and Its Relationship with Quality and Stability
+Baking Problems Solved
+Case Studies in Novel Food Processing Technologies
+Gluten-Free Ancient Grains
+Starch in Food
+Advances in Poultry Welfare
+Soft Drink and Fruit Juice Problems Solved
+Advances in Cattle Welfare
+Consumer Science and Strategic Marketing: Case Studies in the Wine Industry
+Sensory Panel Management
+Consumer Science and Strategic Marketing: Case Studies in the Traditional Food Sector
+Discrimination Testing in Sensory Science
+Advances in Pig Welfare
+Advances in Agricultural Animal Welfare
+Food Freezing and Frozen Food Storage
+Recognition Systems
+Cheese
+Introduction to Food Toxicology
+Enzymes
+Egg Innovation and Strategies for Improvement
+Genomics in Food Safety
+The Edible Aroids
+Wine Tasting
+Gorilla Pathology and Health
+Fruit Juices
+Sustainable Management of Arthropod Pests of Tomato
+The Teeth of Living Vertebrates, Volume 1
+Food Fortification in a Globalized World
+Nutrition in the Prevention and Treatment of Disease
+The Vitamins
+The Craft and Science of Coffee
+The Biology and Conservation of the Whooping Crane (Grus americana)
+Phytotherapy in Aquaculture
+Biofuels, Bioenergy and Food Security
+Internationalizing Food and Agricultural Sciences
+Vegetarian and Plant Based Diets in Health and Disease Prevention
+Proteomics in Food Science
+The Biology and Conservation of Cheetahs
+The Norovirus
+Insect Pests of Millets
+Native Arbuscular Mycorrhiza for Sustainable Agriculture
+New Pesticides and Soil Sensors
+Water Purification
+NanoBioSensors
+Food Packaging
+Ecology and Evolution of Cancer
+Encyclopedia of Marine Mammals
+Nature's Machines
+Biotic Stress Resistance in Millets
+Fish Diseases
+Ultrasound: Advances for Food Processing and Preservation
+Controlled and Modified Atmosphere for Fresh and Fresh-Cut Produce
+Bifidobacterium
+Yogurt in Health and Disease Prevention
+Physiology of the Cladocera
+Animals and Human Society
+Pathology of Zoo and Wild Animals
+The Competitiveness of Tropical Agriculture
+High Throughput Next Generation Sequence Analysis for Food Microbiologists
+Arthropod Vector: Controller of Disease Transmission (Volume 1)
+Mixed-Species Groups of Animals
+Agroforestry
+Arthropod Vector: Controller of Disease Transmission (Volume 2)
+The Future Rice Strategy for India
+Conservation for the Anthropocene Ocean
+Nutrition and Functional Foods for Healthy Aging
+Micronutrients in Human Health
+Emerging Roles of Nutraceuticals and Functional Foods in Immune Support
+Enzymes in Human and Animal Nutrition
+Electron Spin Resonance in Food Science
+FDA Warning Letters about Food Products
+Conceptual Breakthroughs in Ethology and Animal Behavior
+Sexual Biology and Reproduction in Crustaceans
+Examining Ecology
+Nutritional and Health Aspects of Traditional and Ethnic Foods of Nordic Countries
+Bioactive Polysaccharides
+Unconventional Oilseeds and Oil Sources
+Wafer and Waffle Processing and Manufacturing
+Starch-based Materials in Food Packaging
+Starches for Food Application
+Applications in High Resolution Mass Spectrometry
+HARPC
+Forest Management and Planning
+Fatty Acids
+Staphylococcus Aureus
+Nanoencapsulation of Food Bioactive Ingredients
+The Coconut
+Preharvest Modulation of Postharvest Fruit and Vegetable Quality
+Ethnozoology
+Hazard Analysis and Risk Based Preventative Controls
+Valid Preventive Food Safety Controls
+Food Irradiation
+Innovative Technologies for Food Preservation
+Emerging Nanotechnologies in Food Science
+Practical Guide to Vegetable Oil Processing
+Process Control
+Retrovirus-Cell Interactions
+Mucosal Vaccines
+Cell Surface GRP78, a New Paradigm in Signal Transduction Biology
+Immunosensing for Detection of Protein Biomarkers
+Ion Channels in Health and Disease
+Genetics and Evolution of Infectious Diseases
+Neuropsychiatric Disorders and Epigenetics
+Genomic and Precision Medicine
+Translating Epigenetics to the Clinic
+American Trypanosomiasis
+Epigenetics and Behavior
+Viroids and Plant Viral Satellites
+Genomic and Precision Medicine
+Neural Lipid Signalling
+Developmental and Regenerative Biology
+Biology and Engineering of Stem Cell Niches
+Diagnostic Molecular Biology
+Translational Aspects of Extracellular Matrix
+Epigenetics and Systems Biology
+Viruses
+Nuclear Architecture and Dynamics
+Regenerative Medicine Translation
+Biological Chemistry
+Computational Epigenomics and Disease
+Cytokine Effector Functions in Tissues
+PCR Guru
+Long Noncoding RNAs
+The Human Body
+Nitric Oxide
+Science Careers in Flux
+Gnotobiology
+Microscale Transport In Biological Processes
+RNA Methodologies
+The European Research Management Handbook
+Protein NMR Spectroscopy
+Bioprinting
+Handbook of Epigenetics
+Oral Communication Skills for Scientific Presentations
+An Introduction to Ethical, Safety and Intellectual Property Rights Issues in Biotechnology
+Progress and Challenges in Precision Medicine
+Electrocardiography of Laboratory Animals
+Dyneins
+Dyneins
+Epigenetic Mechanisms in Cancer
+Problem Sets Series: Case Studies in Biochemistry
+Polycomb Group Proteins
+Glyceraldehyde-3-Phosphate Dehydrogenase (GAPDH)
+HIV/AIDS
+Bioinformatics for Beginners
+Gas Bubble Dynamics in the Human Body
+Cancer and Noncoding RNAs
+High Throughput Formulation Development of Biopharmaceuticals
+Nanoemulsions
+Early Warning for Infectious Disease Outbreak: Theory and Practice
+International Gender Specific Medicine
+Congenital Adrenal Hyperplasia
+ISTE topics in Biomedical Science 1
+ISTE topics in Biomedical Science 2
+Data Literacy
+Atlas of Comparative Vertebrate Histology
+Laboratory Exercises in Molecular Pathology
+An Introduction to Cardiovascular Therapy
+Kidney Transplantation, Bioengineering and Regeneration
+Back to Basics In Physiology
+The Contribution of Pathology and Laboratory Medicine to Clinical Informatics
+Advances in Brain Cancer for Clinicians and Scientists
+Molecular Pathology
+Biomarkers in Inborn Errors of Metabolism
+Comparative Anatomy and Histology
+Think Like a Biostatistics Analyst
+Clinical Informatics Literacy
+Textbook of Nephro-Endocrinology
+The Heart in Rheumatologic, Inflammatory and Autoimmune Diseases
+Endocrine Biomarkers
+Principles of Gender-Specific Medicine
+Handbook of Supportive and Palliative Radiation Oncology
+Translational Advances in Gynecologic Cancers
+Lung Epithelial Biology in the Pathogenesis of Pulmonary Disease
+Ethical Challenges in Oncology
+Alpha-1-antitrypsin Deficiency
+Transfusion Medicine, Apheresis, and Hemostasis
+Cutaneous Melanoma
+Introduction to Cancer Metastasis
+The Microbiota in Gastrointestinal Pathophysiology
+Bone Marrow Failure
+The Pituitary
+Genetics of Bone Biology and Skeletal Disease
+Case Studies in Physiology
+Liver Pathophysiology
+Chronic Kidney Disease in Disadvantaged Populations
+Translational Bioinformatics and Systems Biology Methods for Personalized Medicine
+Cushing's Disease
+Case Studies in Public Health
+Global Health Informatics
+Omics Technologies and Bio-engineering
+Research in the Biomedical Sciences
+Dietary Fiber for the Prevention of Cardiovascular Disease
+eHealth
+Microbiology and Molecular Diagnosis in Pathology
+Health Professionals' Education in the Age of Clinical Information Systems, Mobile Computing and Social Networks
+Gastrointestinal Tissue
+Alcohol, Drugs, Genes and the Clinical Laboratory
+Nitric Oxide Donors
+Disaster Epidemiology
+Pouchitis and Ileal Pouch Disorders
+Atlas of the Human Body
+Human Genome Informatics
+Key advances in clinical informatics
+Blanco's Overview of Alpha-1 Antitrypsin Deficiency
+Interesting Cases in Pulmonary Medicine
+Molecular Physiology of the Blood Vessel
+Health Reform Policy to Practice
+GERD: A NEW UNDERSTANDING OF PATHOLOGY, PATHOPHYSIOLOGY, AND TREATMENT
+Manual of Chronic Total Occlusion Interventions
+Bladder Cancer
+Vitamin D
+Vitamin D
+Medical Writing and Editing
+Preventive Medicine
+The Complete Reference for Scimitar Syndrome
+Skin Tissue Models for Regenerative Medicine
+Nitric Oxide as a Chemosensitizing Agent
+Wilson Disease
+Anticancer Drugs: Navelbine� and Taxot�re�
+Biopharmaceutical Management
+Pharmacoepidemiology and Pharmacovigilance
+Signals and Systems in e-Health
+New Health Systems
+Statistical Mechanics of Colloidal Matter
+ESCAPE 27 Set
+Coalescence Separations
+Handbook of Spent Hydroprocessing Catalysts
+Reliability, Maintainability and Risk 9E
+Recrystallization and Related Annealing Phenomena
+Handbook of Bioprocessing
+Solid Fuels and Heavy Hydrocarbon Liquids
+Theory of Electrophoresis and Diffusiophoresis of Highly Charged Colloidal Particles
+Bretherick's Handbook of Reactive Chemical Hazards
+Coulson and Richardson\u2019s Chemical Engineering
+Coulson and Richardson\u2019s Chemical Engineering
+Coulson and Richardson\u2019s Chemical Engineering
+Coulson and Richardson\u2019s Chemical Engineering
+Coulson and Richardson\u2019s Chemical Engineering
+Process Safety Calculations
+Chemical Reaction Engineering
+The Science and Technology of Unconventional Oils
+Materials Under Extreme Conditions
+Recent Advances in Emerging Membrane Science and Technology
+Thermodynamics, Phase Diagrams and Thermodynamic Modeling of Solutions
+Cosmetic Science and Technology: Theoretical Principles and Applications
+Novel Catalytic and Separation Processes Based on Ionic Liquids
+Technologies for Biochemical Conversion of Biomass
+Process Plant Layout, 2e
+Natech Risk Assessment and Management
+Polyurethane Polymers
+Polyurethane Polymers
+Lignocellulosics
+Advanced and Emerging Polybenzoxazine Science and Technology
+Concise Encyclopaedia of Combustion Synthesis
+A Systems Approach to Managing the Complexities of Process Industries
+The Art of Cryogenics
+Morphological, Compositional, and Shape Control of Materials for Catalysis
+Low Grade Heat Driven Multi-Effect Distillation
+Solar Energy Desalination Technology
+Desalination Sustainability
+Sustainable Design Through Process Integration
+General Chemistry for Engineers
+Pulp and paper Industry
+Pulp and Paper Industry
+Reaction Rate Theory and Rare Events Simulations
+Lead-Acid Batteries: Science and Technology
+Artificial Photosynthesis
+Monodispersed Particles
+Advanced Industrial Lead-Acid Batteries
+Pressurized Fluids for Food and Natural Products Processing
+New and Future Developments in Microbial Biotechnology and Bioengineering
+New and Future Developments in Microbial Biotechnology and Bioengineering
+New and Future Developments in Microbial Biotechnology and Bioengineering
+Life-Cycle Assessment of Biorefineries
+Modern Inorganic Synthetic Chemistry
+Lead-Acid Batteries for Future Automobiles
+Nanolayer Research
+Future Directions in Biocatalysis
+Membrane Characterization
+Safety of Lithium Batteries
+Experimental Methods and Instrumentation for Chemical Engineers
+Algal Green Chemistry
+Non-covalen Interactions in Organocatalysis
+Bioreactor Modeling
+Organocatalyzed Domino and Multicomponent Reactions
+Recent Advances in Aminocatalyzed Cascade Reactions
+SOMO and Photoredox Activations in Asymmetric Organocatalysis
+Separation Science and Technology
+Transition Metal Catalyzed Isoquinoline Synthesis
+Fundamentals of Enviromental Chemistry
+Searching and Researching: An Autobiography
+Frontiers and Advances in Molecular Spectroscopy
+Biological Chirality
+The Evolution of Medicinal Chemistry
+Validamycin and its Derivatives
+Design of Hybrid Molecules for Drug Development
+The Chemistry of Heterocycles
+Multi-Scale Approaches in Drug Discovery
+Medicinal Chemistry for Organic Chemists
+Electron Microscopy and Analysis
+Organosilicon Compounds
+Advanced Inorganic Chemistry
+Sampling and Analysis of Environmental Chemical Pollutants
+Future Role of Chemistry as Gleaned from Granted U.S. Chemical Patents
+Metal Complexes of Non-Innocent Ligands
+Patent Law Basics for Chemists and Research Professionals
+Selection of the HPLC Method in Chemical Analysis
+C-Furanosides
+Modern Synthesis Processes and Reactivity of Fluorinated Compounds
+Inorganic and Organometallic Transition Metal Complexes
+Encapsulated Catalysts
+Modelling and Simulation in the Science of Micro- and Meso-Porous Materials
+Piperidine-based Drug Design
+Strategies for Palladium-Catalyzed Non-Directed and Directed C-H Bond Functionalization
+Liquid Chromatography
+Liquid Chromatography
+Separation Science and Proteomics
+Supercritical Fluid Chromatography
+Transition Metal-Catalyzed Benzofuran Synthesis
+Transition Metal-Catalyzed Pyrimidine Synthesis
+Water Extraction of Bioactive Compounds
+Discovery and Development of Antidiabetic Agents From Natural Products
+Handbook of Synthetic Organic Chemistry
+Making Fragments From Drugs
+Non-covalent Interactions in Quantum Chemistry and Physics
+Electrons, Atoms, and Molecules in Inorganic Chemistry
+Sample Introduction Systems in ICP-MS and ICP-OES
+Priority Pollutants Monitoring in Water
+Frontiers in Medicinal Chemistry
+Big Data and Smart Service Systems
+Data Fusion for Intelligent Vehicles
+Lossless Information Hiding in Images
+Big Data in Cyber-Physical Society
+Machine Learning
+OpenACC Programming
+Three-dimensional Integrated Circuit Design
+FTTX Networks
+Network Routing
+Contextual Design
+Understanding Virtual Reality
+Patterns for Data Parallel Programming
+Mobile Sensors and Context-Aware Computing
+Environment Modeling-based Requirements Engineering for Software Intensive Systems
+Penetration Tester's Open Source Toolkit
+Rugged Embedded Systems
+CUDA Programming
+Silicon Photonics
+Transfer Learning
+Usability Testing for Survey Research
+Advances in GPU Research and Practice
+Cognitive Information Systems in Management Sciences
+Computer and Information Security Handbook
+Network Storage
+Application Management for Mobile and Cloud Systems
+Embedded Computing for High Performance
+Securing the Internet of Things
+Aging-Friendly Design
+Software Defined Networks
+Adaptive Mobile Computing
+Hacking Wireless Access Points
+Peering Carrier Ethernet Networks
+Research Methods for Cyber Security
+OCEB 2 Certification Guide
+Research Methods in Human Computer Interaction
+Software Architecture for Cloud and Big Data
+Coding for Penetration Testers
+TopUML Modeling
+Knowledge Science
+Advanced Persistent Security
+Big Data Analytics for Sensor-Network Collected Intelligence
+Mobile Cloud Computing
+Federal Cloud Computing
+Managing the Web of Things
+Smart Sensors Networks
+Deep Learning for Medical Image Analysis
+Statistical Shape and Deformation Analysis
+Wireless Public Safety Networks 3
+Certifiable Software Applications 3
+Certifiable Software Applications 4
+ESD Protection Methodologies
+Flash Memory Integration
+B Method
+Marine Geo-Hazards in China
+Earth's Oldest Rocks
+ISTE topics in Earth and Planetary Science 1
+ISTE topics in Earth and Planetary Science 2
+ISTE topics in Earth and Planetary Science 3
+Infrared and Raman Spectroscopy of the Cationic Clay Minerals
+Uncertainty Analysis in Earth and Environmental Science
+Ore Dogs and Economic Geology
+Progress in Rock Physics
+Thermodynamics of Atmospheres and Oceans
+Terrestrial Depositional Systems
+Statistical Modeling and Analysis
+Practical Petroleum Geochemistry for Exploration and Production
+Economic Minerals
+Integrating Emergency Management and Disaster Behavioral Health and Science
+Theory of Electromagnetic Well Logging
+Nickel Sulfide Ores and Impact Melts
+Risk Modeling for Hazards and Disasters
+Volatiles in the Martian Crust
+Urban Planning for Disaster Recovery
+Proterozoic Orogens of India
+Data Assimilation for the Geosciences
+How to Become a International Disaster Volunteer
+Handbook of Mineral Spectroscopy, Volume 1
+KAPPA DISTRIBUTIONS
+Social Network Analysis of Disaster Response, Recovery, and Adaptation
+Practical Solutions to Integrated Reservoir Analysis
+The Indian Ocean Nodule Field
+Introduction to Satellite Remote Sensing
+Permo-Triassic Salt Provinces of Europe, North Africa and Central Atlantic
+Geographical Information Management in Polar Regions
+Case Studies in Disaster Preparedness
+Case Studies in Disaster Mitigation
+Creating Katrina, Rebuilding Resilience
+Shale Gas
+Map Interpretation for Structural Geologists
+Coding and Decoding: Seismic Data
+Processes and Ore Deposits of Ultramafic-Mafic Magmas through Space and Time
+The Quaternary Ice Age in the Alps
+Practical Prospect Evaluation
+Interpretation of Micromorphological Features of Soils and Regoliths
+Introduction to Volcanic Seismology
+Data Room Management and Rapid Asset Evaluation - Theory and Case Studies in Oil and Gas
+Isotopic Geochemistry and Paleobiology
+Palaeobiology of Extinct Giant Flightless Birds
+Marine Reptiles Adaptation to Aquatic Life
+Evolutionary History of Freshwater Fishes during the Last 200 Millions Years
+Evolution of Dental Tissues and Paleobiology in Selachians
+Cenozoic Mammals and their Evolutionary Context
+Fossil Turtles of China
+Thermal Recovery of Oil and Bitumen
+Fine and ultrafine coal processing
+Clean Coal Engineering Technology
+Carbon Capture and Storage
+Heat Recovery Steam Generator Technology
+Advanced Light Water Reactor Fuel Technology
+Materials and Water Chemistry for Supercritical Water-cooled Reactors
+Big Data Application in Power Systems
+Specifications of Photovoltaic Pumping Systems in Agriculture
+Design of Transient Protection Systems
+Managed Pressure Drilling
+Deepwater Drilling
+POWER ELECTRONICS HANDBOOK
+ISTE topics in Energy 1
+ISTE topics in Energy 2
+ISTE topics in Energy 3
+ISTE topics in Energy 4
+Underground Coal Gasification and Combustion
+Gas, Fire and Respirable Dust control In Underground Coal Mines
+Renewable Energy Forecasting
+Geological Repository Systems for Safe Disposal of Spent Nuclear Fuels and Radioactive Waste
+Thermal Hydraulics in Nuclear Reactors
+Hydrogen and Fuel Cells
+Supercritical Carbon Dioxide (SCO2) Based Power Cycles
+Steam Generators for Nuclear Power Plants
+Low-rank Coals for Power Generation, Fuel and Chemical Production
+Coal Combustion Products (CCP's)
+Microalgae-Based Biofuels and Bioproducts
+Bioenergy Systems for the Future
+Greenhouse Gases Balance of Bioenergy Systems
+Optimization in Renewable Energy Systems
+Nuclear Power
+Electricity Generation & The Environment
+Non-Destructive Testing and Condition Monitoring Techniques for Renewable Energy Industrial Assets
+Solid Oxide Fuel Cell Lifetime and Reliability
+Large Scale Biomass Combustion Plants
+Trends in Oil and Gas Corrosion Research and Technologies
+Power Systems Analysis
+Electrical Power Systems
+Molten Salt Reactors and Thorium Energy
+Advances in Productive, Safe, and Responsible Coal Mining
+Offshore Electrical Engineering Manual
+Fuel Cell Propulsion
+Electric Vehicles: Prospects and Challenges
+Deep Shale Oil and Gas
+Fluid Phase Behavior for Conventional and Unconventional Oil and Gas Reservoirs
+Distributed Generation Systems
+Steam Generation from Biomass
+Advances in Sugarcane Biorefinery
+Introduction to Petroleum Biotechnology
+UHV Transmission Technology
+Control of Power Electronic Converters and Systems
+The Power Grid
+High Temperature Thermal Storage Systems using Phase Change Materials
+Thermal Energy Storage Analyses and Designs
+Clean Energy for Sustainable Development
+Petroleum Production Engineering
+Torrefaction of Biomass for Energy Applications
+PEM Fuel Cell Modelling and Simulation using MATLAB
+Theoretical and Applied Aspects of Biomass Torrefaction
+Renewable Energy Integration
+Handbook of Biotechnology-Based Alternative Fuels
+European energy markets and society
+Practical Handbook of Photovoltaics
+Integrated Energy Systems for Multigeneration
+Energy Positive Neighborhoods and Smart Energy Districts
+Performance Management for the Oil, Gas, and Process Industries
+One-dimensional nanostructures for PEM fuel cell applications
+Hydrogen Economy
+PEM Water Electrolysis
+Unconventional Oil and Gas Resource Engineering
+Transmission lines inspection and monitoring technology of remote sensing
+Space Microsystems and Micro/Nano Satellites
+Onshore Structural Design Calculations
+Construction Delays
+Modelling, Solving and Application for Topology Optimization of Continuum Structures --- ICM Method Based on Step Function
+Biot's Poroelastic Theory in Engineering
+Transient Electromagnetic-Thermal Nondestructive Testing
+Permeability Properties of Plastics and Elastomers
+Repair and Rehabilitation of Structures
+Linux for Embedded and Real-time Applications
+Thermo-Mechanical Modeling of Additive Manufacturing
+Green Building Energy Simulation and Modeling
+Intelligent fault diagnosis and remaining useful life prediction of rotating machinery
+Cyber-Physical Systems in Production Engineering
+Databook of Blowing and Auxiliary Agents
+Nonlinear systems in Heat transfer
+Handbook of Foaming and Blowing Agents
+Atlas of Material Damage
+Handbook of Plasticizers
+Handbook of Odors in Plastic Materials
+Databook of Plasticizers
+Tribology Testing
+Academic Press Library in Signal Processing Volume 6
+Reliability Based Airframe Maintenance Optimization and Applications
+Academic Press Library in Signal Processing Volume 7
+Healthcare Technology Management Systems
+Embedded Mechatronic Systems 1 - 2nd Edition
+Embedded Mechatronic Systems 2 - 2nd Edition
+Durability and Reliability of Photovoltaic Polymers and Other Materials
+Global Engineering Ethics
+Optimization Tools for Logistics \u2013 2nd ed / V1 \u2013 Theory and Fundamentals
+Optimization Tools for Logistics \u2013 2nd ed / V2 \u2013 Software applications
+ISTE topics in Engineering 1
+ISTE topics in Engineering 2
+ISTE topics in Engineering 3
+ISTE topics in Engineering 4
+ISTE topics in Engineering 5
+ISTE topics in Engineering 6
+ISTE topics in Engineering 7
+ISTE topics in Engineering 8
+ISTE topics in Engineering 9
+ISTE topics in Engineering 10
+ISTE topics in Engineering 11
+ISTE topics in Engineering 12
+ISTE topics in Engineering 13
+Dynamic Analysis of High-Speed Railway Alignment
+Principles of Railway Location and Design
+Thermal Analysis in Practice
+Basic Polymer Engineering Data
+Extrusion Dies for Plastics and Rubber
+Understanding Polymer Processing
+High Voltage Engineering Fundamentals
+Mechanical Testing of Orthopaedic Implants
+Geometry for Naval Architects
+Marine Propellers and Propulsion
+Aircraft Sustainment and Repair
+TV White Space Communications and Networks
+Strengthening of Concrete Structures Using Fiber Reinforced Polymers (FRP)
+Principles of Textile Finishing
+Spacecraft Dynamics and Control
+Plastics Engineering
+Civil Aircraft Electrical Power System Safety Assessment
+Lea's Chemistry of Cement and Concrete
+Porous Rock Failure Mechanics
+Art of the Helicopter
+High-Performance Apparel
+Manikins for Textile Evaluation
+Computational Methods for Fracture in Porous Media
+Power Supplies for LED Driving
+Morphing Wings Technologies
+Demystifying Numerical Models
+Boiling
+Thermal Power Plant
+Air Conditioning Systems Design
+Cost-effective Energy Efficient Building Retrofitting
+Advances in Carpet Manufacture
+Automation in Garment Manufacturing
+Applications of Computer Vision in Fashion and Textiles
+Skeletonization
+Microgrid
+The Circuit Designer's Companion
+Instrumental Seismology Manual
+Space Safety and Human Performance
+Unsteady Flow and Aeroelasticity in Turbomachinery
+Atomistic Simulation Methods in Solid Mechanics
+Aeroacoustics: Fundamentals and Applications in Aeropropulsion Systems
+Design and Analysis of Intelligent Tires
+Software Defined and Mixed Signal Radio Characterization: Theory, Methods and Applications for Emerging Wireless Systems
+Embedded Operating systems and Board Support Packages
+Gas Explosion Handbook
+Computational Visual Perception for Image and Video Processing
+Analysis and Design of Curved Girder Bridges
+Microelectronics for the Internet of Things
+Analysis and Design of Integral Abutment Bridges
+Opto-Mechanical Fiber Optic Sensors
+Navigation with Signals and Constraints of Opportunity
+Underground Sensing
+Biomedical Engineering in Gastrointestinal Surgery
+Deep Learning in Computer Vision
+General Aviation Aircraft Load Analysis
+Introduction to Nature-Inspired Optimization
+Cooperative Control and Sensing for Mobile Sensor Networks
+Bioinspired Legged Locomotion
+Nano and Bio Heat Transfer and Fluid Flow
+Chemical Engineering Process Simulation
+Biofluid Mechanics of the Respiratory System
+Biomechanics of Living Organs
+Safety Analysis for LNG Facilities
+Wheeled Mobile Robotics
+Rockbolting
+Bridge Engineering
+Oil Spill Environmental Forensics Case Studies
+Advanced Gear Manufacturing and Finishing
+Humanoid Robots
+Renewable Energy
+Trauma Plating Systems
+THE FPGA Users Guide
+Strut and Tie Models
+Atherosclerotic Plaque Characterization Methods based on Coronary Imaging
+Fundamentals of Geoenvironmental Engineering
+Personalized Predictive Modelling in Diabetes
+Rockburst
+Assurance of Sterility for Sensitive Combination Products and Materials
+Soil Fracture Mechanics
+Indoor Navigation Strategies for Aerial Autonomous Systems
+Differential Transformation Method for Mechanical Engineering Problems
+Ambient Assisted Living and Enhanced Living Environments
+Subsea Valves Handbook
+Wastes and Wastewater Treatment in the Petroleum Industry
+Mechanics of Flow-Induced Sound and Vibration V1
+Mechanics of Flow-Induced Sound and Vibration V2
+Group and Crowd Behavior for computer Vision
+More Best Practices for Rotating Equipment
+Computer and Machine Vision
+Transportation Highway Engineering Calculations and Rules of Thumb
+Software Engineering for Embedded Systems
+Thermal System Design and Simulation
+High Dynamic Range Video
+iMprove
+Irregular Shape Anchor in Cohesionless Soils
+Polyaniline Blends, Composites, and Nanocomposites
+Soil Reinforcement for Anchor Plates
+Forsthoffer's Component Condition Monitoring (CCM) Handbook
+The Aeroacoustics of Low Mach Number Flows
+Satellite Signal Propagation, Impairments and Mitigation
+Solid and Hazardous Waste Management
+Heat Transfer in Aerospace Applications
+Basic Finite Element Method as Applied to Injury Biomechanics
+Guide to Laser Welding
+Surface Production Operations: Volume IV: Pump and Compressor Systems: Mechanical Design and Specification
+Embedded and IoT Software Development
+Manufacturing Optimization Using the Internet of Things
+Time-Critical Cooperative Control of Autonomous Air Vehicles
+General Aviation Aircraft Design
+Orthogonal Waveforms and Filter Banks for Future Communication Systems
+Industrial Water Treatment Process Technology
+Understanding Automotive Electronics
+Mechanical Circulatory and Respiratory Support
+Discrete-Time Neural Observers
+Computing and Visualization for Intravascular Imaging and Computer Assisted Stenting
+Mechanics of Carbon Nanotubes
+Rigid Body Dynamics for Space Applications
+eMaintenance
+Plastics in Medical Devices for Cardiovascular Applications
+Sittig's Handbook of Toxic and Hazardous Chemicals and Carcinogens
+Designing Successful Products with Plastics
+Fluoropolymer Applications in Chemical Processing Industries
+Applications of Plastics Under-the-hood in Automotives
+Plasticizers Derived from Post-consumer PET
+Advanced Machining Processes of Metallic Materials
+Computational Methods and Production Engineering
+Microfabrication and Precision Engineering
+Engineering Bioplastics
+Plastics Handbook
+Moldflow Design Guide
+Combination Technologies on the Basis of Injection Molding
+Structure and Rheology of Molten Polymers
+Molding Simulation: Theory and Practice
+Nontraditional Fillers and Stiffening Agents for Polymers
+10 Fundamental Rules for Design of Plastic Products
+Processing of Nanocomposite Polymers
+Leadership & Management of Machining
+Discrete Mechanics of Capillary Bridges
+Inside the Structure of Granular Materials
+THID, the Ultimate Outcome of RFID
+Robustness in Electro-thermal Phenomena
+RCS Synthesis for Chipless RFID
+Reliability Investigation of Leds Devices for Public Light Applications
+Reliability Investigation on Laser Diode Coupling Electro-Optical Models and Physics of Failure
+Reliability of Photonics Devices
+Systems Architecture Modeling with the Arcadia Method
+Model-based System and Architecture Engineering
+SysML in Action with Papyrus
+SysML in Action with Cameo Systems Modeler
+Fractal and Trans-Scale Nature of Entropy
+From Pinch Methodology to Energy Integration of Flexible Systems
+Fractal and Trans-Scale Nature of Entropy / Towards a geometrization of thermodynamics
+Coastal Wetlands
+Initial Human Colonization of Arctic in Changing Paleoenvironments
+Time and Methods in Environmental Interfaces Modelling
+Nanoparticles in the Environment: A Contradictory Relationship with Plants, Algae and Microorganisms
+Nanoparticles in the Environment: A Contradictory Relationship with Plants, Algae and Microorganisms
+ISTE topics in Environmental Science 1
+ISTE topics in Environmental Science 2
+ISTE topics in Environmental Science 3
+Thorp and Covich's Freshwater Invertebrates
+Physical Limnology
+Methods in Stream Ecology
+Chemical Ecology
+Periphyton
+The Transition to Modern Earth
+Atmospheric Impacts of the Oil and Gas Industry
+Intermittent Rivers
+Water for the Environment
+Wetland and Stream Rapid Assessments
+Maintaining Land Productivity
+Soil Mapping and Process Modeling for Sustainable Land Use Management
+Fundamentals of Soil Ecology
+The Application of Green Solvents in Separation Processes
+Soil Magnetism
+Tropical Extremes: Natural Variability and Trends
+The Political Ecology of Oil & Gas Activities in the Nigerian Aquatic Ecosystem
+The Ecology of Sandy Shores
+Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS
+Assessment, Restoration and Reclamation of Mining Influenced Soils
+Remote Sensing of Aerosols, Clouds, and Precipitation
+Decision Making in Water Resources Policy and Management
+A New Ecology
+Environmental Geochemistry
+Biodiversity and Health
+Cybernomics
+The Fair Return
+The Economics of Education
+Handbook of Investor Behavior during Financial Crises
+ISTE topics in Finance
+Decision-Making
+China Business Model: Originality and Limits after the Slowdown of 2013
+The Wine Value Chain in China
+Handbook of the Chinese Economy and Its External Economic Relations
+Underwriting Services and the New Issues Market
+Introduction to Agent-Based Economics
+Entrepreneurship and the Finance of Innovation in Emerging Markets
+International Money and Finance
+Smart Specialization Theory and Practice
+Redefining Capitalism in Global Economic Development
+Strategic Financial Management Casebook
+Advanced Macroeconomics: An Alternative Approach
+Principles of Project Finance
+Handbook of Digital Banking and Internet Finance
+Probability, Statistics and Econometrics
+Equilibrium Problems and Applications
+Engineering Investment Process
+Portfolio Diversification
+Investigating Windows Systems
+Deception In Digital Age
+Physical Criminalistics
+Forensic Investigations
+Global Supply Chain Security and Management
+False Allegations
+Inside Forensic Reform
+Digital Forensics Trial Graphics
+Security Operations Center Guidebook
+An Atlas of Skeletal Trauma in Medico-Legal Contexts
+Security Metrics Management
+Effective Physical Security
+Human Remains - Another Dimension
+The Manager's Handbook for Corporate Security
+The Five Technological Forces Disrupting Security
+Sports Team Security
+Creating Digital Faces for Law Enforcement
+From Corporate Security to Commercial Force
+Contemporary Digital Forensic Investigations of Cloud and Mobile Applications
+Urban Emergency Management
+Contemporary Security Management
+The Psychology of Criminal and Antisocial Behavior
+Cell Phone Location Evidence for Legal Profesionals
+Integrating Python with Leading Computer Forensics Platforms
+Ambulatory Surgery Center Safety Guidebook
+Viral Diseases of Africa and Global Public Health
+Microbial Glycobiology
+Viral Collectives
+Advances in Microbiology
+The Skin in Systemic Autoimmune Diseases
+Surgery in Systemic Autoimmune Diseases in the Era of Biological Agents
+Vaccinology in Latin America
+The history of Immunology
+Zika Virus
+Controversies in Vaccine Safety
+Future Directions in Water and Wastewater Microbiology
+Adjuvants and Autoimmunity
+The Heart in Systemic Autoimmune Diseases
+Immunopotentiators in Modern Vaccines
+The Innate Immune System: A compositional and functional perspective
+Microbial Resources
+Autophagy: Cancer, Other Pathologies, Inflammation, Immunity, Infection, and Aging
+Ticks of Trinidad and Tobago - An Overview
+THE COMPLEMENT FACTSBOOK, 2ND EDITION
+Antimicrobial Stewardship (AMS)
+Ticks of the Southern Cone of America
+Antiphospholipid Syndrome in Systemic Autoimmune Diseases
+The Digestive Involvement in Systemic Autoimmune Diseases
+Carbon for Electronic and Energy Applications
+Graphite and Carbon Materials In Nuclear Engineering
+Advanced Polyimide Materials
+Customized All-Ceramic Dental Prostheses
+Algae Based Polymers, Blends, and Composites
+Emerging Nanotechnologies in Dentistry
+Defect Structure in Nanomaterials
+ISTE topics in Materials Science 7
+ISTE topics in Materials Science 1
+ISTE topics in Materials Science 2
+ISTE topics in Materials Science 3
+ISTE topics in Materials Science 4
+ISTE topics in Materials Science 5
+Engineering with Magnesium: Science, Technology and Application
+Light Alloys
+Nanofiber Composite Materials for Biomedical Applications
+Steels: Microstructure and Properties
+Stability and Vibrations of Thin Walled Composite Structures
+Advanced Characterization and Testing of Textiles
+Biomechanics of Tendons and Ligaments
+Functionalised Cardiovascular Stents
+Hemocompatibility of Biomaterials for Clinical Applications
+Thermal Analysis of Textiles and Fibers
+Fibrous Filter Media
+A Clinical Guide to Fibre Reinforced Composites FRCs in Dentistry
+Natural Fibre-reinforced Biodegradable and Bioresorbable Polymer Composites
+Principles for Evaluating Building Materials in Sustainable Construction
+Nanobiomaterials
+3D Printing in Medicine
+Peptide Applications in Biomedicine, Biotechnology and Bioengineering
+Characterization of Polymeric Biomaterials
+Biomedical Composites
+Green Composites
+Hybrid Polymer Composite Materials
+Hybrid Polymer Composite Materials
+Hybrid Polymer Composite Materials
+Hybrid Polymer Composite Materials
+Biocomposites for High-Performance Applications
+Self-assembling Beta-sheet Forming Peptide Biomaterials
+Peptides and Proteins as Biomaterials for Tissue Regeneration and Repair
+Advances in Ceramic Biomaterials
+Dynamic Response and Failure of Composite Materials and Structures
+Tribology: Friction and Wear of Engineering Materials
+Bioactive Glasses
+Cellulose-reinforced Nanofibre Composites
+Materials Selection for Natural Fiber Composites
+Lignocellulosic Fibre and Biomass-based Composite Materials
+Nanobiomaterials Science, Development and Evaluation
+Biodegradable and Biocompatible Polymer Composites
+Functional 3-D Tissue Engineering Scaffolds
+Performance of Bio-based Building Materials
+Sustainable Construction Materials
+Sustainable Construction Materials
+Sustainable Construction Materials
+Fundamentals of nanotechnology in Biomaterials
+Electrospun Materials for Tissue Engineering and Biomedical Applications
+Foundations in Biomaterials Engineering
+Nanocrystals for Laser-induced Solid State Lighting
+Polyolefin Fibers
+Waterproof and Water Repellent Textiles and Clothing
+Principles and Applications of Organic Light Emitting Diodes (OLEDs)
+Nanofinishing of Textile Materials
+Advances in Laser Materials Processing
+Advanced Piezoelectric Materials
+Iron oxide nanoparticles for biomedical applications
+Colour Design
+Crazing technology for polyester fibers
+Engineering of high-performance textiles
+Natural dyes for textiles
+Transition Metal Oxide Thin Film based Chromogenics and Devices
+Fiber Technology for Fiber-reinforced Composites
+Forensic Textile Science
+Composite Materials
+Laser Surface Engineering of Aluminum Alloys
+Handbook of Solid State Diffusion: Diffusion Fundamentals and Techniques
+Handbook of Solid State Diffusion: Volume 2
+High Temperature Coatings
+Functional Glasses and Glass-Ceramics
+Microstructural Characterization of Radiation Effects in Nuclear Materials
+Laser Shock Peening of Advanced Ceramics
+Ni-free Ti-based Shape Memory Alloys
+Crystallization in Multiphase Polymer Systems
+Biomaterials
+Seaweed Polysaccharides
+Metal Oxides in Energy Technologies
+Metal Oxide-Based Thin Film Structures
+The Future of Semiconductor Oxides in Next-Generation Solar Cells
+Biopolymer Grafting: Applications
+Metal Oxides in Supercapacitors
+A Teaching Essay on Residual Stresses and Eigenstrains
+Functionalized Nanomaterials for the Management of Microbial Infection
+Emerging Nanotechnologies in Rechargable Energy Storage Systems
+Heat Transport in Micro and Nanoscale Thin Films
+Microbiorobotics
+Nanodiamonds
+Mechanical Behaviours of Carbon Nanotubes
+Developments in Surface Contamination and Cleaning: Methods for Surface Cleaning
+Nano Optoelectronic Sensors and Devices
+Thermoelectricity and Heat Transport in Graphene and other 2D Nanomaterials
+Metal Semiconductor Core-shell Nanostructures for Energy and Environmental Applications
+Nanomaterials for Biosensors
+Thermal and Rheological Measurement Techniques for Nanomaterials Characterization
+Spectroscopic Methods for Nanomaterials Characterization
+Microsopy Methods in Nanomaterials Characterization
+Nanostructures for Novel Therapy
+Nanostructures for Drug Delivery
+Nanostructures for Cancer Therapy
+Nanostructures for Antimicrobial Therapy
+Clay-Polymer Nanocomposites
+Nanotechnology for Microelectronics and Optoelectronics
+Thermal Transport in Carbon-Based Nanomaterials
+Nanostructures for Oral Medicine
+Carbon Nanomaterials for Biological and Medical Applications
+Nanopapers
+Graphene and Related Nanomaterials
+Biopolymer Grafting: Synthesis and Properties
+Service Life Prediction of Polymers and Plastics Exposed to Outdoor Weathering
+Nanocharacterization Techniques
+Nanoscience and its Applications
+Structure-mediated Nanobiophotonics
+Intermetallic Matrix Composites
+Nanoinformatics: Principles and Practice
+Nanotechnology and Orthopaedic Surgery
+Quantum Confined Lasers
+Plasma Etching For CMOS Devices Realization
+ISTE topics in Mathematics 1
+ISTE topics in Mathematics 2
+ISTE topics in Mathematics 3
+Techniques of Functional Analysis for Differential and Integral Equations
+Topics in Mathematics 1
+Topics in Mathematics 2
+Hybrid Censoring: Models, Methods and Applications
+The Material Point Method
+Handbook of Statistical Analysis and Data Mining Applications
+Maximum Principles for the Hill's Equation
+Fractional Calculus and Fractional Processes with Applications to Financial Economics
+Riemannian Submersions, Riemannian Maps in Hermitian Geometry, and their Applications
+Principles of Mathematical Modeling
+Inference for Heavy-Tailed Data Analysis
+Differential Equations with Mathematica
+A Concrete Approach to Abstract Algebra
+Optimal Sports Math & Statistics
+Random Operator Theory
+Analysis of Step-Stress Models
+Engineering Mathematics with Examples
+Inequalities and Extremal Problems in Probability and Statistics
+Mathematics Applied to Engineering
+Existence theory of generalized Newtonian Fluids
+Symbolic-Numerical Analysis of 2D Composites and Porous Material
+Cryptographic Boolean Functions and Applications
+Uncertainty Principle for Time Series
+Handbook of Categorization in Cognitive Science
+Innovative Neuromodulation
+Handbook of Cannabis and Related Pathologies
+DNA Modifications in the Brain
+Huntington\u2019s Disease
+Mathematics for Neuroscientists
+Neuroendocrinology and Endocrinology
+Molecular and Cellular Therapies for Motor Neuron Diseases
+Translational Immunotherapy of Brain Tumors
+Evolutionary Neuropsychology
+Primer on Cerebrovascular Diseases
+Network Functions and Plasticity
+Neuroprotection in Alzheimer's Disease
+Machine Dreaming and Consciousness
+Adenosine Receptors in Neurodegenerative Diseases
+Rhythmic Stimulation Procedures in Neuromodulation
+The Neuroscience of Cocaine
+Parkinson's Disease
+Rewiring the Brain
+Nanotechnology Drug Delivery Techniques for Neurological Diseases and Brain Tumors
+The Neurobiology of Brain and Behavioral Development
+Handbook of Neuroemergency Clinical Trials
+Models of Seizures and Epilepsy
+Sleep and Neurologic Disease
+The Human Sciences after the Decade of the Brain
+Chordomas and Chondrosarcomas of the Skull Base and Spine
+Neurobiology of microRNAs
+Fragile X Syndrome
+Biometals in Neurodegenerative Diseases
+Neuroepidemiology in Tropical Health
+The Complex Connection between Cannabis and Schizophrenia
+Noradrenergic Signaling and Astroglia
+Physical Activity and the Aging Brain
+Therapeutic Targets in Neurodegenerative Disorders
+Nutritional Modulators of Pain in the Aging Population
+Stress and Epigenetics in Suicide
+Nutrition and Lifestyle in Neurological Autoimmune Diseases
+Essentials of Neuroanesthesia
+Choroidal Disorders
+Neuromodulation 2V set
+Addictive Substances and Neurological Disease
+Neuronal Correlates of Empathy
+Hearing Loss
+Changing Brain Activity: Improving Intelligence?
+The Endocannabinoid System
+Computational Psychiatry
+Arachnoid Cysts
+Neuroscience Basics
+Designing EEG Experiments for Studying the Brain
+Neurogenetics
+Critical Care Neurology Part II
+Critical Care Neurology Part I
+The Parietal Lobe
+Wilson Disease
+Cavernous Malformations
+Arteriovenous Malformations
+Analytical Assessment of e-Cigarettes
+Social and Administrative Aspects of Pharmacy in Developing Countries
+FDA Quality Standards for Generic Drug Products
+The Discovery and Development of Artemisinins and Derivatives as Antimalarial Agents
+Advances in Molecular Toxicology
+Advances in Nanomedicine for the Delivery of Therapeutic Nucleic Acids
+Clinical Research in Paediatric Psychopharmacology
+Free Radical Toxicology
+Handbook of Bioenvironmental Reproductive Toxicology and Men\u2019s Health
+Pharmaceutical Medicine and Translational Clinical Research
+Developing Solid Oral Dosage Forms
+Accelerated Stability Assessment Program (ASAP)
+Electronic Waste
+Microsized and Nanosized Carriers for Nonsteroidal Anti-Inflammatory Drugs
+Reproductive and Developmental Toxicology
+In Vitro Toxicology
+How to Properly Optimize a Fluid Bed Granulation Unit Operation
+A Comprehensive and Practical Guide to Clinical Trials
+Toxicology: What Everyone Should Know
+Adverse Effects of Engineered Nanomaterials
+Mutagenicity: Assays and Applications
+Medicinal Spices and Vegetables from Africa
+International Regulation of Biologicals
+Japanese Kampo Medicines for the Treatment of Inflammatory Disease
+Adverse Events of Oncotargeted Kinases
+Validation of a Parenteral Solution Product
+History of Risk Assessment in Toxicology
+Toxicology in the Middle Ages and Renaissance
+Discovery and Development of Neuroprotective Agents From Natural Products
+History of Immunotoxicology
+Nanotechnology-Based Approaches for Targeting and Delivery of Drugs and Genes
+Drug Discovery and Development
+Fundamentals of Toxicologic Pathology
+Principal Aspects of Qualitative and Quantitative Bioanalysis by LC-MS
+Risk Management of Complex Inorganic Materials
+Serum Pharmacochemistry of Traditional Chinese Medicine
+Principles and Practice of Clinical Research
+Emerging Nanotechnologies for Diagnostics, Drug Delivery and Medical Devices
+Supercooling, crystallization and melting within emulsions and divided systems: mass, heat transfers and stability
+ISTE topics in Physics
+Neutron Scattering \u2013 Applications in Chemistry, Materials Science and Biology
+Fundamentals of Quantum Mechanics
+Phononics
+Special Relativity
+Advances in Semiconductor Nanostructures
+Introduction to Magnetic Reconnection in Plasmas
+The Classical Stefan Problem
+Linear Ray and Wave Optics in Phase Space
+Global Neutron Calculations
+Laminar Drag Reduction
+Effects of Military Service on Well-Being
+Children's Thinking
+Autism and Autism Spectrum Disorders on the Rise?
+Self-Preservation at the Core of the Personality
+Conducting Independent Educational Evaluations
+The General Factor of Personality
+Personality in Aviation
+Understanding Emotions in Mathematical Thinking and Learning
+Consumer Neuroscience
+Reconstructing Meaning After Trauma
+The Science of Cognitive Behavioral Therapy
+Executive Functions in Health and Disease
+Innovative Approaches to Individual and Community Resilience
+The Psychology of Gender and Health
+Twin Mythconceptions
+Creativity and the Performing Artist
+Digitally Constructed Realities
+Systems Factorial Technology
+Rationality
+Personality Development Across the Lifespan
+Acquisition of Complex Arithmetic Skills and Higher-Order Mathematics Concepts
+Anxiety in Children and Adolescents with Autism Spectrum Disorder
+Dominance and Aggression in Humans and Other Animals
+Journeys of Embodiment at the Intersection of Body and Culture
+Suicide Patterns and Motivations
+Quality Activities in Center-Based Programs for Adults with Autism
+Cognitive Function and the Pleasure of Music
+Practical Guide to Finding Treatments that Work for People with Autism
+The Creative Self
+Teaching Executive Functioning Skills to Individuals with Autism Spectrum Disorder
+Pediatric Disorders of Regulation in Affect and Behavior
+Brain-Based Learning and Education
+Handbook of Key Topics in Research Management and Administration
+The Diaoyu/Senkaku Islands
+Unplugging the Classroom
+Interpreting Japan's Contested Memory
+Positivity and Spirituality in the Information Organization
+Intangible Organisational Resources in Libraries
+Capital Market Integration in South Asia
+Liner Ship Fleet Planning
+Modeling of Transport Demand
+Port Cybersecurity
+Resource Sharing as a Process
+Are We Safe Enough? Measuring and Assessing Aviation Security
+Media and Information Literacy
+XML-based Content Management
+Digital Inclusion and Exclusion
+Scholarly Communication at the Crossroads in China
+The Political Economy of Business Ethics in East Asia
+Marketing Services and Resources in Information Organizations
+Internationalisation and Managing Networks in the Asia Pacific
+Enterprise Content Management, Records Management and Information Culture Amidst E-Government Development
+Transliteracy in Complex Information Environments
+The Road to Active Thinking
+Academic Crowdsourcing in the Humanities
+Organizational Learning in Asia
+The Art of Teaching Online
+Seven Leadership Principles of Chinese Women in Business Leaders
+The Changing Face of Corruption in the Asia Pacific
+Successful Fundraising for the Academic Library
+Innovation in Public Libraries
+Strategic Management of Libraries
+The Crosswalk
+Beyond Mentoring
+Social Media in the Marketing Context
+Social Justice and Librarianship
+The 21st Century Academic Library
+Research Made Accessible
+Ethic Management in Libraries and other Information Services
+International Librarianship At Home and Abroad
+Data Analytics for Intelligent Transportation Systems
+Urban Mobility
+Measuring Road Safety with Surrogate Event
+The Psychology of the Car
+Vulnerability Analysis for Transportation Networks
+Document Management at the Heart of Business Processes:
+Digital interculturality
+Knowledge Audits and Knowledge Mapping
+Utilizing Technology in the Academic Research Process
+Academic Librarianship, Publishing, and the Tenure Track
+Providing Research Support
+The Librarian's Guide to Catholic Resources on the Internet
+Reinventing Librarianship
+Boosting the Knowledge Economy
+Information Architecture
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/distribution/src/main/release/samples/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/pom.xml b/distribution/src/main/release/samples/pom.xml
index f90aad6..5e31d58 100644
--- a/distribution/src/main/release/samples/pom.xml
+++ b/distribution/src/main/release/samples/pom.xml
@@ -125,6 +125,7 @@
<module>jax_rs/sse_cdi</module>
<module>jax_rs/sse_tomcat</module>
<module>jax_rs/sse_spring</module>
+ <module>jax_rs/nio_cdi</module>
</modules>
<dependencyManagement>
<dependencies>
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java
----------------------------------------------------------------------
diff --git a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java
index 97d8e0c..3e9031e 100644
--- a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java
+++ b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java
@@ -344,7 +344,7 @@ public class JAXRSCdiResourceExtension implements Extension {
(JAXRSServerFactoryCustomizationExtension)beanManager.getReference(
extensionBean,
extensionBean.getBeanClass(),
- beanManager.createCreationalContext(extensionBean)
+ createCreationalContext(beanManager, extensionBean)
);
extension.customize(bean);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java
index 29c5c42..e0f98da 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java
@@ -41,6 +41,7 @@ import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.core.Variant;
+import org.apache.cxf.jaxrs.nio.NioWriteEntity;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.PhaseInterceptorChain;
@@ -318,14 +319,14 @@ public class ResponseBuilderImpl extends ResponseBuilder implements Cloneable {
}
@Override
- public ResponseBuilder entity(NioWriterHandler arg0) {
- // TODO: Not Implemented
- return this;
+ public ResponseBuilder entity(NioWriterHandler writer) {
+ return entity(writer, (throwable) -> {
+ });
}
@Override
- public ResponseBuilder entity(NioWriterHandler arg0, NioErrorHandler arg1) {
- // TODO: Not Implemented
+ public ResponseBuilder entity(NioWriterHandler writer, NioErrorHandler error) {
+ this.entity = new NioWriteEntity(writer, error);
return this;
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioOutputStream.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioOutputStream.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioOutputStream.java
new file mode 100644
index 0000000..29e05e1
--- /dev/null
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioOutputStream.java
@@ -0,0 +1,57 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.nio;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.ws.rs.core.NioOutputStream;
+
+public class DelegatingNioOutputStream extends NioOutputStream {
+ private final OutputStream out;
+
+ public DelegatingNioOutputStream(final OutputStream out) {
+ this.out = out;
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ out.write(b, off, len);
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException {
+ out.write(b);
+ }
+
+ @Override
+ public void write(int b) throws IOException {
+ out.write(b);
+ }
+
+ @Override
+ public void flush() throws IOException {
+ out.flush();
+ }
+
+ @Override
+ public void close() throws IOException {
+ out.close();
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioServletOutputStream.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioServletOutputStream.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioServletOutputStream.java
new file mode 100644
index 0000000..682d5a4
--- /dev/null
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/DelegatingNioServletOutputStream.java
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.nio;
+
+import java.io.IOException;
+
+import javax.servlet.ServletOutputStream;
+import javax.ws.rs.core.NioOutputStream;
+
+public class DelegatingNioServletOutputStream extends NioOutputStream {
+ private final ServletOutputStream out;
+
+ public DelegatingNioServletOutputStream(final ServletOutputStream out) {
+ this.out = out;
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException {
+ out.write(b);
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ out.write(b, off, len);
+ }
+
+ @Override
+ public void write(int b) throws IOException {
+ out.write(b);
+ }
+
+ @Override
+ public void flush() throws IOException {
+ out.flush();
+ }
+
+ @Override
+ public void close() throws IOException {
+ out.close();
+ }
+
+ public boolean isReady() {
+ return out.isReady();
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioFeature.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioFeature.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioFeature.java
new file mode 100644
index 0000000..56d4664
--- /dev/null
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioFeature.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.nio;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.jaxrs.provider.ServerProviderFactory;
+
+public class NioFeature extends AbstractFeature {
+ @Override
+ public void initialize(Server server, Bus bus) {
+ final List<Object> providers = new ArrayList<>();
+ providers.add(new NioMessageBodyWriter());
+
+ server.getEndpoint().getInInterceptors().add(new NioInInterceptor());
+ ((ServerProviderFactory)server.getEndpoint()
+ .get(ServerProviderFactory.class.getName()))
+ .setUserProviders(providers);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioInInterceptor.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioInInterceptor.java
new file mode 100644
index 0000000..de97a19
--- /dev/null
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioInInterceptor.java
@@ -0,0 +1,91 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.nio;
+
+import java.util.List;
+
+import javax.ws.rs.core.Response;
+
+import org.apache.cxf.continuations.Continuation;
+import org.apache.cxf.continuations.ContinuationCallback;
+import org.apache.cxf.continuations.ContinuationProvider;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.ServiceInvokerInterceptor;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class NioInInterceptor extends AbstractPhaseInterceptor<Message> {
+ public NioInInterceptor() {
+ super(Phase.INVOKE);
+ addAfter(ServiceInvokerInterceptor.class.getName());
+ }
+
+ public void handleMessage(Message message) throws Fault {
+ final Exchange exchange = message.getExchange();
+ if (exchange.isOneWay()) {
+ return;
+ }
+
+ if (exchange.getOutMessage() != null) {
+ final Message out = exchange.getOutMessage();
+
+ Object result = out.getContent(Object.class);
+ if (result == null) {
+ result = out.getContent(List.class);
+ if (result != null) {
+ final List<?> results = (List<?>)result;
+ if (!results.isEmpty()) {
+ result = results.get(0);
+ }
+ }
+ }
+
+ Object entity = result;
+ if (result instanceof Response) {
+ entity = ((Response)result).getEntity();
+ }
+
+ if (entity instanceof NioWriteEntity) {
+ message.getExchange().put(ContinuationCallback.class, new ContinuationCallback() {
+ @Override
+ public void onError(Throwable error) {
+ System.out.println("onError()");
+ }
+
+ @Override
+ public void onDisconnect() {
+ System.out.println("onDisconnect()");
+ }
+
+ @Override
+ public void onComplete() {
+ System.out.println("onComplete()");
+ }
+ });
+
+
+ final ContinuationProvider provider = message.get(ContinuationProvider.class);
+ final Continuation continuation = provider.getContinuation();
+ continuation.suspend(0);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioMessageBodyWriter.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioMessageBodyWriter.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioMessageBodyWriter.java
new file mode 100644
index 0000000..9a70085
--- /dev/null
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioMessageBodyWriter.java
@@ -0,0 +1,97 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.nio;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+import org.apache.cxf.transport.http.AbstractHTTPDestination.WrappingOutputStream;
+
+@Provider
+public class NioMessageBodyWriter implements MessageBodyWriter<NioWriteEntity> {
+ @Context
+ private HttpServletRequest request;
+
+ public NioMessageBodyWriter() {
+ }
+
+ @Override
+ public boolean isWriteable(Class<?> cls, Type type, Annotation[] anns, MediaType mt) {
+ return NioWriteEntity.class.isAssignableFrom(cls);
+ }
+
+ @Override
+ public void writeTo(NioWriteEntity p, Class<?> cls, Type t, Annotation[] anns,
+ MediaType mt, MultivaluedMap<String, Object> headers, OutputStream os)
+ throws IOException, WebApplicationException {
+
+ OutputStream out = os;
+ if (out instanceof WrappingOutputStream) {
+ final WrappingOutputStream wrappingStream = (WrappingOutputStream)out;
+ if (wrappingStream.getWrappingOutputStream() != null) {
+ out = wrappingStream.getWrappingOutputStream();
+ }
+ }
+
+ if (out instanceof ServletOutputStream) {
+ final ServletOutputStream servletOutputStream = (ServletOutputStream)out;
+
+ if (!request.isAsyncStarted()) {
+ request.startAsync();
+ }
+
+ final WriteListener listener = new NioWriterImpl(p.getWriter(), p.getError(),
+ request.getAsyncContext(), servletOutputStream);
+ servletOutputStream.setWriteListener(listener);
+ } else {
+ final DelegatingNioOutputStream nio = new DelegatingNioOutputStream(out);
+ try {
+ while (p.getWriter().write(nio)) {
+ Thread.yield();
+ }
+ } catch (Throwable ex) {
+ try {
+ p.getError().error(ex);
+ } catch (IOException | WebApplicationException inner) {
+ throw inner;
+ } catch (Throwable inner) {
+ throw new WebApplicationException(ex);
+ }
+ }
+ }
+ }
+
+ @Override
+ public long getSize(NioWriteEntity t, Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType) {
+ return -1;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriteEntity.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriteEntity.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriteEntity.java
new file mode 100644
index 0000000..cdd3410
--- /dev/null
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriteEntity.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.nio;
+
+import javax.ws.rs.core.NioErrorHandler;
+import javax.ws.rs.core.NioWriterHandler;
+
+public final class NioWriteEntity {
+ private final NioWriterHandler writer;
+ private final NioErrorHandler error;
+
+ public NioWriteEntity(final NioWriterHandler writer, final NioErrorHandler error) {
+ this.writer = writer;
+ this.error = error;
+ }
+
+ public NioWriterHandler getWriter() {
+ return writer;
+ }
+
+ public NioErrorHandler getError() {
+ return error;
+ }
+}
[05/30] cxf git commit: Fixes relating to WSS4J changes
Posted by re...@apache.org.
Fixes relating to WSS4J changes
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/970080fb
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/970080fb
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/970080fb
Branch: refs/heads/CXF-6882.nio
Commit: 970080fb9d7208c99ad2bde8e3c6c63a5211b448
Parents: 8a605be
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Nov 25 12:49:14 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Nov 25 12:49:14 2016 +0000
----------------------------------------------------------------------
.../saml/sso/AbstractSAMLCallbackHandler.java | 4 +-
.../wss4j/UsernameTokenInterceptor.java | 15 ++-
.../policyhandlers/AbstractBindingBuilder.java | 111 +++++++++----------
.../AsymmetricBindingHandler.java | 39 ++++---
.../policyhandlers/SymmetricBindingHandler.java | 33 +++---
.../policyhandlers/TransportBindingHandler.java | 35 +++---
.../policyhandlers/WSSecurityTokenHolder.java | 5 +-
.../security/wss4j/WSS4JOutInterceptorTest.java | 4 +-
.../wss4j/saml/AbstractSAMLCallbackHandler.java | 4 +-
.../cxf/sts/operation/AbstractOperation.java | 8 +-
.../token/provider/DefaultSubjectProvider.java | 4 +-
.../sts/token/provider/TokenProviderUtils.java | 10 +-
.../cxf/sts/operation/IssueSamlUnitTest.java | 6 +-
13 files changed, 137 insertions(+), 141 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/AbstractSAMLCallbackHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/AbstractSAMLCallbackHandler.java b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/AbstractSAMLCallbackHandler.java
index 9772967..ee801f7 100644
--- a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/AbstractSAMLCallbackHandler.java
+++ b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/AbstractSAMLCallbackHandler.java
@@ -207,10 +207,10 @@ public abstract class AbstractSAMLCallbackHandler implements CallbackHandler {
Document doc = docBuilder.newDocument();
// Create an Encrypted Key
- WSSecEncryptedKey encrKey = new WSSecEncryptedKey();
+ WSSecEncryptedKey encrKey = new WSSecEncryptedKey(doc);
encrKey.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
encrKey.setUseThisCert(certs[0]);
- encrKey.prepare(doc, null);
+ encrKey.prepare(null);
ephemeralKey = encrKey.getEphemeralKey();
Element encryptedKeyElement = encrKey.getEncryptedKeyElement();
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
index 0660109..890cbf1 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
@@ -29,6 +29,7 @@ import java.util.Set;
import javax.security.auth.Subject;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.common.util.StringUtils;
@@ -369,8 +370,11 @@ public class UsernameTokenInterceptor extends AbstractTokenInterceptor {
UsernameToken tok = assertTokens(message);
Header h = findSecurityHeader(message, true);
+ Element el = (Element)h.getObject();
+ Document doc = el.getOwnerDocument();
+
WSSecUsernameToken utBuilder =
- addUsernameToken(message, tok);
+ addUsernameToken(message, doc, tok);
if (utBuilder == null) {
AssertionInfoMap aim = message.get(AssertionInfoMap.class);
Collection<AssertionInfo> ais =
@@ -382,13 +386,12 @@ public class UsernameTokenInterceptor extends AbstractTokenInterceptor {
}
return;
}
- Element el = (Element)h.getObject();
- utBuilder.prepare(el.getOwnerDocument());
+ utBuilder.prepare();
el.appendChild(utBuilder.getUsernameTokenElement());
}
- protected WSSecUsernameToken addUsernameToken(SoapMessage message, UsernameToken token) {
+ protected WSSecUsernameToken addUsernameToken(SoapMessage message, Document doc, UsernameToken token) {
String userName =
(String)SecurityUtils.getSecurityPropertyValue(SecurityConstants.USERNAME, message);
WSSConfig wssConfig = (WSSConfig)message.getContextualProperty(WSSConfig.class.getName());
@@ -399,7 +402,7 @@ public class UsernameTokenInterceptor extends AbstractTokenInterceptor {
if (!StringUtils.isEmpty(userName)) {
// If NoPassword property is set we don't need to set the password
if (token.getPasswordType() == UsernameToken.PasswordType.NoPassword) {
- WSSecUsernameToken utBuilder = new WSSecUsernameToken();
+ WSSecUsernameToken utBuilder = new WSSecUsernameToken(doc);
utBuilder.setIdAllocator(wssConfig.getIdAllocator());
utBuilder.setWsTimeSource(wssConfig.getCurrentTime());
utBuilder.setUserInfo(userName, null);
@@ -415,7 +418,7 @@ public class UsernameTokenInterceptor extends AbstractTokenInterceptor {
if (!StringUtils.isEmpty(password)) {
//If the password is available then build the token
- WSSecUsernameToken utBuilder = new WSSecUsernameToken();
+ WSSecUsernameToken utBuilder = new WSSecUsernameToken(doc);
utBuilder.setIdAllocator(wssConfig.getIdAllocator());
utBuilder.setWsTimeSource(wssConfig.getCurrentTime());
if (token.getPasswordType() == UsernameToken.PasswordType.HashPassword) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
index c59d16c..cf4333d 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
@@ -222,9 +222,9 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
protected void insertAfter(Element child, Element sib) {
if (sib.getNextSibling() == null) {
- secHeader.getSecurityHeader().appendChild(child);
+ secHeader.getSecurityHeaderElement().appendChild(child);
} else {
- secHeader.getSecurityHeader().insertBefore(child, sib.getNextSibling());
+ secHeader.getSecurityHeaderElement().insertBefore(child, sib.getNextSibling());
}
}
@@ -235,12 +235,12 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
insertAfter(el, lastEncryptedKeyElement);
} else if (topDownElement != null) {
insertAfter(el, topDownElement);
- } else if (secHeader.getSecurityHeader().getFirstChild() != null) {
- secHeader.getSecurityHeader().insertBefore(
- el, secHeader.getSecurityHeader().getFirstChild()
+ } else if (secHeader.getSecurityHeaderElement().getFirstChild() != null) {
+ secHeader.getSecurityHeaderElement().insertBefore(
+ el, secHeader.getSecurityHeaderElement().getFirstChild()
);
} else {
- secHeader.getSecurityHeader().appendChild(el);
+ secHeader.getSecurityHeaderElement().appendChild(el);
}
lastEncryptedKeyElement = el;
}
@@ -249,15 +249,15 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
if (lastEncryptedKeyElement != null) {
insertAfter(el, lastEncryptedKeyElement);
} else if (lastDerivedKeyElement != null) {
- secHeader.getSecurityHeader().insertBefore(el, lastDerivedKeyElement);
+ secHeader.getSecurityHeaderElement().insertBefore(el, lastDerivedKeyElement);
} else if (topDownElement != null) {
insertAfter(el, topDownElement);
- } else if (secHeader.getSecurityHeader().getFirstChild() != null) {
- secHeader.getSecurityHeader().insertBefore(
- el, secHeader.getSecurityHeader().getFirstChild()
+ } else if (secHeader.getSecurityHeaderElement().getFirstChild() != null) {
+ secHeader.getSecurityHeaderElement().insertBefore(
+ el, secHeader.getSecurityHeaderElement().getFirstChild()
);
} else {
- secHeader.getSecurityHeader().appendChild(el);
+ secHeader.getSecurityHeaderElement().appendChild(el);
}
lastEncryptedKeyElement = el;
}
@@ -272,29 +272,29 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
} else if (topDownElement != null) {
insertAfter(el, topDownElement);
} else if (bottomUpElement != null) {
- secHeader.getSecurityHeader().insertBefore(el, bottomUpElement);
+ secHeader.getSecurityHeaderElement().insertBefore(el, bottomUpElement);
} else {
- secHeader.getSecurityHeader().appendChild(el);
+ secHeader.getSecurityHeaderElement().appendChild(el);
}
lastSupportingTokenElement = el;
}
protected void insertBeforeBottomUp(Element el) {
if (bottomUpElement == null) {
- secHeader.getSecurityHeader().appendChild(el);
+ secHeader.getSecurityHeaderElement().appendChild(el);
} else {
- secHeader.getSecurityHeader().insertBefore(el, bottomUpElement);
+ secHeader.getSecurityHeaderElement().insertBefore(el, bottomUpElement);
}
bottomUpElement = el;
}
protected void addTopDownElement(Element el) {
if (topDownElement == null) {
- if (secHeader.getSecurityHeader().getFirstChild() == null) {
- secHeader.getSecurityHeader().appendChild(el);
+ if (secHeader.getSecurityHeaderElement().getFirstChild() == null) {
+ secHeader.getSecurityHeaderElement().appendChild(el);
} else {
- secHeader.getSecurityHeader().insertBefore(
- el, secHeader.getSecurityHeader().getFirstChild()
+ secHeader.getSecurityHeaderElement().insertBefore(
+ el, secHeader.getSecurityHeaderElement().getFirstChild()
);
}
} else {
@@ -335,11 +335,11 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
if (ttl <= 0) {
ttl = 300;
}
- timestampEl = new WSSecTimestamp();
+ timestampEl = new WSSecTimestamp(secHeader);
timestampEl.setIdAllocator(wssConfig.getIdAllocator());
timestampEl.setWsTimeSource(wssConfig.getCurrentTime());
timestampEl.setTimeToLive(ttl);
- timestampEl.prepare(saaj.getSOAPPart());
+ timestampEl.prepare();
String namespace = binding.getName().getNamespaceURI();
PolicyUtils.assertPolicy(aim, new QName(namespace, SPConstants.INCLUDE_TIMESTAMP));
@@ -360,7 +360,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
new QName(binding.getLayout().getName().getNamespaceURI(),
SPConstants.LAYOUT_LAX_TIMESTAMP_LAST));
Element el = timestamp.getElement();
- secHeader.getSecurityHeader().appendChild(el);
+ secHeader.getSecurityHeaderElement().appendChild(el);
if (bottomUpElement == null) {
bottomUpElement = el;
}
@@ -398,17 +398,17 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
// Make sure that the Timestamp is in first place, if that is what the policy requires
if (binding.getLayout() != null && timestampEl != null) {
if (binding.getLayout().getLayoutType() == LayoutType.LaxTsFirst
- && secHeader.getSecurityHeader().getFirstChild() != timestampEl.getElement()) {
- Node firstChild = secHeader.getSecurityHeader().getFirstChild();
+ && secHeader.getSecurityHeaderElement().getFirstChild() != timestampEl.getElement()) {
+ Node firstChild = secHeader.getSecurityHeaderElement().getFirstChild();
while (firstChild != null && firstChild.getNodeType() != Node.ELEMENT_NODE) {
firstChild = firstChild.getNextSibling();
}
if (firstChild != null && firstChild != timestampEl.getElement()) {
- secHeader.getSecurityHeader().insertBefore(timestampEl.getElement(), firstChild);
+ secHeader.getSecurityHeaderElement().insertBefore(timestampEl.getElement(), firstChild);
}
} else if (binding.getLayout().getLayoutType() == LayoutType.LaxTsLast
- && secHeader.getSecurityHeader().getLastChild() != timestampEl.getElement()) {
- secHeader.getSecurityHeader().appendChild(timestampEl.getElement());
+ && secHeader.getSecurityHeaderElement().getLastChild() != timestampEl.getElement()) {
+ secHeader.getSecurityHeaderElement().appendChild(timestampEl.getElement());
}
}
}
@@ -476,11 +476,11 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
if (secToken.getX509Certificate() == null) {
ret.add(
- new SupportingToken(token, new WSSecurityTokenHolder(secToken),
+ new SupportingToken(token, new WSSecurityTokenHolder(secToken, secHeader),
getSignedParts(suppTokens))
);
} else {
- WSSecSignature sig = new WSSecSignature();
+ WSSecSignature sig = new WSSecSignature(secHeader);
sig.setIdAllocator(wssConfig.getIdAllocator());
sig.setCallbackLookup(callbackLookup);
sig.setX509Certificate(secToken.getX509Certificate());
@@ -513,7 +513,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
String password = getPassword(uname, token, WSPasswordCallback.SIGNATURE);
sig.setUserInfo(uname, password);
try {
- sig.prepare(saaj.getSOAPPart(), secToken.getCrypto(), secHeader);
+ sig.prepare(secToken.getCrypto());
} catch (WSSecurityException e) {
LOG.log(Level.FINE, e.getMessage(), e);
throw new Fault(e);
@@ -530,13 +530,13 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
if (bstElem != null) {
if (lastEncryptedKeyElement != null) {
if (lastEncryptedKeyElement.getNextSibling() != null) {
- secHeader.getSecurityHeader().insertBefore(bstElem,
+ secHeader.getSecurityHeaderElement().insertBefore(bstElem,
lastEncryptedKeyElement.getNextSibling());
} else {
- secHeader.getSecurityHeader().appendChild(bstElem);
+ secHeader.getSecurityHeaderElement().appendChild(bstElem);
}
} else {
- sig.prependBSTElementToHeader(secHeader);
+ sig.prependBSTElementToHeader();
}
if (suppTokens.isEncryptedToken()) {
WSEncryptionPart part = new WSEncryptionPart(sig.getBSTTokenId(), "Element");
@@ -577,7 +577,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
if (endorse) {
WSSecUsernameToken utBuilder = addDKUsernameToken(token, true);
if (utBuilder != null) {
- utBuilder.prepare(saaj.getSOAPPart());
+ utBuilder.prepare();
addSupportingElement(utBuilder.getUsernameTokenElement());
ret.add(new SupportingToken(token, utBuilder, null));
if (encryptedToken) {
@@ -589,7 +589,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
} else {
WSSecUsernameToken utBuilder = addUsernameToken(token);
if (utBuilder != null) {
- utBuilder.prepare(saaj.getSOAPPart());
+ utBuilder.prepare();
addSupportingElement(utBuilder.getUsernameTokenElement());
ret.add(new SupportingToken(token, utBuilder, null));
//WebLogic and WCF always encrypt these
@@ -608,8 +608,8 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
}
protected Element cloneElement(Element el) {
- if (!secHeader.getSecurityHeader().getOwnerDocument().equals(el.getOwnerDocument())) {
- return (Element)secHeader.getSecurityHeader().getOwnerDocument().importNode(el, true);
+ if (!secHeader.getSecurityHeaderElement().getOwnerDocument().equals(el.getOwnerDocument())) {
+ return (Element)secHeader.getSecurityHeaderElement().getOwnerDocument().importNode(el, true);
}
return el;
}
@@ -774,7 +774,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
String userName = (String)SecurityUtils.getSecurityPropertyValue(SecurityConstants.USERNAME, message);
if (!StringUtils.isEmpty(userName)) {
- WSSecUsernameToken utBuilder = new WSSecUsernameToken();
+ WSSecUsernameToken utBuilder = new WSSecUsernameToken(secHeader);
utBuilder.setIdAllocator(wssConfig.getIdAllocator());
utBuilder.setWsTimeSource(wssConfig.getCurrentTime());
@@ -825,7 +825,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
String userName = (String)SecurityUtils.getSecurityPropertyValue(SecurityConstants.USERNAME, message);
if (!StringUtils.isEmpty(userName)) {
- WSSecUsernameToken utBuilder = new WSSecUsernameToken();
+ WSSecUsernameToken utBuilder = new WSSecUsernameToken(secHeader);
utBuilder.setIdAllocator(wssConfig.getIdAllocator());
utBuilder.setWsTimeSource(wssConfig.getCurrentTime());
@@ -839,7 +839,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
// If the password is available then build the token
utBuilder.setUserInfo(userName, password);
utBuilder.addDerivedKey(useMac, null, 1000);
- utBuilder.prepare(saaj.getSOAPPart());
+ utBuilder.prepare();
} else {
unassertPolicy(token, "No password available");
return null;
@@ -1425,7 +1425,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
}
protected WSSecEncryptedKey getEncryptedKeyBuilder(AbstractToken token) throws WSSecurityException {
- WSSecEncryptedKey encrKey = new WSSecEncryptedKey();
+ WSSecEncryptedKey encrKey = new WSSecEncryptedKey(secHeader);
encrKey.setIdAllocator(wssConfig.getIdAllocator());
encrKey.setCallbackLookup(callbackLookup);
encrKey.setAttachmentCallbackHandler(new AttachmentCallbackHandler(message));
@@ -1449,7 +1449,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
encrKey.setKeyEncAlgo(algType.getAsymmetricKeyWrap());
encrKey.setMGFAlgorithm(algType.getMGFAlgo());
- encrKey.prepare(saaj.getSOAPPart(), crypto);
+ encrKey.prepare(crypto);
if (alsoIncludeToken) {
X509Certificate encCert = getEncryptCert(crypto, encrUser);
@@ -1458,7 +1458,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
bstToken.addWSUNamespace();
bstToken.setID(wssConfig.getIdAllocator().createSecureId("X509-", encCert));
WSSecurityUtil.prependChildElement(
- secHeader.getSecurityHeader(), bstToken.getElement()
+ secHeader.getSecurityHeaderElement(), bstToken.getElement()
);
bstElement = bstToken.getElement();
}
@@ -1705,7 +1705,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
protected WSSecSignature getSignatureBuilder(
AbstractToken token, boolean attached, boolean endorse
) throws WSSecurityException {
- WSSecSignature sig = new WSSecSignature();
+ WSSecSignature sig = new WSSecSignature(secHeader);
sig.setIdAllocator(wssConfig.getIdAllocator());
sig.setCallbackLookup(callbackLookup);
sig.setAttachmentCallbackHandler(new AttachmentCallbackHandler(message));
@@ -1825,7 +1825,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
sig.setAddInclusivePrefixes(includePrefixes);
try {
- sig.prepare(saaj.getSOAPPart(), crypto, secHeader);
+ sig.prepare(crypto);
} catch (WSSecurityException e) {
LOG.log(Level.FINE, e.getMessage(), e);
unassertPolicy(token, e);
@@ -1861,7 +1861,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
sigParts.add(bstPart);
}
try {
- List<Reference> referenceList = sig.addReferencesToSign(sigParts, secHeader);
+ List<Reference> referenceList = sig.addReferencesToSign(sigParts);
sig.computeSignature(referenceList, false, null);
addSig(sig.getSignatureValue());
@@ -1929,7 +1929,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
throws WSSecurityException {
Document doc = saaj.getSOAPPart();
- WSSecDKSign dkSign = new WSSecDKSign();
+ WSSecDKSign dkSign = new WSSecDKSign(secHeader);
dkSign.setIdAllocator(wssConfig.getIdAllocator());
dkSign.setCallbackLookup(callbackLookup);
@@ -1984,7 +1984,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
dkSign.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
}
- dkSign.prepare(doc, secHeader);
+ dkSign.prepare();
if (isTokenProtection) {
String sigTokId = XMLUtils.getIDFromReference(tok.getId());
@@ -1993,7 +1993,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
dkSign.getParts().addAll(sigParts);
- List<Reference> referenceList = dkSign.addReferencesToSign(sigParts, secHeader);
+ List<Reference> referenceList = dkSign.addReferencesToSign(sigParts);
//Add elements to header
addSupportingElement(dkSign.getdktElement());
@@ -2014,8 +2014,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
boolean isSigProtect)
throws WSSecurityException {
- Document doc = saaj.getSOAPPart();
- WSSecSignature sig = new WSSecSignature();
+ WSSecSignature sig = new WSSecSignature(secHeader);
sig.setIdAllocator(wssConfig.getIdAllocator());
sig.setCallbackLookup(callbackLookup);
@@ -2064,10 +2063,10 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
AlgorithmSuiteType algType = binding.getAlgorithmSuite().getAlgorithmSuiteType();
sig.setDigestAlgo(algType.getDigest());
sig.setSigCanonicalization(binding.getAlgorithmSuite().getC14n().getValue());
- sig.prepare(doc, getSignatureCrypto(), secHeader);
+ sig.prepare(getSignatureCrypto());
sig.getParts().addAll(sigParts);
- List<Reference> referenceList = sig.addReferencesToSign(sigParts, secHeader);
+ List<Reference> referenceList = sig.addReferencesToSign(sigParts);
//Do signature
sig.computeSignature(referenceList, false, null);
@@ -2166,13 +2165,13 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
sigConfList = new ArrayList<>();
// prepare a SignatureConfirmation token
- WSSecSignatureConfirmation wsc = new WSSecSignatureConfirmation();
+ WSSecSignatureConfirmation wsc = new WSSecSignatureConfirmation(secHeader);
wsc.setIdAllocator(wssConfig.getIdAllocator());
if (signatureActions.size() > 0) {
for (WSSecurityEngineResult wsr : signatureActions) {
byte[] sigVal = (byte[]) wsr.get(WSSecurityEngineResult.TAG_SIGNATURE_VALUE);
wsc.setSignatureValue(sigVal);
- wsc.prepare(saaj.getSOAPPart());
+ wsc.prepare();
addSupportingElement(wsc.getSignatureConfirmationElement());
if (sigParts != null) {
WSEncryptionPart part = new WSEncryptionPart(wsc.getId(), "Element");
@@ -2183,7 +2182,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
}
} else {
//No Sig value
- wsc.prepare(saaj.getSOAPPart());
+ wsc.prepare();
addSupportingElement(wsc.getSignatureConfirmationElement());
if (sigParts != null) {
WSEncryptionPart part = new WSEncryptionPart(wsc.getId(), "Element");
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
index 28c33d8..bea5631 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
@@ -404,9 +404,9 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
&& encrBase instanceof WSSecDKEncrypt) {
try {
Element secondRefList =
- ((WSSecDKEncrypt)encrBase).encryptForExternalRef(null, secondEncrParts, secHeader);
+ ((WSSecDKEncrypt)encrBase).encryptForExternalRef(null, secondEncrParts);
if (secondRefList != null) {
- ((WSSecDKEncrypt)encrBase).addExternalRefElement(secondRefList, secHeader);
+ ((WSSecDKEncrypt)encrBase).addExternalRefElement(secondRefList);
}
} catch (WSSecurityException ex) {
@@ -424,7 +424,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
} else {
this.insertBeforeBottomUp(secondRefList);
}
- ((WSSecEncrypt)encrBase).encryptForRef(secondRefList, secondEncrParts, secHeader);
+ ((WSSecEncrypt)encrBase).encryptForRef(secondRefList, secondEncrParts);
} catch (WSSecurityException ex) {
LOG.log(Level.FINE, ex.getMessage(), ex);
@@ -446,14 +446,13 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
return doEncryptionDerived(recToken, encrToken, encrParts, algorithmSuite);
} else {
try {
- WSSecEncrypt encr = new WSSecEncrypt();
+ WSSecEncrypt encr = new WSSecEncrypt(secHeader);
encr.setEncryptionSerializer(new StaxSerializer());
encr.setIdAllocator(wssConfig.getIdAllocator());
encr.setCallbackLookup(callbackLookup);
encr.setAttachmentCallbackHandler(new AttachmentCallbackHandler(message));
encr.setStoreBytesInAttachment(storeBytesInAttachment);
- encr.setDocument(saaj.getSOAPPart());
Crypto crypto = getEncryptionCrypto();
SecurityToken securityToken = getSecurityToken();
@@ -499,13 +498,13 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
encr.setKeyEncAlgo(algType.getAsymmetricKeyWrap());
encr.setMGFAlgorithm(algType.getMGFAlgo());
encr.setDigestAlgorithm(algType.getEncryptionDigest());
- encr.prepare(saaj.getSOAPPart(), crypto);
+ encr.prepare(crypto);
Element encryptedKeyElement = encr.getEncryptedKeyElement();
List<Element> attachments = encr.getAttachmentEncryptedDataElements();
//Encrypt, get hold of the ref list and add it
if (externalRef) {
- Element refList = encr.encryptForRef(null, encrParts, secHeader);
+ Element refList = encr.encryptForRef(null, encrParts);
if (refList != null) {
insertBeforeBottomUp(refList);
}
@@ -518,7 +517,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
this.addEncryptedKeyElement(encryptedKeyElement);
}
} else {
- Element refList = encr.encryptForRef(null, encrParts, secHeader);
+ Element refList = encr.encryptForRef(null, encrParts);
if (refList != null || (attachments != null && !attachments.isEmpty())) {
this.addEncryptedKeyElement(encryptedKeyElement);
}
@@ -536,7 +535,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
// Put BST before EncryptedKey element
if (encr.getBSTTokenId() != null) {
- encr.prependBSTElementToHeader(secHeader);
+ encr.prependBSTElementToHeader();
}
return encr;
@@ -554,7 +553,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
List<WSEncryptionPart> encrParts,
AlgorithmSuite algorithmSuite) {
try {
- WSSecDKEncrypt dkEncr = new WSSecDKEncrypt();
+ WSSecDKEncrypt dkEncr = new WSSecDKEncrypt(secHeader);
dkEncr.setEncryptionSerializer(new StaxSerializer());
dkEncr.setIdAllocator(wssConfig.getIdAllocator());
dkEncr.setCallbackLookup(callbackLookup);
@@ -575,10 +574,10 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
AlgorithmSuiteType algType = algorithmSuite.getAlgorithmSuiteType();
dkEncr.setSymmetricEncAlgorithm(algType.getEncryption());
dkEncr.setDerivedKeyLength(algType.getEncryptionDerivedKeyLength() / 8);
- dkEncr.prepare(saaj.getSOAPPart());
+ dkEncr.prepare();
addDerivedKeyElement(dkEncr.getdktElement());
- Element refList = dkEncr.encryptForExternalRef(null, encrParts, secHeader);
+ Element refList = dkEncr.encryptForExternalRef(null, encrParts);
if (refList != null) {
insertBeforeBottomUp(refList);
}
@@ -631,7 +630,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
// Add the BST to the security header if required
if (!attached && isTokenRequired(sigToken.getIncludeTokenType())) {
WSSecSignature sig = getSignatureBuilder(sigToken, attached, false);
- sig.appendBSTElementToHeader(secHeader);
+ sig.appendBSTElementToHeader();
}
return;
}
@@ -639,7 +638,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
// Set up the encrypted key to use
setupEncryptedKey(wrapper, sigToken);
- WSSecDKSign dkSign = new WSSecDKSign();
+ WSSecDKSign dkSign = new WSSecDKSign(secHeader);
dkSign.setIdAllocator(wssConfig.getIdAllocator());
dkSign.setCallbackLookup(callbackLookup);
dkSign.setAttachmentCallbackHandler(new AttachmentCallbackHandler(message));
@@ -666,7 +665,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
dkSign.setAddInclusivePrefixes(includePrefixes);
try {
- dkSign.prepare(saaj.getSOAPPart(), secHeader);
+ dkSign.prepare();
if (abinding.isProtectTokens()) {
assertPolicy(
@@ -686,7 +685,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
dkSign.getParts().addAll(sigParts);
- List<Reference> referenceList = dkSign.addReferencesToSign(sigParts, secHeader);
+ List<Reference> referenceList = dkSign.addReferencesToSign(sigParts);
if (!referenceList.isEmpty()) {
// Add elements to header
addDerivedKeyElement(dkSign.getdktElement());
@@ -719,10 +718,10 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
bstPart.setElement(sig.getBinarySecurityTokenElement());
sigParts.add(bstPart);
}
- sig.prependBSTElementToHeader(secHeader);
+ sig.prependBSTElementToHeader();
}
- List<Reference> referenceList = sig.addReferencesToSign(sigParts, secHeader);
+ List<Reference> referenceList = sig.addReferencesToSign(sigParts);
if (!referenceList.isEmpty()) {
//Do signature
if (bottomUpElement == null) {
@@ -735,7 +734,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
if (!abinding.isProtectTokens()) {
Element bstElement = sig.getBinarySecurityTokenElement();
if (bstElement != null) {
- secHeader.getSecurityHeader().insertBefore(bstElement, bottomUpElement);
+ secHeader.getSecurityHeaderElement().insertBefore(bstElement, bottomUpElement);
}
}
@@ -787,7 +786,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
Element bstElem = encrKey.getBinarySecurityTokenElement();
if (bstElem != null) {
// If a BST is available then use it
- encrKey.prependBSTElementToHeader(secHeader);
+ encrKey.prependBSTElementToHeader();
}
// Add the EncryptedKey
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
index 2534048..473cd2a 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
@@ -251,10 +251,10 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
if (encryptionToken.getDerivedKeys() == DerivedKeys.RequireDerivedKeys
&& !secondEncrParts.isEmpty()) {
secondRefList = ((WSSecDKEncrypt)encr).encryptForExternalRef(null,
- secondEncrParts, secHeader);
+ secondEncrParts);
} else if (!secondEncrParts.isEmpty()) {
//Encrypt, get hold of the ref list and add it
- secondRefList = ((WSSecEncrypt)encr).encryptForRef(null, secondEncrParts, secHeader);
+ secondRefList = ((WSSecEncrypt)encr).encryptForRef(null, secondEncrParts);
}
if (secondRefList != null) {
this.addDerivedKeyElement(secondRefList);
@@ -402,7 +402,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
List<WSEncryptionPart> encrParts,
boolean atEnd) {
try {
- WSSecDKEncrypt dkEncr = new WSSecDKEncrypt();
+ WSSecDKEncrypt dkEncr = new WSSecDKEncrypt(secHeader);
dkEncr.setEncryptionSerializer(new StaxSerializer());
dkEncr.setIdAllocator(wssConfig.getIdAllocator());
dkEncr.setCallbackLookup(callbackLookup);
@@ -486,12 +486,12 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
AlgorithmSuiteType algType = sbinding.getAlgorithmSuite().getAlgorithmSuiteType();
dkEncr.setSymmetricEncAlgorithm(algType.getEncryption());
dkEncr.setDerivedKeyLength(algType.getEncryptionDerivedKeyLength() / 8);
- dkEncr.prepare(saaj.getSOAPPart());
+ dkEncr.prepare();
Element encrDKTokenElem = null;
encrDKTokenElem = dkEncr.getdktElement();
addDerivedKeyElement(encrDKTokenElem);
- Element refList = dkEncr.encryptForExternalRef(null, encrParts, secHeader);
+ Element refList = dkEncr.encryptForExternalRef(null, encrParts);
List<Element> attachments = dkEncr.getAttachmentEncryptedDataElements();
addAttachmentsForEncryption(atEnd, refList, attachments);
@@ -519,7 +519,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
attached, encrParts, atEnd);
} else {
try {
- WSSecEncrypt encr = new WSSecEncrypt();
+ WSSecEncrypt encr = new WSSecEncrypt(secHeader);
encr.setEncryptionSerializer(new StaxSerializer());
encr.setIdAllocator(wssConfig.getIdAllocator());
encr.setCallbackLookup(callbackLookup);
@@ -552,7 +552,6 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
setEncryptionUser(encr, encrToken, false, crypto);
}
- encr.setDocument(saaj.getSOAPPart());
encr.setEncryptSymmKey(false);
encr.setSymmetricEncAlgorithm(algorithmSuite.getAlgorithmSuiteType().getEncryption());
encr.setMGFAlgorithm(algorithmSuite.getAlgorithmSuiteType().getMGFAlgo());
@@ -595,13 +594,13 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
encr.setKeyIdentifierType(WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER);
}
- encr.prepare(saaj.getSOAPPart(), crypto);
+ encr.prepare(crypto);
if (encr.getBSTTokenId() != null) {
- encr.prependBSTElementToHeader(secHeader);
+ encr.prependBSTElementToHeader();
}
- Element refList = encr.encryptForRef(null, encrParts, secHeader);
+ Element refList = encr.encryptForRef(null, encrParts);
List<Element> attachments = encr.getAttachmentEncryptedDataElements();
addAttachmentsForEncryption(atEnd, refList, attachments);
@@ -643,7 +642,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
SecurityToken tok,
boolean included) throws WSSecurityException {
Document doc = saaj.getSOAPPart();
- WSSecDKSign dkSign = new WSSecDKSign();
+ WSSecDKSign dkSign = new WSSecDKSign(secHeader);
dkSign.setIdAllocator(wssConfig.getIdAllocator());
dkSign.setCallbackLookup(callbackLookup);
dkSign.setAttachmentCallbackHandler(new AttachmentCallbackHandler(message));
@@ -735,7 +734,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
}
}
- dkSign.prepare(doc, secHeader);
+ dkSign.prepare();
if (sbinding.isProtectTokens()) {
String sigTokId = tok.getId();
@@ -754,7 +753,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
}
dkSign.getParts().addAll(sigs);
- List<Reference> referenceList = dkSign.addReferencesToSign(sigs, secHeader);
+ List<Reference> referenceList = dkSign.addReferencesToSign(sigs);
if (!referenceList.isEmpty()) {
//Add elements to header
Element el = dkSign.getdktElement();
@@ -783,7 +782,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
if (policyToken.getDerivedKeys() == DerivedKeys.RequireDerivedKeys) {
return doSignatureDK(sigs, policyAbstractTokenWrapper, policyToken, tok, included);
} else {
- WSSecSignature sig = new WSSecSignature();
+ WSSecSignature sig = new WSSecSignature(secHeader);
sig.setIdAllocator(wssConfig.getIdAllocator());
sig.setCallbackLookup(callbackLookup);
sig.setAttachmentCallbackHandler(new AttachmentCallbackHandler(message));
@@ -888,9 +887,9 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
crypto = getSignatureCrypto();
}
this.message.getExchange().put(SecurityConstants.SIGNATURE_CRYPTO, crypto);
- sig.prepare(saaj.getSOAPPart(), crypto, secHeader);
+ sig.prepare(crypto);
sig.getParts().addAll(sigs);
- List<Reference> referenceList = sig.addReferencesToSign(sigs, secHeader);
+ List<Reference> referenceList = sig.addReferencesToSign(sigs);
if (!referenceList.isEmpty()) {
//Do signature
if (bottomUpElement == null) {
@@ -937,7 +936,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
//If direct ref is used to refer to the cert
//then add the cert to the sec header now
if (bstTokenId != null && bstTokenId.length() > 0) {
- encrKey.prependBSTElementToHeader(secHeader);
+ encrKey.prependBSTElementToHeader();
}
return id;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java
index 4e092d7..b0495e6 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java
@@ -29,7 +29,6 @@ import javax.xml.crypto.dsig.Reference;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.interceptor.Fault;
@@ -105,8 +104,8 @@ public class TransportBindingHandler extends AbstractBindingBuilder {
if (token instanceof UsernameToken) {
WSSecUsernameToken utBuilder = addUsernameToken((UsernameToken)token);
if (utBuilder != null) {
- utBuilder.prepare(saaj.getSOAPPart());
- utBuilder.appendToHeader(secHeader);
+ utBuilder.prepare();
+ utBuilder.appendToHeader();
}
} else if (token instanceof IssuedToken || token instanceof KerberosToken
|| token instanceof SpnegoContextToken) {
@@ -345,8 +344,6 @@ public class TransportBindingHandler extends AbstractBindingBuilder {
private byte[] doX509TokenSignature(AbstractToken token, SupportingTokens wrapper)
throws Exception {
- Document doc = saaj.getSOAPPart();
-
List<WSEncryptionPart> sigParts =
signPartsAndElements(wrapper.getSignedParts(), wrapper.getSignedElements());
@@ -358,9 +355,9 @@ public class TransportBindingHandler extends AbstractBindingBuilder {
if (bstElem != null) {
addTopDownElement(bstElem);
}
- encrKey.appendToHeader(secHeader);
+ encrKey.appendToHeader();
- WSSecDKSign dkSig = new WSSecDKSign();
+ WSSecDKSign dkSig = new WSSecDKSign(secHeader);
dkSig.setIdAllocator(wssConfig.getIdAllocator());
dkSig.setCallbackLookup(callbackLookup);
if (token.getVersion() == SPConstants.SPVersion.SP11) {
@@ -374,13 +371,13 @@ public class TransportBindingHandler extends AbstractBindingBuilder {
dkSig.setExternalKey(encrKey.getEphemeralKey(), encrKey.getId());
- dkSig.prepare(doc, secHeader);
+ dkSig.prepare();
dkSig.getParts().addAll(sigParts);
- List<Reference> referenceList = dkSig.addReferencesToSign(sigParts, secHeader);
+ List<Reference> referenceList = dkSig.addReferencesToSign(sigParts);
//Do signature
- dkSig.appendDKElementToHeader(secHeader);
+ dkSig.appendDKElementToHeader();
dkSig.computeSignature(referenceList, false, null);
return dkSig.getSignatureValue();
@@ -388,9 +385,9 @@ public class TransportBindingHandler extends AbstractBindingBuilder {
WSSecSignature sig = getSignatureBuilder(token, false, false);
assertPolicy(wrapper);
if (sig != null) {
- sig.prependBSTElementToHeader(secHeader);
+ sig.prependBSTElementToHeader();
- List<Reference> referenceList = sig.addReferencesToSign(sigParts, secHeader);
+ List<Reference> referenceList = sig.addReferencesToSign(sigParts);
if (bottomUpElement == null) {
sig.computeSignature(referenceList, false, null);
@@ -451,7 +448,7 @@ public class TransportBindingHandler extends AbstractBindingBuilder {
List<WSEncryptionPart> sigParts
) throws Exception {
//Do Signature with derived keys
- WSSecDKSign dkSign = new WSSecDKSign();
+ WSSecDKSign dkSign = new WSSecDKSign(secHeader);
dkSign.setIdAllocator(wssConfig.getIdAllocator());
dkSign.setCallbackLookup(callbackLookup);
AlgorithmSuite algorithmSuite = tbinding.getAlgorithmSuite();
@@ -481,13 +478,12 @@ public class TransportBindingHandler extends AbstractBindingBuilder {
if (token.getVersion() == SPConstants.SPVersion.SP11) {
dkSign.setWscVersion(ConversationConstants.VERSION_05_02);
}
- Document doc = saaj.getSOAPPart();
- dkSign.prepare(doc, secHeader);
+ dkSign.prepare();
addDerivedKeyElement(dkSign.getdktElement());
dkSign.getParts().addAll(sigParts);
- List<Reference> referenceList = dkSign.addReferencesToSign(sigParts, secHeader);
+ List<Reference> referenceList = dkSign.addReferencesToSign(sigParts);
//Do signature
dkSign.computeSignature(referenceList, false, null);
@@ -502,7 +498,7 @@ public class TransportBindingHandler extends AbstractBindingBuilder {
SupportingTokens wrapper,
List<WSEncryptionPart> sigParts
) throws Exception {
- WSSecSignature sig = new WSSecSignature();
+ WSSecSignature sig = new WSSecSignature(secHeader);
sig.setIdAllocator(wssConfig.getIdAllocator());
sig.setCallbackLookup(callbackLookup);
@@ -583,11 +579,10 @@ public class TransportBindingHandler extends AbstractBindingBuilder {
AlgorithmSuiteType algType = binding.getAlgorithmSuite().getAlgorithmSuiteType();
sig.setDigestAlgo(algType.getDigest());
- Document doc = saaj.getSOAPPart();
- sig.prepare(doc, crypto, secHeader);
+ sig.prepare(crypto);
sig.getParts().addAll(sigParts);
- List<Reference> referenceList = sig.addReferencesToSign(sigParts, secHeader);
+ List<Reference> referenceList = sig.addReferencesToSign(sigParts);
//Do signature
if (bottomUpElement == null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/WSSecurityTokenHolder.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/WSSecurityTokenHolder.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/WSSecurityTokenHolder.java
index 14d35b4..3791d1a 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/WSSecurityTokenHolder.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/WSSecurityTokenHolder.java
@@ -21,6 +21,7 @@ package org.apache.cxf.ws.security.wss4j.policyhandlers;
import org.apache.cxf.ws.security.tokenstore.SecurityToken;
import org.apache.wss4j.dom.message.WSSecBase;
+import org.apache.wss4j.dom.message.WSSecHeader;
/**
*
@@ -28,8 +29,8 @@ import org.apache.wss4j.dom.message.WSSecBase;
public class WSSecurityTokenHolder extends WSSecBase {
SecurityToken token;
- public WSSecurityTokenHolder(SecurityToken t) {
- super();
+ public WSSecurityTokenHolder(SecurityToken t, WSSecHeader securityHeader) {
+ super(securityHeader);
token = t;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
index bcb0d95..35c76f9 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
@@ -224,12 +224,12 @@ public class WSS4JOutInterceptorTest extends AbstractSecurityTest {
private int executions;
@Override
- public void execute(WSHandler handler, SecurityActionToken actionToken, Document doc,
+ public void execute(WSHandler handler, SecurityActionToken actionToken,
RequestData reqData) throws WSSecurityException {
this.executions++;
reqData.setPwType(WSConstants.PW_TEXT);
- super.execute(handler, actionToken, doc, reqData);
+ super.execute(handler, actionToken, reqData);
}
public int getExecutions() {
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/saml/AbstractSAMLCallbackHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/saml/AbstractSAMLCallbackHandler.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/saml/AbstractSAMLCallbackHandler.java
index 0b03e57..2026ec2 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/saml/AbstractSAMLCallbackHandler.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/saml/AbstractSAMLCallbackHandler.java
@@ -171,10 +171,10 @@ public abstract class AbstractSAMLCallbackHandler implements CallbackHandler {
Document doc = docBuilder.newDocument();
// Create an Encrypted Key
- WSSecEncryptedKey encrKey = new WSSecEncryptedKey();
+ WSSecEncryptedKey encrKey = new WSSecEncryptedKey(doc);
encrKey.setKeyIdentifierType(WSConstants.X509_KEY_IDENTIFIER);
encrKey.setUseThisCert(certs[0]);
- encrKey.prepare(doc, null);
+ encrKey.prepare(null);
ephemeralKey = encrKey.getEphemeralKey();
Element encryptedKeyElement = encrKey.getEncryptedKeyElement();
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
index 82f739c..b1360b8 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
@@ -341,15 +341,15 @@ public abstract class AbstractOperation {
}
}
- WSSecEncryptedKey builder = new WSSecEncryptedKey();
+ Document doc = DOMUtils.createDocument();
+
+ WSSecEncryptedKey builder = new WSSecEncryptedKey(doc);
builder.setUserInfo(name);
builder.setKeyIdentifierType(encryptionProperties.getKeyIdentifierType());
builder.setEphemeralKey(secret);
builder.setKeyEncAlgo(keyWrapAlgorithm);
- Document doc = DOMUtils.createDocument();
-
- builder.prepare(doc, stsProperties.getEncryptionCrypto());
+ builder.prepare(stsProperties.getEncryptionCrypto());
return builder.getEncryptedKeyElement();
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
index 9433039..5feb707 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
@@ -334,13 +334,13 @@ public class DefaultSubjectProvider implements SubjectProvider {
KeyInfoBean keyInfo = new KeyInfoBean();
// Create an EncryptedKey
- WSSecEncryptedKey encrKey = new WSSecEncryptedKey();
+ WSSecEncryptedKey encrKey = new WSSecEncryptedKey(doc);
encrKey.setKeyIdentifierType(encryptionProperties.getKeyIdentifierType());
encrKey.setEphemeralKey(secret);
encrKey.setSymmetricEncAlgorithm(encryptionProperties.getEncryptionAlgorithm());
encrKey.setUseThisCert(certificate);
encrKey.setKeyEncAlgo(encryptionProperties.getKeyWrapAlgorithm());
- encrKey.prepare(doc, encryptionCrypto);
+ encrKey.prepare(encryptionCrypto);
Element encryptedKeyElement = encrKey.getEncryptedKeyElement();
// Append the EncryptedKey to a KeyInfo element
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java
index c0794a1..5d0ed4e 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java
@@ -149,7 +149,10 @@ public final class TokenProviderUtils {
}
}
- WSSecEncrypt builder = new WSSecEncrypt();
+ Document doc = element.getOwnerDocument();
+ doc.appendChild(element);
+
+ WSSecEncrypt builder = new WSSecEncrypt(doc);
if (WSHandlerConstants.USE_REQ_SIG_CERT.equals(name)) {
X509Certificate cert = getReqSigCert(messageContext);
builder.setUseThisCert(cert);
@@ -164,10 +167,7 @@ public final class TokenProviderUtils {
WSEncryptionPart encryptionPart = new WSEncryptionPart(id, "Element");
encryptionPart.setElement(element);
- Document doc = element.getOwnerDocument();
- doc.appendChild(element);
-
- builder.prepare(element.getOwnerDocument(), stsProperties.getEncryptionCrypto());
+ builder.prepare(stsProperties.getEncryptionCrypto());
builder.encryptForRef(null, Collections.singletonList(encryptionPart));
return doc.getDocumentElement();
http://git-wip-us.apache.org/repos/asf/cxf/blob/970080fb/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
index c7326d1..1db76c6 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
@@ -825,13 +825,13 @@ public class IssueSamlUnitTest extends org.junit.Assert {
);
// Now add Entropy
- WSSecEncryptedKey builder = new WSSecEncryptedKey();
+ Document doc = DOMUtils.createDocument();
+ WSSecEncryptedKey builder = new WSSecEncryptedKey(doc);
builder.setUserInfo("mystskey");
builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
builder.setKeyEncAlgo(WSConstants.KEYTRANSPORT_RSAOAEP);
- Document doc = DOMUtils.createDocument();
- builder.prepare(doc, stsProperties.getSignatureCrypto());
+ builder.prepare(stsProperties.getSignatureCrypto());
Element encryptedKeyElement = builder.getEncryptedKeyElement();
byte[] secret = builder.getEphemeralKey();
[14/30] cxf git commit: Some code updates to the LDAP code in the STS
+ added some tests to cover more code paths
Posted by re...@apache.org.
Some code updates to the LDAP code in the STS + added some tests to cover more code paths
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5226685d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5226685d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5226685d
Branch: refs/heads/CXF-6882.nio
Commit: 5226685d6d5c199485ac0fd62b113b52a6540d72
Parents: 01fdc40
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Nov 29 14:01:19 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Nov 29 14:01:19 2016 +0000
----------------------------------------------------------------------
.../cxf/sts/claims/LdapClaimsHandler.java | 20 ++++----
.../org/apache/cxf/sts/claims/LdapUtils.java | 16 +++---
.../systest/kerberos/ldap/LDAPClaimsTest.java | 52 ++++++++++++++++++++
3 files changed, 69 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/5226685d/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
index 65593f8..77de94c 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
@@ -37,7 +37,6 @@ import javax.security.auth.kerberos.KerberosPrincipal;
import javax.security.auth.x500.X500Principal;
import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.rt.security.claims.Claim;
import org.apache.cxf.rt.security.claims.ClaimCollection;
import org.apache.cxf.sts.token.realm.RealmSupport;
@@ -171,9 +170,9 @@ public class LdapClaimsHandler implements ClaimsHandler, RealmSupport {
Map<String, Attribute> ldapAttributes = null;
if (useLdapLookup) {
- AttributesMapper mapper =
- new AttributesMapper() {
- public Object mapFromAttributes(Attributes attrs) throws NamingException {
+ AttributesMapper<Map<String, Attribute>> mapper =
+ new AttributesMapper<Map<String, Attribute>>() {
+ public Map<String, Attribute> mapFromAttributes(Attributes attrs) throws NamingException {
Map<String, Attribute> map = new HashMap<>();
NamingEnumeration<? extends Attribute> attrEnum = attrs.getAll();
while (attrEnum.hasMore()) {
@@ -184,25 +183,25 @@ public class LdapClaimsHandler implements ClaimsHandler, RealmSupport {
}
};
- Object result = ldap.lookup(user, mapper);
- ldapAttributes = CastUtils.cast((Map<?, ?>)result);
+ ldapAttributes = ldap.lookup(user, mapper);
} else {
List<String> searchAttributeList = new ArrayList<>();
for (Claim claim : claims) {
- if (getClaimsLdapAttributeMapping().keySet().contains(claim.getClaimType().toString())) {
+ String claimType = claim.getClaimType().toString();
+ if (getClaimsLdapAttributeMapping().keySet().contains(claimType)) {
searchAttributeList.add(
- getClaimsLdapAttributeMapping().get(claim.getClaimType().toString())
+ getClaimsLdapAttributeMapping().get(claimType)
);
} else {
if (LOG.isLoggable(Level.FINER)) {
- LOG.finer("Unsupported claim: " + claim.getClaimType());
+ LOG.finer("Unsupported claim: " + claimType);
}
}
}
String[] searchAttributes = searchAttributeList.toArray(new String[searchAttributeList.size()]);
- if (this.userBaseDNs == null || this.userBaseDn != null) {
+ if (this.userBaseDn != null) {
ldapAttributes = LdapUtils.getAttributesOfEntry(ldap, this.userBaseDn, this.getObjectClass(), this
.getUserNameAttribute(), user, searchAttributes);
}
@@ -226,7 +225,6 @@ public class LdapClaimsHandler implements ClaimsHandler, RealmSupport {
}
ProcessedClaimCollection claimsColl = new ProcessedClaimCollection();
-
for (Claim claim : claims) {
ProcessedClaim c = processClaim(claim, ldapAttributes, principal);
if (c != null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/5226685d/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java
index 55106bc..09138fb 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java
@@ -64,9 +64,9 @@ public final class LdapUtils {
Map<String, Attribute> ldapAttributes = null;
- AttributesMapper mapper =
- new AttributesMapper() {
- public Object mapFromAttributes(Attributes attrs) throws NamingException {
+ AttributesMapper<Map<String, Attribute>> mapper =
+ new AttributesMapper<Map<String, Attribute>>() {
+ public Map<String, Attribute> mapFromAttributes(Attributes attrs) throws NamingException {
Map<String, Attribute> map = new HashMap<>();
NamingEnumeration<? extends Attribute> attrEnum = attrs.getAll();
while (attrEnum.hasMore()) {
@@ -143,9 +143,9 @@ public final class LdapUtils {
public static Name getDnOfEntry(LdapTemplate ldapTemplate, String baseDN,
String objectClass, String filterAttributeName, String filterAttributeValue) {
- ContextMapper mapper =
- new AbstractContextMapper() {
- public Object doMapFromContext(DirContextOperations ctx) {
+ ContextMapper<Name> mapper =
+ new AbstractContextMapper<Name>() {
+ public Name doMapFromContext(DirContextOperations ctx) {
return ctx.getDn();
}
};
@@ -155,12 +155,12 @@ public final class LdapUtils {
new EqualsFilter("objectclass", objectClass)).and(
new EqualsFilter(filterAttributeName, filterAttributeValue));
- List<?> result = ldapTemplate.search((baseDN == null) ? "" : baseDN, filter.toString(),
+ List<Name> result = ldapTemplate.search((baseDN == null) ? "" : baseDN, filter.toString(),
SearchControls.SUBTREE_SCOPE, mapper);
if (result != null && result.size() > 0) {
//not only the first one....
- return (Name)result.get(0);
+ return result.get(0);
}
return null;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5226685d/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java
index b01b627..785bae7 100644
--- a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java
@@ -160,6 +160,37 @@ public class LDAPClaimsTest extends AbstractLdapTestUnit {
}
}
}
+
+ @org.junit.Test
+ public void testRetrieveClaimsUsingLDAPLookup() throws Exception {
+ LdapClaimsHandler claimsHandler = (LdapClaimsHandler)appContext.getBean("testClaimsHandler");
+
+ ClaimCollection requestedClaims = createRequestClaimCollection();
+
+ List<URI> expectedClaims = new ArrayList<URI>();
+ expectedClaims.add(ClaimTypes.FIRSTNAME);
+ expectedClaims.add(ClaimTypes.LASTNAME);
+ expectedClaims.add(ClaimTypes.EMAILADDRESS);
+
+ ClaimsParameters params = new ClaimsParameters();
+ params.setPrincipal(new CustomTokenPrincipal("cn=alice,ou=users,dc=example,dc=com"));
+ ProcessedClaimCollection retrievedClaims =
+ claimsHandler.retrieveClaimValues(requestedClaims, params);
+
+ Assert.isTrue(
+ retrievedClaims.size() == expectedClaims.size(),
+ "Retrieved number of claims [" + retrievedClaims.size()
+ + "] doesn't match with expected [" + expectedClaims.size() + "]"
+ );
+
+ for (ProcessedClaim c : retrievedClaims) {
+ if (expectedClaims.contains(c.getClaimType())) {
+ expectedClaims.remove(c.getClaimType());
+ } else {
+ Assert.isTrue(false, "Claim '" + c.getClaimType() + "' not requested");
+ }
+ }
+ }
@org.junit.Test
public void testMultiUserBaseDNs() throws Exception {
@@ -391,6 +422,27 @@ public class LDAPClaimsTest extends AbstractLdapTestUnit {
}
@org.junit.Test
+ public void testRetrieveRolesForAliceUsingLDAPLookup() throws Exception {
+ LdapGroupClaimsHandler claimsHandler =
+ (LdapGroupClaimsHandler)appContext.getBean("testGroupClaimsHandler");
+
+ ClaimCollection requestedClaims = new ClaimCollection();
+ Claim claim = new Claim();
+ URI roleURI = URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role");
+ claim.setClaimType(roleURI);
+ requestedClaims.add(claim);
+
+ ClaimsParameters params = new ClaimsParameters();
+ params.setPrincipal(new CustomTokenPrincipal("cn=alice,ou=users,dc=example,dc=com"));
+ ProcessedClaimCollection retrievedClaims =
+ claimsHandler.retrieveClaimValues(requestedClaims, params);
+
+ Assert.isTrue(retrievedClaims.size() == 1);
+ Assert.isTrue(retrievedClaims.get(0).getClaimType().equals(roleURI));
+ Assert.isTrue(retrievedClaims.get(0).getValues().size() == 2);
+ }
+
+ @org.junit.Test
public void testRetrieveRolesForBob() throws Exception {
LdapGroupClaimsHandler claimsHandler =
(LdapGroupClaimsHandler)appContext.getBean("testGroupClaimsHandlerOtherUsers");
[28/30] cxf git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/cxf
Posted by re...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cxf
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/08911629
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/08911629
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/08911629
Branch: refs/heads/CXF-6882.nio
Commit: 08911629ee02b12b1d7b14ef4d1c6de6d292e947
Parents: d99c9ad 7a98960
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Fri Dec 2 16:50:39 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Fri Dec 2 16:50:39 2016 +0000
----------------------------------------------------------------------
.../apache/cxf/maven_plugin/Java2WSMojo.java | 22 +++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
[29/30] cxf git commit: CXF-6882: Implement JAX-RS 2.1 NIO Proposal
Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriterImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriterImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriterImpl.java
new file mode 100644
index 0000000..52ad6ab
--- /dev/null
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/nio/NioWriterImpl.java
@@ -0,0 +1,68 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.nio;
+
+import java.io.IOException;
+
+import javax.servlet.AsyncContext;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
+import javax.ws.rs.core.NioErrorHandler;
+import javax.ws.rs.core.NioWriterHandler;
+
+public final class NioWriterImpl implements WriteListener {
+ private final NioWriterHandler writer;
+ private final NioErrorHandler error;
+ private final AsyncContext async;
+ private final DelegatingNioServletOutputStream out;
+
+ NioWriterImpl(NioWriterHandler writer, AsyncContext async, ServletOutputStream out) {
+ this(writer, (throwable) -> {
+ }, async, out);
+ }
+
+ NioWriterImpl(NioWriterHandler writer, NioErrorHandler error, AsyncContext async, ServletOutputStream out) {
+ this.writer = writer;
+ this.error = error;
+ this.async = async;
+ this.out = new DelegatingNioServletOutputStream(out);
+ }
+
+ @Override
+ public void onWritePossible() throws IOException {
+ // while we are able to write without blocking
+ while (out.isReady()) {
+ if (!writer.write(out)) {
+ async.complete();
+ return;
+ }
+ }
+ }
+
+ @Override
+ public void onError(Throwable t) {
+ try {
+ error.error(t);
+ } catch (final Throwable ex) {
+ // LOG exception here;
+ } finally {
+ async.complete();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
index d1e956f..df1d676 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
@@ -752,11 +752,16 @@ public abstract class AbstractHTTPDestination
}
}
+ public interface WrappingOutputStream {
+ OutputStream getWrappingOutputStream() throws IOException;
+ }
+
/**
* Wrapper stream responsible for flushing headers and committing outgoing
* HTTP-level response.
*/
- private class WrappedOutputStream extends AbstractWrappedOutputStream implements CopyingOutputStream {
+ private class WrappedOutputStream extends AbstractWrappedOutputStream
+ implements CopyingOutputStream, WrappingOutputStream {
private Message outMessage;
@@ -788,6 +793,20 @@ public abstract class AbstractHTTPDestination
wrappedStream = responseStream;
}
}
+
+ @Override
+ public OutputStream getWrappingOutputStream() throws IOException {
+ if (wrappedStream != null) {
+ return wrappedStream;
+ } else {
+ final HttpServletResponse response = getHttpResponseFromMessage(outMessage);
+ if (response != null) {
+ return response.getOutputStream();
+ }
+ }
+
+ return null;
+ }
/**
* Perform any actions required on stream closure (handle response etc.)
@@ -915,7 +934,7 @@ public abstract class AbstractHTTPDestination
public HTTPServerPolicy getServer() {
return calcServerPolicy(null);
}
-
+
public void setServer(HTTPServerPolicy server) {
this.serverPolicy = server;
if (server != null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStore.java
new file mode 100644
index 0000000..8073eca
--- /dev/null
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStore.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jaxrs.nio;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.cxf.helpers.IOUtils;
+
+@Path("/bookstore")
+public class NioBookStore {
+ @GET
+ @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ public Response readBooks(@QueryParam("path") String path) throws IOException {
+ final ByteArrayInputStream in = new ByteArrayInputStream(
+ IOUtils.readBytesFromStream(getClass().getResourceAsStream("/files/books.txt")));
+ final byte[] buffer = new byte[4096];
+
+ return Response.ok().entity(
+ out -> {
+ try {
+ final int n = in.read(buffer);
+
+ if (n >= 0) {
+ out.write(buffer, 0, n);
+ return true;
+ }
+
+ try {
+ in.close();
+ } catch (IOException ex) {
+ /* do nothing */
+ }
+
+ return false;
+ } catch (IOException ex) {
+ throw new WebApplicationException(ex);
+ }
+ },
+ throwable -> {
+ throw throwable;
+ }
+ ).build();
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreServer.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreServer.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreServer.java
new file mode 100644
index 0000000..c4743e9
--- /dev/null
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreServer.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.jaxrs.nio;
+
+import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
+import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
+import org.apache.cxf.jaxrs.nio.NioMessageBodyWriter;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+
+public class NioBookStoreServer extends AbstractBusTestServerBase {
+ static final String PORT = allocatePort(NioBookStoreServer.class);
+
+ private org.apache.cxf.endpoint.Server server;
+
+ public NioBookStoreServer() {
+ }
+
+ protected void run() {
+ final Bus bus = BusFactory.getDefaultBus();
+ final JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
+ sf.setProvider(new JacksonJsonProvider());
+ sf.setBus(bus);
+ sf.setProvider(new NioMessageBodyWriter());
+ sf.setResourceClasses(NioBookStore.class);
+ sf.setResourceProvider(NioBookStore.class, new SingletonResourceProvider(new NioBookStore(), true));
+ sf.setAddress("http://localhost:" + PORT + "/");
+ server = sf.create();
+ }
+
+ public void tearDown() throws Exception {
+ server.stop();
+ server.destroy();
+ server = null;
+ }
+
+ public static void main(String[] args) {
+ try {
+ NioBookStoreServer s = new NioBookStoreServer();
+ s.start();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ System.exit(-1);
+ } finally {
+ System.out.println("done!");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreTest.java
new file mode 100644
index 0000000..fbe225b
--- /dev/null
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreTest.java
@@ -0,0 +1,70 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.jaxrs.nio;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
+
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+
+public class NioBookStoreTest extends AbstractBusClientServerTestBase {
+ @BeforeClass
+ public static void startServers() throws Exception {
+ AbstractResourceInfo.clearAllMaps();
+ assertTrue("server did not launch correctly", launchServer(NioBookStoreServer.class, true));
+ createStaticBus();
+ }
+
+ @Test
+ public void testGetAllBooks() throws Exception {
+ final Response response = createWebClient("/bookstore", MediaType.APPLICATION_OCTET_STREAM).get();
+
+ try {
+ assertEquals(response.getStatus(), 200);
+ assertThat(response.readEntity(String.class), equalTo(IOUtils.readStringFromStream(
+ getClass().getResourceAsStream("/files/books.txt"))));
+ } finally {
+ response.close();
+ }
+ }
+
+ protected WebClient createWebClient(final String url, final String mediaType) {
+ final List< ? > providers = Arrays.asList(new JacksonJsonProvider());
+
+ final WebClient wc = WebClient
+ .create("http://localhost:" + NioBookStoreServer.PORT + url, providers)
+ .accept(mediaType);
+
+ WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000L);
+ return wc;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/cfc99443/systests/jaxrs/src/test/resources/files/books.txt
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/resources/files/books.txt b/systests/jaxrs/src/test/resources/files/books.txt
new file mode 100644
index 0000000..d830d91
--- /dev/null
+++ b/systests/jaxrs/src/test/resources/files/books.txt
@@ -0,0 +1,1270 @@
+Molecular Breeding and Nutritional Aspects of Buckwheat
+{Progress in Heterocyclic Chemistry, Volume 28}
+Oral, Head and Neck Oncology and Reconstructive Surgery
+Pharmacology and Therapeutics for Dentistry
+Sedation
+Clinical Reasoning in Musculoskeletal Practice
+Maxillofacial Surgery
+A Practical Guide to Fascial Manipulation
+Case Studies in Clinical Cardiac Electrophysiology
+Liu, Volpe, and Galetta\u2019s Neuro-Ophthalmology
+Plotkin's Vaccines
+Hematology
+Integrative Medicine
+Gynecologic Pathology
+Swaiman's Pediatric Neurology
+Pathology of Melanocytic Tumors
+Zakim and Boyer's Hepatology
+Case Reviews in Ophthalmology
+Essential Echocardiography
+Evidence-Based Physical Diagnosis
+Pulmonary Pathology
+Manual for Pulmonary and Critical Care Medicine
+Nelson Pediatric Symptom-Based Diagnosis
+Arrhythmia Essentials
+Clinical Gynecologic Oncology
+Surgical Implantation of Cardiac Rhythm Devices
+Atlas of Image-Guided Spinal Procedures
+Goldberger's Clinical Electrocardiography
+Principles and Practice of Pediatric Infectious Diseases
+Kaufman's Clinical Neurology for Psychiatrists
+Cardiovascular Magnetic Resonance
+Practical Hepatic Pathology: A Diagnostic Approach
+Drugs for Pregnant and Lactating Women
+Volpe's Neurology of the Newborn
+Chronic Coronary Artery Disease
+Hypertension: A Companion to Braunwald's Heart Disease
+Practical Pulmonary Pathology: A Diagnostic Approach
+Obstetric Imaging: Expert Radiology
+Diagnostic Pathology of Infectious Disease
+Cardiac Electrophysiology: From Cell to Bedside
+Practical Surgical Neuropathology: A Diagnostic Approach
+The Interventional Cardiac Catheterization Handbook
+Imaging in Pediatrics
+Cardiology Secrets
+Nephrology Secrets
+Handbook of Liver Disease
+Braddom\u2019s Rehabilitation Care: A Clinical Handbook
+Interstitial Lung Disease
+Textbook of Clinical Hemodynamics
+Current Management of Diabetic Retinopathy
+Drug Allergy Testing
+Personalized Medicine in Asthma
+Urgent Care Dermatology: Symptom-Based Diagnosis
+Imaging in Spine Surgery
+Pediatric Cancer Genetics
+Handbook of Legal Medicine
+Sarcoidosis: A Specialist\u2019s Guide
+Heart Failure: Epidemiology and Research Methods
+Practical Guide to Obesity Medicine
+Music Therapy: Research and Evidence-Based Practice
+Human Milk Composition
+Skull Base Imaging
+Lung Cancer: Evidence-Based Clinical Evaluation and Management
+Challenging Neuropathic Pain Syndromes
+PET/CT in Cancer: An Interdisciplinary Approach to Individualized Imaging
+Arrhythmias in Adult Congenital Heart Disease
+State-of-the-Art Treatment of Osteoarthritis: A Practical Guide
+Peters' Atlas of Tropical Medicine and Parasitology
+Essentials of Global Health
+MacSween's Pathology of the Liver
+Diagnosis and Management of Adult Congenital Heart Disease
+Community Pharmacy
+Aulton's Pharmaceutics
+Medical Pharmacology and Therapeutics
+Diagnostic Atlas of Cutaneous Mesenchymal Neoplasia
+Disorders of the Rotator Cuff and Biceps Tendon
+Neurocritical Care Management of the Neurosurgical Patient
+Blumgart's Surgery of the Liver, Biliary Tract and Pancreas
+Master Techniques in Facial Rejuvenation
+The Anterior Cruciate Ligament
+Clinical Orthopaedic Rehabilitation: A Team Approach
+Cosmetic Facial Surgery
+Operative Techniques: Spine Surgery
+Operative Techniques: Hand and Wrist Surgery
+Aesthetic Surgery Techniques
+Principles of Gynecologic Oncology Surgery
+Principles of Neurological Surgery
+Operative Techniques: Knee Surgery
+Total Burn Care
+Lumbar Interbody Fusions
+Abernathy's Surgical Secrets
+Pediatric Head and Neck Masses
+Scaphoid Fractures: Evidence-Based Management
+Functional Neurosurgery and Neuromodulation
+Pathologic Basis of Veterinary Disease Expert Consult
+Rebhun's Diseases of Dairy Cattle
+Equine Internal Medicine
+Exotic Animal Formulary
+Textbook of Veterinary Diagnostic Radiology
+Small Animal Medical Differential Diagnosis
+Veterinary Medicine
+Soil Science Test Project
+Modern Detection Techniques for Food Safety and Quality
+Sweet potato processing technology
+Food Biosynthesis
+Food Bioconversion
+Soft Chemistry in Food Fermentation
+Ingredients Extraction by Physico-Chemical Methods
+Why Penguins Communicate
+ISTE topics in Agriculture 1
+Plant Macro-Nutrient Use Efficiency
+A Practical Guide to Sensory and Consumer Evaluation
+Food Processing Technology
+Kent\u2019s Technology of Cereals
+New Aspects of Meat Quality
+Chemical Contaminants and Residues in Food
+Regulatory Impact on Food Product Development in the European Union
+Lawrie�s Meat Science
+Advances in Sheep Welfare
+Cereal Grains
+Improving the Sensory and Nutritional Quality of Fresh Meat
+Proteins in Food Processing
+Poultry Quality Evaluation
+Food Microstructure and Its Relationship with Quality and Stability
+Baking Problems Solved
+Case Studies in Novel Food Processing Technologies
+Gluten-Free Ancient Grains
+Starch in Food
+Advances in Poultry Welfare
+Soft Drink and Fruit Juice Problems Solved
+Advances in Cattle Welfare
+Consumer Science and Strategic Marketing: Case Studies in the Wine Industry
+Sensory Panel Management
+Consumer Science and Strategic Marketing: Case Studies in the Traditional Food Sector
+Discrimination Testing in Sensory Science
+Advances in Pig Welfare
+Advances in Agricultural Animal Welfare
+Food Freezing and Frozen Food Storage
+Recognition Systems
+Cheese
+Introduction to Food Toxicology
+Enzymes
+Egg Innovation and Strategies for Improvement
+Genomics in Food Safety
+The Edible Aroids
+Wine Tasting
+Gorilla Pathology and Health
+Fruit Juices
+Sustainable Management of Arthropod Pests of Tomato
+The Teeth of Living Vertebrates, Volume 1
+Food Fortification in a Globalized World
+Nutrition in the Prevention and Treatment of Disease
+The Vitamins
+The Craft and Science of Coffee
+The Biology and Conservation of the Whooping Crane (Grus americana)
+Phytotherapy in Aquaculture
+Biofuels, Bioenergy and Food Security
+Internationalizing Food and Agricultural Sciences
+Vegetarian and Plant Based Diets in Health and Disease Prevention
+Proteomics in Food Science
+The Biology and Conservation of Cheetahs
+The Norovirus
+Insect Pests of Millets
+Native Arbuscular Mycorrhiza for Sustainable Agriculture
+New Pesticides and Soil Sensors
+Water Purification
+NanoBioSensors
+Food Packaging
+Ecology and Evolution of Cancer
+Encyclopedia of Marine Mammals
+Nature's Machines
+Biotic Stress Resistance in Millets
+Fish Diseases
+Ultrasound: Advances for Food Processing and Preservation
+Controlled and Modified Atmosphere for Fresh and Fresh-Cut Produce
+Bifidobacterium
+Yogurt in Health and Disease Prevention
+Physiology of the Cladocera
+Animals and Human Society
+Pathology of Zoo and Wild Animals
+The Competitiveness of Tropical Agriculture
+High Throughput Next Generation Sequence Analysis for Food Microbiologists
+Arthropod Vector: Controller of Disease Transmission (Volume 1)
+Mixed-Species Groups of Animals
+Agroforestry
+Arthropod Vector: Controller of Disease Transmission (Volume 2)
+The Future Rice Strategy for India
+Conservation for the Anthropocene Ocean
+Nutrition and Functional Foods for Healthy Aging
+Micronutrients in Human Health
+Emerging Roles of Nutraceuticals and Functional Foods in Immune Support
+Enzymes in Human and Animal Nutrition
+Electron Spin Resonance in Food Science
+FDA Warning Letters about Food Products
+Conceptual Breakthroughs in Ethology and Animal Behavior
+Sexual Biology and Reproduction in Crustaceans
+Examining Ecology
+Nutritional and Health Aspects of Traditional and Ethnic Foods of Nordic Countries
+Bioactive Polysaccharides
+Unconventional Oilseeds and Oil Sources
+Wafer and Waffle Processing and Manufacturing
+Starch-based Materials in Food Packaging
+Starches for Food Application
+Applications in High Resolution Mass Spectrometry
+HARPC
+Forest Management and Planning
+Fatty Acids
+Staphylococcus Aureus
+Nanoencapsulation of Food Bioactive Ingredients
+The Coconut
+Preharvest Modulation of Postharvest Fruit and Vegetable Quality
+Ethnozoology
+Hazard Analysis and Risk Based Preventative Controls
+Valid Preventive Food Safety Controls
+Food Irradiation
+Innovative Technologies for Food Preservation
+Emerging Nanotechnologies in Food Science
+Practical Guide to Vegetable Oil Processing
+Process Control
+Retrovirus-Cell Interactions
+Mucosal Vaccines
+Cell Surface GRP78, a New Paradigm in Signal Transduction Biology
+Immunosensing for Detection of Protein Biomarkers
+Ion Channels in Health and Disease
+Genetics and Evolution of Infectious Diseases
+Neuropsychiatric Disorders and Epigenetics
+Genomic and Precision Medicine
+Translating Epigenetics to the Clinic
+American Trypanosomiasis
+Epigenetics and Behavior
+Viroids and Plant Viral Satellites
+Genomic and Precision Medicine
+Neural Lipid Signalling
+Developmental and Regenerative Biology
+Biology and Engineering of Stem Cell Niches
+Diagnostic Molecular Biology
+Translational Aspects of Extracellular Matrix
+Epigenetics and Systems Biology
+Viruses
+Nuclear Architecture and Dynamics
+Regenerative Medicine Translation
+Biological Chemistry
+Computational Epigenomics and Disease
+Cytokine Effector Functions in Tissues
+PCR Guru
+Long Noncoding RNAs
+The Human Body
+Nitric Oxide
+Science Careers in Flux
+Gnotobiology
+Microscale Transport In Biological Processes
+RNA Methodologies
+The European Research Management Handbook
+Protein NMR Spectroscopy
+Bioprinting
+Handbook of Epigenetics
+Oral Communication Skills for Scientific Presentations
+An Introduction to Ethical, Safety and Intellectual Property Rights Issues in Biotechnology
+Progress and Challenges in Precision Medicine
+Electrocardiography of Laboratory Animals
+Dyneins
+Dyneins
+Epigenetic Mechanisms in Cancer
+Problem Sets Series: Case Studies in Biochemistry
+Polycomb Group Proteins
+Glyceraldehyde-3-Phosphate Dehydrogenase (GAPDH)
+HIV/AIDS
+Bioinformatics for Beginners
+Gas Bubble Dynamics in the Human Body
+Cancer and Noncoding RNAs
+High Throughput Formulation Development of Biopharmaceuticals
+Nanoemulsions
+Early Warning for Infectious Disease Outbreak: Theory and Practice
+International Gender Specific Medicine
+Congenital Adrenal Hyperplasia
+ISTE topics in Biomedical Science 1
+ISTE topics in Biomedical Science 2
+Data Literacy
+Atlas of Comparative Vertebrate Histology
+Laboratory Exercises in Molecular Pathology
+An Introduction to Cardiovascular Therapy
+Kidney Transplantation, Bioengineering and Regeneration
+Back to Basics In Physiology
+The Contribution of Pathology and Laboratory Medicine to Clinical Informatics
+Advances in Brain Cancer for Clinicians and Scientists
+Molecular Pathology
+Biomarkers in Inborn Errors of Metabolism
+Comparative Anatomy and Histology
+Think Like a Biostatistics Analyst
+Clinical Informatics Literacy
+Textbook of Nephro-Endocrinology
+The Heart in Rheumatologic, Inflammatory and Autoimmune Diseases
+Endocrine Biomarkers
+Principles of Gender-Specific Medicine
+Handbook of Supportive and Palliative Radiation Oncology
+Translational Advances in Gynecologic Cancers
+Lung Epithelial Biology in the Pathogenesis of Pulmonary Disease
+Ethical Challenges in Oncology
+Alpha-1-antitrypsin Deficiency
+Transfusion Medicine, Apheresis, and Hemostasis
+Cutaneous Melanoma
+Introduction to Cancer Metastasis
+The Microbiota in Gastrointestinal Pathophysiology
+Bone Marrow Failure
+The Pituitary
+Genetics of Bone Biology and Skeletal Disease
+Case Studies in Physiology
+Liver Pathophysiology
+Chronic Kidney Disease in Disadvantaged Populations
+Translational Bioinformatics and Systems Biology Methods for Personalized Medicine
+Cushing's Disease
+Case Studies in Public Health
+Global Health Informatics
+Omics Technologies and Bio-engineering
+Research in the Biomedical Sciences
+Dietary Fiber for the Prevention of Cardiovascular Disease
+eHealth
+Microbiology and Molecular Diagnosis in Pathology
+Health Professionals' Education in the Age of Clinical Information Systems, Mobile Computing and Social Networks
+Gastrointestinal Tissue
+Alcohol, Drugs, Genes and the Clinical Laboratory
+Nitric Oxide Donors
+Disaster Epidemiology
+Pouchitis and Ileal Pouch Disorders
+Atlas of the Human Body
+Human Genome Informatics
+Key advances in clinical informatics
+Blanco's Overview of Alpha-1 Antitrypsin Deficiency
+Interesting Cases in Pulmonary Medicine
+Molecular Physiology of the Blood Vessel
+Health Reform Policy to Practice
+GERD: A NEW UNDERSTANDING OF PATHOLOGY, PATHOPHYSIOLOGY, AND TREATMENT
+Manual of Chronic Total Occlusion Interventions
+Bladder Cancer
+Vitamin D
+Vitamin D
+Medical Writing and Editing
+Preventive Medicine
+The Complete Reference for Scimitar Syndrome
+Skin Tissue Models for Regenerative Medicine
+Nitric Oxide as a Chemosensitizing Agent
+Wilson Disease
+Anticancer Drugs: Navelbine� and Taxot�re�
+Biopharmaceutical Management
+Pharmacoepidemiology and Pharmacovigilance
+Signals and Systems in e-Health
+New Health Systems
+Statistical Mechanics of Colloidal Matter
+ESCAPE 27 Set
+Coalescence Separations
+Handbook of Spent Hydroprocessing Catalysts
+Reliability, Maintainability and Risk 9E
+Recrystallization and Related Annealing Phenomena
+Handbook of Bioprocessing
+Solid Fuels and Heavy Hydrocarbon Liquids
+Theory of Electrophoresis and Diffusiophoresis of Highly Charged Colloidal Particles
+Bretherick's Handbook of Reactive Chemical Hazards
+Coulson and Richardson\u2019s Chemical Engineering
+Coulson and Richardson\u2019s Chemical Engineering
+Coulson and Richardson\u2019s Chemical Engineering
+Coulson and Richardson\u2019s Chemical Engineering
+Coulson and Richardson\u2019s Chemical Engineering
+Process Safety Calculations
+Chemical Reaction Engineering
+The Science and Technology of Unconventional Oils
+Materials Under Extreme Conditions
+Recent Advances in Emerging Membrane Science and Technology
+Thermodynamics, Phase Diagrams and Thermodynamic Modeling of Solutions
+Cosmetic Science and Technology: Theoretical Principles and Applications
+Novel Catalytic and Separation Processes Based on Ionic Liquids
+Technologies for Biochemical Conversion of Biomass
+Process Plant Layout, 2e
+Natech Risk Assessment and Management
+Polyurethane Polymers
+Polyurethane Polymers
+Lignocellulosics
+Advanced and Emerging Polybenzoxazine Science and Technology
+Concise Encyclopaedia of Combustion Synthesis
+A Systems Approach to Managing the Complexities of Process Industries
+The Art of Cryogenics
+Morphological, Compositional, and Shape Control of Materials for Catalysis
+Low Grade Heat Driven Multi-Effect Distillation
+Solar Energy Desalination Technology
+Desalination Sustainability
+Sustainable Design Through Process Integration
+General Chemistry for Engineers
+Pulp and paper Industry
+Pulp and Paper Industry
+Reaction Rate Theory and Rare Events Simulations
+Lead-Acid Batteries: Science and Technology
+Artificial Photosynthesis
+Monodispersed Particles
+Advanced Industrial Lead-Acid Batteries
+Pressurized Fluids for Food and Natural Products Processing
+New and Future Developments in Microbial Biotechnology and Bioengineering
+New and Future Developments in Microbial Biotechnology and Bioengineering
+New and Future Developments in Microbial Biotechnology and Bioengineering
+Life-Cycle Assessment of Biorefineries
+Modern Inorganic Synthetic Chemistry
+Lead-Acid Batteries for Future Automobiles
+Nanolayer Research
+Future Directions in Biocatalysis
+Membrane Characterization
+Safety of Lithium Batteries
+Experimental Methods and Instrumentation for Chemical Engineers
+Algal Green Chemistry
+Non-covalen Interactions in Organocatalysis
+Bioreactor Modeling
+Organocatalyzed Domino and Multicomponent Reactions
+Recent Advances in Aminocatalyzed Cascade Reactions
+SOMO and Photoredox Activations in Asymmetric Organocatalysis
+Separation Science and Technology
+Transition Metal Catalyzed Isoquinoline Synthesis
+Fundamentals of Enviromental Chemistry
+Searching and Researching: An Autobiography
+Frontiers and Advances in Molecular Spectroscopy
+Biological Chirality
+The Evolution of Medicinal Chemistry
+Validamycin and its Derivatives
+Design of Hybrid Molecules for Drug Development
+The Chemistry of Heterocycles
+Multi-Scale Approaches in Drug Discovery
+Medicinal Chemistry for Organic Chemists
+Electron Microscopy and Analysis
+Organosilicon Compounds
+Advanced Inorganic Chemistry
+Sampling and Analysis of Environmental Chemical Pollutants
+Future Role of Chemistry as Gleaned from Granted U.S. Chemical Patents
+Metal Complexes of Non-Innocent Ligands
+Patent Law Basics for Chemists and Research Professionals
+Selection of the HPLC Method in Chemical Analysis
+C-Furanosides
+Modern Synthesis Processes and Reactivity of Fluorinated Compounds
+Inorganic and Organometallic Transition Metal Complexes
+Encapsulated Catalysts
+Modelling and Simulation in the Science of Micro- and Meso-Porous Materials
+Piperidine-based Drug Design
+Strategies for Palladium-Catalyzed Non-Directed and Directed C-H Bond Functionalization
+Liquid Chromatography
+Liquid Chromatography
+Separation Science and Proteomics
+Supercritical Fluid Chromatography
+Transition Metal-Catalyzed Benzofuran Synthesis
+Transition Metal-Catalyzed Pyrimidine Synthesis
+Water Extraction of Bioactive Compounds
+Discovery and Development of Antidiabetic Agents From Natural Products
+Handbook of Synthetic Organic Chemistry
+Making Fragments From Drugs
+Non-covalent Interactions in Quantum Chemistry and Physics
+Electrons, Atoms, and Molecules in Inorganic Chemistry
+Sample Introduction Systems in ICP-MS and ICP-OES
+Priority Pollutants Monitoring in Water
+Frontiers in Medicinal Chemistry
+Big Data and Smart Service Systems
+Data Fusion for Intelligent Vehicles
+Lossless Information Hiding in Images
+Big Data in Cyber-Physical Society
+Machine Learning
+OpenACC Programming
+Three-dimensional Integrated Circuit Design
+FTTX Networks
+Network Routing
+Contextual Design
+Understanding Virtual Reality
+Patterns for Data Parallel Programming
+Mobile Sensors and Context-Aware Computing
+Environment Modeling-based Requirements Engineering for Software Intensive Systems
+Penetration Tester's Open Source Toolkit
+Rugged Embedded Systems
+CUDA Programming
+Silicon Photonics
+Transfer Learning
+Usability Testing for Survey Research
+Advances in GPU Research and Practice
+Cognitive Information Systems in Management Sciences
+Computer and Information Security Handbook
+Network Storage
+Application Management for Mobile and Cloud Systems
+Embedded Computing for High Performance
+Securing the Internet of Things
+Aging-Friendly Design
+Software Defined Networks
+Adaptive Mobile Computing
+Hacking Wireless Access Points
+Peering Carrier Ethernet Networks
+Research Methods for Cyber Security
+OCEB 2 Certification Guide
+Research Methods in Human Computer Interaction
+Software Architecture for Cloud and Big Data
+Coding for Penetration Testers
+TopUML Modeling
+Knowledge Science
+Advanced Persistent Security
+Big Data Analytics for Sensor-Network Collected Intelligence
+Mobile Cloud Computing
+Federal Cloud Computing
+Managing the Web of Things
+Smart Sensors Networks
+Deep Learning for Medical Image Analysis
+Statistical Shape and Deformation Analysis
+Wireless Public Safety Networks 3
+Certifiable Software Applications 3
+Certifiable Software Applications 4
+ESD Protection Methodologies
+Flash Memory Integration
+B Method
+Marine Geo-Hazards in China
+Earth's Oldest Rocks
+ISTE topics in Earth and Planetary Science 1
+ISTE topics in Earth and Planetary Science 2
+ISTE topics in Earth and Planetary Science 3
+Infrared and Raman Spectroscopy of the Cationic Clay Minerals
+Uncertainty Analysis in Earth and Environmental Science
+Ore Dogs and Economic Geology
+Progress in Rock Physics
+Thermodynamics of Atmospheres and Oceans
+Terrestrial Depositional Systems
+Statistical Modeling and Analysis
+Practical Petroleum Geochemistry for Exploration and Production
+Economic Minerals
+Integrating Emergency Management and Disaster Behavioral Health and Science
+Theory of Electromagnetic Well Logging
+Nickel Sulfide Ores and Impact Melts
+Risk Modeling for Hazards and Disasters
+Volatiles in the Martian Crust
+Urban Planning for Disaster Recovery
+Proterozoic Orogens of India
+Data Assimilation for the Geosciences
+How to Become a International Disaster Volunteer
+Handbook of Mineral Spectroscopy, Volume 1
+KAPPA DISTRIBUTIONS
+Social Network Analysis of Disaster Response, Recovery, and Adaptation
+Practical Solutions to Integrated Reservoir Analysis
+The Indian Ocean Nodule Field
+Introduction to Satellite Remote Sensing
+Permo-Triassic Salt Provinces of Europe, North Africa and Central Atlantic
+Geographical Information Management in Polar Regions
+Case Studies in Disaster Preparedness
+Case Studies in Disaster Mitigation
+Creating Katrina, Rebuilding Resilience
+Shale Gas
+Map Interpretation for Structural Geologists
+Coding and Decoding: Seismic Data
+Processes and Ore Deposits of Ultramafic-Mafic Magmas through Space and Time
+The Quaternary Ice Age in the Alps
+Practical Prospect Evaluation
+Interpretation of Micromorphological Features of Soils and Regoliths
+Introduction to Volcanic Seismology
+Data Room Management and Rapid Asset Evaluation - Theory and Case Studies in Oil and Gas
+Isotopic Geochemistry and Paleobiology
+Palaeobiology of Extinct Giant Flightless Birds
+Marine Reptiles Adaptation to Aquatic Life
+Evolutionary History of Freshwater Fishes during the Last 200 Millions Years
+Evolution of Dental Tissues and Paleobiology in Selachians
+Cenozoic Mammals and their Evolutionary Context
+Fossil Turtles of China
+Thermal Recovery of Oil and Bitumen
+Fine and ultrafine coal processing
+Clean Coal Engineering Technology
+Carbon Capture and Storage
+Heat Recovery Steam Generator Technology
+Advanced Light Water Reactor Fuel Technology
+Materials and Water Chemistry for Supercritical Water-cooled Reactors
+Big Data Application in Power Systems
+Specifications of Photovoltaic Pumping Systems in Agriculture
+Design of Transient Protection Systems
+Managed Pressure Drilling
+Deepwater Drilling
+POWER ELECTRONICS HANDBOOK
+ISTE topics in Energy 1
+ISTE topics in Energy 2
+ISTE topics in Energy 3
+ISTE topics in Energy 4
+Underground Coal Gasification and Combustion
+Gas, Fire and Respirable Dust control In Underground Coal Mines
+Renewable Energy Forecasting
+Geological Repository Systems for Safe Disposal of Spent Nuclear Fuels and Radioactive Waste
+Thermal Hydraulics in Nuclear Reactors
+Hydrogen and Fuel Cells
+Supercritical Carbon Dioxide (SCO2) Based Power Cycles
+Steam Generators for Nuclear Power Plants
+Low-rank Coals for Power Generation, Fuel and Chemical Production
+Coal Combustion Products (CCP's)
+Microalgae-Based Biofuels and Bioproducts
+Bioenergy Systems for the Future
+Greenhouse Gases Balance of Bioenergy Systems
+Optimization in Renewable Energy Systems
+Nuclear Power
+Electricity Generation & The Environment
+Non-Destructive Testing and Condition Monitoring Techniques for Renewable Energy Industrial Assets
+Solid Oxide Fuel Cell Lifetime and Reliability
+Large Scale Biomass Combustion Plants
+Trends in Oil and Gas Corrosion Research and Technologies
+Power Systems Analysis
+Electrical Power Systems
+Molten Salt Reactors and Thorium Energy
+Advances in Productive, Safe, and Responsible Coal Mining
+Offshore Electrical Engineering Manual
+Fuel Cell Propulsion
+Electric Vehicles: Prospects and Challenges
+Deep Shale Oil and Gas
+Fluid Phase Behavior for Conventional and Unconventional Oil and Gas Reservoirs
+Distributed Generation Systems
+Steam Generation from Biomass
+Advances in Sugarcane Biorefinery
+Introduction to Petroleum Biotechnology
+UHV Transmission Technology
+Control of Power Electronic Converters and Systems
+The Power Grid
+High Temperature Thermal Storage Systems using Phase Change Materials
+Thermal Energy Storage Analyses and Designs
+Clean Energy for Sustainable Development
+Petroleum Production Engineering
+Torrefaction of Biomass for Energy Applications
+PEM Fuel Cell Modelling and Simulation using MATLAB
+Theoretical and Applied Aspects of Biomass Torrefaction
+Renewable Energy Integration
+Handbook of Biotechnology-Based Alternative Fuels
+European energy markets and society
+Practical Handbook of Photovoltaics
+Integrated Energy Systems for Multigeneration
+Energy Positive Neighborhoods and Smart Energy Districts
+Performance Management for the Oil, Gas, and Process Industries
+One-dimensional nanostructures for PEM fuel cell applications
+Hydrogen Economy
+PEM Water Electrolysis
+Unconventional Oil and Gas Resource Engineering
+Transmission lines inspection and monitoring technology of remote sensing
+Space Microsystems and Micro/Nano Satellites
+Onshore Structural Design Calculations
+Construction Delays
+Modelling, Solving and Application for Topology Optimization of Continuum Structures --- ICM Method Based on Step Function
+Biot's Poroelastic Theory in Engineering
+Transient Electromagnetic-Thermal Nondestructive Testing
+Permeability Properties of Plastics and Elastomers
+Repair and Rehabilitation of Structures
+Linux for Embedded and Real-time Applications
+Thermo-Mechanical Modeling of Additive Manufacturing
+Green Building Energy Simulation and Modeling
+Intelligent fault diagnosis and remaining useful life prediction of rotating machinery
+Cyber-Physical Systems in Production Engineering
+Databook of Blowing and Auxiliary Agents
+Nonlinear systems in Heat transfer
+Handbook of Foaming and Blowing Agents
+Atlas of Material Damage
+Handbook of Plasticizers
+Handbook of Odors in Plastic Materials
+Databook of Plasticizers
+Tribology Testing
+Academic Press Library in Signal Processing Volume 6
+Reliability Based Airframe Maintenance Optimization and Applications
+Academic Press Library in Signal Processing Volume 7
+Healthcare Technology Management Systems
+Embedded Mechatronic Systems 1 - 2nd Edition
+Embedded Mechatronic Systems 2 - 2nd Edition
+Durability and Reliability of Photovoltaic Polymers and Other Materials
+Global Engineering Ethics
+Optimization Tools for Logistics \u2013 2nd ed / V1 \u2013 Theory and Fundamentals
+Optimization Tools for Logistics \u2013 2nd ed / V2 \u2013 Software applications
+ISTE topics in Engineering 1
+ISTE topics in Engineering 2
+ISTE topics in Engineering 3
+ISTE topics in Engineering 4
+ISTE topics in Engineering 5
+ISTE topics in Engineering 6
+ISTE topics in Engineering 7
+ISTE topics in Engineering 8
+ISTE topics in Engineering 9
+ISTE topics in Engineering 10
+ISTE topics in Engineering 11
+ISTE topics in Engineering 12
+ISTE topics in Engineering 13
+Dynamic Analysis of High-Speed Railway Alignment
+Principles of Railway Location and Design
+Thermal Analysis in Practice
+Basic Polymer Engineering Data
+Extrusion Dies for Plastics and Rubber
+Understanding Polymer Processing
+High Voltage Engineering Fundamentals
+Mechanical Testing of Orthopaedic Implants
+Geometry for Naval Architects
+Marine Propellers and Propulsion
+Aircraft Sustainment and Repair
+TV White Space Communications and Networks
+Strengthening of Concrete Structures Using Fiber Reinforced Polymers (FRP)
+Principles of Textile Finishing
+Spacecraft Dynamics and Control
+Plastics Engineering
+Civil Aircraft Electrical Power System Safety Assessment
+Lea's Chemistry of Cement and Concrete
+Porous Rock Failure Mechanics
+Art of the Helicopter
+High-Performance Apparel
+Manikins for Textile Evaluation
+Computational Methods for Fracture in Porous Media
+Power Supplies for LED Driving
+Morphing Wings Technologies
+Demystifying Numerical Models
+Boiling
+Thermal Power Plant
+Air Conditioning Systems Design
+Cost-effective Energy Efficient Building Retrofitting
+Advances in Carpet Manufacture
+Automation in Garment Manufacturing
+Applications of Computer Vision in Fashion and Textiles
+Skeletonization
+Microgrid
+The Circuit Designer's Companion
+Instrumental Seismology Manual
+Space Safety and Human Performance
+Unsteady Flow and Aeroelasticity in Turbomachinery
+Atomistic Simulation Methods in Solid Mechanics
+Aeroacoustics: Fundamentals and Applications in Aeropropulsion Systems
+Design and Analysis of Intelligent Tires
+Software Defined and Mixed Signal Radio Characterization: Theory, Methods and Applications for Emerging Wireless Systems
+Embedded Operating systems and Board Support Packages
+Gas Explosion Handbook
+Computational Visual Perception for Image and Video Processing
+Analysis and Design of Curved Girder Bridges
+Microelectronics for the Internet of Things
+Analysis and Design of Integral Abutment Bridges
+Opto-Mechanical Fiber Optic Sensors
+Navigation with Signals and Constraints of Opportunity
+Underground Sensing
+Biomedical Engineering in Gastrointestinal Surgery
+Deep Learning in Computer Vision
+General Aviation Aircraft Load Analysis
+Introduction to Nature-Inspired Optimization
+Cooperative Control and Sensing for Mobile Sensor Networks
+Bioinspired Legged Locomotion
+Nano and Bio Heat Transfer and Fluid Flow
+Chemical Engineering Process Simulation
+Biofluid Mechanics of the Respiratory System
+Biomechanics of Living Organs
+Safety Analysis for LNG Facilities
+Wheeled Mobile Robotics
+Rockbolting
+Bridge Engineering
+Oil Spill Environmental Forensics Case Studies
+Advanced Gear Manufacturing and Finishing
+Humanoid Robots
+Renewable Energy
+Trauma Plating Systems
+THE FPGA Users Guide
+Strut and Tie Models
+Atherosclerotic Plaque Characterization Methods based on Coronary Imaging
+Fundamentals of Geoenvironmental Engineering
+Personalized Predictive Modelling in Diabetes
+Rockburst
+Assurance of Sterility for Sensitive Combination Products and Materials
+Soil Fracture Mechanics
+Indoor Navigation Strategies for Aerial Autonomous Systems
+Differential Transformation Method for Mechanical Engineering Problems
+Ambient Assisted Living and Enhanced Living Environments
+Subsea Valves Handbook
+Wastes and Wastewater Treatment in the Petroleum Industry
+Mechanics of Flow-Induced Sound and Vibration V1
+Mechanics of Flow-Induced Sound and Vibration V2
+Group and Crowd Behavior for computer Vision
+More Best Practices for Rotating Equipment
+Computer and Machine Vision
+Transportation Highway Engineering Calculations and Rules of Thumb
+Software Engineering for Embedded Systems
+Thermal System Design and Simulation
+High Dynamic Range Video
+iMprove
+Irregular Shape Anchor in Cohesionless Soils
+Polyaniline Blends, Composites, and Nanocomposites
+Soil Reinforcement for Anchor Plates
+Forsthoffer's Component Condition Monitoring (CCM) Handbook
+The Aeroacoustics of Low Mach Number Flows
+Satellite Signal Propagation, Impairments and Mitigation
+Solid and Hazardous Waste Management
+Heat Transfer in Aerospace Applications
+Basic Finite Element Method as Applied to Injury Biomechanics
+Guide to Laser Welding
+Surface Production Operations: Volume IV: Pump and Compressor Systems: Mechanical Design and Specification
+Embedded and IoT Software Development
+Manufacturing Optimization Using the Internet of Things
+Time-Critical Cooperative Control of Autonomous Air Vehicles
+General Aviation Aircraft Design
+Orthogonal Waveforms and Filter Banks for Future Communication Systems
+Industrial Water Treatment Process Technology
+Understanding Automotive Electronics
+Mechanical Circulatory and Respiratory Support
+Discrete-Time Neural Observers
+Computing and Visualization for Intravascular Imaging and Computer Assisted Stenting
+Mechanics of Carbon Nanotubes
+Rigid Body Dynamics for Space Applications
+eMaintenance
+Plastics in Medical Devices for Cardiovascular Applications
+Sittig's Handbook of Toxic and Hazardous Chemicals and Carcinogens
+Designing Successful Products with Plastics
+Fluoropolymer Applications in Chemical Processing Industries
+Applications of Plastics Under-the-hood in Automotives
+Plasticizers Derived from Post-consumer PET
+Advanced Machining Processes of Metallic Materials
+Computational Methods and Production Engineering
+Microfabrication and Precision Engineering
+Engineering Bioplastics
+Plastics Handbook
+Moldflow Design Guide
+Combination Technologies on the Basis of Injection Molding
+Structure and Rheology of Molten Polymers
+Molding Simulation: Theory and Practice
+Nontraditional Fillers and Stiffening Agents for Polymers
+10 Fundamental Rules for Design of Plastic Products
+Processing of Nanocomposite Polymers
+Leadership & Management of Machining
+Discrete Mechanics of Capillary Bridges
+Inside the Structure of Granular Materials
+THID, the Ultimate Outcome of RFID
+Robustness in Electro-thermal Phenomena
+RCS Synthesis for Chipless RFID
+Reliability Investigation of Leds Devices for Public Light Applications
+Reliability Investigation on Laser Diode Coupling Electro-Optical Models and Physics of Failure
+Reliability of Photonics Devices
+Systems Architecture Modeling with the Arcadia Method
+Model-based System and Architecture Engineering
+SysML in Action with Papyrus
+SysML in Action with Cameo Systems Modeler
+Fractal and Trans-Scale Nature of Entropy
+From Pinch Methodology to Energy Integration of Flexible Systems
+Fractal and Trans-Scale Nature of Entropy / Towards a geometrization of thermodynamics
+Coastal Wetlands
+Initial Human Colonization of Arctic in Changing Paleoenvironments
+Time and Methods in Environmental Interfaces Modelling
+Nanoparticles in the Environment: A Contradictory Relationship with Plants, Algae and Microorganisms
+Nanoparticles in the Environment: A Contradictory Relationship with Plants, Algae and Microorganisms
+ISTE topics in Environmental Science 1
+ISTE topics in Environmental Science 2
+ISTE topics in Environmental Science 3
+Thorp and Covich's Freshwater Invertebrates
+Physical Limnology
+Methods in Stream Ecology
+Chemical Ecology
+Periphyton
+The Transition to Modern Earth
+Atmospheric Impacts of the Oil and Gas Industry
+Intermittent Rivers
+Water for the Environment
+Wetland and Stream Rapid Assessments
+Maintaining Land Productivity
+Soil Mapping and Process Modeling for Sustainable Land Use Management
+Fundamentals of Soil Ecology
+The Application of Green Solvents in Separation Processes
+Soil Magnetism
+Tropical Extremes: Natural Variability and Trends
+The Political Ecology of Oil & Gas Activities in the Nigerian Aquatic Ecosystem
+The Ecology of Sandy Shores
+Applied Hierarchical Modeling in Ecology: Analysis of Distribution, Abundance and Species Richness in R and BUGS
+Assessment, Restoration and Reclamation of Mining Influenced Soils
+Remote Sensing of Aerosols, Clouds, and Precipitation
+Decision Making in Water Resources Policy and Management
+A New Ecology
+Environmental Geochemistry
+Biodiversity and Health
+Cybernomics
+The Fair Return
+The Economics of Education
+Handbook of Investor Behavior during Financial Crises
+ISTE topics in Finance
+Decision-Making
+China Business Model: Originality and Limits after the Slowdown of 2013
+The Wine Value Chain in China
+Handbook of the Chinese Economy and Its External Economic Relations
+Underwriting Services and the New Issues Market
+Introduction to Agent-Based Economics
+Entrepreneurship and the Finance of Innovation in Emerging Markets
+International Money and Finance
+Smart Specialization Theory and Practice
+Redefining Capitalism in Global Economic Development
+Strategic Financial Management Casebook
+Advanced Macroeconomics: An Alternative Approach
+Principles of Project Finance
+Handbook of Digital Banking and Internet Finance
+Probability, Statistics and Econometrics
+Equilibrium Problems and Applications
+Engineering Investment Process
+Portfolio Diversification
+Investigating Windows Systems
+Deception In Digital Age
+Physical Criminalistics
+Forensic Investigations
+Global Supply Chain Security and Management
+False Allegations
+Inside Forensic Reform
+Digital Forensics Trial Graphics
+Security Operations Center Guidebook
+An Atlas of Skeletal Trauma in Medico-Legal Contexts
+Security Metrics Management
+Effective Physical Security
+Human Remains - Another Dimension
+The Manager's Handbook for Corporate Security
+The Five Technological Forces Disrupting Security
+Sports Team Security
+Creating Digital Faces for Law Enforcement
+From Corporate Security to Commercial Force
+Contemporary Digital Forensic Investigations of Cloud and Mobile Applications
+Urban Emergency Management
+Contemporary Security Management
+The Psychology of Criminal and Antisocial Behavior
+Cell Phone Location Evidence for Legal Profesionals
+Integrating Python with Leading Computer Forensics Platforms
+Ambulatory Surgery Center Safety Guidebook
+Viral Diseases of Africa and Global Public Health
+Microbial Glycobiology
+Viral Collectives
+Advances in Microbiology
+The Skin in Systemic Autoimmune Diseases
+Surgery in Systemic Autoimmune Diseases in the Era of Biological Agents
+Vaccinology in Latin America
+The history of Immunology
+Zika Virus
+Controversies in Vaccine Safety
+Future Directions in Water and Wastewater Microbiology
+Adjuvants and Autoimmunity
+The Heart in Systemic Autoimmune Diseases
+Immunopotentiators in Modern Vaccines
+The Innate Immune System: A compositional and functional perspective
+Microbial Resources
+Autophagy: Cancer, Other Pathologies, Inflammation, Immunity, Infection, and Aging
+Ticks of Trinidad and Tobago - An Overview
+THE COMPLEMENT FACTSBOOK, 2ND EDITION
+Antimicrobial Stewardship (AMS)
+Ticks of the Southern Cone of America
+Antiphospholipid Syndrome in Systemic Autoimmune Diseases
+The Digestive Involvement in Systemic Autoimmune Diseases
+Carbon for Electronic and Energy Applications
+Graphite and Carbon Materials In Nuclear Engineering
+Advanced Polyimide Materials
+Customized All-Ceramic Dental Prostheses
+Algae Based Polymers, Blends, and Composites
+Emerging Nanotechnologies in Dentistry
+Defect Structure in Nanomaterials
+ISTE topics in Materials Science 7
+ISTE topics in Materials Science 1
+ISTE topics in Materials Science 2
+ISTE topics in Materials Science 3
+ISTE topics in Materials Science 4
+ISTE topics in Materials Science 5
+Engineering with Magnesium: Science, Technology and Application
+Light Alloys
+Nanofiber Composite Materials for Biomedical Applications
+Steels: Microstructure and Properties
+Stability and Vibrations of Thin Walled Composite Structures
+Advanced Characterization and Testing of Textiles
+Biomechanics of Tendons and Ligaments
+Functionalised Cardiovascular Stents
+Hemocompatibility of Biomaterials for Clinical Applications
+Thermal Analysis of Textiles and Fibers
+Fibrous Filter Media
+A Clinical Guide to Fibre Reinforced Composites FRCs in Dentistry
+Natural Fibre-reinforced Biodegradable and Bioresorbable Polymer Composites
+Principles for Evaluating Building Materials in Sustainable Construction
+Nanobiomaterials
+3D Printing in Medicine
+Peptide Applications in Biomedicine, Biotechnology and Bioengineering
+Characterization of Polymeric Biomaterials
+Biomedical Composites
+Green Composites
+Hybrid Polymer Composite Materials
+Hybrid Polymer Composite Materials
+Hybrid Polymer Composite Materials
+Hybrid Polymer Composite Materials
+Biocomposites for High-Performance Applications
+Self-assembling Beta-sheet Forming Peptide Biomaterials
+Peptides and Proteins as Biomaterials for Tissue Regeneration and Repair
+Advances in Ceramic Biomaterials
+Dynamic Response and Failure of Composite Materials and Structures
+Tribology: Friction and Wear of Engineering Materials
+Bioactive Glasses
+Cellulose-reinforced Nanofibre Composites
+Materials Selection for Natural Fiber Composites
+Lignocellulosic Fibre and Biomass-based Composite Materials
+Nanobiomaterials Science, Development and Evaluation
+Biodegradable and Biocompatible Polymer Composites
+Functional 3-D Tissue Engineering Scaffolds
+Performance of Bio-based Building Materials
+Sustainable Construction Materials
+Sustainable Construction Materials
+Sustainable Construction Materials
+Fundamentals of nanotechnology in Biomaterials
+Electrospun Materials for Tissue Engineering and Biomedical Applications
+Foundations in Biomaterials Engineering
+Nanocrystals for Laser-induced Solid State Lighting
+Polyolefin Fibers
+Waterproof and Water Repellent Textiles and Clothing
+Principles and Applications of Organic Light Emitting Diodes (OLEDs)
+Nanofinishing of Textile Materials
+Advances in Laser Materials Processing
+Advanced Piezoelectric Materials
+Iron oxide nanoparticles for biomedical applications
+Colour Design
+Crazing technology for polyester fibers
+Engineering of high-performance textiles
+Natural dyes for textiles
+Transition Metal Oxide Thin Film based Chromogenics and Devices
+Fiber Technology for Fiber-reinforced Composites
+Forensic Textile Science
+Composite Materials
+Laser Surface Engineering of Aluminum Alloys
+Handbook of Solid State Diffusion: Diffusion Fundamentals and Techniques
+Handbook of Solid State Diffusion: Volume 2
+High Temperature Coatings
+Functional Glasses and Glass-Ceramics
+Microstructural Characterization of Radiation Effects in Nuclear Materials
+Laser Shock Peening of Advanced Ceramics
+Ni-free Ti-based Shape Memory Alloys
+Crystallization in Multiphase Polymer Systems
+Biomaterials
+Seaweed Polysaccharides
+Metal Oxides in Energy Technologies
+Metal Oxide-Based Thin Film Structures
+The Future of Semiconductor Oxides in Next-Generation Solar Cells
+Biopolymer Grafting: Applications
+Metal Oxides in Supercapacitors
+A Teaching Essay on Residual Stresses and Eigenstrains
+Functionalized Nanomaterials for the Management of Microbial Infection
+Emerging Nanotechnologies in Rechargable Energy Storage Systems
+Heat Transport in Micro and Nanoscale Thin Films
+Microbiorobotics
+Nanodiamonds
+Mechanical Behaviours of Carbon Nanotubes
+Developments in Surface Contamination and Cleaning: Methods for Surface Cleaning
+Nano Optoelectronic Sensors and Devices
+Thermoelectricity and Heat Transport in Graphene and other 2D Nanomaterials
+Metal Semiconductor Core-shell Nanostructures for Energy and Environmental Applications
+Nanomaterials for Biosensors
+Thermal and Rheological Measurement Techniques for Nanomaterials Characterization
+Spectroscopic Methods for Nanomaterials Characterization
+Microsopy Methods in Nanomaterials Characterization
+Nanostructures for Novel Therapy
+Nanostructures for Drug Delivery
+Nanostructures for Cancer Therapy
+Nanostructures for Antimicrobial Therapy
+Clay-Polymer Nanocomposites
+Nanotechnology for Microelectronics and Optoelectronics
+Thermal Transport in Carbon-Based Nanomaterials
+Nanostructures for Oral Medicine
+Carbon Nanomaterials for Biological and Medical Applications
+Nanopapers
+Graphene and Related Nanomaterials
+Biopolymer Grafting: Synthesis and Properties
+Service Life Prediction of Polymers and Plastics Exposed to Outdoor Weathering
+Nanocharacterization Techniques
+Nanoscience and its Applications
+Structure-mediated Nanobiophotonics
+Intermetallic Matrix Composites
+Nanoinformatics: Principles and Practice
+Nanotechnology and Orthopaedic Surgery
+Quantum Confined Lasers
+Plasma Etching For CMOS Devices Realization
+ISTE topics in Mathematics 1
+ISTE topics in Mathematics 2
+ISTE topics in Mathematics 3
+Techniques of Functional Analysis for Differential and Integral Equations
+Topics in Mathematics 1
+Topics in Mathematics 2
+Hybrid Censoring: Models, Methods and Applications
+The Material Point Method
+Handbook of Statistical Analysis and Data Mining Applications
+Maximum Principles for the Hill's Equation
+Fractional Calculus and Fractional Processes with Applications to Financial Economics
+Riemannian Submersions, Riemannian Maps in Hermitian Geometry, and their Applications
+Principles of Mathematical Modeling
+Inference for Heavy-Tailed Data Analysis
+Differential Equations with Mathematica
+A Concrete Approach to Abstract Algebra
+Optimal Sports Math & Statistics
+Random Operator Theory
+Analysis of Step-Stress Models
+Engineering Mathematics with Examples
+Inequalities and Extremal Problems in Probability and Statistics
+Mathematics Applied to Engineering
+Existence theory of generalized Newtonian Fluids
+Symbolic-Numerical Analysis of 2D Composites and Porous Material
+Cryptographic Boolean Functions and Applications
+Uncertainty Principle for Time Series
+Handbook of Categorization in Cognitive Science
+Innovative Neuromodulation
+Handbook of Cannabis and Related Pathologies
+DNA Modifications in the Brain
+Huntington\u2019s Disease
+Mathematics for Neuroscientists
+Neuroendocrinology and Endocrinology
+Molecular and Cellular Therapies for Motor Neuron Diseases
+Translational Immunotherapy of Brain Tumors
+Evolutionary Neuropsychology
+Primer on Cerebrovascular Diseases
+Network Functions and Plasticity
+Neuroprotection in Alzheimer's Disease
+Machine Dreaming and Consciousness
+Adenosine Receptors in Neurodegenerative Diseases
+Rhythmic Stimulation Procedures in Neuromodulation
+The Neuroscience of Cocaine
+Parkinson's Disease
+Rewiring the Brain
+Nanotechnology Drug Delivery Techniques for Neurological Diseases and Brain Tumors
+The Neurobiology of Brain and Behavioral Development
+Handbook of Neuroemergency Clinical Trials
+Models of Seizures and Epilepsy
+Sleep and Neurologic Disease
+The Human Sciences after the Decade of the Brain
+Chordomas and Chondrosarcomas of the Skull Base and Spine
+Neurobiology of microRNAs
+Fragile X Syndrome
+Biometals in Neurodegenerative Diseases
+Neuroepidemiology in Tropical Health
+The Complex Connection between Cannabis and Schizophrenia
+Noradrenergic Signaling and Astroglia
+Physical Activity and the Aging Brain
+Therapeutic Targets in Neurodegenerative Disorders
+Nutritional Modulators of Pain in the Aging Population
+Stress and Epigenetics in Suicide
+Nutrition and Lifestyle in Neurological Autoimmune Diseases
+Essentials of Neuroanesthesia
+Choroidal Disorders
+Neuromodulation 2V set
+Addictive Substances and Neurological Disease
+Neuronal Correlates of Empathy
+Hearing Loss
+Changing Brain Activity: Improving Intelligence?
+The Endocannabinoid System
+Computational Psychiatry
+Arachnoid Cysts
+Neuroscience Basics
+Designing EEG Experiments for Studying the Brain
+Neurogenetics
+Critical Care Neurology Part II
+Critical Care Neurology Part I
+The Parietal Lobe
+Wilson Disease
+Cavernous Malformations
+Arteriovenous Malformations
+Analytical Assessment of e-Cigarettes
+Social and Administrative Aspects of Pharmacy in Developing Countries
+FDA Quality Standards for Generic Drug Products
+The Discovery and Development of Artemisinins and Derivatives as Antimalarial Agents
+Advances in Molecular Toxicology
+Advances in Nanomedicine for the Delivery of Therapeutic Nucleic Acids
+Clinical Research in Paediatric Psychopharmacology
+Free Radical Toxicology
+Handbook of Bioenvironmental Reproductive Toxicology and Men\u2019s Health
+Pharmaceutical Medicine and Translational Clinical Research
+Developing Solid Oral Dosage Forms
+Accelerated Stability Assessment Program (ASAP)
+Electronic Waste
+Microsized and Nanosized Carriers for Nonsteroidal Anti-Inflammatory Drugs
+Reproductive and Developmental Toxicology
+In Vitro Toxicology
+How to Properly Optimize a Fluid Bed Granulation Unit Operation
+A Comprehensive and Practical Guide to Clinical Trials
+Toxicology: What Everyone Should Know
+Adverse Effects of Engineered Nanomaterials
+Mutagenicity: Assays and Applications
+Medicinal Spices and Vegetables from Africa
+International Regulation of Biologicals
+Japanese Kampo Medicines for the Treatment of Inflammatory Disease
+Adverse Events of Oncotargeted Kinases
+Validation of a Parenteral Solution Product
+History of Risk Assessment in Toxicology
+Toxicology in the Middle Ages and Renaissance
+Discovery and Development of Neuroprotective Agents From Natural Products
+History of Immunotoxicology
+Nanotechnology-Based Approaches for Targeting and Delivery of Drugs and Genes
+Drug Discovery and Development
+Fundamentals of Toxicologic Pathology
+Principal Aspects of Qualitative and Quantitative Bioanalysis by LC-MS
+Risk Management of Complex Inorganic Materials
+Serum Pharmacochemistry of Traditional Chinese Medicine
+Principles and Practice of Clinical Research
+Emerging Nanotechnologies for Diagnostics, Drug Delivery and Medical Devices
+Supercooling, crystallization and melting within emulsions and divided systems: mass, heat transfers and stability
+ISTE topics in Physics
+Neutron Scattering \u2013 Applications in Chemistry, Materials Science and Biology
+Fundamentals of Quantum Mechanics
+Phononics
+Special Relativity
+Advances in Semiconductor Nanostructures
+Introduction to Magnetic Reconnection in Plasmas
+The Classical Stefan Problem
+Linear Ray and Wave Optics in Phase Space
+Global Neutron Calculations
+Laminar Drag Reduction
+Effects of Military Service on Well-Being
+Children's Thinking
+Autism and Autism Spectrum Disorders on the Rise?
+Self-Preservation at the Core of the Personality
+Conducting Independent Educational Evaluations
+The General Factor of Personality
+Personality in Aviation
+Understanding Emotions in Mathematical Thinking and Learning
+Consumer Neuroscience
+Reconstructing Meaning After Trauma
+The Science of Cognitive Behavioral Therapy
+Executive Functions in Health and Disease
+Innovative Approaches to Individual and Community Resilience
+The Psychology of Gender and Health
+Twin Mythconceptions
+Creativity and the Performing Artist
+Digitally Constructed Realities
+Systems Factorial Technology
+Rationality
+Personality Development Across the Lifespan
+Acquisition of Complex Arithmetic Skills and Higher-Order Mathematics Concepts
+Anxiety in Children and Adolescents with Autism Spectrum Disorder
+Dominance and Aggression in Humans and Other Animals
+Journeys of Embodiment at the Intersection of Body and Culture
+Suicide Patterns and Motivations
+Quality Activities in Center-Based Programs for Adults with Autism
+Cognitive Function and the Pleasure of Music
+Practical Guide to Finding Treatments that Work for People with Autism
+The Creative Self
+Teaching Executive Functioning Skills to Individuals with Autism Spectrum Disorder
+Pediatric Disorders of Regulation in Affect and Behavior
+Brain-Based Learning and Education
+Handbook of Key Topics in Research Management and Administration
+The Diaoyu/Senkaku Islands
+Unplugging the Classroom
+Interpreting Japan's Contested Memory
+Positivity and Spirituality in the Information Organization
+Intangible Organisational Resources in Libraries
+Capital Market Integration in South Asia
+Liner Ship Fleet Planning
+Modeling of Transport Demand
+Port Cybersecurity
+Resource Sharing as a Process
+Are We Safe Enough? Measuring and Assessing Aviation Security
+Media and Information Literacy
+XML-based Content Management
+Digital Inclusion and Exclusion
+Scholarly Communication at the Crossroads in China
+The Political Economy of Business Ethics in East Asia
+Marketing Services and Resources in Information Organizations
+Internationalisation and Managing Networks in the Asia Pacific
+Enterprise Content Management, Records Management and Information Culture Amidst E-Government Development
+Transliteracy in Complex Information Environments
+The Road to Active Thinking
+Academic Crowdsourcing in the Humanities
+Organizational Learning in Asia
+The Art of Teaching Online
+Seven Leadership Principles of Chinese Women in Business Leaders
+The Changing Face of Corruption in the Asia Pacific
+Successful Fundraising for the Academic Library
+Innovation in Public Libraries
+Strategic Management of Libraries
+The Crosswalk
+Beyond Mentoring
+Social Media in the Marketing Context
+Social Justice and Librarianship
+The 21st Century Academic Library
+Research Made Accessible
+Ethic Management in Libraries and other Information Services
+International Librarianship At Home and Abroad
+Data Analytics for Intelligent Transportation Systems
+Urban Mobility
+Measuring Road Safety with Surrogate Event
+The Psychology of the Car
+Vulnerability Analysis for Transportation Networks
+Document Management at the Heart of Business Processes:
+Digital interculturality
+Knowledge Audits and Knowledge Mapping
+Utilizing Technology in the Academic Research Process
+Academic Librarianship, Publishing, and the Tenure Track
+Providing Research Support
+The Librarian's Guide to Catholic Resources on the Internet
+Reinventing Librarianship
+Boosting the Knowledge Economy
+Information Architecture
[11/30] cxf git commit: This closes #206
Posted by re...@apache.org.
This closes #206
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/71376c2e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/71376c2e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/71376c2e
Branch: refs/heads/CXF-6882.nio
Commit: 71376c2e386e5a1307a5f484346d253498c92a50
Parents: 0398758
Author: Owen Farrell <ow...@gmail.com>
Authored: Sat Nov 26 16:43:32 2016 -0500
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon Nov 28 13:57:14 2016 +0000
----------------------------------------------------------------------
.../frontend/jaxws/customization/JAXWSBindingParser.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/71376c2e/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
index a7d5265..d3f24cd 100644
--- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
+++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.apache.commons.lang.StringEscapeUtils;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
@@ -93,14 +94,14 @@ public class JAXWSBindingParser {
jaxwsBinding.setPackage(getPackageName(child));
Node docChild = DOMUtils.getChild(child, Element.ELEMENT_NODE);
if (docChild != null && this.isJAXWSClassDoc(docChild)) {
- jaxwsBinding.setPackageJavaDoc(DOMUtils.getContent(docChild));
+ jaxwsBinding.setPackageJavaDoc(StringEscapeUtils.escapeHtml(DOMUtils.getContent(docChild)));
}
} else if (isJAXWSMethodElement(child)) {
jaxwsBinding.setMethodName(getMethodName(child));
Node docChild = DOMUtils.getChild(child, Element.ELEMENT_NODE);
if (docChild != null && this.isJAXWSClassDoc(docChild)) {
- jaxwsBinding.setMethodJavaDoc(DOMUtils.getContent(docChild));
+ jaxwsBinding.setMethodJavaDoc(StringEscapeUtils.escapeHtml(DOMUtils.getContent(docChild)));
}
} else if (isJAXWSParameterElement(child)) {
Element childElement = (Element)child;
@@ -139,7 +140,7 @@ public class JAXWSBindingParser {
Node docChild = DOMUtils.getChild(child, Element.ELEMENT_NODE);
if (docChild != null && this.isJAXWSClassDoc(docChild)) {
- javadoc = DOMUtils.getContent(docChild);
+ javadoc = StringEscapeUtils.escapeHtml(DOMUtils.getContent(docChild));
}
JAXWSClass jaxwsClass = new JAXWSClass(clzName, javadoc);
[10/30] cxf git commit: Some improvements in the tooling code
Posted by re...@apache.org.
Some improvements in the tooling code
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/03987585
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/03987585
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/03987585
Branch: refs/heads/CXF-6882.nio
Commit: 03987585902ef5db3c265a353e483f20e31b2c18
Parents: f4252d0
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Mon Nov 28 13:56:14 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon Nov 28 13:56:14 2016 +0000
----------------------------------------------------------------------
.../tools/common/AbstractCXFToolContainer.java | 2 +-
.../org/apache/cxf/tools/common/ClassUtils.java | 2 +-
.../cxf/tools/common/ToolErrorListener.java | 2 +-
.../common/toolspec/AbstractToolContainer.java | 2 +-
.../toolspec/parser/CommandLineParser.java | 14 +-
.../tools/corba/processors/idl/IDLLexer.java | 130 +++++++++----------
.../tools/corba/common/idltypes/IdlParam.java | 2 +-
.../corba/common/idltypes/IdlPrimitive.java | 2 +-
.../corba/common/idltypes/IdlScopedName.java | 2 +-
.../corba/common/idltypes/IdlStructBase.java | 2 +-
.../idlpreprocessor/IdlPreprocessorReader.java | 2 +-
.../corba/processors/idl/ArrayVisitor.java | 2 +-
.../processors/idl/IDLToWSDLProcessor.java | 23 ++--
.../corba/processors/idl/ScopedNameVisitor.java | 3 +-
.../corba/processors/idl/StringVisitor.java | 4 +-
.../corba/processors/idl/WSDLSchemaManager.java | 19 ++-
.../processors/wsdl/WSDLToCorbaBinding.java | 11 +-
.../processors/wsdl/WSDLToCorbaHelper.java | 1 -
.../processors/wsdl/WSDLToCorbaProcessor.java | 6 +-
.../corba/processors/wsdl/WSDLToIDLAction.java | 8 +-
.../databinding/jaxb/JAXBDataBinding.java | 2 +-
.../jaxws/customization/JAXWSBindingParser.java | 2 +-
.../jaxws/generators/FaultGenerator.java | 6 +-
.../misc/processor/WSDLToSoapProcessor.java | 13 +-
24 files changed, 129 insertions(+), 133 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java b/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
index 96fc51c..c5d68a9 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
@@ -160,7 +160,7 @@ public abstract class AbstractCXFToolContainer extends AbstractToolContainer {
fileBase = tok.nextToken();
}
if (fileBase.endsWith(".wsdl")) {
- fileBase = new String(fileBase.substring(0, fileBase.length() - 5));
+ fileBase = fileBase.substring(0, fileBase.length() - 5);
}
return fileBase;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java b/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
index 6085c34..1ac6744 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
@@ -82,7 +82,7 @@ public class ClassUtils {
dirSet.add(path);
File file = new File(path);
- if (file.isDirectory()) {
+ if (file.isDirectory() && file.list() != null) {
for (String str : file.list()) {
if (str.endsWith("java")) {
fileList.add(path + str);
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java b/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java
index aff9015..422084f 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java
@@ -31,7 +31,7 @@ import org.apache.cxf.common.logging.LogUtils;
public class ToolErrorListener {
private static final Logger LOG = LogUtils.getL7dLogger(ToolErrorListener.class);
- class ErrorInfo {
+ static class ErrorInfo {
String file;
int line;
int col;
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
index d26c3ef..9bf3d4f 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
@@ -57,7 +57,7 @@ public abstract class AbstractToolContainer implements ToolContainer {
private OutputStream outOutputStream;
private OutputStream errOutputStream;
- public class GenericOutputStream extends OutputStream {
+ public static class GenericOutputStream extends OutputStream {
public void write(int b) throws IOException {
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
index 967f4be..bb757db 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
@@ -210,8 +210,8 @@ public class CommandLineParser {
public String getUsage() throws TransformerException, IOException {
// REVISIT: style usage document into a form more readily output as a
// usage message
- try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
- InputStream in = getClass().getResourceAsStream("usage.xsl");
+ try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ InputStream in = getClass().getResourceAsStream("usage.xsl")) {
toolspec.transform(in, baos);
return baos.toString();
@@ -221,16 +221,18 @@ public class CommandLineParser {
public String getDetailedUsage() throws TransformerException, IOException {
// REVISIT: style usage document into a form more readily output as a
// usage message
- try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
- toolspec.transform(getClass().getResourceAsStream("detailedUsage.xsl"), baos);
+ try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ InputStream is = getClass().getResourceAsStream("detailedUsage.xsl")) {
+ toolspec.transform(is, baos);
return baos.toString();
}
}
public String getFormattedDetailedUsage() throws TransformerException, IOException {
String usage = null;
- try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
- toolspec.transform(getClass().getResourceAsStream("detailedUsage.xsl"), baos);
+ try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ InputStream is = getClass().getResourceAsStream("detailedUsage.xsl")) {
+ toolspec.transform(is, baos);
usage = baos.toString();
}
// we use the following pattern to format usage
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java b/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java
index aab7339..7498df2 100644
--- a/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java
+++ b/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java
@@ -47,71 +47,71 @@ public IDLLexer(LexerSharedInputState state) {
caseSensitiveLiterals = true;
setCaseSensitive(true);
literals = new Hashtable<ANTLRHashString, Integer>();
- literals.put(new ANTLRHashString("switch", this), new Integer(56));
- literals.put(new ANTLRHashString("typeprefix", this), new Integer(78));
- literals.put(new ANTLRHashString("case", this), new Integer(57));
- literals.put(new ANTLRHashString("finder", this), new Integer(93));
- literals.put(new ANTLRHashString("manages", this), new Integer(91));
- literals.put(new ANTLRHashString("interface", this), new Integer(7));
- literals.put(new ANTLRHashString("provides", this), new Integer(84));
- literals.put(new ANTLRHashString("exception", this), new Integer(67));
- literals.put(new ANTLRHashString("primarykey", this), new Integer(92));
- literals.put(new ANTLRHashString("sequence", this), new Integer(60));
- literals.put(new ANTLRHashString("uses", this), new Integer(85));
- literals.put(new ANTLRHashString("consumes", this), new Integer(89));
- literals.put(new ANTLRHashString("void", this), new Integer(69));
- literals.put(new ANTLRHashString("factory", this), new Integer(22));
- literals.put(new ANTLRHashString("import", this), new Integer(76));
- literals.put(new ANTLRHashString("float", this), new Integer(43));
- literals.put(new ANTLRHashString("publishes", this), new Integer(88));
- literals.put(new ANTLRHashString("private", this), new Integer(21));
- literals.put(new ANTLRHashString("boolean", this), new Integer(50));
- literals.put(new ANTLRHashString("string", this), new Integer(63));
- literals.put(new ANTLRHashString("getraises", this), new Integer(81));
- literals.put(new ANTLRHashString("emits", this), new Integer(87));
- literals.put(new ANTLRHashString("custom", this), new Integer(8));
- literals.put(new ANTLRHashString("component", this), new Integer(83));
- literals.put(new ANTLRHashString("context", this), new Integer(73));
- literals.put(new ANTLRHashString("octet", this), new Integer(51));
- literals.put(new ANTLRHashString("oneway", this), new Integer(68));
- literals.put(new ANTLRHashString("long", this), new Integer(45));
- literals.put(new ANTLRHashString("ValueBase", this), new Integer(75));
- literals.put(new ANTLRHashString("in", this), new Integer(25));
- literals.put(new ANTLRHashString("truncatable", this), new Integer(18));
- literals.put(new ANTLRHashString("FALSE", this), new Integer(40));
- literals.put(new ANTLRHashString("readonly", this), new Integer(79));
- literals.put(new ANTLRHashString("typedef", this), new Integer(41));
- literals.put(new ANTLRHashString("supports", this), new Integer(19));
- literals.put(new ANTLRHashString("short", this), new Integer(46));
- literals.put(new ANTLRHashString("TRUE", this), new Integer(39));
- literals.put(new ANTLRHashString("fixed", this), new Integer(74));
- literals.put(new ANTLRHashString("Object", this), new Integer(53));
- literals.put(new ANTLRHashString("enum", this), new Integer(59));
- literals.put(new ANTLRHashString("home", this), new Integer(90));
- literals.put(new ANTLRHashString("multiple", this), new Integer(86));
- literals.put(new ANTLRHashString("attribute", this), new Integer(80));
- literals.put(new ANTLRHashString("char", this), new Integer(48));
- literals.put(new ANTLRHashString("union", this), new Integer(55));
- literals.put(new ANTLRHashString("local", this), new Integer(6));
- literals.put(new ANTLRHashString("const", this), new Integer(26));
- literals.put(new ANTLRHashString("setraises", this), new Integer(82));
- literals.put(new ANTLRHashString("abstract", this), new Integer(5));
- literals.put(new ANTLRHashString("valuetype", this), new Integer(9));
- literals.put(new ANTLRHashString("inout", this), new Integer(71));
- literals.put(new ANTLRHashString("raises", this), new Integer(72));
- literals.put(new ANTLRHashString("out", this), new Integer(70));
- literals.put(new ANTLRHashString("typeid", this), new Integer(77));
- literals.put(new ANTLRHashString("wchar", this), new Integer(49));
- literals.put(new ANTLRHashString("any", this), new Integer(52));
- literals.put(new ANTLRHashString("double", this), new Integer(44));
- literals.put(new ANTLRHashString("default", this), new Integer(58));
- literals.put(new ANTLRHashString("eventtype", this), new Integer(10));
- literals.put(new ANTLRHashString("wstring", this), new Integer(64));
- literals.put(new ANTLRHashString("unsigned", this), new Integer(47));
- literals.put(new ANTLRHashString("struct", this), new Integer(54));
- literals.put(new ANTLRHashString("public", this), new Integer(20));
- literals.put(new ANTLRHashString("module", this), new Integer(11));
- literals.put(new ANTLRHashString("native", this), new Integer(42));
+ literals.put(new ANTLRHashString("switch", this), Integer.valueOf(56));
+ literals.put(new ANTLRHashString("typeprefix", this), Integer.valueOf(78));
+ literals.put(new ANTLRHashString("case", this), Integer.valueOf(57));
+ literals.put(new ANTLRHashString("finder", this), Integer.valueOf(93));
+ literals.put(new ANTLRHashString("manages", this), Integer.valueOf(91));
+ literals.put(new ANTLRHashString("interface", this), Integer.valueOf(7));
+ literals.put(new ANTLRHashString("provides", this), Integer.valueOf(84));
+ literals.put(new ANTLRHashString("exception", this), Integer.valueOf(67));
+ literals.put(new ANTLRHashString("primarykey", this), Integer.valueOf(92));
+ literals.put(new ANTLRHashString("sequence", this), Integer.valueOf(60));
+ literals.put(new ANTLRHashString("uses", this), Integer.valueOf(85));
+ literals.put(new ANTLRHashString("consumes", this), Integer.valueOf(89));
+ literals.put(new ANTLRHashString("void", this), Integer.valueOf(69));
+ literals.put(new ANTLRHashString("factory", this), Integer.valueOf(22));
+ literals.put(new ANTLRHashString("import", this), Integer.valueOf(76));
+ literals.put(new ANTLRHashString("float", this), Integer.valueOf(43));
+ literals.put(new ANTLRHashString("publishes", this), Integer.valueOf(88));
+ literals.put(new ANTLRHashString("private", this), Integer.valueOf(21));
+ literals.put(new ANTLRHashString("boolean", this), Integer.valueOf(50));
+ literals.put(new ANTLRHashString("string", this), Integer.valueOf(63));
+ literals.put(new ANTLRHashString("getraises", this), Integer.valueOf(81));
+ literals.put(new ANTLRHashString("emits", this), Integer.valueOf(87));
+ literals.put(new ANTLRHashString("custom", this), Integer.valueOf(8));
+ literals.put(new ANTLRHashString("component", this), Integer.valueOf(83));
+ literals.put(new ANTLRHashString("context", this), Integer.valueOf(73));
+ literals.put(new ANTLRHashString("octet", this), Integer.valueOf(51));
+ literals.put(new ANTLRHashString("oneway", this), Integer.valueOf(68));
+ literals.put(new ANTLRHashString("long", this), Integer.valueOf(45));
+ literals.put(new ANTLRHashString("ValueBase", this), Integer.valueOf(75));
+ literals.put(new ANTLRHashString("in", this), Integer.valueOf(25));
+ literals.put(new ANTLRHashString("truncatable", this), Integer.valueOf(18));
+ literals.put(new ANTLRHashString("FALSE", this), Integer.valueOf(40));
+ literals.put(new ANTLRHashString("readonly", this), Integer.valueOf(79));
+ literals.put(new ANTLRHashString("typedef", this), Integer.valueOf(41));
+ literals.put(new ANTLRHashString("supports", this), Integer.valueOf(19));
+ literals.put(new ANTLRHashString("short", this), Integer.valueOf(46));
+ literals.put(new ANTLRHashString("TRUE", this), Integer.valueOf(39));
+ literals.put(new ANTLRHashString("fixed", this), Integer.valueOf(74));
+ literals.put(new ANTLRHashString("Object", this), Integer.valueOf(53));
+ literals.put(new ANTLRHashString("enum", this), Integer.valueOf(59));
+ literals.put(new ANTLRHashString("home", this), Integer.valueOf(90));
+ literals.put(new ANTLRHashString("multiple", this), Integer.valueOf(86));
+ literals.put(new ANTLRHashString("attribute", this), Integer.valueOf(80));
+ literals.put(new ANTLRHashString("char", this), Integer.valueOf(48));
+ literals.put(new ANTLRHashString("union", this), Integer.valueOf(55));
+ literals.put(new ANTLRHashString("local", this), Integer.valueOf(6));
+ literals.put(new ANTLRHashString("const", this), Integer.valueOf(26));
+ literals.put(new ANTLRHashString("setraises", this), Integer.valueOf(82));
+ literals.put(new ANTLRHashString("abstract", this), Integer.valueOf(5));
+ literals.put(new ANTLRHashString("valuetype", this), Integer.valueOf(9));
+ literals.put(new ANTLRHashString("inout", this), Integer.valueOf(71));
+ literals.put(new ANTLRHashString("raises", this), Integer.valueOf(72));
+ literals.put(new ANTLRHashString("out", this), Integer.valueOf(70));
+ literals.put(new ANTLRHashString("typeid", this), Integer.valueOf(77));
+ literals.put(new ANTLRHashString("wchar", this), Integer.valueOf(49));
+ literals.put(new ANTLRHashString("any", this), Integer.valueOf(52));
+ literals.put(new ANTLRHashString("double", this), Integer.valueOf(44));
+ literals.put(new ANTLRHashString("default", this), Integer.valueOf(58));
+ literals.put(new ANTLRHashString("eventtype", this), Integer.valueOf(10));
+ literals.put(new ANTLRHashString("wstring", this), Integer.valueOf(64));
+ literals.put(new ANTLRHashString("unsigned", this), Integer.valueOf(47));
+ literals.put(new ANTLRHashString("struct", this), Integer.valueOf(54));
+ literals.put(new ANTLRHashString("public", this), Integer.valueOf(20));
+ literals.put(new ANTLRHashString("module", this), Integer.valueOf(11));
+ literals.put(new ANTLRHashString("native", this), Integer.valueOf(42));
}
public Token nextToken() throws TokenStreamException {
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java
index a4c04df..77f2ef6 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java
@@ -35,7 +35,7 @@ public final class IdlParam extends IdlDefnImplBase {
private IdlParam(IdlOperation parent, String name, IdlType typeType, String modeValue) {
super(parent, name);
this.type = typeType;
- this.mode = new String(modeValue);
+ this.mode = modeValue;
}
public static IdlParam create(IdlOperation parent, String name, IdlType type, String mode) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java
index 4325032..35188e0 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java
@@ -44,7 +44,7 @@ public final class IdlPrimitive extends IdlDefnImplBase implements IdlType {
private IdlPrimitive(IdlScopeBase parent, String name, String wsdlFileName, short typeValue) {
super(parent, name);
- this.wsdlName = new String(wsdlFileName);
+ this.wsdlName = wsdlFileName;
this.type = typeValue;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java
index c84926b..88e94ac 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java
@@ -28,7 +28,7 @@ public class IdlScopedName {
IdlScopedName(IdlScopeBase parent, String name) {
if (parent != null) {
- fullName = new String(parent.fullName() + ToolCorbaConstants.MODULE_SEPARATOR + name);
+ fullName = parent.fullName() + ToolCorbaConstants.MODULE_SEPARATOR + name;
parentNames = parent.name().parentNames();
} else {
fullName = new String(name);
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java
index 5dd6d7f..73026fd 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java
@@ -29,7 +29,7 @@ public abstract class IdlStructBase extends IdlScopeBase implements IdlType {
protected IdlStructBase(IdlScopeBase parent, String name, String type) {
super(parent, name);
- this.kind = new String(type);
+ this.kind = type;
}
void addField(IdlField f) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
index c4e5a90..d0b1ce7 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
@@ -265,7 +265,7 @@ public final class IdlPreprocessorReader extends Reader {
String symbol = line.substring("#if".length()).trim();
boolean notSkip = true;
try {
- int value = Integer.valueOf(symbol);
+ int value = Integer.parseInt(symbol);
if (value == 0) {
notSkip = false;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java
index 50a120e..5d8fcdd 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java
@@ -254,7 +254,7 @@ public class ArrayVisitor extends VisitorBase {
return anonarray;
}
- class Types {
+ static class Types {
private XmlSchemaType schemaType;
private CorbaType corbaType;
private Scope fullyQualifiedName;
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java
index fe33970..d261258 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java
@@ -33,6 +33,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import java.util.StringTokenizer;
@@ -315,30 +316,26 @@ public class IDLToWSDLProcessor extends IDLProcessor {
assert importSchemaWriters.size() == schemas.size();
}
- for (java.util.Iterator<File> it = defns.keySet().iterator(); it.hasNext();) {
- File file = it.next();
- Definition defn = defns.get(file);
+ for (Entry<File, Definition> entry : defns.entrySet()) {
Writer writer = null;
if (importDefnWriters != null) {
- writer = getOutputWriter(importDefnWriters.get(defn.getTargetNamespace()));
+ writer = getOutputWriter(importDefnWriters.get(entry.getValue().getTargetNamespace()));
}
if (writer == null) {
- writer = getOutputWriter(file);
+ writer = getOutputWriter(entry.getKey());
}
- visitor.writeDefinition(defn, writer);
+ visitor.writeDefinition(entry.getValue(), writer);
writer.close();
}
- for (java.util.Iterator<File> it = schemas.keySet().iterator(); it.hasNext();) {
- File file = it.next();
- XmlSchema schema = schemas.get(file);
+ for (Entry<File, XmlSchema> entry : schemas.entrySet()) {
Writer writer = null;
if (importSchemaWriters != null) {
- writer = getOutputWriter(importSchemaWriters.get(schema.getTargetNamespace()));
+ writer = getOutputWriter(importSchemaWriters.get(entry.getValue().getTargetNamespace()));
}
if (writer == null) {
- writer = getOutputWriter(file);
+ writer = getOutputWriter(entry.getKey());
}
- visitor.writeSchema(schema, writer);
+ visitor.writeSchema(entry.getValue(), writer);
writer.close();
}
}
@@ -427,7 +424,7 @@ public class IDLToWSDLProcessor extends IDLProcessor {
fileName = token.nextToken();
}
if (fileName.endsWith(".idl")) {
- fileName = new String(fileName.substring(0, fileName.length() - 4));
+ fileName = fileName.substring(0, fileName.length() - 4);
}
return fileName;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java
index a1a2585..6c0d0ac 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java
@@ -601,8 +601,7 @@ public class ScopedNameVisitor extends VisitorBase {
populateAliasSchemaType(corbaType, wsdlVisitor, holder);
}
} else if (((corbaType instanceof Sequence) || (corbaType instanceof Anonsequence))
- && ((corbaType.getType().equals(Constants.XSD_BASE64))
- || (corbaType.getType().equals(Constants.XSD_BASE64)))) {
+ && ((corbaType.getType().equals(Constants.XSD_BASE64)))) {
//special case of sequence of octets
result = true;
if (holder != null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
index 1a06fa0..e7abf03 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
@@ -129,7 +129,7 @@ public class StringVisitor extends VisitorBase {
// corba:anonstring
Anonstring anonstring = new Anonstring();
anonstring.setQName(new QName(typeMap.getTargetNamespace(), stringScopedName.toString()));
- anonstring.setBound(Long.valueOf(boundNode.toString()));
+ anonstring.setBound(Long.parseLong(boundNode.toString()));
anonstring.setType(simpleType.getQName());
anon = anonstring;
@@ -138,7 +138,7 @@ public class StringVisitor extends VisitorBase {
// corba:anonwstring
Anonwstring anonwstring = new Anonwstring();
anonwstring.setQName(new QName(typeMap.getTargetNamespace(), stringScopedName.toString()));
- anonwstring.setBound(Long.valueOf(boundNode.toString()));
+ anonwstring.setBound(Long.parseLong(boundNode.toString()));
anonwstring.setType(simpleType.getQName());
anon = anonwstring;
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java
index 4379b19..8f2d66f 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java
@@ -25,6 +25,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import javax.wsdl.Definition;
import javax.wsdl.Import;
@@ -60,7 +61,7 @@ public class WSDLSchemaManager {
boolean ignoreImports;
- class DeferredSchemaAttachment {
+ static class DeferredSchemaAttachment {
Definition defn;
XmlSchema schema;
boolean isGenerated;
@@ -319,22 +320,18 @@ public class WSDLSchemaManager {
}
public File getImportedWSDLDefinitionFile(String ns) {
- for (Iterator<File> it = importedDefns.keySet().iterator(); it.hasNext();) {
- File file = it.next();
- Definition defn = importedDefns.get(file);
- if (defn.getTargetNamespace().equals(ns)) {
- return file;
+ for (Entry<File, Definition> entry : importedDefns.entrySet()) {
+ if (entry.getValue().getTargetNamespace().equals(ns)) {
+ return entry.getKey();
}
}
return null;
}
public File getImportedXmlSchemaFile(String ns) {
- for (Iterator<File> it = importedSchemas.keySet().iterator(); it.hasNext();) {
- File file = it.next();
- XmlSchema schema = importedSchemas.get(file);
- if (schema.getTargetNamespace().equals(ns)) {
- return file;
+ for (Entry<File, XmlSchema> entry : importedSchemas.entrySet()) {
+ if (entry.getValue().getTargetNamespace().equals(ns)) {
+ return entry.getKey();
}
}
return null;
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java
index 3b602d7..7e482e1 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java
@@ -28,6 +28,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -145,11 +146,11 @@ public class WSDLToCorbaBinding {
Map<QName, PortType> portTypes = CastUtils.cast(def.getAllPortTypes());
if (portTypes != null) {
- for (QName existPortQName : portTypes.keySet()) {
- if (!existPortQName.getLocalPart().equals(interfaceName)) {
+ for (Entry<QName, PortType> entry : portTypes.entrySet()) {
+ if (!entry.getKey().getLocalPart().equals(interfaceName)) {
portType = null;
} else {
- portType = portTypes.get(existPortQName);
+ portType = entry.getValue();
break;
}
}
@@ -689,7 +690,7 @@ public class WSDLToCorbaBinding {
public void setWsdlFile(String file) {
- wsdlFileName = new String(file);
+ wsdlFileName = file;
}
public String getWsdlFileName() {
@@ -817,7 +818,7 @@ public class WSDLToCorbaBinding {
}
public void setOutputFile(String file) {
- outputFile = new String(file);
+ outputFile = file;
}
public void setNamespace(String nameSpaceName) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java
index 9f2fed0..ebefbd4 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java
@@ -754,7 +754,6 @@ public class WSDLToCorbaHelper {
corbaTypeImpl, anonymous);
} else if ((corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_BASE64))
|| (baseName.equals(W3CConstants.NT_SCHEMA_BASE64))
- || (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN))
|| (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN))) {
corbaTypeImpl = WSDLTypes.processBase64Type(corbaTypeImpl,
name, maxLength, length);
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java
index 7f38f95..6dbd6a5 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java
@@ -71,10 +71,10 @@ public class WSDLToCorbaProcessor extends WSDLToProcessor {
setOutputFile();
String filename = getFileBase(env.get("wsdlurl").toString());
if ((wsdlOutput == null) && (wsdlToCorbaBinding != null)) {
- wsdlOutput = new String(filename + "-corba.wsdl");
+ wsdlOutput = filename + "-corba.wsdl";
}
if ((idlOutput == null) && (idlAction != null)) {
- idlOutput = new String(filename + ".idl");
+ idlOutput = filename + ".idl";
}
if (wsdlToCorbaBinding != null) {
@@ -222,7 +222,7 @@ public class WSDLToCorbaProcessor extends WSDLToProcessor {
fileBase = tok.nextToken();
}
if (fileBase.endsWith(".wsdl")) {
- fileBase = new String(fileBase.substring(0, fileBase.length() - 5));
+ fileBase = fileBase.substring(0, fileBase.length() - 5);
}
return fileBase;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java
index 502cdf7..efa45b2 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java
@@ -785,7 +785,7 @@ public class WSDLToIDLAction {
String result[] = new String[strtok.countTokens()];
for (int i = 0; strtok.hasMoreTokens(); ++i) {
- result[i] = new String(strtok.nextToken());
+ result[i] = strtok.nextToken();
}
return result;
@@ -800,7 +800,7 @@ public class WSDLToIDLAction {
}
public void setWsdlFile(String file) {
- wsdlFileName = new String(file);
+ wsdlFileName = file;
}
public void setVerboseOn(boolean verbose) {
@@ -811,7 +811,7 @@ public class WSDLToIDLAction {
}
public void setBindingName(String bindName) {
- bindingName = new String(bindName);
+ bindingName = bindName;
}
public String getBindingName() {
@@ -819,7 +819,7 @@ public class WSDLToIDLAction {
}
public void setNamespace(String namespaceName) {
- namespace = new String(namespaceName);
+ namespace = namespaceName;
}
public String getNamespace() {
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java b/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
index 8cab353..d85ee7d 100644
--- a/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
+++ b/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
@@ -167,7 +167,7 @@ public class JAXBDataBinding implements DataBindingProfile {
}
}
}
- public class LocationFilterReader extends StreamReaderDelegate {
+ public static class LocationFilterReader extends StreamReaderDelegate {
boolean isImport;
boolean isInclude;
int locIdx = -1;
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
index 3ef5af9..a7d5265 100644
--- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
+++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
@@ -232,7 +232,7 @@ public class JAXWSBindingParser {
return rnode;
}
- class ContextImpl implements NamespaceContext {
+ static class ContextImpl implements NamespaceContext {
private Node targetNode;
ContextImpl(Node node) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java
index 47b6536..cc5f325 100644
--- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java
+++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java
@@ -21,6 +21,7 @@ package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
+import java.util.Map.Entry;
import javax.xml.namespace.QName;
@@ -68,9 +69,8 @@ public class FaultGenerator extends AbstractJAXWSGenerator {
Map<String, JavaExceptionClass> exceptionClasses = javaModel
.getExceptionClasses();
- for (String expClassName : exceptionClasses.keySet()) {
- JavaExceptionClass expClz =
- exceptionClasses.get(expClassName);
+ for (Entry<String, JavaExceptionClass> entry : exceptionClasses.entrySet()) {
+ JavaExceptionClass expClz = entry.getValue();
clearAttributes();
http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java b/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java
index 08458af..72e78bf 100644
--- a/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java
+++ b/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java
@@ -24,6 +24,7 @@ import java.io.Writer;
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import javax.wsdl.Binding;
import javax.wsdl.BindingFault;
@@ -116,10 +117,10 @@ public class WSDLToSoapProcessor extends AbstractWSDLToProcessor {
if (portTypes == null) {
return false;
}
- for (QName existPortQName : portTypes.keySet()) {
- String existPortName = existPortQName.getLocalPart();
+ for (Entry<QName, PortType> entry : portTypes.entrySet()) {
+ String existPortName = entry.getKey().getLocalPart();
if (existPortName.equals(env.get(ToolConstants.CFG_PORTTYPE))) {
- portType = portTypes.get(existPortQName);
+ portType = entry.getValue();
break;
}
}
@@ -131,11 +132,11 @@ public class WSDLToSoapProcessor extends AbstractWSDLToProcessor {
if (bindings == null) {
return false;
}
- for (QName existBindingQName : bindings.keySet()) {
- String existBindingName = existBindingQName.getLocalPart();
+ for (Entry<QName, Binding> entry : bindings.entrySet()) {
+ String existBindingName = entry.getKey().getLocalPart();
String bindingName = (String)env.get(ToolConstants.CFG_BINDING);
if (bindingName.equals(existBindingName)) {
- binding = bindings.get(existBindingQName);
+ binding = entry.getValue();
}
}
return (binding == null) ? false : true;
[24/30] cxf git commit: CXF-6604 - Sporadic ClassCastException in
AsymmetricBindingHandler#doSignBeforeEncrypt
Posted by re...@apache.org.
CXF-6604 - Sporadic ClassCastException in AsymmetricBindingHandler#doSignBeforeEncrypt
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/66e97c77
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/66e97c77
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/66e97c77
Branch: refs/heads/CXF-6882.nio
Commit: 66e97c77eaa43ab3a2cd95f0edc6a27e7445e8ce
Parents: a644c5d
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Dec 2 13:30:06 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Dec 2 13:30:06 2016 +0000
----------------------------------------------------------------------
.../java/org/apache/cxf/staxutils/StaxUtils.java | 2 +-
.../policyhandlers/AbstractBindingBuilder.java | 19 +++++++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/66e97c77/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
index d307b04..7f29345 100644
--- a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
+++ b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
@@ -95,7 +95,7 @@ import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.message.Message;
public final class StaxUtils {
- // System properies for defaults, but also contextual properties usable
+ // System properties for defaults, but also contextual properties usable
// for StaxInInterceptor
public static final String MAX_CHILD_ELEMENTS =
"org.apache.cxf.stax.maxChildElements";
http://git-wip-us.apache.org/repos/asf/cxf/blob/66e97c77/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
index cf4333d..66de78c 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
@@ -41,6 +41,8 @@ import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
@@ -48,6 +50,7 @@ import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -63,6 +66,8 @@ import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.MessageUtils;
import org.apache.cxf.rt.security.utils.SecurityUtils;
import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.staxutils.W3CDOMStreamWriter;
import org.apache.cxf.ws.policy.AssertionInfo;
import org.apache.cxf.ws.policy.AssertionInfoMap;
import org.apache.cxf.ws.policy.PolicyConstants;
@@ -608,8 +613,18 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
}
protected Element cloneElement(Element el) {
- if (!secHeader.getSecurityHeaderElement().getOwnerDocument().equals(el.getOwnerDocument())) {
- return (Element)secHeader.getSecurityHeaderElement().getOwnerDocument().importNode(el, true);
+ Document doc = secHeader.getSecurityHeaderElement().getOwnerDocument();
+ if (!doc.equals(el.getOwnerDocument())) {
+
+ XMLStreamReader reader = StaxUtils.createXMLStreamReader(el);
+ DocumentFragment fragment = doc.createDocumentFragment();
+ W3CDOMStreamWriter writer = new W3CDOMStreamWriter(fragment);
+ try {
+ StaxUtils.copy(reader, writer);
+ return (Element)fragment.getFirstChild();
+ } catch (XMLStreamException ex) {
+ LOG.log(Level.FINE, "Error cloning security element", ex);
+ }
}
return el;
}
[13/30] cxf git commit: More FindBugs work
Posted by re...@apache.org.
More FindBugs work
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/01fdc405
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/01fdc405
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/01fdc405
Branch: refs/heads/CXF-6882.nio
Commit: 01fdc40526185ee89202692088fd5367f0690af0
Parents: 75093fe
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Nov 29 11:45:51 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Nov 29 11:45:51 2016 +0000
----------------------------------------------------------------------
.../management/web/logging/ReadOnlyFileStorage.java | 2 +-
.../jmx/export/runtime/ModelMBeanAssembler.java | 2 +-
.../java/org/apache/cxf/wsdl/JAXBExtensionHelper.java | 5 ++---
.../cxf/wsdl/interceptors/WrappedOutInterceptor.java | 2 +-
.../service/factory/XercesSchemaValidationUtils.java | 6 +++---
.../org/apache/cxf/wsdl11/PartialWSDLProcessor.java | 13 +++++++------
.../org/apache/cxf/customer/book/BookServiceImpl.java | 4 ++--
.../cxf/customer/book/BookServiceWrappedImpl.java | 1 -
8 files changed, 17 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java
----------------------------------------------------------------------
diff --git a/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java b/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java
index 2754cd3..79849e7 100644
--- a/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java
+++ b/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java
@@ -612,7 +612,7 @@ public class ReadOnlyFileStorage implements ReadableLogStorage {
private int getLogIndex(String name) {
int index = name.lastIndexOf('.');
try {
- return Integer.valueOf(name.substring(index + 1));
+ return Integer.parseInt(name.substring(index + 1));
} catch (Exception ex) {
return 0;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java
----------------------------------------------------------------------
diff --git a/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java b/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java
index 884ee3f..480c40f 100644
--- a/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java
+++ b/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java
@@ -116,7 +116,7 @@ public class ModelMBeanAssembler {
return result;
}
- class ManagedAttributeInfo {
+ static class ManagedAttributeInfo {
String fname;
String ftype;
String description;
http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
index 9b77c26..5548bbc 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
@@ -359,9 +359,8 @@ public class JAXBExtensionHelper implements ExtensionSerializer, ExtensionDeseri
reader = new MappingReaderDelegate(reader);
o = u.unmarshal(reader, extensionClass);
}
- if (o instanceof JAXBElement<?>) {
- JAXBElement<?> el = (JAXBElement<?>)o;
- o = el.getValue();
+ if (o != null) {
+ o = ((JAXBElement<?>)o).getValue();
}
ExtensibilityElement el = o instanceof ExtensibilityElement ? (ExtensibilityElement)o
http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java
index 73db9ed..b00ccfc 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java
@@ -90,7 +90,7 @@ public class WrappedOutInterceptor extends AbstractOutDatabindingInterceptor {
}
}
- public class WrappedOutEndingInterceptor extends AbstractOutDatabindingInterceptor {
+ public static class WrappedOutEndingInterceptor extends AbstractOutDatabindingInterceptor {
public WrappedOutEndingInterceptor(String phase) {
super(phase);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java
index 0456671..4b79611 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java
@@ -50,7 +50,7 @@ import org.apache.ws.commons.schema.XmlSchemaSerializer;
class XercesSchemaValidationUtils {
- class DOMLSInput implements LSInput {
+ static class DOMLSInput implements LSInput {
private String systemId;
private String data;
@@ -144,8 +144,8 @@ class XercesSchemaValidationUtils {
Method findMethod(Object o, String name) {
- for (Method m: o.getClass().getMethods()) {
- if (m.getName() == name) {
+ for (Method m : o.getClass().getMethods()) {
+ if (m.getName() != null && m.getName().equals(name)) {
m.setAccessible(true);
return m;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java
index 389dbcd..0b2432e 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java
@@ -21,6 +21,7 @@ package org.apache.cxf.wsdl11;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import javax.wsdl.Binding;
import javax.wsdl.BindingFault;
@@ -68,10 +69,10 @@ public final class PartialWSDLProcessor {
String existPortTypeName = null;
PortType portType = null;
try {
- for (QName existPortTypeQName : portTypes.keySet()) {
- existPortTypeName = existPortTypeQName.getLocalPart();
+ for (Entry<QName, PortType> entry : portTypes.entrySet()) {
+ existPortTypeName = entry.getKey().getLocalPart();
if (name.getLocalPart().contains(existPortTypeName)) {
- portType = portTypes.get(existPortTypeQName);
+ portType = entry.getValue();
break;
}
}
@@ -88,9 +89,9 @@ public final class PartialWSDLProcessor {
return false;
}
try {
- for (QName existBindingQName : bindings.keySet()) {
- if (existBindingQName.getLocalPart().contains(name.getLocalPart())) {
- binding = bindings.get(existBindingQName);
+ for (Entry<QName, Binding> entry : bindings.entrySet()) {
+ if (entry.getKey().getLocalPart().contains(name.getLocalPart())) {
+ binding = entry.getValue();
break;
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java b/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java
index d8fdd2f..6907409 100644
--- a/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java
+++ b/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java
@@ -51,7 +51,7 @@ public class BookServiceImpl implements BookService {
+ me.getValue().getName() + ", " + me.getValue().getId());
}
System.out.println("Book de id " + getBook.getId());
- Book b = books.get(((Long)getBook.getId()).longValue());
+ Book b = books.get(getBook.getId());
if (b == null) {
BookNotFoundDetails details = new BookNotFoundDetails();
@@ -67,7 +67,7 @@ public class BookServiceImpl implements BookService {
+ me.getValue().getName() + ", " + me.getValue().getId());
}
System.out.println("Book de id " + getAnotherBook.getId());
- Book b = books.get(((Long)getAnotherBook.getId()).longValue());
+ Book b = books.get(getAnotherBook.getId());
if (b == null) {
BookNotFoundDetails details = new BookNotFoundDetails();
http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java b/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java
index 5295da2..bf38d54 100644
--- a/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java
+++ b/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java
@@ -27,7 +27,6 @@ import javax.jws.WebService;
@WebService(endpointInterface = "org.apache.cxf.customer.book.BookService")
public class BookServiceWrappedImpl implements BookServiceWrapped {
- long currentId = 1;
Map<Long, Book> books = new HashMap<Long, Book>();
public BookServiceWrappedImpl() {
[23/30] cxf git commit: Findbugs work on the transports
Posted by re...@apache.org.
Findbugs work on the transports
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a644c5d0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a644c5d0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a644c5d0
Branch: refs/heads/CXF-6882.nio
Commit: a644c5d06c0bae321e2c669efa0cecf3abdd944d
Parents: 847216a
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Dec 2 11:12:23 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Dec 2 11:54:36 2016 +0000
----------------------------------------------------------------------
.../http_undertow/UndertowHTTPServerEngine.java | 4 ++--
.../java/org/apache/cxf/transport/http/Headers.java | 2 +-
.../org/apache/cxf/transport/http/ProxyFactory.java | 2 +-
.../http/auth/AbstractSpnegoAuthSupplier.java | 2 +-
.../apache/cxf/transport/http/auth/HttpAuthHeader.java | 7 ++++---
.../http/osgi/ConfigAdminHttpConduitConfigurer.java | 2 +-
.../java/org/apache/cxf/transport/jms/JMSConduit.java | 2 +-
.../org/apache/cxf/transport/jms/uri/JMSEndpoint.java | 13 +++++++------
.../atmosphere/DefaultProtocolInterceptor.java | 2 +-
9 files changed, 19 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
index 7cfed67..ad3a6a6 100644
--- a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
@@ -461,11 +461,11 @@ public class UndertowHTTPServerEngine implements ServerEngine {
? SSLContext.getInstance(proto)
: SSLContext.getInstance(proto, tlsServerParameters.getJsseProvider());
- KeyManager keyManagers[] = tlsServerParameters.getKeyManagers();
+ KeyManager[] keyManagers = tlsServerParameters.getKeyManagers();
if (tlsServerParameters.getCertAlias() != null) {
keyManagers = getKeyManagersWithCertAlias(keyManagers);
}
- context.init(tlsServerParameters.getKeyManagers(),
+ context.init(keyManagers,
tlsServerParameters.getTrustManagers(),
tlsServerParameters.getSecureRandom());
http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
index 7ec9f4a..3d58112 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
@@ -487,7 +487,7 @@ public class Headers {
return true;
}
try {
- if (Integer.valueOf(ctLen.get(0)) == 0) {
+ if (Integer.parseInt(ctLen.get(0)) == 0) {
return false;
}
} catch (NumberFormatException ex) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
index 22779db..c53794d 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
@@ -79,7 +79,7 @@ public class ProxyFactory {
proxyPort = "8080";
}
- systemProxyConfiguration.setProxyServerPort(Integer.valueOf(proxyPort));
+ systemProxyConfiguration.setProxyServerPort(Integer.parseInt(proxyPort));
// Load non proxy hosts
String nonProxyHosts = SystemPropertyAction.getPropertyOrNull(HTTP_NON_PROXY_HOSTS);
http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
index dc28427..172d110 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
@@ -196,7 +196,7 @@ public abstract class AbstractSpnegoAuthSupplier {
this.realm = realm;
}
- private final class CreateServiceTicketAction implements PrivilegedExceptionAction<byte[]> {
+ private static final class CreateServiceTicketAction implements PrivilegedExceptionAction<byte[]> {
private final GSSContext context;
private final byte[] token;
http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
index 0b331ed..fef7d12 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
@@ -119,11 +119,12 @@ public final class HttpAuthHeader {
if (value.indexOf(".") > 0) {
value = value.substring(0, value.indexOf("."));
}
- String pad = "";
+ StringBuilder pad = new StringBuilder();
+ pad.append("");
for (int i = 0; i < 8 - value.length(); i++) {
- pad = pad + "0";
+ pad.append("0");
}
- value = pad + value;
+ value = pad.toString() + value;
} else {
value = tok.sval;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java
index 1bc01f3..baaeb77 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java
@@ -121,7 +121,7 @@ class ConfigAdminHttpConduitConfigurer implements ManagedServiceFactory, HTTPCon
String p = (String)properties.get("order");
int order = 50;
if (p != null) {
- order = Integer.valueOf(p);
+ order = Integer.parseInt(p);
}
PidInfo info = new PidInfo(properties, matcher, order);
http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
index 9a0f4be..814aa2a 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
@@ -232,7 +232,7 @@ public class JMSConduit extends AbstractConduit implements JMSExchangeSender, Me
} catch (InterruptedException e) {
throw new JMSException("Interrupted while correlating " + e.getMessage());
}
- if (exchange.get(CORRELATED) != Boolean.TRUE) {
+ if (!Boolean.TRUE.equals(exchange.get(CORRELATED))) {
throw new JMSException("Timeout receiving message with correlationId "
+ correlationId);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
index f5e9d03..64a77dd 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
@@ -22,6 +22,7 @@ package org.apache.cxf.transport.jms.uri;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
+import java.util.Map.Entry;
import javax.jms.ConnectionFactory;
import javax.jms.Message;
@@ -137,9 +138,9 @@ public class JMSEndpoint {
if (jaxwsProps == null) {
return;
}
- for (String key : jaxwsProps.keySet()) {
- if (key.startsWith(JAXWS_PROPERTY_PREFIX)) {
- jmsProps.put(key.substring(JAXWS_PROPERTY_PREFIX.length()), jaxwsProps.get(key));
+ for (Entry<String, Object> entry : jaxwsProps.entrySet()) {
+ if (entry.getKey().startsWith(JAXWS_PROPERTY_PREFIX)) {
+ jmsProps.put(entry.getKey().substring(JAXWS_PROPERTY_PREFIX.length()), entry.getValue());
}
}
}
@@ -312,7 +313,7 @@ public class JMSEndpoint {
this.timeToLive = timeToLive;
}
public void setTimeToLive(String timeToLive) {
- this.timeToLive = Long.valueOf(timeToLive);
+ this.timeToLive = Long.parseLong(timeToLive);
}
public boolean isSetPriority() {
return priority != null;
@@ -372,7 +373,7 @@ public class JMSEndpoint {
}
public void setConcurrentConsumers(String concurrentConsumers) {
- this.concurrentConsumers = Integer.valueOf(concurrentConsumers);
+ this.concurrentConsumers = Integer.parseInt(concurrentConsumers);
}
public String getPassword() {
@@ -407,7 +408,7 @@ public class JMSEndpoint {
}
public void setReceiveTimeout(String receiveTimeout) {
- this.receiveTimeout = Long.valueOf(receiveTimeout);
+ this.receiveTimeout = Long.parseLong(receiveTimeout);
}
public String getTargetService() {
return targetService;
http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
index 9646fd6..e2e2d98 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
@@ -359,7 +359,7 @@ public class DefaultProtocolInterceptor extends AtmosphereInterceptorAdapter {
}
// a workaround to flush the header data upon close when no write operation occurs
- private class WrappedAtmosphereResponse extends AtmosphereResponseImpl {
+ private static class WrappedAtmosphereResponse extends AtmosphereResponseImpl {
final AtmosphereResponse response;
ServletOutputStream sout;
WrappedAtmosphereResponse(AtmosphereResponse resp, AtmosphereRequest req) throws IOException {
[26/30] cxf git commit: [CXF-7156] added portName configuration
option to the Java2WSMojo to no longer have to use argline for the portname
option This closes #208
Posted by re...@apache.org.
[CXF-7156] added portName configuration option to the Java2WSMojo to no longer have to use argline for the portname option
This closes #208
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7a989600
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7a989600
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7a989600
Branch: refs/heads/CXF-6882.nio
Commit: 7a989600653fbbe42d621fa7d7abbc07fec2e009
Parents: 4dcf512
Author: Stefaan Dutry <st...@gmail.com>
Authored: Sun Nov 27 13:47:19 2016 +0100
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Dec 2 11:42:54 2016 -0500
----------------------------------------------------------------------
.../apache/cxf/maven_plugin/Java2WSMojo.java | 22 +++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/7a989600/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java b/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
index f819aa4..b97c7d3 100644
--- a/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
+++ b/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
@@ -151,6 +151,12 @@ public class Java2WSMojo extends AbstractMojo {
private Boolean genWrapperbean;
/**
+ * @parameter
+ */
+ private String portName;
+
+
+ /**
* Attach the generated wsdl file to the list of files to be deployed
* on install. This means the wsdl file will be copied to the repository
* with groupId, artifactId and version of the project and type "wsdl".
@@ -283,12 +289,12 @@ public class Java2WSMojo extends AbstractMojo {
}
}
- if (frontend != null) {
+ if (!StringUtils.isEmpty(frontend)) {
args.add("-frontend");
args.add(frontend);
}
- if (databinding != null) {
+ if (!StringUtils.isEmpty(databinding)) {
args.add("-databinding");
args.add(databinding);
}
@@ -315,13 +321,13 @@ public class Java2WSMojo extends AbstractMojo {
}
// target namespace arg
- if (targetNamespace != null) {
+ if (!StringUtils.isEmpty(targetNamespace)) {
args.add("-t");
args.add(targetNamespace);
}
// servicename arg
- if (serviceName != null) {
+ if (!StringUtils.isEmpty(serviceName)) {
args.add("-servicename");
args.add(serviceName);
}
@@ -337,11 +343,17 @@ public class Java2WSMojo extends AbstractMojo {
}
// address arg
- if (address != null) {
+ if (!StringUtils.isEmpty(address)) {
args.add("-address");
args.add(address);
}
+ // portname arg
+ if (!StringUtils.isEmpty(portName)) {
+ args.add("-portname");
+ args.add(portName);
+ }
+
if (argline != null) {
StringTokenizer stoken = new StringTokenizer(argline, " ");
while (stoken.hasMoreTokens()) {
[19/30] cxf git commit: [CXF-7152] Minor update to support
multivalued response types better
Posted by re...@apache.org.
[CXF-7152] Minor update to support multivalued response types better
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8d725cb8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8d725cb8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8d725cb8
Branch: refs/heads/CXF-6882.nio
Commit: 8d725cb89823e0c0e78dc10d3a7d92ab1f8972db
Parents: 5b6b094
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Wed Nov 30 16:52:24 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Wed Nov 30 16:52:24 2016 +0000
----------------------------------------------------------------------
.../oauth2/common/AbstractFormImplicitResponse.java | 11 +++++++++++
.../oauth2/services/AbstractImplicitGrantService.java | 1 +
.../cxf/rs/security/oidc/idp/FormIdTokenResponse.java | 7 +++----
3 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/8d725cb8/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractFormImplicitResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractFormImplicitResponse.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractFormImplicitResponse.java
index 3fa841f..6244faa 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractFormImplicitResponse.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractFormImplicitResponse.java
@@ -18,11 +18,14 @@
*/
package org.apache.cxf.rs.security.oauth2.common;
+import java.util.LinkedHashMap;
+import java.util.Map;
public abstract class AbstractFormImplicitResponse {
private String responseType;
private String redirectUri;
private String state;
+ private Map<String, String> parameters = new LinkedHashMap<String, String>();
public String getRedirectUri() {
return redirectUri;
}
@@ -45,4 +48,12 @@ public abstract class AbstractFormImplicitResponse {
public void setState(String state) {
this.state = state;
}
+
+ public Map<String, String> getParameters() {
+ return parameters;
+ }
+
+ public void setParameters(Map<String, String> parameters) {
+ this.parameters = parameters;
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8d725cb8/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
index 75966fb..8606769 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
@@ -127,6 +127,7 @@ public abstract class AbstractImplicitGrantService extends RedirectionBasedGrant
bean.setAccessToken(clientToken.getTokenKey());
bean.setAccessTokenType(clientToken.getTokenType());
bean.setAccessTokenExpiresIn(clientToken.getExpiresIn());
+ bean.getParameters().putAll(clientToken.getParameters());
return bean;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8d725cb8/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormIdTokenResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormIdTokenResponse.java b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormIdTokenResponse.java
index 8b53a1b..41f28ff 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormIdTokenResponse.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormIdTokenResponse.java
@@ -19,15 +19,14 @@
package org.apache.cxf.rs.security.oidc.idp;
import org.apache.cxf.rs.security.oauth2.common.AbstractFormImplicitResponse;
+import org.apache.cxf.rs.security.oidc.utils.OidcUtils;
public class FormIdTokenResponse extends AbstractFormImplicitResponse {
- private String idToken;
-
public String getIdToken() {
- return idToken;
+ return (String)getParameters().get(OidcUtils.ID_TOKEN);
}
public void setIdToken(String idToken) {
- this.idToken = idToken;
+ getParameters().put(OidcUtils.ID_TOKEN, idToken);
}
}
[25/30] cxf git commit: [CXF-7161] Avoiding reporting a null secret
key with a dangling secret expiry time, patch from Adrian Gonzalez applied,
This closes #209
Posted by re...@apache.org.
[CXF-7161] Avoiding reporting a null secret key with a dangling secret expiry time, patch from Adrian Gonzalez applied, This closes #209
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4dcf5120
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4dcf5120
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4dcf5120
Branch: refs/heads/CXF-6882.nio
Commit: 4dcf5120561ba5b11bf9493c931889c591cf36e0
Parents: 66e97c7
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Fri Dec 2 16:42:09 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Fri Dec 2 16:42:09 2016 +0000
----------------------------------------------------------------------
.../security/oauth2/services/DynamicRegistrationService.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/4dcf5120/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java
index 8a8dd93..69d7f7b 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java
@@ -125,10 +125,12 @@ public class DynamicRegistrationService {
protected ClientRegistrationResponse fromClientToRegistrationResponse(Client client) {
ClientRegistrationResponse response = new ClientRegistrationResponse();
response.setClientId(client.getClientId());
- response.setClientSecret(client.getClientSecret());
+ if (client.getClientSecret() != null) {
+ response.setClientSecret(client.getClientSecret());
+ // TODO: consider making Client secret time limited
+ response.setClientSecretExpiresAt(Long.valueOf(0));
+ }
response.setClientIdIssuedAt(client.getRegisteredAt());
- // TODO: consider making Client secret time limited
- response.setClientSecretExpiresAt(Long.valueOf(0));
UriBuilder ub = getMessageContext().getUriInfo().getAbsolutePathBuilder();
if (supportRegistrationAccessTokens) {
[17/30] cxf git commit: Some minor FindBugs stuff
Posted by re...@apache.org.
Some minor FindBugs stuff
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/bddf16d7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/bddf16d7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/bddf16d7
Branch: refs/heads/CXF-6882.nio
Commit: bddf16d73a5627e1f984645d3edb1e7769179bbd
Parents: e0c3ed7
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed Nov 30 15:24:37 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed Nov 30 15:24:37 2016 +0000
----------------------------------------------------------------------
.../org/apache/cxf/binding/soap/Soap11.java | 34 +++++++++---------
.../org/apache/cxf/binding/soap/Soap12.java | 36 +++++++++-----------
.../interceptor/MustUnderstandInterceptor.java | 4 +--
.../soap/jms/interceptor/SoapFaultFactory.java | 3 +-
...AbstractRequestAssertionConsumerHandler.java | 4 ++-
5 files changed, 39 insertions(+), 42 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/bddf16d7/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
index 8985b64..10ee250 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
@@ -22,7 +22,7 @@ package org.apache.cxf.binding.soap;
import javax.xml.namespace.QName;
/**
- * Singleton object that represents the SOAP 1.1 version.
+ * Singleton object that represents the SOAP 1.1 VERSION.
*
*/
public final class Soap11 implements SoapVersion {
@@ -45,25 +45,23 @@ public final class Soap11 implements SoapVersion {
private static final Soap11 INSTANCE = new Soap11();
- private final double version = 1.1;
+ private static final double VERSION = 1.1;
- private final String namespace = SOAP_NAMESPACE;
+ private static final String NONE_ROLE = SOAP_NAMESPACE + "/role/none";
- private final String noneRole = namespace + "/role/none";
-
- private final String ultimateReceiverRole = namespace + "/role/ultimateReceiver";
+ private static final String ULTIMATE_RECEIVER_ROLE = SOAP_NAMESPACE + "/role/ultimateReceiver";
- private final String nextRole = "http://schemas.xmlsoap.org/soap/actor/next";
+ private static final String NEXT_ROLE = "http://schemas.xmlsoap.org/soap/actor/next";
- private final String soapEncodingStyle = SOAP_ENCODING_URI;
+ private static final String SOAP_ENCODING_STYLE = SOAP_ENCODING_URI;
- private final QName envelope = new QName(namespace, "Envelope");
+ private final QName envelope = new QName(SOAP_NAMESPACE, "Envelope");
- private final QName header = new QName(namespace, "Header");
+ private final QName header = new QName(SOAP_NAMESPACE, "Header");
- private final QName body = new QName(namespace, "Body");
+ private final QName body = new QName(SOAP_NAMESPACE, "Body");
- private final QName fault = new QName(namespace, "Fault");
+ private final QName fault = new QName(SOAP_NAMESPACE, "Fault");
private Soap11() {
// Singleton
@@ -79,11 +77,11 @@ public final class Soap11 implements SoapVersion {
}
public double getVersion() {
- return version;
+ return VERSION;
}
public String getNamespace() {
- return namespace;
+ return SOAP_NAMESPACE;
}
public QName getEnvelope() {
@@ -103,21 +101,21 @@ public final class Soap11 implements SoapVersion {
}
public String getSoapEncodingStyle() {
- return soapEncodingStyle;
+ return SOAP_ENCODING_STYLE;
}
// Role URIs
// -------------------------------------------------------------------------
public String getNoneRole() {
- return noneRole;
+ return NONE_ROLE;
}
public String getUltimateReceiverRole() {
- return ultimateReceiverRole;
+ return ULTIMATE_RECEIVER_ROLE;
}
public String getNextRole() {
- return nextRole;
+ return NEXT_ROLE;
}
public String getAttrNameRole() {
http://git-wip-us.apache.org/repos/asf/cxf/blob/bddf16d7/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
index 4c65507..c57844c 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
@@ -28,45 +28,43 @@ import javax.xml.namespace.QName;
public final class Soap12 implements SoapVersion {
public static final String SOAP_NAMESPACE = "http://www.w3.org/2003/05/soap-envelope";
- private static Soap12 instance = new Soap12();
+ private static final Soap12 INSTANCE = new Soap12();
- private final double version = 1.2;
+ private static final double VERSION = 1.2;
- private final String namespace = SOAP_NAMESPACE;
+ private static final String NONE_ROLE = SOAP_NAMESPACE + "/role/none";
- private final String noneRole = namespace + "/role/none";
+ private static final String ULTIMATE_RECEIVER_ROLE = SOAP_NAMESPACE + "/role/ultimateReceiver";
- private final String ultimateReceiverRole = namespace + "/role/ultimateReceiver";
+ private static final String NEXT_ROLE = SOAP_NAMESPACE + "/role/next";
- private final String nextRole = namespace + "/role/next";
+ private static final String SOAP_ENCODING_STYLE = "http://www.w3.org/2003/05/soap-encoding";
- private final String soapEncodingStyle = "http://www.w3.org/2003/05/soap-encoding";
+ private final QName envelope = new QName(SOAP_NAMESPACE, "Envelope");
- private final QName envelope = new QName(namespace, "Envelope");
+ private final QName header = new QName(SOAP_NAMESPACE, "Header");
- private final QName header = new QName(namespace, "Header");
+ private final QName body = new QName(SOAP_NAMESPACE, "Body");
- private final QName body = new QName(namespace, "Body");
-
- private final QName fault = new QName(namespace, "Fault");
+ private final QName fault = new QName(SOAP_NAMESPACE, "Fault");
private Soap12() {
// Singleton
}
public static Soap12 getInstance() {
- return instance;
+ return INSTANCE;
}
public String getBindingId() {
return SoapBindingConstants.SOAP12_BINDING_ID;
}
public double getVersion() {
- return version;
+ return VERSION;
}
public String getNamespace() {
- return namespace;
+ return SOAP_NAMESPACE;
}
public QName getEnvelope() {
@@ -86,21 +84,21 @@ public final class Soap12 implements SoapVersion {
}
public String getSoapEncodingStyle() {
- return soapEncodingStyle;
+ return SOAP_ENCODING_STYLE;
}
// Role URIs
// -------------------------------------------------------------------------
public String getNoneRole() {
- return noneRole;
+ return NONE_ROLE;
}
public String getUltimateReceiverRole() {
- return ultimateReceiverRole;
+ return ULTIMATE_RECEIVER_ROLE;
}
public String getNextRole() {
- return nextRole;
+ return NEXT_ROLE;
}
public String getAttrNameRole() {
http://git-wip-us.apache.org/repos/asf/cxf/blob/bddf16d7/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
index 23d4048..64c3f75 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
@@ -222,7 +222,7 @@ public class MustUnderstandInterceptor extends AbstractSoapInterceptor {
/**
*
*/
- private class UltimateReceiverMustUnderstandInterceptor extends AbstractSoapInterceptor {
+ private static class UltimateReceiverMustUnderstandInterceptor extends AbstractSoapInterceptor {
Set<QName> knownHeaders;
UltimateReceiverMustUnderstandInterceptor(Set<QName> knownHeaders) {
super(Phase.INVOKE);
@@ -256,7 +256,7 @@ public class MustUnderstandInterceptor extends AbstractSoapInterceptor {
}
- public class MustUnderstandEndingInterceptor extends AbstractSoapInterceptor {
+ public static class MustUnderstandEndingInterceptor extends AbstractSoapInterceptor {
public MustUnderstandEndingInterceptor() {
super(Phase.PRE_LOGICAL);
addAfter(OneWayProcessorInterceptor.class.getName());
http://git-wip-us.apache.org/repos/asf/cxf/blob/bddf16d7/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java
index 7115468..61046ea 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java
@@ -86,8 +86,7 @@ public class SoapFaultFactory {
}
public String toString(Fault f) {
- SoapFault sf = (SoapFault)f;
- return sf.toString();
+ return f.toString();
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/bddf16d7/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
index 7486313..9c13637 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
@@ -294,7 +294,9 @@ public abstract class AbstractRequestAssertionConsumerHandler extends AbstractSS
throw new WebApplicationException(400);
}
- LOG.fine("Received response: " + DOM2Writer.nodeToString(responseDoc.getDocumentElement()));
+ if (LOG.isLoggable(Level.FINE)) {
+ LOG.fine("Received response: " + DOM2Writer.nodeToString(responseDoc.getDocumentElement()));
+ }
XMLObject responseObject = null;
try {
[07/30] cxf git commit: [CXF-7119] Optional propagation of the proxy
runtime exceptions without wrapping them into ProcessingEx
Posted by re...@apache.org.
[CXF-7119] Optional propagation of the proxy runtime exceptions without wrapping them into ProcessingEx
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/57649645
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/57649645
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/57649645
Branch: refs/heads/CXF-6882.nio
Commit: 57649645ce6592a23445b17be4fe64a25855db91
Parents: a43c1eb
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Fri Nov 25 19:59:24 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Fri Nov 25 19:59:24 2016 +0000
----------------------------------------------------------------------
.../apache/cxf/jaxrs/client/AbstractClient.java | 20 +++++++++++++-------
.../systest/jaxrs/CustomFaultInInterceptor.java | 18 +++++++++++++++---
.../jaxrs/JAXRSClientServerBookTest.java | 5 +++--
3 files changed, 31 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/57649645/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
index c8a76ba..b97483e 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
@@ -586,16 +586,22 @@ public abstract class AbstractClient implements Client {
protected void checkClientException(Message outMessage, Exception ex) throws Exception {
Throwable actualEx = ex instanceof Fault ? ((Fault)ex).getCause() : ex;
- Integer responseCode = getResponseCode(outMessage.getExchange());
+ Exchange exchange = outMessage.getExchange();
+ Integer responseCode = getResponseCode(exchange);
if (responseCode == null
- || actualEx instanceof IOException
- && outMessage.getExchange().get("client.redirect.exception") != null) {
+ || actualEx instanceof IOException && exchange.get("client.redirect.exception") != null) {
if (actualEx instanceof ProcessingException) {
- throw (ProcessingException)actualEx;
+ throw (RuntimeException)actualEx;
} else if (actualEx != null) {
- throw new ProcessingException(actualEx);
- } else if (!outMessage.getExchange().isOneWay() || cfg.isResponseExpectedForOneway()) {
- waitForResponseCode(outMessage.getExchange());
+ Object useProcExProp = exchange.get("wrap.in.processing.exception");
+ if (actualEx instanceof RuntimeException
+ && useProcExProp != null && PropertyUtils.isFalse(useProcExProp)) {
+ throw (Exception)actualEx;
+ } else {
+ throw new ProcessingException(actualEx);
+ }
+ } else if (!exchange.isOneWay() || cfg.isResponseExpectedForOneway()) {
+ waitForResponseCode(exchange);
}
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/57649645/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomFaultInInterceptor.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomFaultInInterceptor.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomFaultInInterceptor.java
index bd29c08..e86792a 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomFaultInInterceptor.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomFaultInInterceptor.java
@@ -26,16 +26,28 @@ import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
public class CustomFaultInInterceptor extends AbstractPhaseInterceptor<Message> {
- public CustomFaultInInterceptor() {
+ private boolean useProcEx;
+ public CustomFaultInInterceptor(boolean useProcEx) {
super(Phase.PRE_STREAM);
+ this.useProcEx = useProcEx;
}
public void handleMessage(Message message) throws Fault {
Exception ex = message.getContent(Exception.class);
- throw new ProcessingException(ex.getCause().getClass().getSimpleName()
+ String errorMessage = ex.getCause().getClass().getSimpleName()
+ ": Microservice at "
+ message.get(Message.REQUEST_URI)
- + " is not available");
+ + " is not available";
+ message.getExchange().put("wrap.in.processing.exception", useProcEx);
+ throw useProcEx ? new ProcessingException(new CustomRuntimeException(errorMessage))
+ : new CustomRuntimeException(errorMessage);
+ }
+ public static class CustomRuntimeException extends RuntimeException {
+ private static final long serialVersionUID = -4664563239685175537L;
+
+ public CustomRuntimeException(String errorMessage) {
+ super(errorMessage);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/57649645/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
index da1f046..b19dc6b 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
@@ -73,6 +73,7 @@ import org.apache.cxf.jaxrs.provider.XSLTJaxbProvider;
import org.apache.cxf.systest.jaxrs.BookStore.BookInfo;
import org.apache.cxf.systest.jaxrs.BookStore.BookInfoInterface;
import org.apache.cxf.systest.jaxrs.BookStore.BookNotReturnedException;
+import org.apache.cxf.systest.jaxrs.CustomFaultInInterceptor.CustomRuntimeException;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.junit.BeforeClass;
@@ -2645,11 +2646,11 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
public void testNonExistentWithGetCustomEx() throws Exception {
String address = "http://localhostt/bookstore";
BookStore c = JAXRSClientFactory.create(address, BookStore.class);
- WebClient.getConfig(c).getInFaultInterceptors().add(new CustomFaultInInterceptor());
+ WebClient.getConfig(c).getInFaultInterceptors().add(new CustomFaultInInterceptor(false));
try {
c.getBook("123");
fail("Exception expected");
- } catch (ProcessingException ex) {
+ } catch (CustomRuntimeException ex) {
assertEquals("UnknownHostException: Microservice at http://localhostt/bookstore/bookstore/books/123/"
+ " is not available", ex.getMessage());
}
[04/30] cxf git commit: Some issues in the core identified by findbugs
Posted by re...@apache.org.
Some issues in the core identified by findbugs
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8a605be6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8a605be6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8a605be6
Branch: refs/heads/CXF-6882.nio
Commit: 8a605be6dbf7810252cc60a4dc44b6fac7d2e2f9
Parents: dc28879
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Thu Nov 24 11:41:56 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Thu Nov 24 11:42:14 2016 +0000
----------------------------------------------------------------------
.../apache/cxf/attachment/AttachmentUtil.java | 4 ++--
.../cxf/attachment/ContentDisposition.java | 2 +-
.../jaxb/SchemaCollectionContextProxy.java | 7 +++---
.../apache/cxf/common/security/SimpleGroup.java | 2 +-
.../AbstractBPBeanDefinitionParser.java | 9 ++++----
.../databinding/source/XMLStreamDataReader.java | 2 +-
.../apache/cxf/feature/FastInfosetFeature.java | 12 +++++-----
.../transform/AbstractXSLTInterceptor.java | 8 +++----
.../java/org/apache/cxf/helpers/FileUtils.java | 23 +++++++++++---------
.../staxutils/PrettyPrintXMLStreamWriter.java | 2 +-
.../org/apache/cxf/staxutils/StaxUtils.java | 10 ++++-----
11 files changed, 42 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
index 5950d6c..79af3b1 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
@@ -176,7 +176,7 @@ public final class AttachmentUtil {
if (threshold instanceof Long) {
bos.setThreshold((Long)threshold);
} else {
- bos.setThreshold(Long.valueOf((String)threshold));
+ bos.setThreshold(Long.parseLong((String)threshold));
}
} else {
bos.setThreshold(AttachmentDeserializer.THRESHOLD);
@@ -187,7 +187,7 @@ public final class AttachmentUtil {
if (maxSize instanceof Long) {
bos.setMaxSize((Long) maxSize);
} else {
- bos.setMaxSize(Long.valueOf((String)maxSize));
+ bos.setMaxSize(Long.parseLong((String)maxSize));
}
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java
index 9ce30e9..2632e57 100644
--- a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java
+++ b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java
@@ -103,7 +103,7 @@ public class ContentDisposition {
while (matcher.find()) {
String matched = matcher.group();
if (matched.startsWith("&#")) {
- int codePoint = Integer.valueOf(matched.substring(2, 6));
+ int codePoint = Integer.parseInt(matched.substring(2, 6));
sb.append(Character.toChars(codePoint));
} else {
sb.append(matched.charAt(0));
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java b/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
index c5e7d65..5091235 100644
--- a/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
+++ b/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
@@ -126,10 +126,11 @@ public class SchemaCollectionContextProxy implements JAXBContextProxy {
public Object getBeanInfo(Class<?> cls) {
Class<?> origCls = cls;
- String postfix = "";
+ StringBuilder postfix = new StringBuilder();
+ postfix.append("");
while (cls.isArray()) {
cls = cls.getComponentType();
- postfix += "Array";
+ postfix.append("Array");
}
XmlRootElement xre = cls.getAnnotation(XmlRootElement.class);
String name = xre == null ? "##default" : xre.name();
@@ -149,7 +150,7 @@ public class SchemaCollectionContextProxy implements JAXBContextProxy {
namespace = defaultNamespace;
}
}
- final QName qname = new QName(namespace, name + postfix);
+ final QName qname = new QName(namespace, name + postfix.toString());
final XmlSchemaElement el = schemas.getElementByQName(qname);
XmlSchemaType type = null;
if (el != null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/common/security/SimpleGroup.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/security/SimpleGroup.java b/core/src/main/java/org/apache/cxf/common/security/SimpleGroup.java
index 1d39a5e..73b0d5c 100644
--- a/core/src/main/java/org/apache/cxf/common/security/SimpleGroup.java
+++ b/core/src/main/java/org/apache/cxf/common/security/SimpleGroup.java
@@ -82,7 +82,7 @@ public class SimpleGroup extends SimplePrincipal implements Group {
return false;
}
SimpleGroup other = (SimpleGroup)obj;
- return getName().equals(other.getName()) && members.equals(other.members);
+ return members.equals(other.members) && super.equals(obj);
}
public int hashCode() {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java b/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
index 1e34cf0..8b83053 100644
--- a/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
+++ b/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
@@ -336,12 +336,11 @@ public abstract class AbstractBPBeanDefinitionParser {
public Object createJAXBBean(String v) {
XMLStreamReader reader = StaxUtils.createXMLStreamReader(new StringReader(v));
try {
- Object o = JAXBUtils.unmarshall(ctx, reader, cls);
- if (o instanceof JAXBElement<?>) {
- JAXBElement<?> el = (JAXBElement<?>)o;
- o = el.getValue();
+ JAXBElement<?> el = JAXBUtils.unmarshall(ctx, reader, cls);
+ if (el != null) {
+ return el.getValue();
}
- return o;
+ return null;
} catch (JAXBException e) {
throw new RuntimeException(e);
} finally {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
index 092a841..5e1a056 100644
--- a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
+++ b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
@@ -316,7 +316,7 @@ public class XMLStreamDataReader implements DataReader<XMLStreamReader> {
}
}
- class NUllOutputStream extends OutputStream {
+ static class NUllOutputStream extends OutputStream {
public void write(byte[] b, int off, int len) {
}
public void write(int b) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/feature/FastInfosetFeature.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/feature/FastInfosetFeature.java b/core/src/main/java/org/apache/cxf/feature/FastInfosetFeature.java
index 38cc159..91bdc74 100644
--- a/core/src/main/java/org/apache/cxf/feature/FastInfosetFeature.java
+++ b/core/src/main/java/org/apache/cxf/feature/FastInfosetFeature.java
@@ -59,24 +59,24 @@ public class FastInfosetFeature extends AbstractFeature {
FIStaxOutInterceptor out = new FIStaxOutInterceptor(force);
if (serializerAttributeValueMapMemoryLimit != null && serializerAttributeValueMapMemoryLimit.intValue() > 0) {
- out.setSerializerAttributeValueMapMemoryLimit(serializerAttributeValueMapMemoryLimit.intValue());
+ out.setSerializerAttributeValueMapMemoryLimit(serializerAttributeValueMapMemoryLimit);
}
if (serializerMinAttributeValueSize != null && serializerMinAttributeValueSize.intValue() > 0) {
- out.setSerializerMinAttributeValueSize(serializerMinAttributeValueSize.intValue());
+ out.setSerializerMinAttributeValueSize(serializerMinAttributeValueSize);
}
if (serializerMaxAttributeValueSize != null && serializerMaxAttributeValueSize.intValue() > 0) {
- out.setSerializerMaxAttributeValueSize(serializerMaxAttributeValueSize.intValue());
+ out.setSerializerMaxAttributeValueSize(serializerMaxAttributeValueSize);
}
if (serializerCharacterContentChunkMapMemoryLimit != null
&& serializerCharacterContentChunkMapMemoryLimit.intValue() > 0) {
out.setSerializerCharacterContentChunkMapMemoryLimit(
- serializerCharacterContentChunkMapMemoryLimit.intValue());
+ serializerCharacterContentChunkMapMemoryLimit);
}
if (serializerMinCharacterContentChunkSize != null && serializerMinCharacterContentChunkSize.intValue() > 0) {
- out.setSerializerMinCharacterContentChunkSize(serializerMinCharacterContentChunkSize.intValue());
+ out.setSerializerMinCharacterContentChunkSize(serializerMinCharacterContentChunkSize);
}
if (serializerMaxCharacterContentChunkSize != null && serializerMaxCharacterContentChunkSize.intValue() > 0) {
- out.setSerializerMaxCharacterContentChunkSize(serializerMaxCharacterContentChunkSize.intValue());
+ out.setSerializerMaxCharacterContentChunkSize(serializerMaxCharacterContentChunkSize);
}
provider.getInInterceptors().add(in);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/feature/transform/AbstractXSLTInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/feature/transform/AbstractXSLTInterceptor.java b/core/src/main/java/org/apache/cxf/feature/transform/AbstractXSLTInterceptor.java
index 4259220..562e7b1 100644
--- a/core/src/main/java/org/apache/cxf/feature/transform/AbstractXSLTInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/feature/transform/AbstractXSLTInterceptor.java
@@ -72,12 +72,12 @@ public abstract class AbstractXSLTInterceptor extends AbstractPhaseInterceptor<M
xsltTemplate = TRANSFORM_FACTORY.newTemplates(new DOMSource(doc));
} catch (TransformerConfigurationException e) {
throw new IllegalArgumentException(
- String.format("Cannot create XSLT template from path: %s, error: ",
- xsltPath, e.getException()), e);
+ String.format("Cannot create XSLT template from path: %s",
+ xsltPath), e);
} catch (XMLStreamException e) {
throw new IllegalArgumentException(
- String.format("Cannot create XSLT template from path: %s, error: ",
- xsltPath, e.getNestedException()), e);
+ String.format("Cannot create XSLT template from path: %s",
+ xsltPath), e);
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/helpers/FileUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/helpers/FileUtils.java b/core/src/main/java/org/apache/cxf/helpers/FileUtils.java
index 59632e5..cdab0ab 100644
--- a/core/src/main/java/org/apache/cxf/helpers/FileUtils.java
+++ b/core/src/main/java/org/apache/cxf/helpers/FileUtils.java
@@ -377,16 +377,19 @@ public final class FileUtils {
Pattern pattern,
File exclude, boolean rec,
List<File> fileList) {
- for (File file : dir.listFiles()) {
- if (file.equals(exclude)) {
- continue;
- }
- if (file.isDirectory() && rec) {
- getFilesRecurse(file, pattern, exclude, rec, fileList);
- } else {
- Matcher m = pattern.matcher(file.getName());
- if (m.matches()) {
- fileList.add(file);
+ File[] files = dir.listFiles();
+ if (files != null) {
+ for (File file : dir.listFiles()) {
+ if (file.equals(exclude)) {
+ continue;
+ }
+ if (file.isDirectory() && rec) {
+ getFilesRecurse(file, pattern, exclude, rec, fileList);
+ } else {
+ Matcher m = pattern.matcher(file.getName());
+ if (m.matches()) {
+ fileList.add(file);
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/staxutils/PrettyPrintXMLStreamWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/staxutils/PrettyPrintXMLStreamWriter.java b/core/src/main/java/org/apache/cxf/staxutils/PrettyPrintXMLStreamWriter.java
index 0c34c96..73b5d0c 100644
--- a/core/src/main/java/org/apache/cxf/staxutils/PrettyPrintXMLStreamWriter.java
+++ b/core/src/main/java/org/apache/cxf/staxutils/PrettyPrintXMLStreamWriter.java
@@ -240,7 +240,7 @@ public class PrettyPrintXMLStreamWriter implements XMLStreamWriter {
}
- class CurrentElement {
+ static class CurrentElement {
private QName name;
private boolean hasChildElements;
http://git-wip-us.apache.org/repos/asf/cxf/blob/8a605be6/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
index eb68092..d307b04 100644
--- a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
+++ b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
@@ -814,7 +814,7 @@ public final class StaxUtils {
&& StringUtils.isEmpty(writer.getNamespaceContext().getNamespaceURI(""))) {
writeElementNS = false;
}
- while (it != null && it.hasNext()) {
+ while (it.hasNext()) {
String s = it.next();
if (s == null) {
s = "";
@@ -1182,7 +1182,7 @@ public final class StaxUtils {
Document doc = DOMUtils.createDocument();
if (reader.getLocation().getSystemId() != null) {
try {
- doc.setDocumentURI(new String(reader.getLocation().getSystemId()));
+ doc.setDocumentURI(reader.getLocation().getSystemId());
} catch (Exception e) {
//ignore - probably not DOM level 3
}
@@ -1197,7 +1197,7 @@ public final class StaxUtils {
Document doc = builder == null ? DOMUtils.createDocument() : builder.newDocument();
if (reader.getLocation().getSystemId() != null) {
try {
- doc.setDocumentURI(new String(reader.getLocation().getSystemId()));
+ doc.setDocumentURI(reader.getLocation().getSystemId());
} catch (Exception e) {
//ignore - probably not DOM level 3
}
@@ -1687,8 +1687,8 @@ public final class StaxUtils {
node.setAttributeNodeNS(attr);
}
public static XMLStreamReader createXMLStreamReader(InputSource src) {
- String sysId = src.getSystemId() == null ? null : new String(src.getSystemId());
- String pubId = src.getPublicId() == null ? null : new String(src.getPublicId());
+ String sysId = src.getSystemId() == null ? null : src.getSystemId();
+ String pubId = src.getPublicId() == null ? null : src.getPublicId();
if (src.getByteStream() != null) {
if (src.getEncoding() == null) {
StreamSource ss = new StreamSource(src.getByteStream(), sysId);
[20/30] cxf git commit: Adding a 'resource_uris' extension prop to
the OAuth2 dyn reg request
Posted by re...@apache.org.
Adding a 'resource_uris' extension prop to the OAuth2 dyn reg request
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8d0e9776
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8d0e9776
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8d0e9776
Branch: refs/heads/CXF-6882.nio
Commit: 8d0e9776201dcf2e53ae3a9bd004669c403266df
Parents: 8d725cb
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Dec 1 10:23:58 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Dec 1 10:23:58 2016 +0000
----------------------------------------------------------------------
.../security/oauth2/services/ClientRegistration.java | 15 ++++++++++++++-
.../oauth2/services/DynamicRegistrationService.java | 9 +++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/8d0e9776/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ClientRegistration.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ClientRegistration.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ClientRegistration.java
index d81a623..ef933a2 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ClientRegistration.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ClientRegistration.java
@@ -38,7 +38,12 @@ public class ClientRegistration extends JsonMapObject {
public static final String TOS_URI = "tos_uri";
public static final String TOKEN_ENDPOINT_AUTH_METHOD = "token_endpoint_auth_method";
public static final String SCOPE = OAuthConstants.SCOPE;
-
+ // Extension - an array of resource audiences, the name is based on combining
+ // a property 'resource' (the resource indicators draft) and "_uris", similar to
+ // a "redirect_uris" property. This property name may change in the future.
+ public static final String RESOURCE_URIS = "resource_uris";
+
+
private static final long serialVersionUID = 7903976943604132150L;
public ClientRegistration() {
@@ -54,6 +59,14 @@ public class ClientRegistration extends JsonMapObject {
public List<String> getRedirectUris() {
return getListStringProperty(REDIRECT_URIS);
}
+
+ public void setResourceUris(List<String> redirectUris) {
+ super.setProperty(RESOURCE_URIS, redirectUris);
+ }
+ public List<String> getResourceUris() {
+ return getListStringProperty(RESOURCE_URIS);
+ }
+
public void setResponseTypes(List<String> responseTypes) {
super.setProperty(RESPONSE_TYPES, responseTypes);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8d0e9776/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java
index d8d5c59..8a8dd93 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java
@@ -160,6 +160,9 @@ public class DynamicRegistrationService {
if (c.getApplicationLogoUri() != null) {
reg.setLogoUri(c.getApplicationLogoUri());
}
+ if (!c.getRegisteredAudiences().isEmpty()) {
+ reg.setResourceUris(c.getRegisteredAudiences());
+ }
//etc
return reg;
}
@@ -230,6 +233,12 @@ public class DynamicRegistrationService {
newClient.setRedirectUris(redirectUris);
}
+ // Client Resource Audience URIs
+ List<String> resourceUris = request.getResourceUris();
+ if (resourceUris != null) {
+ newClient.setRegisteredAudiences(resourceUris);
+ }
+
// Client Scopes
String scope = request.getScope();
if (!StringUtils.isEmpty(scope)) {
[09/30] cxf git commit: [CXF-7137] Adding a Map of
SecuritySchemeDefinitions property
Posted by re...@apache.org.
[CXF-7137] Adding a Map of SecuritySchemeDefinitions property
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f4252d0f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f4252d0f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f4252d0f
Branch: refs/heads/CXF-6882.nio
Commit: f4252d0f7e66ec30bd3543edcd356697622b07e5
Parents: 2ac4094
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Mon Nov 28 11:08:53 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Mon Nov 28 11:08:53 2016 +0000
----------------------------------------------------------------------
.../org/apache/cxf/jaxrs/swagger/Swagger2Feature.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/f4252d0f/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
index b417927..7dbda71 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
@@ -69,6 +69,8 @@ import io.swagger.jaxrs.config.DefaultReaderConfig;
import io.swagger.jaxrs.config.ReaderConfig;
import io.swagger.jaxrs.config.SwaggerContextService;
import io.swagger.jaxrs.listing.ApiListingResource;
+import io.swagger.models.Swagger;
+import io.swagger.models.auth.SecuritySchemeDefinition;
@Provider(value = Type.Feature, scope = Scope.Server)
public class Swagger2Feature extends AbstractSwaggerFeature {
@@ -94,6 +96,8 @@ public class Swagger2Feature extends AbstractSwaggerFeature {
private boolean dynamicBasePath;
+ private Map<String, SecuritySchemeDefinition> securityDefinitions;
+
@Override
protected void calculateDefaultBasePath(Server server) {
dynamicBasePath = true;
@@ -191,6 +195,11 @@ public class Swagger2Feature extends AbstractSwaggerFeature {
beanConfig.setPrettyPrint(isPrettyPrint());
beanConfig.setFilterClass(getFilterClass());
+ Swagger swagger = beanConfig.getSwagger();
+ if (swagger != null && securityDefinitions != null) {
+ swagger.setSecurityDefinitions(securityDefinitions);
+ }
+
swagger2Serializers.setBeanConfig(beanConfig);
}
@@ -270,6 +279,10 @@ public class Swagger2Feature extends AbstractSwaggerFeature {
this.swaggerUiMediaTypes = swaggerUiMediaTypes;
}
+ public void setSecurityDefinitions(Map<String, SecuritySchemeDefinition> securityDefinitions) {
+ this.securityDefinitions = securityDefinitions;
+ }
+
private class ServletConfigProvider implements ContextProvider<ServletConfig> {
@Override
[03/30] cxf git commit: Fix body writer error reporting message,
patch from Michail Nikolaev applied, This closes #205
Posted by re...@apache.org.
Fix body writer error reporting message, patch from Michail Nikolaev applied, This closes #205
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/dc288794
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/dc288794
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/dc288794
Branch: refs/heads/CXF-6882.nio
Commit: dc2887948146bd0b27089e5c8f7ac9c38790ca74
Parents: 897e71a
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Nov 24 11:19:25 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Nov 24 11:20:16 2016 +0000
----------------------------------------------------------------------
.../src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/dc288794/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
index 82e30a6..c8a76ba 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
@@ -794,7 +794,7 @@ public abstract class AbstractClient implements Client {
}
protected static void reportMessageHandlerProblem(String name, Class<?> cls, MediaType ct, Throwable ex) {
- String errorMessage = JAXRSUtils.logMessageHandlerProblem("NO_MSG_WRITER", cls, ct);
+ String errorMessage = JAXRSUtils.logMessageHandlerProblem(name, cls, ct);
Throwable actualEx = ex instanceof Fault ? ((Fault)ex).getCause() : ex;
throw new ProcessingException(errorMessage, actualEx);
}
[08/30] cxf git commit: [CXF-7155] Close CachedOutputStream when
response is written to the output stream, patch from Alexander Onnikov applied,
This closes #207
Posted by re...@apache.org.
[CXF-7155] Close CachedOutputStream when response is written to the output stream, patch from Alexander Onnikov applied, This closes #207
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2ac40942
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2ac40942
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2ac40942
Branch: refs/heads/CXF-6882.nio
Commit: 2ac40942fe097b666610e95c0a06b2d0f85e84b7
Parents: 5764964
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Sun Nov 27 18:43:26 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Sun Nov 27 18:44:56 2016 +0000
----------------------------------------------------------------------
.../org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/2ac40942/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
index 9506f8d..9ee4c7d 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
@@ -256,6 +256,10 @@ public class JAXRSOutInterceptor extends AbstractOutDatabindingInterceptor {
checkCachedStream(message, outOriginal, enabled);
} finally {
if (enabled) {
+ OutputStream os = message.getContent(OutputStream.class);
+ if (os != outOriginal && os instanceof CachedOutputStream) {
+ os.close();
+ }
message.setContent(OutputStream.class, outOriginal);
message.put(XMLStreamWriter.class.getName(), null);
}
[18/30] cxf git commit: [CXF-7152] More FormResponse work
Posted by re...@apache.org.
[CXF-7152] More FormResponse work
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5b6b0947
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5b6b0947
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5b6b0947
Branch: refs/heads/CXF-6882.nio
Commit: 5b6b0947a07a4bc6962d1069afbc4bbc28a19e55
Parents: bddf16d
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Wed Nov 30 16:25:58 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Wed Nov 30 16:25:58 2016 +0000
----------------------------------------------------------------------
.../common/AbstractAuthorizationResponse.java | 41 ++++++++
.../common/AbstractFormImplicitResponse.java | 48 ++++++++++
.../common/FormAuthorizationResponse.java | 40 ++++++++
.../oauth2/common/FormTokenResponse.java | 50 ++++++++++
.../oauth2/common/OOBAuthorizationResponse.java | 29 +-----
.../services/AbstractImplicitGrantService.java | 98 ++++++++++++++------
.../services/AuthorizationCodeGrantService.java | 30 +++---
.../services/RedirectionBasedGrantService.java | 8 ++
.../security/oidc/idp/FormHybridResponse.java | 42 +++++++++
.../security/oidc/idp/FormIdTokenResponse.java | 33 +++++++
.../rs/security/oidc/idp/OidcHybridService.java | 56 +++++++++--
.../security/oidc/idp/OidcImplicitService.java | 28 +++++-
12 files changed, 421 insertions(+), 82 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractAuthorizationResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractAuthorizationResponse.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractAuthorizationResponse.java
new file mode 100644
index 0000000..eaf46f4
--- /dev/null
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractAuthorizationResponse.java
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.rs.security.oauth2.common;
+
+
+public abstract class AbstractAuthorizationResponse {
+ private String authorizationCode;
+ private long expiresIn;
+ public String getAuthorizationCode() {
+ return authorizationCode;
+ }
+
+ public void setAuthorizationCode(String authorizationCode) {
+ this.authorizationCode = authorizationCode;
+ }
+
+
+ public long getExpiresIn() {
+ return expiresIn;
+ }
+
+ public void setExpiresIn(long lifetime) {
+ this.expiresIn = lifetime;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractFormImplicitResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractFormImplicitResponse.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractFormImplicitResponse.java
new file mode 100644
index 0000000..3fa841f
--- /dev/null
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/AbstractFormImplicitResponse.java
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.rs.security.oauth2.common;
+
+
+public abstract class AbstractFormImplicitResponse {
+ private String responseType;
+ private String redirectUri;
+ private String state;
+ public String getRedirectUri() {
+ return redirectUri;
+ }
+
+ public void setRedirectUri(String redirectUri) {
+ this.redirectUri = redirectUri;
+ }
+
+ public String getResponseType() {
+ return responseType;
+ }
+
+ public void setResponseType(String responseType) {
+ this.responseType = responseType;
+ }
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/FormAuthorizationResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/FormAuthorizationResponse.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/FormAuthorizationResponse.java
new file mode 100644
index 0000000..5ba6364
--- /dev/null
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/FormAuthorizationResponse.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.rs.security.oauth2.common;
+
+
+public class FormAuthorizationResponse extends AbstractAuthorizationResponse {
+ private String redirectUri;
+ private String state;
+ public String getRedirectUri() {
+ return redirectUri;
+ }
+
+ public void setRedirectUri(String redirectUri) {
+ this.redirectUri = redirectUri;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/FormTokenResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/FormTokenResponse.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/FormTokenResponse.java
new file mode 100644
index 0000000..459da82
--- /dev/null
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/FormTokenResponse.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.rs.security.oauth2.common;
+
+
+public class FormTokenResponse extends AbstractFormImplicitResponse {
+ private String accessToken;
+ private String accessTokenType;
+ private long accessTokenExpiresIn;
+
+ public String getAccessToken() {
+ return accessToken;
+ }
+
+ public void setAccessToken(String accessToken) {
+ this.accessToken = accessToken;
+ }
+
+ public String getAccessTokenType() {
+ return accessTokenType;
+ }
+
+ public void setAccessTokenType(String accessTokenType) {
+ this.accessTokenType = accessTokenType;
+ }
+
+ public long getAccessTokenExpiresIn() {
+ return accessTokenExpiresIn;
+ }
+
+ public void setAccessTokenExpiresIn(long accessTokenExpiresIn) {
+ this.accessTokenExpiresIn = accessTokenExpiresIn;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OOBAuthorizationResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OOBAuthorizationResponse.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OOBAuthorizationResponse.java
index 673c2b0..6220258 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OOBAuthorizationResponse.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OOBAuthorizationResponse.java
@@ -19,21 +19,10 @@
package org.apache.cxf.rs.security.oauth2.common;
-public class OOBAuthorizationResponse {
- private String authorizationCode;
+public class OOBAuthorizationResponse extends AbstractAuthorizationResponse {
private String clientId;
private String clientDescription;
private String userId;
- private long expiresIn;
- private String redirectUri;
- public String getAuthorizationCode() {
- return authorizationCode;
- }
-
- public void setAuthorizationCode(String authorizationCode) {
- this.authorizationCode = authorizationCode;
- }
-
public String getClientId() {
return clientId;
}
@@ -50,14 +39,7 @@ public class OOBAuthorizationResponse {
this.userId = userId;
}
- public long getExpiresIn() {
- return expiresIn;
- }
-
- public void setExpiresIn(long lifetime) {
- this.expiresIn = lifetime;
- }
-
+
public String getClientDescription() {
return clientDescription;
}
@@ -66,12 +48,5 @@ public class OOBAuthorizationResponse {
this.clientDescription = clientDescription;
}
- public String getRedirectUri() {
- return redirectUri;
- }
-
- public void setRedirectUri(String redirectUri) {
- this.redirectUri = redirectUri;
- }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
index 0beae41..75966fb 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
@@ -31,9 +31,11 @@ import javax.ws.rs.core.Response;
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.jaxrs.utils.HttpUtils;
import org.apache.cxf.jaxrs.utils.JAXRSUtils;
+import org.apache.cxf.rs.security.oauth2.common.AbstractFormImplicitResponse;
import org.apache.cxf.rs.security.oauth2.common.AccessTokenRegistration;
import org.apache.cxf.rs.security.oauth2.common.Client;
import org.apache.cxf.rs.security.oauth2.common.ClientAccessToken;
+import org.apache.cxf.rs.security.oauth2.common.FormTokenResponse;
import org.apache.cxf.rs.security.oauth2.common.OAuthRedirectionState;
import org.apache.cxf.rs.security.oauth2.common.ServerAccessToken;
import org.apache.cxf.rs.security.oauth2.common.UserSubject;
@@ -57,41 +59,30 @@ public abstract class AbstractImplicitGrantService extends RedirectionBasedGrant
}
protected Response createGrant(OAuthRedirectionState state,
- Client client,
- List<String> requestedScope,
- List<String> approvedScope,
- UserSubject userSubject,
- ServerAccessToken preAuthorizedToken) {
- StringBuilder sb =
- prepareGrant(state, client, requestedScope, approvedScope, userSubject, preAuthorizedToken);
- return Response.seeOther(URI.create(sb.toString())).build();
-
- }
- protected StringBuilder prepareGrant(OAuthRedirectionState state,
Client client,
List<String> requestedScope,
List<String> approvedScope,
UserSubject userSubject,
ServerAccessToken preAuthorizedToken) {
-
- ServerAccessToken token = null;
- if (preAuthorizedToken == null) {
- AccessTokenRegistration reg = createTokenRegistration(state,
- client,
- requestedScope,
- approvedScope,
- userSubject);
- token = getDataProvider().createAccessToken(reg);
+ if (isFormResponse(state)) {
+ return createHtmlResponse(prepareFormResponse(state, client, requestedScope,
+ approvedScope, userSubject, preAuthorizedToken));
} else {
- token = preAuthorizedToken;
- if (state.getNonce() != null) {
- JAXRSUtils.getCurrentMessage().getExchange().put(OAuthConstants.NONCE, state.getNonce());
- }
+ StringBuilder sb =
+ prepareRedirectResponse(state, client, requestedScope, approvedScope, userSubject, preAuthorizedToken);
+ return Response.seeOther(URI.create(sb.toString())).build();
}
+ }
+
+ protected StringBuilder prepareRedirectResponse(OAuthRedirectionState state,
+ Client client,
+ List<String> requestedScope,
+ List<String> approvedScope,
+ UserSubject userSubject,
+ ServerAccessToken preAuthorizedToken) {
- ClientAccessToken clientToken = OAuthUtils.toClientAccessToken(token, isWriteOptionalParameters());
- processClientAccessToken(clientToken, token);
-
+ ClientAccessToken clientToken =
+ getClientAccessToken(state, client, requestedScope, approvedScope, userSubject, preAuthorizedToken);
// return the token by appending it as a fragment parameter to the redirect URI
StringBuilder sb = getUriWithFragment(state.getRedirectUri());
@@ -111,14 +102,61 @@ public abstract class AbstractImplicitGrantService extends RedirectionBasedGrant
sb.append("&").append(entry.getKey()).append("=").append(HttpUtils.queryEncode(entry.getValue()));
}
}
- if (token.getRefreshToken() != null) {
- processRefreshToken(sb, token.getRefreshToken());
+ if (clientToken.getRefreshToken() != null) {
+ processRefreshToken(sb, clientToken.getRefreshToken());
}
-
+
finalizeResponse(sb, state);
return sb;
}
+ protected AbstractFormImplicitResponse prepareFormResponse(OAuthRedirectionState state,
+ Client client,
+ List<String> requestedScope,
+ List<String> approvedScope,
+ UserSubject userSubject,
+ ServerAccessToken preAuthorizedToken) {
+
+ ClientAccessToken clientToken =
+ getClientAccessToken(state, client, requestedScope, approvedScope, userSubject, preAuthorizedToken);
+
+ FormTokenResponse bean = new FormTokenResponse();
+ bean.setResponseType(OAuthConstants.TOKEN_RESPONSE_TYPE);
+ bean.setRedirectUri(state.getRedirectUri());
+ bean.setState(state.getState());
+ bean.setAccessToken(clientToken.getTokenKey());
+ bean.setAccessTokenType(clientToken.getTokenType());
+ bean.setAccessTokenExpiresIn(clientToken.getExpiresIn());
+ return bean;
+ }
+
+ protected ClientAccessToken getClientAccessToken(OAuthRedirectionState state,
+ Client client,
+ List<String> requestedScope,
+ List<String> approvedScope,
+ UserSubject userSubject,
+ ServerAccessToken preAuthorizedToken) {
+
+ ServerAccessToken token = null;
+ if (preAuthorizedToken == null) {
+ AccessTokenRegistration reg = createTokenRegistration(state,
+ client,
+ requestedScope,
+ approvedScope,
+ userSubject);
+ token = getDataProvider().createAccessToken(reg);
+ } else {
+ token = preAuthorizedToken;
+ if (state.getNonce() != null) {
+ JAXRSUtils.getCurrentMessage().getExchange().put(OAuthConstants.NONCE, state.getNonce());
+ }
+ }
+
+ ClientAccessToken clientToken = OAuthUtils.toClientAccessToken(token, isWriteOptionalParameters());
+ processClientAccessToken(clientToken, token);
+ return clientToken;
+ }
+
protected AccessTokenRegistration createTokenRegistration(OAuthRedirectionState state,
Client client,
List<String> requestedScope,
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
index 3b14da1..27c744b 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
@@ -22,12 +22,12 @@ package org.apache.cxf.rs.security.oauth2.services;
import java.util.List;
import javax.ws.rs.Path;
-import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import org.apache.cxf.rs.security.oauth2.common.Client;
+import org.apache.cxf.rs.security.oauth2.common.FormAuthorizationResponse;
import org.apache.cxf.rs.security.oauth2.common.OAuthAuthorizationData;
import org.apache.cxf.rs.security.oauth2.common.OAuthPermission;
import org.apache.cxf.rs.security.oauth2.common.OAuthRedirectionState;
@@ -104,17 +104,21 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService
return createErrorResponse(state.getState(), state.getRedirectUri(), OAuthConstants.ACCESS_DENIED);
}
String grantCode = processCodeGrant(client, grant.getCode(), grant.getSubject());
- if (state.getRedirectUri() == null
- || OAuthConstants.FORM_RESPONSE_MODE.equals(
- state.getExtraProperties().get(OAuthConstants.RESPONSE_MODE))) {
- OOBAuthorizationResponse oobResponse = new OOBAuthorizationResponse();
- oobResponse.setClientId(client.getClientId());
- oobResponse.setClientDescription(client.getApplicationDescription());
- oobResponse.setAuthorizationCode(grantCode);
- oobResponse.setUserId(userSubject.getLogin());
- oobResponse.setExpiresIn(grant.getExpiresIn());
- oobResponse.setRedirectUri(state.getRedirectUri());
- return deliverOOBResponse(oobResponse);
+ if (state.getRedirectUri() == null) {
+ OOBAuthorizationResponse bean = new OOBAuthorizationResponse();
+ bean.setClientId(client.getClientId());
+ bean.setClientDescription(client.getApplicationDescription());
+ bean.setAuthorizationCode(grantCode);
+ bean.setUserId(userSubject.getLogin());
+ bean.setExpiresIn(grant.getExpiresIn());
+ return deliverOOBResponse((OOBAuthorizationResponse)bean);
+ } else if (isFormResponse(state)) {
+ FormAuthorizationResponse bean = new FormAuthorizationResponse();
+ bean.setAuthorizationCode(grantCode);
+ bean.setExpiresIn(grant.getExpiresIn());
+ bean.setState(state.getState());
+ bean.setRedirectUri(state.getRedirectUri());
+ return createHtmlResponse(bean);
} else {
// return the code by appending it as a query parameter to the redirect URI
UriBuilder ub = getRedirectUriBuilder(state.getState(), state.getRedirectUri());
@@ -174,7 +178,7 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService
if (oobDeliverer != null) {
return oobDeliverer.deliver(response);
} else {
- return Response.ok(response).type(MediaType.TEXT_HTML).build();
+ return createHtmlResponse(response);
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
index d336a09..1ab30b8 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
@@ -31,6 +31,7 @@ import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
@@ -528,6 +529,13 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
return client;
}
+ protected Response createHtmlResponse(Object response) {
+ return Response.ok(response).type(MediaType.TEXT_HTML).build();
+ }
+ protected boolean isFormResponse(OAuthRedirectionState state) {
+ return OAuthConstants.FORM_RESPONSE_MODE.equals(
+ state.getExtraProperties().get(OAuthConstants.RESPONSE_MODE));
+ }
protected String getSupportedGrantType() {
return this.supportedGrantType;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormHybridResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormHybridResponse.java b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormHybridResponse.java
new file mode 100644
index 0000000..5ca8223
--- /dev/null
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormHybridResponse.java
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.rs.security.oidc.idp;
+
+import org.apache.cxf.rs.security.oauth2.common.AbstractFormImplicitResponse;
+
+public class FormHybridResponse extends AbstractFormImplicitResponse {
+ private AbstractFormImplicitResponse implicitResponse;
+ private String code;
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public AbstractFormImplicitResponse getImplicitResponse() {
+ return implicitResponse;
+ }
+
+ public void setImplicitResponse(AbstractFormImplicitResponse implicitResponse) {
+ this.implicitResponse = implicitResponse;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormIdTokenResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormIdTokenResponse.java b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormIdTokenResponse.java
new file mode 100644
index 0000000..8b53a1b
--- /dev/null
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/FormIdTokenResponse.java
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.rs.security.oidc.idp;
+
+import org.apache.cxf.rs.security.oauth2.common.AbstractFormImplicitResponse;
+
+public class FormIdTokenResponse extends AbstractFormImplicitResponse {
+ private String idToken;
+
+ public String getIdToken() {
+ return idToken;
+ }
+
+ public void setIdToken(String idToken) {
+ this.idToken = idToken;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcHybridService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcHybridService.java b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcHybridService.java
index c7dca0f..708ad0a 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcHybridService.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcHybridService.java
@@ -27,6 +27,7 @@ import java.util.Set;
import javax.ws.rs.Path;
import org.apache.cxf.jaxrs.utils.JAXRSUtils;
+import org.apache.cxf.rs.security.oauth2.common.AbstractFormImplicitResponse;
import org.apache.cxf.rs.security.oauth2.common.Client;
import org.apache.cxf.rs.security.oauth2.common.OAuthRedirectionState;
import org.apache.cxf.rs.security.oauth2.common.ServerAccessToken;
@@ -67,21 +68,16 @@ public class OidcHybridService extends OidcImplicitService {
}
@Override
- protected StringBuilder prepareGrant(OAuthRedirectionState state,
+ protected StringBuilder prepareRedirectResponse(OAuthRedirectionState state,
Client client,
List<String> requestedScope,
List<String> approvedScope,
UserSubject userSubject,
ServerAccessToken preAuthorizedToken) {
- ServerAuthorizationCodeGrant codeGrant = null;
- if (state.getResponseType() != null && state.getResponseType().startsWith(OAuthConstants.CODE_RESPONSE_TYPE)) {
- codeGrant = codeService.getGrantRepresentation(
- state, client, requestedScope, approvedScope, userSubject, preAuthorizedToken);
- JAXRSUtils.getCurrentMessage().getExchange().put(OAuthConstants.AUTHORIZATION_CODE_VALUE,
- codeGrant.getCode());
- }
+ ServerAuthorizationCodeGrant codeGrant = prepareHybrideCode(
+ state, client, requestedScope, approvedScope, userSubject, preAuthorizedToken);
- StringBuilder sb = super.prepareGrant(state, client, requestedScope,
+ StringBuilder sb = super.prepareRedirectResponse(state, client, requestedScope,
approvedScope, userSubject, preAuthorizedToken);
if (codeGrant != null) {
@@ -91,7 +87,47 @@ public class OidcHybridService extends OidcImplicitService {
return sb;
}
-
+ @Override
+ protected AbstractFormImplicitResponse prepareFormResponse(OAuthRedirectionState state,
+ Client client,
+ List<String> requestedScope,
+ List<String> approvedScope,
+ UserSubject userSubject,
+ ServerAccessToken preAuthorizedToken) {
+ ServerAuthorizationCodeGrant codeGrant = prepareHybrideCode(
+ state, client, requestedScope, approvedScope, userSubject, preAuthorizedToken);
+
+ AbstractFormImplicitResponse implResp = super.prepareFormResponse(state, client, requestedScope,
+ approvedScope, userSubject, preAuthorizedToken);
+
+ FormHybridResponse response = new FormHybridResponse();
+ response.setResponseType(state.getResponseType());
+ response.setRedirectUri(state.getRedirectUri());
+ response.setState(state.getState());
+ response.setImplicitResponse(implResp);
+ if (codeGrant != null) {
+ response.setCode(codeGrant.getCode());
+ }
+ return response;
+ }
+
+
+ protected ServerAuthorizationCodeGrant prepareHybrideCode(OAuthRedirectionState state,
+ Client client,
+ List<String> requestedScope,
+ List<String> approvedScope,
+ UserSubject userSubject,
+ ServerAccessToken preAuthorizedToken) {
+ ServerAuthorizationCodeGrant codeGrant = null;
+ if (state.getResponseType() != null && state.getResponseType().startsWith(OAuthConstants.CODE_RESPONSE_TYPE)) {
+ codeGrant = codeService.getGrantRepresentation(
+ state, client, requestedScope, approvedScope, userSubject, preAuthorizedToken);
+ JAXRSUtils.getCurrentMessage().getExchange().put(OAuthConstants.AUTHORIZATION_CODE_VALUE,
+ codeGrant.getCode());
+ }
+ return codeGrant;
+ }
+
public void setCodeService(OidcAuthorizationCodeService codeService) {
this.codeService = codeService;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/5b6b0947/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcImplicitService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcImplicitService.java b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcImplicitService.java
index b5b2a6c..936f787 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcImplicitService.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcImplicitService.java
@@ -33,6 +33,7 @@ import org.apache.cxf.jaxrs.utils.JAXRSUtils;
import org.apache.cxf.rs.security.jose.jwa.SignatureAlgorithm;
import org.apache.cxf.rs.security.jose.jws.JwsUtils;
import org.apache.cxf.rs.security.jose.jwt.JwtToken;
+import org.apache.cxf.rs.security.oauth2.common.AbstractFormImplicitResponse;
import org.apache.cxf.rs.security.oauth2.common.Client;
import org.apache.cxf.rs.security.oauth2.common.OAuthError;
import org.apache.cxf.rs.security.oauth2.common.OAuthPermission;
@@ -114,7 +115,7 @@ public class OidcImplicitService extends ImplicitGrantService {
}
@Override
- protected StringBuilder prepareGrant(OAuthRedirectionState state,
+ protected StringBuilder prepareRedirectResponse(OAuthRedirectionState state,
Client client,
List<String> requestedScope,
List<String> approvedScope,
@@ -122,7 +123,8 @@ public class OidcImplicitService extends ImplicitGrantService {
ServerAccessToken preAuthorizedToken) {
if (canAccessTokenBeReturned(state.getResponseType())) {
- return super.prepareGrant(state, client, requestedScope, approvedScope, userSubject, preAuthorizedToken);
+ return super.prepareRedirectResponse(state, client, requestedScope, approvedScope,
+ userSubject, preAuthorizedToken);
}
// id_token response type processing
@@ -137,6 +139,28 @@ public class OidcImplicitService extends ImplicitGrantService {
return sb;
}
+ @Override
+ protected AbstractFormImplicitResponse prepareFormResponse(OAuthRedirectionState state,
+ Client client,
+ List<String> requestedScope,
+ List<String> approvedScope,
+ UserSubject userSubject,
+ ServerAccessToken preAuthorizedToken) {
+ if (canAccessTokenBeReturned(state.getResponseType())) {
+ return super.prepareFormResponse(state, client, requestedScope, approvedScope,
+ userSubject, preAuthorizedToken);
+ }
+ // id_token response type processing
+ String idToken = getProcessedIdToken(state, userSubject,
+ getApprovedScope(requestedScope, approvedScope));
+ FormIdTokenResponse response = new FormIdTokenResponse();
+ response.setIdToken(idToken);
+ response.setResponseType(state.getResponseType());
+ response.setRedirectUri(state.getRedirectUri());
+ response.setState(state.getState());
+ return response;
+ }
+
private String getProcessedIdToken(OAuthRedirectionState state,
UserSubject subject,
List<String> scopes) {
[06/30] cxf git commit: CXF-7124 Fix PackageUtils bug
Posted by re...@apache.org.
CXF-7124 Fix PackageUtils bug
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a43c1eb0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a43c1eb0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a43c1eb0
Branch: refs/heads/CXF-6882.nio
Commit: a43c1eb0034c20399fd6a9371dbe8aa680e2402d
Parents: 970080f
Author: Neal Hu <hu...@tops001.com>
Authored: Fri Nov 25 23:59:59 2016 +0800
Committer: Neal Hu <hu...@tops001.com>
Committed: Fri Nov 25 23:59:59 2016 +0800
----------------------------------------------------------------------
.../main/java/org/apache/cxf/common/util/PackageUtils.java | 2 ++
.../java/org/apache/cxf/common/util/PackageUtilsTest.java | 7 +++++++
2 files changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/a43c1eb0/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
index 9ff5510..cd5b306 100644
--- a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
@@ -67,6 +67,8 @@ public final class PackageUtils {
}
if (j == lParts.size()) {
currentParts.add(lParts.get(j - 1).get(i));
+ } else {
+ break;
}
}
StringBuilder sb = new StringBuilder();
http://git-wip-us.apache.org/repos/asf/cxf/blob/a43c1eb0/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
index f4401f6..03ad66d 100644
--- a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
@@ -93,4 +93,11 @@ public class PackageUtilsTest extends Assert {
org.apache.cxf.common.jaxb.JAXBContextCache.class));
assertEquals("", packageName);
}
+ @Test
+ public void testSharedPackageNameManyClassesCommonRoot6() {
+ String packageName = PackageUtils.getSharedPackageName(
+ Arrays.asList(org.apache.cxf.bus.spring.BusApplicationContext.class,
+ org.apache.cxf.configuration.spring.JAXBBeanFactory.class));
+ assertEquals("org.apache.cxf", packageName);
+ }
}
[16/30] cxf git commit: Prototyping a UserAplication model bean
Posted by re...@apache.org.
Prototyping a UserAplication model bean
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e0c3ed7c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e0c3ed7c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e0c3ed7c
Branch: refs/heads/CXF-6882.nio
Commit: e0c3ed7c11a68a9395df811465066b250e87b255
Parents: 5954d4c
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Tue Nov 29 17:18:46 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Tue Nov 29 17:18:46 2016 +0000
----------------------------------------------------------------------
.../apache/cxf/jaxrs/model/UserApplication.java | 65 ++++++++++++++++++++
1 file changed, 65 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/e0c3ed7c/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/UserApplication.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/UserApplication.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/UserApplication.java
new file mode 100644
index 0000000..404416d
--- /dev/null
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/UserApplication.java
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxrs.model;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class UserApplication {
+
+ private String name;
+ private List<UserResource> resources;
+
+ public UserApplication() {
+ }
+
+ public UserApplication(String name) {
+ this(name, null);
+ }
+ public UserApplication(String name, List<UserResource> resources) {
+ this.name = name;
+ this.resources = resources;
+ }
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setResources(List<UserResource> resources) {
+ this.resources = resources;
+ }
+
+ public List<UserResource> getResources() {
+ return resources;
+ }
+
+ public Map<String, UserResource> getResourcesAsMap() {
+ Map<String, UserResource> map = new HashMap<String, UserResource>();
+ if (resources != null) {
+ for (UserResource r : resources) {
+ map.put(r.getName(), r);
+ }
+ }
+ return map;
+ }
+}