summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-09-18 09:25:55 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-09-18 09:25:55 +0000
commita20fb683943ce0893302b6dc25015c998cd9687f (patch)
treec7642496f0d453f0f250420647e8eae893e7d602
parentf72d5842828ec072813eb30051d24f7cc8613606 (diff)
downloadmocca-a20fb683943ce0893302b6dc25015c998cd9687f.tar.gz
mocca-a20fb683943ce0893302b6dc25015c998cd9687f.tar.bz2
mocca-a20fb683943ce0893302b6dc25015c998cd9687f.zip
hashdatainput cached
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@46 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java6
-rw-r--r--BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java28
-rw-r--r--BKULocal/src/main/resources/commons-logging.properties16
-rw-r--r--BKULocal/src/main/resources/log4j.properties2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/DataObjectHashDataInput.java6
5 files changed, 46 insertions, 12 deletions
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index 5fb67982..be4aeded 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -871,8 +871,10 @@ public class BKUGUI implements BKUGUIFacade {
.addComponent(waitMsgLabel)
.addContainerGap()); //, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(waitMsgLabel));
+ mainPanelLayout.createSequentialGroup()
+// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(waitMsgLabel)
+ .addContainerGap());
contentPanel.validate();
}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
index a288a716..ca420f13 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
@@ -16,6 +16,7 @@
*/
package at.gv.egiz.bku.local.stal;
+import at.gv.egiz.bku.slcommands.impl.DataObjectHashDataInput;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -68,14 +69,27 @@ public class LocalSignRequestHandler extends SignRequestHandler {
if (dsigRefId != null) {
for (HashDataInput hdi : hashDataInput) {
if (hdi.getReferenceId().equals(dsigRefId)) {
- InputStream hdIs = hdi.getHashDataInput();
- ByteArrayOutputStream baos = new ByteArrayOutputStream(hdIs.available());
- int b;
- while ((b = hdIs.read()) != -1) {
- baos.write(b);
+ if (hdi instanceof DataObjectHashDataInput) {
+ if (log.isTraceEnabled())
+ log.trace("adding DataObjectHashDataInput");
+ result.add(hdi);
+ } else if (hdi instanceof ByteArrayHashDataInput) {
+ if (log.isTraceEnabled())
+ log.trace("adding ByteArrayHashDataInput");
+ result.add(hdi);
+ } else {
+ if (log.isDebugEnabled())
+ log.debug("provided HashDataInput not chaching enabled, creating ByteArrayHashDataInput");
+
+ InputStream hdIs = hdi.getHashDataInput();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(hdIs.available());
+ int b;
+ while ((b = hdIs.read()) != -1) {
+ baos.write(b);
+ }
+ ByteArrayHashDataInput baHdi = new ByteArrayHashDataInput(baos.toByteArray(), hdi.getReferenceId(), hdi.getMimeType(), hdi.getEncoding());
+ result.add(baHdi);
}
- ByteArrayHashDataInput baHdi = new ByteArrayHashDataInput(baos.toByteArray(), hdi.getReferenceId(), hdi.getMimeType(), hdi.getEncoding());
- result.add(baHdi);
}
}
} else {
diff --git a/BKULocal/src/main/resources/commons-logging.properties b/BKULocal/src/main/resources/commons-logging.properties
new file mode 100644
index 00000000..0d497b1b
--- /dev/null
+++ b/BKULocal/src/main/resources/commons-logging.properties
@@ -0,0 +1,16 @@
+# Copyright 2008 Federal Chancellery Austria and
+# Graz University of Technology
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
diff --git a/BKULocal/src/main/resources/log4j.properties b/BKULocal/src/main/resources/log4j.properties
index 49d763f8..3a730bac 100644
--- a/BKULocal/src/main/resources/log4j.properties
+++ b/BKULocal/src/main/resources/log4j.properties
@@ -14,7 +14,7 @@
# limitations under the License.
# loglever DEBUG, appender STDOUT
-log4j.rootLogger=TRACE, STDOUT, file
+log4j.rootLogger=DEBUG, STDOUT, file
# STDOUT appender
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/DataObjectHashDataInput.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/DataObjectHashDataInput.java
index 71b62911..0386bdd6 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/DataObjectHashDataInput.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/DataObjectHashDataInput.java
@@ -10,7 +10,9 @@ import at.gv.egiz.stal.HashDataInput;
import java.io.InputStream;
/**
- *
+ * DataObject-backed HashDataInput
+ * If <a href="XMLSignContext.html#Supported Properties">reference caching</a> is enabled,
+ * the hashdata input stream can be obtained repeatedly.
* @author clemens
*/
public class DataObjectHashDataInput implements HashDataInput {
@@ -34,7 +36,7 @@ public class DataObjectHashDataInput implements HashDataInput {
}
/**
- *
+ * may be called repeatedly
* @return the pre-digested input stream if reference caching is enabled, null otherwise
*/
@Override