Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CA174200D09 for ; Tue, 12 Sep 2017 14:11:34 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C897F1609C7; Tue, 12 Sep 2017 12:11:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 199A91609C6 for ; Tue, 12 Sep 2017 14:11:33 +0200 (CEST) Received: (qmail 63811 invoked by uid 500); 12 Sep 2017 12:11:33 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 63797 invoked by uid 99); 12 Sep 2017 12:11:33 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2017 12:11:33 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id B3D3A8176C; Tue, 12 Sep 2017 12:11:32 +0000 (UTC) Date: Tue, 12 Sep 2017 12:11:32 +0000 To: "commits@cxf.apache.org" Subject: [cxf-fediz] branch 1.3.x-fixes updated: FEDIZ-209 - Make FedizResponse properly serializable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <150521829268.7497.9704586056765647402@gitbox.apache.org> From: coheigea@apache.org Reply-To: "commits@cxf.apache.org" X-Git-Host: gitbox.apache.org X-Git-Repo: cxf-fediz X-Git-Refname: refs/heads/1.3.x-fixes X-Git-Reftype: branch X-Git-Oldrev: 7d7a461c5aea1c2c39d2a70e537d1b35505a1f01 X-Git-Newrev: 7d3dea6239c04ec1069df8d052c2ce5b95d3596e X-Git-Rev: 7d3dea6239c04ec1069df8d052c2ce5b95d3596e X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated archived-at: Tue, 12 Sep 2017 12:11:35 -0000 This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch 1.3.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git The following commit(s) were added to refs/heads/1.3.x-fixes by this push: new 7d3dea6 FEDIZ-209 - Make FedizResponse properly serializable 7d3dea6 is described below commit 7d3dea6239c04ec1069df8d052c2ce5b95d3596e Author: Colm O hEigeartaigh AuthorDate: Tue Sep 12 13:10:09 2017 +0100 FEDIZ-209 - Make FedizResponse properly serializable --- .../cxf/fediz/core/processor/FedizResponse.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FedizResponse.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FedizResponse.java index 255765d..13c6726 100644 --- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FedizResponse.java +++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FedizResponse.java @@ -19,14 +19,24 @@ package org.apache.cxf.fediz.core.processor; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.io.Serializable; +import java.io.StringReader; import java.util.Collections; import java.util.Date; import java.util.List; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.stream.XMLStreamException; + import org.w3c.dom.Element; +import org.xml.sax.SAXException; import org.apache.cxf.fediz.core.Claim; +import org.apache.cxf.fediz.core.util.DOMUtils; +import org.apache.wss4j.common.util.DOM2Writer; public class FedizResponse implements Serializable { @@ -38,6 +48,7 @@ public class FedizResponse implements Serializable { private String issuer; private List claims; private transient Element token; + private String tokenStr; private String uniqueTokenId; /** @@ -116,5 +127,19 @@ public class FedizResponse implements Serializable { return token; } + 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, SAXException, ParserConfigurationException { + in.defaultReadObject(); + if (token == null && tokenStr != null) { + token = DOMUtils.readXml(new StringReader(tokenStr)).getDocumentElement(); + } + } } -- To stop receiving notification emails like this one, please contact ['"commits@cxf.apache.org" '].