cxf-fediz git commit: Wrapping the collection of clients to make it simpler to manage multiple views for a single path

2016-01-29 Thread sergeyb
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 10b9246ae -> 11826312b


Wrapping the collection of clients to make it simpler to manage multiple views 
for a single path


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/11826312
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/11826312
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/11826312

Branch: refs/heads/master
Commit: 11826312ba5e2be08f457814655efe2460e79578
Parents: 10b9246
Author: Sergey Beryozkin 
Authored: Fri Jan 29 13:51:57 2016 +
Committer: Sergey Beryozkin 
Committed: Fri Jan 29 13:51:57 2016 +

--
 .../service/oidc/ClientRegistrationService.java | 70 
 .../fediz/service/oidc/InvalidRegistration.java | 31 +
 .../oidc/InvalidRegistrationException.java  | 32 -
 .../fediz/service/oidc/RegisteredClients.java   | 35 ++
 .../main/webapp/WEB-INF/applicationContext.xml  |  7 +-
 .../WEB-INF/views/invalidRegistration.jsp   | 24 +++
 .../webapp/WEB-INF/views/registeredClients.jsp  |  3 +-
 7 files changed, 141 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/11826312/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
--
diff --git 
a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
 
b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
index 733f7ea..dfe2a01 100644
--- 
a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
+++ 
b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
@@ -40,6 +40,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
 import javax.ws.rs.core.SecurityContext;
 
 import org.apache.commons.validator.routines.UrlValidator;
