summaryrefslogtreecommitdiff
path: root/bkucommon/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
authorwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-09-25 07:29:47 +0000
committerwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-09-25 07:29:47 +0000
commite21dd5249d5fa19c5619847922cf8cdea95e3145 (patch)
tree00756b302d7fe37a4912ff5da812e25e2a781d9b /bkucommon/src/main/java/at/gv/egiz
parent55302f2bbe65d28a21d61822f3c316a7fafd1eff (diff)
downloadmocca-e21dd5249d5fa19c5619847922cf8cdea95e3145.tar.gz
mocca-e21dd5249d5fa19c5619847922cf8cdea95e3145.tar.bz2
mocca-e21dd5249d5fa19c5619847922cf8cdea95e3145.zip
improved robustness of http binding processor
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@70 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'bkucommon/src/main/java/at/gv/egiz')
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessor.java4
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessor.java9
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadCommandImpl.java8
3 files changed, 16 insertions, 5 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessor.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessor.java
index c386508d..2569bf85 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessor.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessor.java
@@ -71,5 +71,7 @@ public interface BindingProcessor extends Runnable {
* If the locale is not set the default locale will be used.
* @param locale must not be null.
*/
- public void setLocale(Locale locale);
+ public void setLocale(Locale locale);
+
+ public boolean isFinished();
} \ No newline at end of file
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessor.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessor.java
index 8f72c3ee..5e44e82b 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessor.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessor.java
@@ -115,6 +115,7 @@ public class HTTPBindingProcessor extends AbstractBindingProcessor implements
protected int responseCode = 200;
protected Map<String, String> responseHeaders = Collections.EMPTY_MAP;
protected Locale locale = Locale.getDefault();
+ protected boolean finished = false;
/**
*
@@ -246,6 +247,7 @@ public class HTTPBindingProcessor extends AbstractBindingProcessor implements
commandInvoker.setCommand(slCommand);
responseCode = 200;
responseHeaders = Collections.EMPTY_MAP;
+ dataUrlResponse = null;
try {
commandInvoker.invoke(srcContex);
} catch (SLException e) {
@@ -253,7 +255,6 @@ public class HTTPBindingProcessor extends AbstractBindingProcessor implements
bindingProcessorError = e;
currentState = State.TRANSFORM;
}
- dataUrlResponse = null;
if (getDataUrl() != null) {
log.debug("Data Url set to: " + getDataUrl());
currentState = State.DATAURL;
@@ -495,6 +496,7 @@ public class HTTPBindingProcessor extends AbstractBindingProcessor implements
sendSTALQuit();
log.info("Terminating Bindingprocessor; Thread: "
+ Thread.currentThread().getId());
+ finished = true;
}
// -- END Methods that handle the http binding activities as defined in the
@@ -620,6 +622,7 @@ public class HTTPBindingProcessor extends AbstractBindingProcessor implements
currentState = State.FINISHED;
}
log.debug("Terminated http binding processor");
+ finished = true;
}
@Override
@@ -805,4 +808,8 @@ public class HTTPBindingProcessor extends AbstractBindingProcessor implements
this.locale = locale;
}
+ @Override
+ public boolean isFinished() {
+ return finished;
+ }
} \ No newline at end of file
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadCommandImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadCommandImpl.java
index 4d64ae36..b6c89e5b 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadCommandImpl.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/InfoboxReadCommandImpl.java
@@ -371,12 +371,12 @@ public class InfoboxReadCommandImpl extends SLCommandImpl<InfoboxReadRequestType
infoboxReadRequest = new InfoboxReadRequest();
infoboxReadRequest.setInfoboxIdentifier("SecureSignatureKeypair");
stalRequests.add(infoboxReadRequest);
-
infoboxReadRequest = new InfoboxReadRequest();
infoboxReadRequest.setInfoboxIdentifier("CertifiedKeypair");
stalRequests.add(infoboxReadRequest);
requestSTAL(stalRequests);
+ log.trace("Got STAL response");
IdentityLink identityLink = getIdentityLinkFromResponses();
List<X509Certificate> certificates = getCertificatesFromResponses();
@@ -413,10 +413,12 @@ public class InfoboxReadCommandImpl extends SLCommandImpl<InfoboxReadRequestType
Result xmlResult = (isXMLEntity || identityLinkDomainIdentifier != null)
? result.getXmlResult(true)
: new StreamResult((resultBytes = new ByteArrayOutputStream()));
- try {
+ try {
+ log.trace("Trying to transform identitylink");
identityLinkTransformer.transformIdLink(issuerTemplate, new DOMSource(document), xmlResult);
} catch (IOException e) {
- // we should not get an IOException as we are writing into a DOMResult
+ // we should not get an IOException as we are writing into a DOMResult
+ log.warn("Failed to transform idlink",e);
throw new SLRuntimeException(e);
} catch (TransformerException e) {
log.info("Faild to transform CompressedIdentityLink.", e);