aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java
diff options
context:
space:
mode:
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java
index 304a7d3..d752a63 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java
@@ -33,11 +33,12 @@ import iaik.pki.ldap.Handler;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLConnection;
import java.net.URLStreamHandler;
import java.util.Collection;
import java.util.Date;
-import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moaspss.logging.Logger;
/**
* A customized implementation of
@@ -51,6 +52,11 @@ import at.gv.egovernment.moa.logging.Logger;
* @version $$
*/
public class CRLRetriever implements RevocationInfoRetriever {
+
+ private int connectTimeout = 5;
+ private int readTimeout = 5;
+
+
public void update(RevocationSource source, Collection supplementalRequestData, TransactionId tid)
throws RevocationStoreException {
if (source == null) {
@@ -70,8 +76,10 @@ public class CRLRetriever implements RevocationInfoRetriever {
URLStreamHandler handler = new Handler();
crlUrl = new URL(null, source.getUri(), handler);
}
-
- InputStream crlInputStream = crlUrl.openStream();
+ URLConnection con = crlUrl.openConnection();
+ con.setConnectTimeout(connectTimeout);
+ con.setReadTimeout(readTimeout);
+ InputStream crlInputStream = con.getInputStream();
source.readFrom(crlInputStream, tid);
source.setDownloadTime(new Date());
crlInputStream.close();
@@ -83,11 +91,11 @@ public class CRLRetriever implements RevocationInfoRetriever {
@Override
public void setConnectTimeout(int arg0) {
- // TODO AFITZEK IMPLEMENT THIS METHOD
+ this.connectTimeout = arg0;
}
@Override
public void setReadTimeout(int arg0) {
- // TODO AFITZEK IMPLEMENT THIS METHOD
+ this.readTimeout = arg0;
}
}