@@ -76,8 +77,8 @@ public class ClientRegistrationService {
 @GET
 @Produces(MediaType.TEXT_HTML)
 @Path("/")
-public Collection getClients() {
-return getClientRegistrations();
+public RegisteredClients getClients() {
+return new RegisteredClients(getClientRegistrations());
 }
 
 @GET
@@ -97,7 +98,7 @@ public class ClientRegistrationService {
 @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
 @Produces(MediaType.TEXT_HTML)
 @Path("/{id}/remove")
-public Collection removeClient(@PathParam("id") String id) {
+public RegisteredClients removeClient(@PathParam("id") String id) {
 Collection clients = getClientRegistrations(); 
 for (Iterator it = clients.iterator(); it.hasNext();) {
 Client c = it.next();
@@ -107,7 +108,7 @@ public class ClientRegistrationService {
 break;
 }
 }
-return clients;
+return new RegisteredClients(clients);
 }
 @POST
 @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@@ -193,62 +194,68 @@ public class ClientRegistrationService {
 @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
 @Produces(MediaType.TEXT_HTML)
 @Path("/")
-public Collection registerForm(@FormParam("client_name") String 
appName,
+public Response registerForm(@FormParam("client_name") String appName,
@FormParam("client_type") String 
appType, 
@FormParam("client_audience") 
String audience,
@FormParam("client_redirectURI") 
String redirectURI,
@FormParam("client_homeRealm") 
String homeRealm
-) throws InvalidRegistrationException {
+) {
 
-// Check parameters
-if (appName == null || "".equals(appName)) {
-throw new InvalidRegistrationException("The client id must not be 
empty");
+// Client Name
+if (StringUtils.isEmpty(appName)) {
+return invalidRegistrationResponse("The client name must not be 
empty");
 }
-if (appType == null) {
-throw new InvalidRegistrationException("The client type must not 
be empty");
+// Client Type
+if (StringUtils.isEmpty(appType)) {
+return invalidRegistrationResponse("The client type must not be 
empty");
 }
 if (!("confidential".equals(appType) || "public".equals(appType))) {
-throw new InvalidRegistrationException("An invalid client type was 
specified: " + appType);
+return 

buildbot success in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a restored build on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5120

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

Build succeeded!

Sincerely,
 -The Buildbot





cxf git commit: Make sure the SecurityToken Element can survive serialization

2016-01-29 Thread coheigea
Repository: cxf
Updated Branches:
  refs/heads/master 279182600 -> 1ed42aa85


Make sure the SecurityToken Element can survive serialization


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1ed42aa8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1ed42aa8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1ed42aa8

Branch: refs/heads/master
Commit: 1ed42aa8588b6690e7c47f2c2f3043e0de0b8dc4
Parents: 2791826
Author: Colm O hEigeartaigh 
Authored: Fri Jan 29 13:33:01 2016 +
Committer: Colm O hEigeartaigh 
Committed: Fri Jan 29 13:33:28 2016 +

--
 .../ws/security/tokenstore/SecurityToken.java   | 32 +++-
 1 file changed, 31 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/1ed42aa8/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
--
diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
index b778bcd..522c596 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
@@ -19,7 +19,11 @@
 
 package org.apache.cxf.ws.security.tokenstore;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.io.StringReader;
 import java.security.Key;
 import java.security.Principal;
 import java.security.cert.X509Certificate;
@@ -28,6 +32,8 @@ import java.text.ParseException;
 import java.util.Date;
 import java.util.Map;
 
+import javax.xml.stream.XMLStreamException;
+
 import org.w3c.dom.Element;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.security.SecurityContext;
@@ -35,6 +41,7 @@ import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 import org.apache.wss4j.common.crypto.Crypto;
 import org.apache.wss4j.common.token.Reference;
+import org.apache.wss4j.common.util.DOM2Writer;
 import org.apache.wss4j.common.util.XMLUtils;
 import org.apache.wss4j.dom.WSConstants;
 import org.apache.wss4j.dom.util.XmlSchemaDateFormat;
@@ -50,7 +57,11 @@ public class SecurityToken implements Serializable {
  */
 public static final String BOOTSTRAP_TOKEN_ID = 
"bootstrap_security_token_id";
 
-private static final long serialVersionUID = 3820740387121650613L;
+/**
+ * 
+ */
+private static final long serialVersionUID = -8220267049304000696L;
+
 
 /**
  * Token identifier
@@ -68,6 +79,11 @@ public class SecurityToken implements Serializable {
 private transient Element token;
 
 /**
+ * The String representation of the token (The token can't be serialized 
as it's a DOM Element) 
+ */
+private String tokenStr;
+
+/**
  * The RequestedAttachedReference element
  * NOTE : The oasis-200401-wss-soap-message-security-1.0 spec allows 
  * an extensibility mechanism for wsse:SecurityTokenReference and 
@@ -546,4 +562,18 @@ public class SecurityToken implements Serializable {
 this.data = data;
 }
 
+private void writeObject(ObjectOutputStream stream) throws IOException {
+if (token != null && tokenStr == null) {
+tokenStr = DOM2Writer.nodeToString(token);
+}
+stream.defaultWriteObject();
+}
+
+private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException, XMLStreamException {
+in.defaultReadObject();
+
+if (token == null && tokenStr != null) {
+token = StaxUtils.read(new 
StringReader(tokenStr)).getDocumentElement();
+}
+}
 } 



cxf git commit: Make sure the SecurityToken Element can survive serialization

2016-01-29 Thread coheigea
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes f5911fb98 -> 4b4e98b07


Make sure the SecurityToken Element can survive serialization


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4b4e98b0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4b4e98b0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4b4e98b0

Branch: refs/heads/3.1.x-fixes
Commit: 4b4e98b07c9106ee45bc9071fd971e666ed4936d
Parents: f5911fb
Author: Colm O hEigeartaigh 
Authored: Fri Jan 29 13:33:01 2016 +
Committer: Colm O hEigeartaigh 
Committed: Fri Jan 29 13:33:56 2016 +

--
 .../ws/security/tokenstore/SecurityToken.java   | 32 +++-
 1 file changed, 31 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/4b4e98b0/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
--
diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
index b778bcd..522c596 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
@@ -19,7 +19,11 @@
 
 package org.apache.cxf.ws.security.tokenstore;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.io.StringReader;
 import java.security.Key;
 import java.security.Principal;
 import java.security.cert.X509Certificate;
@@ -28,6 +32,8 @@ import java.text.ParseException;
 import java.util.Date;
 import java.util.Map;
 
+import javax.xml.stream.XMLStreamException;
+
 import org.w3c.dom.Element;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.security.SecurityContext;
@@ -35,6 +41,7 @@ import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 import org.apache.wss4j.common.crypto.Crypto;
 import org.apache.wss4j.common.token.Reference;
+import org.apache.wss4j.common.util.DOM2Writer;
 import org.apache.wss4j.common.util.XMLUtils;
 import org.apache.wss4j.dom.WSConstants;
 import org.apache.wss4j.dom.util.XmlSchemaDateFormat;
@@ -50,7 +57,11 @@ public class SecurityToken implements Serializable {
  */
 public static final String BOOTSTRAP_TOKEN_ID = 
"bootstrap_security_token_id";
 
-private static final long serialVersionUID = 3820740387121650613L;
+/**
+ * 
+ */
+private static final long serialVersionUID = -8220267049304000696L;
+
 
 /**
  * Token identifier
@@ -68,6 +79,11 @@ public class SecurityToken implements Serializable {
 private transient Element token;
 
 /**
+ * The String representation of the token (The token can't be serialized 
as it's a DOM Element) 
+ */
+private String tokenStr;
+
+/**
  * The RequestedAttachedReference element
  * NOTE : The oasis-200401-wss-soap-message-security-1.0 spec allows 
  * an extensibility mechanism for wsse:SecurityTokenReference and 
@@ -546,4 +562,18 @@ public class SecurityToken implements Serializable {
 this.data = data;
 }
 
+private void writeObject(ObjectOutputStream stream) throws IOException {
+if (token != null && tokenStr == null) {
+tokenStr = DOM2Writer.nodeToString(token);
+}
+stream.defaultWriteObject();
+}
+
+private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException, XMLStreamException {
+in.defaultReadObject();
+
+if (token == null && tokenStr != null) {
+token = StaxUtils.read(new 
StringReader(tokenStr)).getDocumentElement();
+}
+}
 } 



[2/2] cxf git commit: Make sure the SecurityToken Element can survive serialization

2016-01-29 Thread coheigea
Make sure the SecurityToken Element can survive serialization

# Conflicts:
#   
rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/da9a54c5
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/da9a54c5
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/da9a54c5

Branch: refs/heads/3.0.x-fixes
Commit: da9a54c573c411a2562b1fbe733f8ece0bb98f07
Parents: 6303c85
Author: Colm O hEigeartaigh 
Authored: Fri Jan 29 13:33:01 2016 +
Committer: Colm O hEigeartaigh 
Committed: Fri Jan 29 13:34:34 2016 +

--
 .../ws/security/tokenstore/SecurityToken.java   | 32 +++-
 1 file changed, 31 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/da9a54c5/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
--
diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
index 7a74b35..43d3d68 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
@@ -19,7 +19,11 @@
 
 package org.apache.cxf.ws.security.tokenstore;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.io.StringReader;
 import java.security.Key;
 import java.security.Principal;
 import java.security.cert.X509Certificate;
@@ -28,6 +32,8 @@ import java.text.ParseException;
 import java.util.Date;
 import java.util.Properties;
 
+import javax.xml.stream.XMLStreamException;
+
 import org.w3c.dom.Element;
 
 import org.apache.cxf.helpers.DOMUtils;
@@ -35,6 +41,7 @@ import org.apache.cxf.security.SecurityContext;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 import org.apache.wss4j.common.crypto.Crypto;
+import org.apache.wss4j.common.util.DOM2Writer;
 import org.apache.wss4j.dom.WSConstants;
 import org.apache.wss4j.dom.message.token.Reference;
 import org.apache.wss4j.dom.util.XmlSchemaDateFormat;
@@ -50,7 +57,11 @@ public class SecurityToken implements Serializable {
  */
 public static final String BOOTSTRAP_TOKEN_ID = 
"bootstrap_security_token_id";
 
-private static final long serialVersionUID = 3820740387121650613L;
+/**
+ * 
+ */
+private static final long serialVersionUID = -8220267049304000696L;
+
 
 /**
  * Token identifier
@@ -68,6 +79,11 @@ public class SecurityToken implements Serializable {
 private transient Element token;
 
 /**
+ * The String representation of the token (The token can't be serialized 
as it's a DOM Element) 
+ */
+private String tokenStr;
+
+/**
  * The RequestedAttachedReference element
  * NOTE : The oasis-200401-wss-soap-message-security-1.0 spec allows 
  * an extensibility mechanism for wsse:SecurityTokenReference and 
@@ -558,4 +574,18 @@ public class SecurityToken implements Serializable {
 this.data = data;
 }
 
+private void writeObject(ObjectOutputStream stream) throws IOException {
+if (token != null && tokenStr == null) {
+tokenStr = DOM2Writer.nodeToString(token);
+}
+stream.defaultWriteObject();
+}
+
+private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException, XMLStreamException {
+in.defaultReadObject();
+
+if (token == null && tokenStr != null) {
+token = StaxUtils.read(new 
StringReader(tokenStr)).getDocumentElement();
+}
+}
 } 



[1/2] cxf git commit: Recording .gitmergeinfo Changes

2016-01-29 Thread coheigea
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 6303c852b -> ad0f5f1a1


Recording .gitmergeinfo Changes


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ad0f5f1a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ad0f5f1a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ad0f5f1a

Branch: refs/heads/3.0.x-fixes
Commit: ad0f5f1a104fde478ed955984305eaefc3a389cc
Parents: da9a54c
Author: Colm O hEigeartaigh 
Authored: Fri Jan 29 13:34:34 2016 +
Committer: Colm O hEigeartaigh 
Committed: Fri Jan 29 13:34:34 2016 +

--
 .gitmergeinfo | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/ad0f5f1a/.gitmergeinfo
--
diff --git a/.gitmergeinfo b/.gitmergeinfo
index fffb921..02845ee 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -684,6 +684,7 @@ M 498a3c2f415c119cd82e1e5779eee4e103755a89
 M 49a5e392144d9137bf47c574e701334ff6c41779
 M 49b2b813deb93106f1f20ae7b067a318e8f04c0b
 M 4a292c0cc49c0c4eef5d50efc78a499c7a5e1783
+M 4b4e98b07c9106ee45bc9071fd971e666ed4936d
 M 4ba52d10601f19b852b3e7f88942d1fc33d56113
 M 4c4ef0dd26fb038ab4c2be504639575af4922531
 M 4cd28267092129b3ea456fc436dd2a4f210b365f



cxf-fediz git commit: Fixing systests

2016-01-29 Thread coheigea
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 11826312b -> eff7b768f


Fixing systests


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/eff7b768
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/eff7b768
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/eff7b768

Branch: refs/heads/master
Commit: eff7b768f1e24f02be989ed3f4a8b02992cc145b
Parents: 1182631
Author: Colm O hEigeartaigh 
Authored: Fri Jan 29 14:41:00 2016 +
Committer: Colm O hEigeartaigh 
Committed: Fri Jan 29 14:41:00 2016 +

--
 .../apache/cxf/fediz/systests/oidc/OIDCTest.java| 16 
 1 file changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/eff7b768/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java
--
diff --git 
a/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java 
b/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java
index 37aad49..bbfc1fa 100644
--- 
a/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java
+++ 
b/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java
@@ -563,9 +563,9 @@ public class OIDCTest {
 
 // Now try to register a new client
 try {
-registerNewClient(webClient, url, "asfxyz", "https://127.0.0.1//;,
+HtmlPage errorPage = registerNewClient(webClient, url, "asfxyz", 
"https://127.0.0.1//;,
   "https://cxf.apache.org;);
-Assert.fail("Failure expected on an invalid registration URI");
+Assert.assertTrue(errorPage.asText().contains("Invalid Client 
Registration"));
 } catch (Exception ex) {
 // expected
 }
@@ -587,9 +587,9 @@ public class OIDCTest {
 
 // Now try to register a new client
 try {
-registerNewClient(webClient, url, "asfxyz", 
"https://127.0.0.1#fragment;,
+HtmlPage errorPage = registerNewClient(webClient, url, "asfxyz", 
"https://127.0.0.1#fragment;,
   "https://cxf.apache.org;);
-Assert.fail("Failure expected on an invalid registration URI");
+Assert.assertTrue(errorPage.asText().contains("Invalid Client 
Registration"));
 } catch (Exception ex) {
 // expected
 }
@@ -611,9 +611,9 @@ public class OIDCTest {
 
 // Now try to register a new client
 try {
-registerNewClient(webClient, url, "asfxyz", "https://127.0.0.1/;,
+HtmlPage errorPage = registerNewClient(webClient, url, "asfxyz", 
"https://127.0.0.1/;,
   "https://cxf.apache.org//;);
-Assert.fail("Failure expected on an invalid audience URI");
+Assert.assertTrue(errorPage.asText().contains("Invalid Client 
Registration"));
 } catch (Exception ex) {
 // expected
 }
@@ -635,9 +635,9 @@ public class OIDCTest {
 
 // Now try to register a new client
 try {
-registerNewClient(webClient, url, "asfxyz", "https://127.0.0.1;,
+HtmlPage errorPage = registerNewClient(webClient, url, "asfxyz", 
"https://127.0.0.1;,
   "https://cxf.apache.org#fragment;);
-Assert.fail("Failure expected on an invalid audience URI");
+Assert.assertTrue(errorPage.asText().contains("Invalid Client 
Registration"));
 } catch (Exception ex) {
 // expected
 }



cxf git commit: [CXF-6759] Fixing a duplicate method issue, patch from Neal Hu applied with minor updates

2016-01-29 Thread sergeyb
Repository: cxf
Updated Branches:
  refs/heads/master 25c151ed9 -> 05470459f


[CXF-6759] Fixing a duplicate method issue, patch from Neal Hu applied with 
minor updates


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/05470459
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/05470459
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/05470459

Branch: refs/heads/master
Commit: 05470459f4dad0864ae639d7d91ccc0637682710
Parents: 25c151e
Author: Sergey Beryozkin 
Authored: Fri Jan 29 10:13:46 2016 +
Committer: Sergey Beryozkin 
Committed: Fri Jan 29 10:13:46 2016 +

--
 .../cxf/tools/wadlto/jaxrs/SourceGenerator.java | 32 ++-
 .../tools/wadlto/jaxrs/JAXRSContainerTest.java  | 33 +++-
 .../src/test/resources/wadl/testComplexPath.xml |  3 ++
 3 files changed, 46 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/05470459/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
--
diff --git 
a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
 
b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
index ff37819..f07df3b 100644
--- 
a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
+++ 
b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
@@ -506,7 +506,10 @@ public class SourceGenerator {
 writeImplementsInterface(sbCode, qname.getLocalPart(), 
info.isInterfaceGenerated());  
 sbCode.append(" {" + getLineSep() + getLineSep());
 
-writeMethods(rElement, classPackage, imports, sbCode, info, 
resourceId, isRoot, "");
+Map methodNameMap = new HashMap();
+writeMethods(rElement, classPackage, imports, sbCode, 
+ info, resourceId, isRoot, "",
+ methodNameMap);
 
 sbCode.append("}");
 writeImports(sbImports, imports, classPackage);
@@ -611,14 +614,15 @@ public class SourceGenerator {
   ContextInfo info,
   String resourceId,
   boolean isRoot,
-  String currentPath) {
+  String currentPath,
+  Map methodNameMap) {
 //CHECKSTYLE:ON
 List methodEls = getWadlElements(rElement, "method");
 
 List currentInheritedParams = inheritResourceParams 
 ? new LinkedList(info.getInheritedParams()) : 
Collections.emptyList();
 for (Element methodEl : methodEls) {
-writeResourceMethod(methodEl, classPackage, imports, sbCode, info, 
isRoot, currentPath);
+writeResourceMethod(methodEl, classPackage, imports, sbCode, info, 
isRoot, currentPath, methodNameMap);
 }
 if (inheritResourceParams && methodEls.isEmpty()) {
 info.getInheritedParams().addAll(getWadlElements(rElement, 
"param"));
@@ -633,9 +637,9 @@ public class SourceGenerator {
 String newPath = currentPath + path.replace("//", "/");
 String id = childEl.getAttribute("id");
 if (id.length() == 0) {
-writeMethods(childEl, classPackage, imports, sbCode, info, id, 
false, newPath);
+writeMethods(childEl, classPackage, imports, sbCode, info, id, 
false, newPath, methodNameMap);
 } else {
-writeResourceMethod(childEl, classPackage, imports, sbCode, 
info, false, newPath);
+writeResourceMethod(childEl, classPackage, imports, sbCode, 
info, false, newPath, methodNameMap);
 }
 }
 info.getInheritedParams().clear();
@@ -679,13 +683,16 @@ public class SourceGenerator {
 }
 }
 
+//CHECKSTYLE:OFF
 private void writeResourceMethod(Element methodEl,
  String classPackage,
  Set imports,
  StringBuilder sbCode,
  ContextInfo info,
  boolean isRoot,
- String currentPath) {
+ String currentPath,
+ Map methodNameMap) {
+//CHECKSTYLE:ON
 StringBuilder sbMethodCode = sbCode;
 StringBuilder sbMethodDocs = null;
 StringBuilder sbMethodRespDocs = null;
@@ -793,7 +800,18 @@ public class 

cxf-fediz git commit: Support for more involved client webapps with multiple redirect points

2016-01-29 Thread sergeyb
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 485b96744 -> 10b9246ae


Support for more involved client webapps with multiple redirect points


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/10b9246a
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/10b9246a
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/10b9246a

Branch: refs/heads/master
Commit: 10b9246ae1221997799dcdc44a4981264cf5e630
Parents: 485b967
Author: Sergey Beryozkin 
Authored: Fri Jan 29 12:35:19 2016 +
Committer: Sergey Beryozkin 
Committed: Fri Jan 29 12:35:19 2016 +

--
 .../service/oidc/ClientRegistrationService.java | 30 +++-
 1 file changed, 17 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/10b9246a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
--
diff --git 
a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
 
b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
index 351b922..733f7ea 100644
--- 
a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
+++ 
b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
@@ -23,7 +23,6 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -211,10 +210,6 @@ public class ClientRegistrationService {
 if (!("confidential".equals(appType) || "public".equals(appType))) {
 throw new InvalidRegistrationException("An invalid client type was 
specified: " + appType);
 }
-//TODO: support multiple redirect URIs
-if (redirectURI != null && !"".equals(redirectURI) && 
!isValidURI(redirectURI, false)) {
-throw new InvalidRegistrationException("An invalid redirect URI 
was specified: " + redirectURI);
-}
 
 String clientId = generateClientId();
 boolean isConfidential = "confidential".equals(appType);
@@ -225,7 +220,17 @@ public class ClientRegistrationService {
 FedizClient newClient = new FedizClient(clientId, clientSecret, 
isConfidential, appName);
 newClient.setHomeRealm(homeRealm);
 if (!StringUtils.isEmpty(redirectURI)) {
-newClient.setRedirectUris(Collections.singletonList(redirectURI));
+String[] allUris = redirectURI.trim().split(" ");
+List redirectUris = new LinkedList();
+for (String uri : allUris) {
+if (!StringUtils.isEmpty(uri)) {
+if (!isValidURI(uri, false)) {
+throw new InvalidRegistrationException("An invalid 
redirect URI was specified: " + uri);
+}
+redirectUris.add(uri);
+}
+}
+newClient.setRedirectUris(redirectUris);
 }
 String userName = sc.getUserPrincipal().getName();
 UserSubject userSubject = new UserSubject(userName);
@@ -241,15 +246,14 @@ public class ClientRegistrationService {
 String[] auds = audience.trim().split(" ");
 List registeredAuds = new LinkedList();
 for (String aud : auds) {
-// make sure it is a proper URI
-if (!"".equals(aud) && !isValidURI(aud, true)) {
-throw new InvalidRegistrationException("An invalid 
audience URI was specified: " + aud);
+if (!StringUtils.isEmpty(aud)) {
+if (!isValidURI(aud, true)) {
+throw new InvalidRegistrationException("An invalid 
audience URI was specified: " + aud);
+}
+registeredAuds.add(aud);
 }
-registeredAuds.add(aud);
-}
-if (!registeredAuds.isEmpty()) {
-newClient.setRegisteredAudiences(registeredAuds);
 }
+newClient.setRegisteredAudiences(registeredAuds);
 }
 
 return registerNewClient(newClient);



cxf git commit: Optimizing JwtRequestCodeFilter code

2016-01-29 Thread sergeyb
Repository: cxf
Updated Branches:
  refs/heads/master 05470459f -> 279182600


Optimizing JwtRequestCodeFilter code


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/27918260
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/27918260
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/27918260

Branch: refs/heads/master
Commit: 279182600756a2a74c769121c6928d75acdee9d8
Parents: 0547045
Author: Sergey Beryozkin 
Authored: Fri Jan 29 10:49:17 2016 +
Committer: Sergey Beryozkin 
Committed: Fri Jan 29 10:49:17 2016 +

--
 .../grants/code/JwtRequestCodeFilter.java   | 74 
 1 file changed, 12 insertions(+), 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/27918260/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
--
diff --git 
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
 
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
index 371f61c..ddb4f74 100644
--- 
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
+++ 
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
@@ -22,35 +22,29 @@ import java.security.cert.X509Certificate;
 import java.util.List;
 import java.util.Map;
 
-import javax.crypto.SecretKey;
 import javax.ws.rs.core.MultivaluedMap;
 
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.json.basic.JsonMapObjectReaderWriter;
-import org.apache.cxf.rs.security.jose.jwa.ContentAlgorithm;
 import org.apache.cxf.rs.security.jose.jwa.SignatureAlgorithm;
 import org.apache.cxf.rs.security.jose.jwe.JweDecryptionProvider;
-import org.apache.cxf.rs.security.jose.jwe.JweUtils;
-import org.apache.cxf.rs.security.jose.jws.JwsJwtCompactConsumer;
 import org.apache.cxf.rs.security.jose.jws.JwsSignatureVerifier;
 import org.apache.cxf.rs.security.jose.jws.JwsUtils;
 import org.apache.cxf.rs.security.jose.jwt.JwtClaims;
+import org.apache.cxf.rs.security.jose.jwt.JwtToken;
 import org.apache.cxf.rs.security.oauth2.common.Client;
 import org.apache.cxf.rs.security.oauth2.common.UserSubject;
+import org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthJoseJwtConsumer;
 import 
org.apache.cxf.rs.security.oauth2.provider.AuthorizationCodeRequestFilter;
 import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
 import org.apache.cxf.rt.security.crypto.CryptoUtils;
 
-public class JwtRequestCodeFilter implements AuthorizationCodeRequestFilter {
+public class JwtRequestCodeFilter extends AbstractOAuthJoseJwtConsumer 
implements AuthorizationCodeRequestFilter {
 private static final String REQUEST_PARAM = "request";
 private static final String REQUEST_URI_PARAM = "request_uri";
-private JweDecryptionProvider jweDecryptor;
-private JwsSignatureVerifier jwsVerifier;
 private boolean verifyWithClientCertificates;
-private boolean verifyWithClientSecret;
-private boolean decryptWithClientSecret;
 private String issuer;
 private JsonMapObjectReaderWriter jsonHandler = new 
JsonMapObjectReaderWriter();
 @Override
@@ -60,21 +54,15 @@ public class JwtRequestCodeFilter implements 
AuthorizationCodeRequestFilter {
 String requestToken = params.getFirst(REQUEST_PARAM);
 if (requestToken == null) {
 String requestUri = params.getFirst(REQUEST_URI_PARAM);
-if (requestUri != null && 
requestUri.startsWith(getPrefix(client))) {
+if (isRequestUriValid(client, requestUri)) {
 requestToken = WebClient.create(requestUri).get(String.class);
 }
 }
 if (requestToken != null) {
-JweDecryptionProvider theJweDecryptor = 
getInitializedDecryptionProvider(client);
-if (theJweDecryptor != null) {
-requestToken = 
theJweDecryptor.decrypt(requestToken).getContentText();
-}
+JweDecryptionProvider theDecryptor = 
super.getInitializedDecryptionProvider(client.getClientSecret());
 JwsSignatureVerifier theSigVerifier = 
getInitializedSigVerifier(client);
-JwsJwtCompactConsumer consumer = new 
JwsJwtCompactConsumer(requestToken);
-if (!consumer.verifySignatureWith(theSigVerifier)) {
-throw new SecurityException("Invalid Signature");
-}
-JwtClaims 

cxf git commit: Optimizing JwtRequestCodeFilter code

2016-01-29 Thread sergeyb
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 560dfbcac -> 6303c852b


Optimizing JwtRequestCodeFilter code


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6303c852
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6303c852
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6303c852

Branch: refs/heads/3.0.x-fixes
Commit: 6303c852bbc6c4e2bd690011670a2c5bd4e5945e
Parents: 560dfbc
Author: Sergey Beryozkin 
Authored: Fri Jan 29 10:49:17 2016 +
Committer: Sergey Beryozkin 
Committed: Fri Jan 29 10:50:03 2016 +

--
 .../grants/code/JwtRequestCodeFilter.java   | 74 
 1 file changed, 12 insertions(+), 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/6303c852/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
--
diff --git 
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
 
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
index 371f61c..ddb4f74 100644
--- 
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
+++ 
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
@@ -22,35 +22,29 @@ import java.security.cert.X509Certificate;
 import java.util.List;
 import java.util.Map;
 
-import javax.crypto.SecretKey;
 import javax.ws.rs.core.MultivaluedMap;
 
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.json.basic.JsonMapObjectReaderWriter;
-import org.apache.cxf.rs.security.jose.jwa.ContentAlgorithm;
 import org.apache.cxf.rs.security.jose.jwa.SignatureAlgorithm;
 import org.apache.cxf.rs.security.jose.jwe.JweDecryptionProvider;
-import org.apache.cxf.rs.security.jose.jwe.JweUtils;
-import org.apache.cxf.rs.security.jose.jws.JwsJwtCompactConsumer;
 import org.apache.cxf.rs.security.jose.jws.JwsSignatureVerifier;
 import org.apache.cxf.rs.security.jose.jws.JwsUtils;
 import org.apache.cxf.rs.security.jose.jwt.JwtClaims;
+import org.apache.cxf.rs.security.jose.jwt.JwtToken;
 import org.apache.cxf.rs.security.oauth2.common.Client;
 import org.apache.cxf.rs.security.oauth2.common.UserSubject;
+import org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthJoseJwtConsumer;
 import 
org.apache.cxf.rs.security.oauth2.provider.AuthorizationCodeRequestFilter;
 import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
 import org.apache.cxf.rt.security.crypto.CryptoUtils;
 
-public class JwtRequestCodeFilter implements AuthorizationCodeRequestFilter {
+public class JwtRequestCodeFilter extends AbstractOAuthJoseJwtConsumer 
implements AuthorizationCodeRequestFilter {
 private static final String REQUEST_PARAM = "request";
 private static final String REQUEST_URI_PARAM = "request_uri";
-private JweDecryptionProvider jweDecryptor;
-private JwsSignatureVerifier jwsVerifier;
 private boolean verifyWithClientCertificates;
-private boolean verifyWithClientSecret;
-private boolean decryptWithClientSecret;
 private String issuer;
 private JsonMapObjectReaderWriter jsonHandler = new 
JsonMapObjectReaderWriter();
 @Override
@@ -60,21 +54,15 @@ public class JwtRequestCodeFilter implements 
AuthorizationCodeRequestFilter {
 String requestToken = params.getFirst(REQUEST_PARAM);
 if (requestToken == null) {
 String requestUri = params.getFirst(REQUEST_URI_PARAM);
-if (requestUri != null && 
requestUri.startsWith(getPrefix(client))) {
+if (isRequestUriValid(client, requestUri)) {
 requestToken = WebClient.create(requestUri).get(String.class);
 }
 }
 if (requestToken != null) {
-JweDecryptionProvider theJweDecryptor = 
getInitializedDecryptionProvider(client);
-if (theJweDecryptor != null) {
-requestToken = 
theJweDecryptor.decrypt(requestToken).getContentText();
-}
+JweDecryptionProvider theDecryptor = 
super.getInitializedDecryptionProvider(client.getClientSecret());
 JwsSignatureVerifier theSigVerifier = 
getInitializedSigVerifier(client);
-JwsJwtCompactConsumer consumer = new 
JwsJwtCompactConsumer(requestToken);
-if (!consumer.verifySignatureWith(theSigVerifier)) {
-throw new SecurityException("Invalid Signature");
-}
-

cxf git commit: Optimizing JwtRequestCodeFilter code

2016-01-29 Thread sergeyb
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes c811308df -> f5911fb98


Optimizing JwtRequestCodeFilter code


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f5911fb9
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f5911fb9
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f5911fb9

Branch: refs/heads/3.1.x-fixes
Commit: f5911fb98e06b6ec09942edccbf205deb0138e27
Parents: c811308
Author: Sergey Beryozkin 
Authored: Fri Jan 29 10:49:17 2016 +
Committer: Sergey Beryozkin 
Committed: Fri Jan 29 10:50:48 2016 +

--
 .../grants/code/JwtRequestCodeFilter.java   | 74 
 1 file changed, 12 insertions(+), 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/f5911fb9/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
--
diff --git 
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
 
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
index 371f61c..ddb4f74 100644
--- 
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
+++ 
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JwtRequestCodeFilter.java
@@ -22,35 +22,29 @@ import java.security.cert.X509Certificate;
 import java.util.List;
 import java.util.Map;
 
-import javax.crypto.SecretKey;
 import javax.ws.rs.core.MultivaluedMap;
 
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.json.basic.JsonMapObjectReaderWriter;
-import org.apache.cxf.rs.security.jose.jwa.ContentAlgorithm;
 import org.apache.cxf.rs.security.jose.jwa.SignatureAlgorithm;
 import org.apache.cxf.rs.security.jose.jwe.JweDecryptionProvider;
-import org.apache.cxf.rs.security.jose.jwe.JweUtils;
-import org.apache.cxf.rs.security.jose.jws.JwsJwtCompactConsumer;
 import org.apache.cxf.rs.security.jose.jws.JwsSignatureVerifier;
 import org.apache.cxf.rs.security.jose.jws.JwsUtils;
 import org.apache.cxf.rs.security.jose.jwt.JwtClaims;
+import org.apache.cxf.rs.security.jose.jwt.JwtToken;
 import org.apache.cxf.rs.security.oauth2.common.Client;
 import org.apache.cxf.rs.security.oauth2.common.UserSubject;
+import org.apache.cxf.rs.security.oauth2.provider.AbstractOAuthJoseJwtConsumer;
 import 
org.apache.cxf.rs.security.oauth2.provider.AuthorizationCodeRequestFilter;
 import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
 import org.apache.cxf.rt.security.crypto.CryptoUtils;
 
-public class JwtRequestCodeFilter implements AuthorizationCodeRequestFilter {
+public class JwtRequestCodeFilter extends AbstractOAuthJoseJwtConsumer 
implements AuthorizationCodeRequestFilter {
 private static final String REQUEST_PARAM = "request";
 private static final String REQUEST_URI_PARAM = "request_uri";
-private JweDecryptionProvider jweDecryptor;
-private JwsSignatureVerifier jwsVerifier;
 private boolean verifyWithClientCertificates;
-private boolean verifyWithClientSecret;
-private boolean decryptWithClientSecret;
 private String issuer;
 private JsonMapObjectReaderWriter jsonHandler = new 
JsonMapObjectReaderWriter();
 @Override
@@ -60,21 +54,15 @@ public class JwtRequestCodeFilter implements 
AuthorizationCodeRequestFilter {
 String requestToken = params.getFirst(REQUEST_PARAM);
 if (requestToken == null) {
 String requestUri = params.getFirst(REQUEST_URI_PARAM);
-if (requestUri != null && 
requestUri.startsWith(getPrefix(client))) {
+if (isRequestUriValid(client, requestUri)) {
 requestToken = WebClient.create(requestUri).get(String.class);
 }
 }
 if (requestToken != null) {
-JweDecryptionProvider theJweDecryptor = 
getInitializedDecryptionProvider(client);
-if (theJweDecryptor != null) {
-requestToken = 
theJweDecryptor.decrypt(requestToken).getContentText();
-}
+JweDecryptionProvider theDecryptor = 
super.getInitializedDecryptionProvider(client.getClientSecret());
 JwsSignatureVerifier theSigVerifier = 
getInitializedSigVerifier(client);
-JwsJwtCompactConsumer consumer = new 
JwsJwtCompactConsumer(requestToken);
-if (!consumer.verifySignatureWith(theSigVerifier)) {
-throw new SecurityException("Invalid Signature");
-}
-

buildbot failure in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a new failure on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5116

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

BUILD FAILED: failed compile

Sincerely,
 -The Buildbot





cxf-fediz git commit: Minor update to clientTokens.jsp

2016-01-29 Thread sergeyb
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 3a53baccd -> 485b96744


Minor update to clientTokens.jsp


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/485b9674
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/485b9674
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/485b9674

Branch: refs/heads/master
Commit: 485b967449a36f37bbf1405bb60a2e309afc3c80
Parents: 3a53bac
Author: Sergey Beryozkin 
Authored: Fri Jan 29 12:10:47 2016 +
Committer: Sergey Beryozkin 
Committed: Fri Jan 29 12:10:47 2016 +

--
 .../oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp   | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/485b9674/services/oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp
--
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp 
b/services/oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp
index d87ca2c..dd1505f 100644
--- a/services/oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp
+++ b/services/oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp
@@ -94,11 +94,17 @@
   }
   %>
<%
- if (token.getRefreshToken() != null) {
+ if (!tokens.getRefreshTokens().isEmpty()) {
   %>
 
+ <%
+ if (token.getRefreshToken() != null) {
+ %>
   <%=token.getRefreshToken() %>
-  
+ <%
+   }
+ %> 
+
   <%
  }
   %>



buildbot success in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a restored build on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5115

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

Build succeeded!

Sincerely,
 -The Buildbot





cxf git commit: [CXF-6759] Fixing a duplicate method issue, patch from Neal Hu applied with minor updates

2016-01-29 Thread sergeyb
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 38a36b5a5 -> c811308df


[CXF-6759] Fixing a duplicate method issue, patch from Neal Hu applied with 
minor updates


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c811308d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c811308d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c811308d

Branch: refs/heads/3.1.x-fixes
Commit: c811308dfe36bdb08236c33694aaa9a379c485b6
Parents: 38a36b5
Author: Sergey Beryozkin 
Authored: Fri Jan 29 10:13:46 2016 +
Committer: Sergey Beryozkin 
Committed: Fri Jan 29 10:15:15 2016 +

--
 .../cxf/tools/wadlto/jaxrs/SourceGenerator.java | 32 ++-
 .../tools/wadlto/jaxrs/JAXRSContainerTest.java  | 33 +++-
 .../src/test/resources/wadl/testComplexPath.xml |  3 ++
 3 files changed, 46 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/c811308d/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
--
diff --git 
a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
 
b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
index ff37819..f07df3b 100644
--- 
a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
+++ 
b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
@@ -506,7 +506,10 @@ public class SourceGenerator {
 writeImplementsInterface(sbCode, qname.getLocalPart(), 
info.isInterfaceGenerated());  
 sbCode.append(" {" + getLineSep() + getLineSep());
 
-writeMethods(rElement, classPackage, imports, sbCode, info, 
resourceId, isRoot, "");
+Map methodNameMap = new HashMap();
+writeMethods(rElement, classPackage, imports, sbCode, 
+ info, resourceId, isRoot, "",
+ methodNameMap);
 
 sbCode.append("}");
 writeImports(sbImports, imports, classPackage);
@@ -611,14 +614,15 @@ public class SourceGenerator {
   ContextInfo info,
   String resourceId,
   boolean isRoot,
-  String currentPath) {
+  String currentPath,
+  Map methodNameMap) {
 //CHECKSTYLE:ON
 List methodEls = getWadlElements(rElement, "method");
 
 List currentInheritedParams = inheritResourceParams 
 ? new LinkedList(info.getInheritedParams()) : 
Collections.emptyList();
 for (Element methodEl : methodEls) {
-writeResourceMethod(methodEl, classPackage, imports, sbCode, info, 
isRoot, currentPath);
+writeResourceMethod(methodEl, classPackage, imports, sbCode, info, 
isRoot, currentPath, methodNameMap);
 }
 if (inheritResourceParams && methodEls.isEmpty()) {
 info.getInheritedParams().addAll(getWadlElements(rElement, 
"param"));
@@ -633,9 +637,9 @@ public class SourceGenerator {
 String newPath = currentPath + path.replace("//", "/");
 String id = childEl.getAttribute("id");
 if (id.length() == 0) {
-writeMethods(childEl, classPackage, imports, sbCode, info, id, 
false, newPath);
+writeMethods(childEl, classPackage, imports, sbCode, info, id, 
false, newPath, methodNameMap);
 } else {
-writeResourceMethod(childEl, classPackage, imports, sbCode, 
info, false, newPath);
+writeResourceMethod(childEl, classPackage, imports, sbCode, 
info, false, newPath, methodNameMap);
 }
 }
 info.getInheritedParams().clear();
@@ -679,13 +683,16 @@ public class SourceGenerator {
 }
 }
 
+//CHECKSTYLE:OFF
 private void writeResourceMethod(Element methodEl,
  String classPackage,
  Set imports,
  StringBuilder sbCode,
  ContextInfo info,
  boolean isRoot,
- String currentPath) {
+ String currentPath,
+ Map methodNameMap) {
+//CHECKSTYLE:ON
 StringBuilder sbMethodCode = sbCode;
 StringBuilder sbMethodDocs = null;
 StringBuilder sbMethodRespDocs = null;
@@ -793,7 +800,18 @@ public class 

cxf git commit: [CXF-6759] Fixing a duplicate method issue, patch from Neal Hu applied with minor updates

2016-01-29 Thread sergeyb
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes f420fe361 -> 560dfbcac


[CXF-6759] Fixing a duplicate method issue, patch from Neal Hu applied with 
minor updates


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/560dfbca
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/560dfbca
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/560dfbca

Branch: refs/heads/3.0.x-fixes
Commit: 560dfbcacc40737186feda09ca27fefcac5f511a
Parents: f420fe3
Author: Sergey Beryozkin 
Authored: Fri Jan 29 10:13:46 2016 +
Committer: Sergey Beryozkin 
Committed: Fri Jan 29 10:16:07 2016 +

--
 .../cxf/tools/wadlto/jaxrs/SourceGenerator.java | 32 ++-
 .../tools/wadlto/jaxrs/JAXRSContainerTest.java  | 33 +++-
 .../src/test/resources/wadl/testComplexPath.xml |  3 ++
 3 files changed, 46 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/560dfbca/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
--
diff --git 
a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
 
b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
index 1627d49..e25eda7 100644
--- 
a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
+++ 
b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
@@ -505,7 +505,10 @@ public class SourceGenerator {
 writeImplementsInterface(sbCode, qname.getLocalPart(), 
info.isInterfaceGenerated());  
 sbCode.append(" {" + getLineSep() + getLineSep());
 
-writeMethods(rElement, classPackage, imports, sbCode, info, 
resourceId, isRoot, "");
+Map methodNameMap = new HashMap();
+writeMethods(rElement, classPackage, imports, sbCode, 
+ info, resourceId, isRoot, "",
+ methodNameMap);
 
 sbCode.append("}");
 writeImports(sbImports, imports, classPackage);
@@ -610,14 +613,15 @@ public class SourceGenerator {
   ContextInfo info,
   String resourceId,
   boolean isRoot,
-  String currentPath) {
+  String currentPath,
+  Map methodNameMap) {
 //CHECKSTYLE:ON
 List methodEls = getWadlElements(rElement, "method");
 
 List currentInheritedParams = inheritResourceParams 
 ? new LinkedList(info.getInheritedParams()) : 
Collections.emptyList();
 for (Element methodEl : methodEls) {
-writeResourceMethod(methodEl, classPackage, imports, sbCode, info, 
isRoot, currentPath);
+writeResourceMethod(methodEl, classPackage, imports, sbCode, info, 
isRoot, currentPath, methodNameMap);
 }
 if (inheritResourceParams && methodEls.isEmpty()) {
 info.getInheritedParams().addAll(getWadlElements(rElement, 
"param"));
@@ -632,9 +636,9 @@ public class SourceGenerator {
 String newPath = currentPath + path.replace("//", "/");
 String id = childEl.getAttribute("id");
 if (id.length() == 0) {
-writeMethods(childEl, classPackage, imports, sbCode, info, id, 
false, newPath);
+writeMethods(childEl, classPackage, imports, sbCode, info, id, 
false, newPath, methodNameMap);
 } else {
-writeResourceMethod(childEl, classPackage, imports, sbCode, 
info, false, newPath);
+writeResourceMethod(childEl, classPackage, imports, sbCode, 
info, false, newPath, methodNameMap);
 }
 }
 info.getInheritedParams().clear();
@@ -678,13 +682,16 @@ public class SourceGenerator {
 }
 }
 
+//CHECKSTYLE:OFF
 private void writeResourceMethod(Element methodEl,
  String classPackage,
  Set imports,
  StringBuilder sbCode,
  ContextInfo info,
  boolean isRoot,
- String currentPath) {
+ String currentPath,
+ Map methodNameMap) {
+//CHECKSTYLE:ON
 StringBuilder sbMethodCode = sbCode;
 StringBuilder sbMethodDocs = null;
 StringBuilder sbMethodRespDocs = null;
@@ -792,7 +799,18 @@ public class 

[3/5] cxf-dosgi git commit: Little refactorings in greeter samples

2016-01-29 Thread amichai
Little refactorings in greeter samples


Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/3d2022a1
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/3d2022a1
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/3d2022a1

Branch: refs/heads/master
Commit: 3d2022a1170624358366bb59f277f554b34804a1
Parents: 09ff50b
Author: Amichai Rothman 
Authored: Fri Jan 29 17:06:39 2016 +0200
Committer: Amichai Rothman 
Committed: Fri Jan 29 17:06:39 2016 +0200

--
 .../greeter/impl/GreeterServiceImpl.java|  4 +-
 .../samples/greeter/client/rest/Activator.java  | 42 ++--
 2 files changed, 21 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/3d2022a1/samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java
--
diff --git 
a/samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java
 
b/samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java
index 6e6a4af..0a10dd8 100644
--- 
a/samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java
+++ 
b/samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java
@@ -50,12 +50,10 @@ public class GreeterServiceImpl implements GreeterService {
 String details = gd.getName() + "(" + gd.getAge() + ")";
 System.out.println("Invoking: greetMe(" + details + ")");
 
-GreetingPhrase[] greetings = new GreetingPhrase[] {
+return new GreetingPhrase[] {
 new GreetingPhrase("Howdy " + details),
 new GreetingPhrase("Hallo " + details),
 new GreetingPhrase("Ni hao " + details)
 };
-
-return greetings;
 }
 }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/3d2022a1/samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/Activator.java
--
diff --git 
a/samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/Activator.java
 
b/samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/Activator.java
index 667060f..2d5cfd1 100644
--- 
a/samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/Activator.java
+++ 
b/samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/Activator.java
@@ -85,19 +85,18 @@ public class Activator implements BundleActivator {
 String name = JOptionPane.showInputDialog("Enter name:");
 if (name == null) {
 break;
-} else {
-System.out.println("*** Invoking greeter ***");
-try {
-GreeterInfo info = greeter.greetMe(name);
+}
+System.out.println("*** Invoking greeter ***");
+try {
+GreeterInfo info = greeter.greetMe(name);
 
-System.out.println("greetMe(\"" + name + "\") returns:");
-for (GreetingPhrase greeting: info.getGreetings()) {
-System.out.println("  " + greeting.getPhrase()
-+ " " + greeting.getName());
-}
-} catch (GreeterException ex) {
-System.out.println("GreeterException: " + ex.toString());
+System.out.println("greetMe(\"" + name + "\") returns:");
+for (GreetingPhrase greeting: info.getGreetings()) {
+System.out.println("  " + greeting.getPhrase()
++ " " + greeting.getName());
 }
+} catch (GreeterException ex) {
+System.out.println("GreeterException: " + ex.toString());
 }
 }
 }
@@ -108,19 +107,18 @@ public class Activator implements BundleActivator {
 String name = JOptionPane.showInputDialog("Greeter2: Enter name");
 if (name == null) {
 break;
-} else {
-System.out.println("*** Invoking greeter2 ***");
-try {
-GreeterInfo info = greeter.greetMe(name);
+}
+System.out.println("*** Invoking greeter2 ***");
+try {
+GreeterInfo info = greeter.greetMe(name);
 
-System.out.println("greetMe(\"" + name + "\") returns:");
-for (GreetingPhrase greeting: info.getGreetings()) {
-

[1/5] cxf-dosgi git commit: Upgrade all dependencies versions

2016-01-29 Thread amichai
Repository: cxf-dosgi
Updated Branches:
  refs/heads/master e690e12c9 -> 1e102fb85


Upgrade all dependencies versions


Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/17efe75d
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/17efe75d
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/17efe75d

Branch: refs/heads/master
Commit: 17efe75dcdd9155e6a940ea24101e4f10250db06
Parents: e690e12
Author: Amichai Rothman 
Authored: Fri Jan 29 16:47:59 2016 +0200
Committer: Amichai Rothman 
Committed: Fri Jan 29 16:47:59 2016 +0200

--
 felix/shell.tui/pom.xml|  4 ++--
 parent/pom.xml | 32 
 systests2/multi-bundle/pom.xml |  2 +-
 3 files changed, 19 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/17efe75d/felix/shell.tui/pom.xml
--
diff --git a/felix/shell.tui/pom.xml b/felix/shell.tui/pom.xml
index 8dd6b56..e0a6d6f 100644
--- a/felix/shell.tui/pom.xml
+++ b/felix/shell.tui/pom.xml
@@ -42,12 +42,12 @@
 
   org.apache.felix
   org.osgi.core
-  1.0.1
+  1.4.0
 
 
   org.apache.felix
   org.apache.felix.shell
-  1.0.1
+  1.4.3
 
   
   

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/17efe75d/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index c9cecd2..cc143f5 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -40,33 +40,33 @@
 
 4.3.1
 4.3.1
-3.1.1
+3.1.4
 3.1.0
-4.2.1
-3.0.6.RELEASE
+5.4.0
+4.2.4.RELEASE
 1.2.1
-3.3.2
+3.4.7
 
 
1.0.0
 
-2.2.0
+2.6.0
 1.0.11
 1.7.0
 3.0
 1.2.17
-7.4.2.v20110526
-2.0.3
+9.3.7.v20160115
+2.2.1
 1.2_5
-3.0.2
+3.0.3
 1.6.2_6
 1.5.3
 3.3.1_1
 1.5.4_1
-4.1.4
+4.4.1
 2.2.1.1_2
-1.7.0
+1.7.14
 2.4.0
-3.2.0
+4.8.0
 
 
 
@@ -96,25 +96,25 @@
 
 junit
 junit
-4.7
+4.12
 test
 
 
 org.easymock
 easymock
-2.5.2
+3.4
 test
 
 
 org.easymock
 easymockclassextension
-2.5.2
+3.2
 test
 
 
 xmlunit
 xmlunit
-1.4
+1.6
 test
 
 
@@ -160,7 +160,7 @@
 
 org.ops4j.pax.tinybundles
 tinybundles
-2.0.0
+2.1.1
 
 
 

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/17efe75d/systests2/multi-bundle/pom.xml
--
diff --git a/systests2/multi-bundle/pom.xml b/systests2/multi-bundle/pom.xml
index 5147cd6..cccb87f 100644
--- a/systests2/multi-bundle/pom.xml
+++ b/systests2/multi-bundle/pom.xml
@@ -67,7 +67,7 @@
 
 org.ops4j.pax.url
 pax-url-aether
-1.6.0
+2.4.5
 
 
 



[5/5] cxf-dosgi git commit: Fix greeter sample issues: - many dialogs created but never disposed (resource leak) - thread never ends (thread leak) - dialog still shown after service bundle is stopped

2016-01-29 Thread amichai
Fix greeter sample issues:
- many dialogs created but never disposed (resource leak)
- thread never ends (thread leak)
- dialog still shown after service bundle is stopped
- dialog still shown after client bundle is stopped


Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/1e102fb8
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/1e102fb8
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/1e102fb8

Branch: refs/heads/master
Commit: 1e102fb85054dc958bed74c32f6e7b32c88a55f9
Parents: 2f2bb26
Author: Amichai Rothman 
Authored: Fri Jan 29 17:56:15 2016 +0200
Committer: Amichai Rothman 
Committed: Fri Jan 29 17:56:15 2016 +0200

--
 .../dosgi/samples/greeter/client/Activator.java | 26 ++--
 .../samples/greeter/client/GreeterDialog.java   |  4 +++
 2 files changed, 23 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1e102fb8/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/Activator.java
--
diff --git 
a/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/Activator.java
 
b/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/Activator.java
index 78b9fe1..121573e 100644
--- 
a/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/Activator.java
+++ 
b/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/Activator.java
@@ -19,6 +19,7 @@
 package org.apache.cxf.dosgi.samples.greeter.client;
 
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.cxf.dosgi.samples.greeter.GreeterData;
 import org.apache.cxf.dosgi.samples.greeter.GreeterException;
@@ -32,15 +33,25 @@ import org.osgi.util.tracker.ServiceTracker;
 public class Activator implements BundleActivator {
 
 private ServiceTracker tracker;
+private ConcurrentHashMap dialogs =
+new ConcurrentHashMap();
 
 public void start(final BundleContext bc) {
 tracker = new ServiceTracker(bc, 
GreeterService.class, null) {
 @Override
 public GreeterService 
addingService(ServiceReference reference) {
 GreeterService service = super.addingService(reference);
+dialogs.put(service, new GreeterDialog());
 useService(service);
 return service;
 }
+
+@Override
+public void removedService(ServiceReference 
reference, GreeterService service) {
+super.removedService(reference, service);
+GreeterDialog dialog = dialogs.remove(service);
+dialog.dispose();
+}
 };
 tracker.open();
 }
@@ -56,8 +67,15 @@ public class Activator implements BundleActivator {
 
 private void greeterUI(final GreeterService greeter) {
 while (true) {
+GreeterDialog dialog = dialogs.get(greeter);
+if (dialog == null) {
+return; // exit thread if service is removed
+}
 System.out.println("*** Opening greeter client dialog ***");
-Object gd = getGreeterData();
+dialog.resetSelection();
+dialog.setVisible(true); // blocks until dismissed
+Object gd = dialog.getSelection();
+
 if (gd instanceof String) {
 System.out.println("*** Invoking greeter ***");
 Map result = greeter.greetMe((String) 
gd);
@@ -82,12 +100,6 @@ public class Activator implements BundleActivator {
 }
 }
 
-private static Object getGreeterData() {
-GreeterDialog gd = new GreeterDialog();
-gd.setVisible(true);
-return gd.getSelection();
-}
-
 public void stop(BundleContext bc) throws Exception {
 tracker.close();
 }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1e102fb8/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDialog.java
--
diff --git 
a/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDialog.java
 
b/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDialog.java
index 3983a82..fa48792 100644
--- 
a/samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDialog.java
+++ 

[4/5] cxf-dosgi git commit: Update ServiceTrackers to use generics and @Override annotations

2016-01-29 Thread amichai
Update ServiceTrackers to use generics and @Override annotations


Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/2f2bb26a
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/2f2bb26a
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/2f2bb26a

Branch: refs/heads/master
Commit: 2f2bb26af80833404a17a47d1582705a45b740d7
Parents: 3d2022a
Author: Amichai Rothman 
Authored: Fri Jan 29 17:42:22 2016 +0200
Committer: Amichai Rothman 
Committed: Fri Jan 29 17:42:22 2016 +0200

--
 .../subscribe/EndpointListenerTracker.java  |  3 ++
 .../zookeeper/server/config/Activator.java  | 31 +---
 .../local/internal/LocalDiscovery.java  |  6 ++--
 .../util/SimpleServiceTracker.java  |  2 +-
 .../samples/discovery/consumer/Activator.java   | 21 +++--
 .../dosgi/samples/ds/consumer/Activator.java|  4 +--
 .../dosgi/samples/greeter/client/Activator.java | 12 
 .../samples/greeter/client/rest/Activator.java  | 24 +++
 .../common/test1/MyServiceTracker.java  | 19 ++--
 .../test2/client/Test2ServiceTracker.java   | 24 +++
 10 files changed, 68 insertions(+), 78 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/2f2bb26a/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/subscribe/EndpointListenerTracker.java
--
diff --git 
a/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/subscribe/EndpointListenerTracker.java
 
b/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/subscribe/EndpointListenerTracker.java
index 59e8c66..4d0a25f 100644
--- 
a/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/subscribe/EndpointListenerTracker.java
+++ 
b/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/subscribe/EndpointListenerTracker.java
@@ -35,17 +35,20 @@ public class EndpointListenerTracker extends 
ServiceTracker st;
 
 public void start(BundleContext context) throws Exception {
 synchronized (Activator.class) {
@@ -50,24 +50,21 @@ public class Activator implements BundleActivator {
 }
 }
 
-st = new ServiceTracker(context, ConfigurationAdmin.class.getName(), 
null) {
+st = new ServiceTracker(context, ConfigurationAdmin.class, null) {
 @Override
-public Object addingService(ServiceReference reference) {
-Object svc = super.addingService(reference);
-if (svc 

buildbot failure in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a new failure on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5122

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

BUILD FAILED: failed compile

Sincerely,
 -The Buildbot





buildbot success in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a restored build on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5123

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

Build succeeded!

Sincerely,
 -The Buildbot





buildbot failure in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a new failure on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5128

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

BUILD FAILED: failed compile

Sincerely,
 -The Buildbot





buildbot failure in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a new failure on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5134

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

BUILD FAILED: failed compile

Sincerely,
 -The Buildbot





buildbot success in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a restored build on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5133

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

Build succeeded!

Sincerely,
 -The Buildbot





buildbot success in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a restored build on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5127

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

Build succeeded!

Sincerely,
 -The Buildbot





buildbot failure in on cxf-site-production

2016-01-29 Thread buildbot
The Buildbot has detected a new failure on builder cxf-site-production while 
building . Full details are available at:
https://ci.apache.org/builders/cxf-site-production/builds/5124

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this 
build
Build Source Stamp: [branch cxf/web] HEAD
Blamelist: 

BUILD FAILED: failed compile

Sincerely,
 -The Buildbot