aboutsummaryrefslogtreecommitdiff
path: root/spss/server
diff options
context:
space:
mode:
authorpdanner <pdanner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-09-10 15:16:34 +0000
committerpdanner <pdanner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-09-10 15:16:34 +0000
commit4e12d1df5daab1f7600fa3a58e6fc535375224ff (patch)
tree9391d309ef57e98c0d46833356b726b622926b36 /spss/server
parenteecee431bf1e766c8b4d8b744269e2b62a7dc2b8 (diff)
downloadmoa-id-spss-4e12d1df5daab1f7600fa3a58e6fc535375224ff.tar.gz
moa-id-spss-4e12d1df5daab1f7600fa3a58e6fc535375224ff.tar.bz2
moa-id-spss-4e12d1df5daab1f7600fa3a58e6fc535375224ff.zip
moved test classes, cashing of resolved entities
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@1002 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss/server')
-rw-r--r--spss/server/history.txt8
-rw-r--r--spss/server/pom.xml4
-rw-r--r--spss/server/serverlib/pom.xml4
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java119
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java15
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java6
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java43
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java13
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java131
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/AllTests.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/AllTests.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/SPSSTestCase.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/AllTests.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/AllTests.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java)0
-rw-r--r--spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java (renamed from spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java)0
-rw-r--r--spss/server/serverws/pom.xml6
-rw-r--r--spss/server/tools/pom.xml6
31 files changed, 260 insertions, 95 deletions
diff --git a/spss/server/history.txt b/spss/server/history.txt
index d21fef433..3cbb39f06 100644
--- a/spss/server/history.txt
+++ b/spss/server/history.txt
@@ -1,9 +1,15 @@
##############
+1.4.2
+##############
+
+- Performance-Verbesserungen bei der Verwendnung von externen Referenzen.
+
+##############
1.4.1
##############
- Die Projektstruktur wurde eimem Maven Build-Prozess unterlegt. Der Sourcocde
- ab dieser Version unter http://egovlabs.gv.at/scm/?group_id=6 verfügbar.
+ ab dieser Version unter http://egovlabs.gv.at/scm/?group_id=6 verfügbar.
##############
1.4.0
diff --git a/spss/server/pom.xml b/spss/server/pom.xml
index aa5db1624..82e8a8c2f 100644
--- a/spss/server/pom.xml
+++ b/spss/server/pom.xml
@@ -3,14 +3,14 @@
<parent>
<groupId>MOA</groupId>
<artifactId>spss</artifactId>
- <version>1.4.1</version>
+ <version>1.4.x</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>MOA.spss</groupId>
<artifactId>moa-spss</artifactId>
<packaging>pom</packaging>
- <version>1.4.1</version>
+ <version>1.4.x</version>
<name>MOA SP/SS Server</name>
<modules>
diff --git a/spss/server/serverlib/pom.xml b/spss/server/serverlib/pom.xml
index 49bc37ceb..c49a234a1 100644
--- a/spss/server/serverlib/pom.xml
+++ b/spss/server/serverlib/pom.xml
@@ -3,14 +3,14 @@
<parent>
<groupId>MOA.spss</groupId>
<artifactId>moa-spss</artifactId>
- <version>1.4.1</version>
+ <version>1.4.x</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>MOA.spss.server</groupId>
<artifactId>moa-spss-lib</artifactId>
<packaging>jar</packaging>
- <version>1.4.1</version>
+ <version>1.4.2</version>
<name>MOA SP/SS API</name>
<properties>
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java
index 1386d5c2d..ad0da28f4 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java
@@ -1,5 +1,10 @@
package at.gv.egovernment.moa.spss.server.invoke;
+import iaik.ixsil.util.URI;
+import iaik.ixsil.util.XPointerReferenceResolver;
+import iaik.server.modules.xml.DataObject;
+import iaik.server.modules.xml.XMLDataObject;
+
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -7,6 +12,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Vector;
import javax.xml.parsers.ParserConfigurationException;
@@ -14,25 +20,11 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-
import org.xml.sax.EntityResolver;
import org.xml.sax.SAXException;
-import iaik.ixsil.util.URI;
-import iaik.ixsil.util.XPointerReferenceResolver;
-import iaik.server.modules.xml.DataObject;
-import iaik.server.modules.xml.XMLDataObject;
-
import at.gv.egovernment.moa.logging.LogMsg;
import at.gv.egovernment.moa.logging.Logger;
-import at.gv.egovernment.moa.util.Constants;
-import at.gv.egovernment.moa.util.DOMUtils;
-import at.gv.egovernment.moa.util.EntityResolverChain;
-import at.gv.egovernment.moa.util.MOAEntityResolver;
-import at.gv.egovernment.moa.util.MOAErrorHandler;
-import at.gv.egovernment.moa.util.StreamEntityResolver;
-import at.gv.egovernment.moa.util.StreamUtils;
-
import at.gv.egovernment.moa.spss.MOAApplicationException;
import at.gv.egovernment.moa.spss.MOASystemException;
import at.gv.egovernment.moa.spss.api.common.Content;
@@ -48,7 +40,16 @@ import at.gv.egovernment.moa.spss.server.iaik.xml.ByteStreamDataObjectImpl;
import at.gv.egovernment.moa.spss.server.iaik.xml.DataObjectImpl;
import at.gv.egovernment.moa.spss.server.iaik.xml.XMLDataObjectImpl;
import at.gv.egovernment.moa.spss.server.iaik.xml.XMLNodeListDataObjectImpl;
+import at.gv.egovernment.moa.spss.server.transaction.TransactionContext;
+import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager;
import at.gv.egovernment.moa.spss.util.MessageProvider;
+import at.gv.egovernment.moa.util.Constants;
+import at.gv.egovernment.moa.util.DOMUtils;
+import at.gv.egovernment.moa.util.EntityResolverChain;
+import at.gv.egovernment.moa.util.MOAEntityResolver;
+import at.gv.egovernment.moa.util.MOAErrorHandler;
+import at.gv.egovernment.moa.util.StreamEntityResolver;
+import at.gv.egovernment.moa.util.StreamUtils;
/**
* A class to create <code>DataObject</code>s contained in different
@@ -132,12 +133,16 @@ public class DataObjectFactory {
}
case Content.LOCREF_CONTENT:
{
- ExternalURIResolver uriResolver = new ExternalURIResolver();
String locRefURI = ((ContentLocRef) content).getLocationReferenceURI();
InputStream is = null;
try
{
- is = uriResolver.resolve(locRefURI);
+ TransactionContext context = TransactionContextManager.getInstance().getTransactionContext();
+ is = context.ResolveURI(locRefURI);
+ if (is == null) {
+ ExternalURIResolver uriResolver = new ExternalURIResolver();
+ is = uriResolver.resolve(locRefURI);
+ }
contentBytes = StreamUtils.readStream(is);
}
catch (MOAApplicationException e)
@@ -299,25 +304,39 @@ public class DataObjectFactory {
}
case Content.LOCREF_CONTENT:
{
- ExternalURIResolver uriResolver = new ExternalURIResolver();
- String locRefURI = ((ContentLocRef) content).getLocationReferenceURI();
InputStream contentIS = null;
- InputStream uriStream = null;
- try
- {
- uriStream = uriResolver.resolve(locRefURI);
- byte[] contentBytes = StreamUtils.readStream(uriStream);
- contentIS = new ByteArrayInputStream(contentBytes);
- }
- catch (Exception e)
- {
- throw new MOAApplicationException("3202", new Object[]{reference, locRefURI}, e);
- }
- finally
- {
- closeInputStream(uriStream);
- }
- entities.put(reference, contentIS);
+ String locRefURI = ((ContentLocRef) content).getLocationReferenceURI();
+
+
+ TransactionContext context = TransactionContextManager.getInstance().getTransactionContext();
+ Vector entity = context.FindResolvedEntity(locRefURI);
+ if (entity!=null) {
+ contentIS = (InputStream) entity.get(0);
+ } else {
+
+ ExternalURIResolver uriResolver = new ExternalURIResolver();
+
+ InputStream uriStream = null;
+ byte[] contentBytes;
+ String contentType = null;
+ try
+ {
+ uriStream = uriResolver.resolve(locRefURI);
+ contentBytes = StreamUtils.readStream(uriStream);
+ contentIS = new ByteArrayInputStream(contentBytes);
+ contentType = uriResolver.getContentType();
+ }
+ catch (Exception e)
+ {
+ throw new MOAApplicationException("3202", new Object[]{reference, locRefURI}, e);
+ }
+ finally
+ {
+ closeInputStream(uriStream);
+ }
+ entities.put(locRefURI, contentIS);
+ context.PutResolvedEntity(locRefURI, contentBytes, contentType);
+ }
break;
}
case Content.XML_CONTENT :
@@ -648,9 +667,23 @@ public class DataObjectFactory {
private DataObjectImpl createFromURIImpl(String uri, boolean asXml)
throws MOASystemException, MOAApplicationException {
+ Logger.trace(">>> resolving uri \"" + uri + "\"");
+
ExternalURIResolver resolver = new ExternalURIResolver();
- InputStream is = resolver.resolve(uri);
- String contentType = resolver.getContentType();
+
+ TransactionContext context = TransactionContextManager.getInstance().getTransactionContext();
+ InputStream is = context.ResolveURI(uri);
+ String contentType = null;
+ boolean foundURI = false;
+ if (is == null) {
+ is = resolver.resolve(uri);
+ contentType = resolver.getContentType();
+ } else {
+ foundURI = true;
+ contentType = (String) context.FindResolvedEntity(uri).get(1);
+ Logger.trace("found \"" + uri + "\" InputStream in preread Supplements!, do not read any more. Content=" + contentType);
+ }
+
DataObjectImpl dataObject;
// read the content
@@ -684,6 +717,7 @@ public class DataObjectFactory {
dataObject = new XMLDataObjectImpl(doc.getDocumentElement());
} catch (Exception e) {
// this is the last chance: return the data as a byte stream
+ Logger.trace(">>> reading stream for \"" + uri + "\"");
is = resolver.resolve(uri);
ByteArrayInputStream bis;
try
@@ -699,9 +733,11 @@ public class DataObjectFactory {
{
closeInputStream(is);
}
+ Logger.trace(">>> read stream for \"" + uri + "\"");
}
}
}
+
else if (asXml)
{
// if we need XML data, we're in the wrong place here
@@ -711,10 +747,13 @@ public class DataObjectFactory {
else
{
// content is binary: make it available as a binary input stream
+ Logger.trace(">>> getting binary input for \"" + uri + "\"");
+ byte[] contentBytes;
ByteArrayInputStream bis;
try
{
- bis = new ByteArrayInputStream(StreamUtils.readStream(is));
+ contentBytes = StreamUtils.readStream(is);
+ bis = new ByteArrayInputStream(contentBytes);
}
catch (IOException e)
{
@@ -724,12 +763,18 @@ public class DataObjectFactory {
{
closeInputStream(is);
}
+ if (!foundURI) {
+ context.PutResolvedEntity(uri, contentBytes, contentType);
+ }
dataObject = new ByteStreamDataObjectImpl(bis);
+ Logger.trace("<<< got binary input for \"" + uri + "\"");
}
dataObject.setMimeType(contentType);
dataObject.setURI(uri);
+ Logger.trace("<<< resolved uri \"" + uri + "\"");
+
return dataObject;
}
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java
index 106742067..cbd88f7f3 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java
@@ -61,7 +61,6 @@ public class ExternalURIResolver {
//no transaction
throw new MOAApplicationException("2282", new Object[] { uri });
} else {
-
InputStream attachmentIs = context.getAttachmentInputStream(uri);
if (attachmentIs != null) {
setContentType(context.getAttachmentContentType(uri.getPath()));
@@ -70,20 +69,6 @@ public class ExternalURIResolver {
//maybe attachments provided but no suiting attachment found
throw new MOAApplicationException("2282", new Object[] { uri });
}
-/*
- try {
- InputStream attachmentIs = context.getAttachment(uri).getInputStream();
- if (attachmentIs != null) {
- setContentType(context.getAttachmentContentType(uri.getPath()));
- return attachmentIs;
- } else {
- //maybe attachments provided but no suiting attachment found
- throw new MOAApplicationException("2282", new Object[] { uri });
- }
- } catch (IOException e) {
- throw new MOAApplicationException("2208", new Object[] { uri }, e);
- }
-*/
}
}
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java
index 4642593eb..3dd7ecf11 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java
@@ -89,10 +89,8 @@ public class XMLSignatureVerificationInvoker {
FILTERED_REF_TYPES = new HashSet();
FILTERED_REF_TYPES.add(DsigManifest.XML_DSIG_MANIFEST_TYPE);
FILTERED_REF_TYPES.add(SecurityLayerManifest.SECURITY_LAYER_MANIFEST_TYPE);
- FILTERED_REF_TYPES.add(
- SecurityLayerManifest.SECURITY_LAYER_MANIFEST_TYPE_OLD);
- FILTERED_REF_TYPES.add(
- XMLConstants.NAMESPACE_ETSI_STRING + "SignedProperties");
+ FILTERED_REF_TYPES.add(SecurityLayerManifest.SECURITY_LAYER_MANIFEST_TYPE_OLD);
+ FILTERED_REF_TYPES.add(XMLConstants.NAMESPACE_ETSI_STRING + "SignedProperties");
}
/**
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java
index befbd58dd..f5f77ff50 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java
@@ -27,6 +27,7 @@ import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.logging.LoggingContext;
import at.gv.egovernment.moa.logging.LoggingContextManager;
import at.gv.egovernment.moa.spss.MOASystemException;
+import at.gv.egovernment.moa.spss.api.common.Content;
import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
import at.gv.egovernment.moa.spss.server.transaction.TransactionContext;
import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager;
@@ -94,6 +95,7 @@ public class AxisHandler extends BasicHandler {
*/
private void handleRequest(MessageContext msgContext) throws AxisFault {
try {
+ Logger.trace("---- Entering Axishandler");
// generate a unique transaction id and build the TransactionContext
// for this request
HttpServletRequest request =
@@ -143,7 +145,9 @@ public class AxisHandler extends BasicHandler {
}
context.setRequestName(soapAction);
+ Logger.trace(">>> Get AttachmentCount");
int attachmentCount = soapMessage.getAttachmentsImpl().getAttachmentCount();
+ Logger.trace("<<< Finished Get AttachmentCount");
if (attachmentCount>0) {
// add SOAP attachments to transaction context
@@ -156,12 +160,23 @@ public class AxisHandler extends BasicHandler {
//Now get the InputStream (note: we could also get the content with Object content = attachment.getContent();)
InputStream is = null;
javax.activation.DataHandler datahandler = attachment.getDataHandler();
- org.apache.axis.attachments.ManagedMemoryDataSource mmds = (org.apache.axis.attachments.ManagedMemoryDataSource)datahandler.getDataSource();
- if (mmds!=null){
- is = mmds.getInputStream();
+
+ int TYPE = 2;
+ switch (TYPE) {
+ case 1:
+ {
+ org.apache.axis.attachments.ManagedMemoryDataSource mmds = (org.apache.axis.attachments.ManagedMemoryDataSource)datahandler.getDataSource();
+ context.addAttachment(id, type, mmds);
+ break;
+ }
+ case 2:
+ {
+ is = datahandler.getDataSource().getInputStream();
+ context.addAttachment(id, type, is, datahandler.getDataSource().getName());
+ break;
+ }
}
debug("handler.06", new Object[] {id, type});
- context.addAttachment(id, type, mmds);
}
}
@@ -202,6 +217,7 @@ public class AxisHandler extends BasicHandler {
fault.setFaultDetail(new Element[] { e.toErrorResponse()});
throw fault;
}
+ Logger.trace("---- Leaving Axishandler");
}
/**
@@ -379,4 +395,21 @@ public class AxisHandler extends BasicHandler {
Logger.debug(new LogMsg(msg.getMessage(messageId, parameters)));
}
-}
+
+
+// private byte[] toByteArray(AttachmentPart attachment) throws SOAPException, IOException
+// {
+// ByteArrayOutputStream outputStream = new ByteArrayOutputStream(attachment.getSize());
+// InputStream inputStream = (InputStream) attachment.getContent();
+// int currentByte = -1;
+// while ((currentByte = inputStream.read()) != -1)
+// outputStream.write(currentByte);
+//
+// inputStream.close();
+// outputStream.close();
+//
+// return outputStream.toByteArray();
+//
+//}
+
+} \ No newline at end of file
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java
index 2d548ea3a..c173625f8 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java
@@ -40,6 +40,7 @@ public class SignatureCreationService {
*/
public Element[] CreateXMLSignatureRequest(Element[] request)
throws AxisFault {
+ Logger.trace("---- Entering SignatureCreationService");
XMLSignatureCreationInvoker invoker =
XMLSignatureCreationInvoker.getInstance();
Element[] response = new Element[1];
@@ -72,17 +73,23 @@ public class SignatureCreationService {
reparsedReq = ServiceUtils.reparseRequest(context.getRequest());
// convert to API objects
+ Logger.trace(">>> preparsing Request");
requestObj = requestParser.parse(reparsedReq);
-
+ Logger.trace("<<< preparsed Request");
+
+ Logger.trace(">>> creating Signature");
// invoke the core logic
- responseObj =
- invoker.createXMLSignature(requestObj, Collections.EMPTY_SET);
+ responseObj = invoker.createXMLSignature(requestObj, Collections.EMPTY_SET);
+ Logger.trace("<<< created Signature");
+ Logger.trace(">>> building Response");
// map back to XML
response[0] = responseBuilder.build(responseObj).getDocumentElement();
+ Logger.trace("<<< built Response");
// save response in transaction
context.setResponse(response[0]);
+ Logger.trace("---- Leaving SignatureCreationService");
} catch (MOAException e) {
AxisFault fault = AxisFault.makeFault(e);
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java
index 774880d26..5c1e35a95 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java
@@ -2,6 +2,7 @@ package at.gv.egovernment.moa.spss.server.transaction;
import iaik.ixsil.util.URI;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -14,6 +15,7 @@ import java.util.Map.Entry;
import org.apache.axis.attachments.ManagedMemoryDataSource;
import org.w3c.dom.Element;
+import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.spss.MOAApplicationException;
import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
@@ -37,9 +39,11 @@ public class TransactionContext {
private Element response;
/** The map pointing to SOAP attachments needed by the request. */
private HashMap attachments = null;
+ /** The map containing cashed entities used in DataObjectFactory. */
+ private HashMap resolvedEntities = null;
/** The configuration to use throughout the request. */
private ConfigurationProvider configuration = null;
-
+
/**
* Create a <code>TransactionContext</code> object.
*
@@ -170,6 +174,23 @@ public class TransactionContext {
}
/**
+ * Adds an attachment to the transactions list of SOAP attachments.
+ *
+ * @param referenceId Identification value for the SOAP attachment.
+ * @param contentType MIME type of the SOAP attachment.
+ * @param is Handle to the InputStream of the SOAP attachment.
+ * @param filename Filename of the temporary file the InputStream belongs to
+ */
+ public void addAttachment(String referenceId, String contentType, InputStream is, String filename) {
+ if (this.attachments == null) this.attachments = new HashMap();
+ Vector entry = new Vector(3);
+ entry.add(contentType);
+ entry.add(is);
+ entry.add(filename);
+ this.attachments.put(referenceId, entry);
+ }
+
+ /**
* Returns the ManagedMemoryDataSource to a specific SOAP attachment identified by referenceId.
*
* @param referenceId Identification value for the SOAP attachment.
@@ -182,10 +203,14 @@ public class TransactionContext {
if (entry==null) {
return null;
}
- //return (InputStream) ( ((ManagedMemoryDataSource)entry.get(1)).getInputStream());
- return (ManagedMemoryDataSource) entry.get(1);
+ Object object = entry.get(1);
+ if (object instanceof ManagedMemoryDataSource) {
+ return (ManagedMemoryDataSource) object;
+ } else {
+ return null;
+ }
}
-
+
/**
* Returns the InputStream to a specific SOAP attachment identified by uri.
*
@@ -202,12 +227,17 @@ public class TransactionContext {
}
InputStream attachmentIs = null;
- try {
- attachmentIs = (InputStream) ( ((ManagedMemoryDataSource)entry.get(1)).getInputStream());
- } catch (IOException e) {
- throw new MOAApplicationException("2208", new Object[] { uri }, e);
+ Object object = entry.get(1);
+
+ if (object instanceof ManagedMemoryDataSource) {
+ try {
+ attachmentIs = (InputStream) ( ((ManagedMemoryDataSource)object).getInputStream());
+ } catch (IOException e) {
+ throw new MOAApplicationException("2208", new Object[] { uri }, e);
+ }
+ } else {
+ attachmentIs = (InputStream) object;
}
-
return attachmentIs;
//If we would return the whole mmds: return (ManagedMemoryDataSource) entry.get(1);
}
@@ -236,17 +266,32 @@ public void cleanAttachmentCache() {
while (iterator.hasNext()) {
Entry hmEntry = (Entry) iterator.next();
Vector entry = (Vector)hmEntry.getValue();
- ManagedMemoryDataSource mmds = (ManagedMemoryDataSource)entry.get(1);
- try {
- if (mmds!=null) {
- InputStream is = mmds.getInputStream();
- if (is!=null) is.close();
- File f = mmds.getDiskCacheFile();
- if (f!=null) f.delete();
- mmds.delete();
- }
- } catch (IOException e) {
- // ok to do nothing here
+ Object object = entry.get(1);
+ if (object instanceof ManagedMemoryDataSource) {
+ ManagedMemoryDataSource mmds = (ManagedMemoryDataSource)object;
+ try {
+ if (mmds!=null) {
+ InputStream is = mmds.getInputStream();
+ if (is!=null) is.close();
+ File f = mmds.getDiskCacheFile();
+ if (f!=null) f.delete();
+ mmds.delete();
+ }
+ } catch (IOException e) {
+ // ok to do nothing here
+ }
+ } else if (object instanceof InputStream) {
+ InputStream is = (InputStream)object;
+ try {
+ if (is!=null) is.close();
+ String tempFile = (String) entry.get(2);
+ if (tempFile!=null){
+ File f = new File(tempFile);
+ f.delete();
+ }
+ } catch (IOException e) {
+ // ok to do nothing here
+ }
}
}
}
@@ -261,4 +306,50 @@ public void cleanAttachmentCache() {
return configuration;
}
+ /**
+ * Search an uri content in cashed map.
+ *
+ * @param uri The value to look for.
+ * @return If found the cached entity, <code>null<code> otherwise.
+ */
+ public Vector FindResolvedEntity(String uri) {
+ if (resolvedEntities==null) return null;
+ return (Vector) resolvedEntities.get(uri);
+ }
+
+ /**
+ * Get a new InputStream of a cached entity.
+ *
+ * @param uri The value to look for.
+ * @return A new InputStream of the cached entity.
+ */
+ public InputStream ResolveURI(String uri) {
+ InputStream is = null;
+ Vector entity = FindResolvedEntity(uri);
+ if (entity!=null) {
+ byte[] contentBytes = (byte[]) entity.get(0);
+ if (contentBytes!=null) {
+ is = new ByteArrayInputStream(contentBytes);
+ }
+ }
+ return is;
+ }
+
+ /**
+ * Put a read entity (supplement, detached content, data object) on
+ * transactions entity cash, to prevent repeated reading on slower channels.
+ *
+ * @param uri A transaction-wide unique URI used as key of the entity cash
+ * table.
+ * @param contentBytes The cached content belonging to the uri.
+ * @param contentType If known, the MIME-type of the cashed content.
+ */
+ public void PutResolvedEntity(String uri, byte[] contentBytes, String contentType) {
+ Logger.trace(" storing uri content of uri \"" + uri + "\" for future references");
+ if (resolvedEntities==null) resolvedEntities = new HashMap();
+ Vector entity = new Vector();
+ entity.add(contentBytes);
+ entity.add(contentType);
+ resolvedEntities.put(uri, entity);
+ }
}
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/AllTests.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/AllTests.java
index c670b5e55..c670b5e55 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/AllTests.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/AllTests.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/SPSSTestCase.java
index a585e30a0..a585e30a0 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/SPSSTestCase.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java
index 28f79729e..28f79729e 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java
index 7ce705b01..7ce705b01 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java
index f580f86bc..f580f86bc 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java
index 4be7667eb..4be7667eb 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java
index 3b8e8b00e..3b8e8b00e 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/AllTests.java
index 131f38c19..131f38c19 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/AllTests.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java
index 474a387ad..474a387ad 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java
index adf02809b..adf02809b 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java
index 7da2165cb..7da2165cb 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java
index be1090e4a..be1090e4a 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java
index 3b403dc19..3b403dc19 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/AllTests.java
index 65fa2bf72..65fa2bf72 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/AllTests.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java
index 3024730f4..3024730f4 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java
index 7de2add33..7de2add33 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java
index 13a80cbf1..13a80cbf1 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java
index 28cd3805a..28cd3805a 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java
index 56e3d541b..56e3d541b 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java
diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java
index b46c20086..b46c20086 100644
--- a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java
+++ b/spss/server/serverlib/src/test/java/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java
diff --git a/spss/server/serverws/pom.xml b/spss/server/serverws/pom.xml
index de0f511c2..88b3345d6 100644
--- a/spss/server/serverws/pom.xml
+++ b/spss/server/serverws/pom.xml
@@ -3,14 +3,14 @@
<parent>
<groupId>MOA.spss</groupId>
<artifactId>moa-spss</artifactId>
- <version>1.4.1</version>
+ <version>1.4.x</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>MOA.spss.server</groupId>
<artifactId>moa-spss-ws</artifactId>
<packaging>war</packaging>
- <version>1.4.1</version>
+ <version>1.4.2</version>
<name>MOA SP/SS WebService</name>
<properties>
@@ -57,7 +57,7 @@
<dependency>
<groupId>MOA.spss.server</groupId>
<artifactId>moa-spss-lib</artifactId>
- <version>${project.version}</version>
+ <version>${pom.version}</version>
</dependency>
<dependency>
<groupId>MOA</groupId>
diff --git a/spss/server/tools/pom.xml b/spss/server/tools/pom.xml
index 3bfb747f8..3a3cde79c 100644
--- a/spss/server/tools/pom.xml
+++ b/spss/server/tools/pom.xml
@@ -3,14 +3,14 @@
<parent>
<groupId>MOA.spss</groupId>
<artifactId>moa-spss</artifactId>
- <version>1.4.1</version>
+ <version>1.4.x</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>MOA.spss.server</groupId>
<artifactId>moa-spss-tools</artifactId>
<packaging>jar</packaging>
- <version>1.4.1</version>
+ <version>1.4.2</version>
<name>MOA SP/SS Tools</name>
<properties>
@@ -21,7 +21,7 @@
<dependency>
<groupId>MOA.spss.server</groupId>
<artifactId>moa-spss-lib</artifactId>
- <version>${project.version}</version>
+ <version>${pom.version}</version>
</dependency>
<dependency>
<groupId>iaik.prod</groupId>