aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas/web/SignSessionInformation.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/web/SignSessionInformation.java')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/web/SignSessionInformation.java140
1 files changed, 140 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/web/SignSessionInformation.java b/src/main/java/at/gv/egiz/pdfas/web/SignSessionInformation.java
new file mode 100644
index 0000000..459a104
--- /dev/null
+++ b/src/main/java/at/gv/egiz/pdfas/web/SignSessionInformation.java
@@ -0,0 +1,140 @@
+/**
+ *
+ */
+package at.gv.egiz.pdfas.web;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
+
+import at.gv.egiz.pdfas.impl.input.FileBasedPdfDataSourceImpl;
+import at.gv.egiz.pdfas.impl.output.FileBasedDataSink;
+import at.gv.egiz.pdfas.web.helper.TempDirHelper;
+import at.gv.egiz.pdfas.framework.signator.SignatorInformation;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import at.knowcenter.wag.egov.egiz.pdf.TablePos;
+import at.knowcenter.wag.egov.egiz.web.ExternAppInformation;
+import at.knowcenter.wag.egov.egiz.web.LocalRequest;
+
+/**
+ * @author wprinz
+ *
+ */
+public class SignSessionInformation implements HttpSessionBindingListener, Serializable
+{
+ /**
+ * SVUID.
+ */
+ private static final long serialVersionUID = 2739944460007369626L;
+
+ /**
+ * The log.
+ */
+ private static Log log = LogFactory.getLog(SignSessionInformation.class);
+
+ /**
+ * The connector.
+ */
+ public String connector = null;
+
+ /**
+ * For local requests, tells the application (sign, verify).
+ */
+ public String application = null;
+
+ /**
+ * Tells the operation mode (binary, textual).
+ */
+ public String mode = null;
+
+ /**
+ * The original, uploaded pdf.
+ */
+ public FileBasedPdfDataSourceImpl pdfDataSource = null;
+
+ /**
+ * The type/profile of the signature.
+ */
+ public String type = null;
+
+ /**
+ * The suggested filename.
+ */
+ public String filename;
+
+ /**
+ * Tells, if the file download should be done inline or as attachment.
+ */
+ public boolean download_inline;
+
+ /**
+ * Object containing information about the calling webapplication.
+ *
+ * @author: Thomas Zefferer
+ */
+ public ExternAppInformation exappinf;
+
+ /**
+ * Information about the signature position
+ *
+ * @author: Thomas Zefferer
+ */
+ public TablePos pos;
+
+ /**
+ * The SignatorInformation.
+ */
+ public SignatorInformation si = null;
+
+ /**
+ * The DataSink to write the output data to.
+ */
+ public FileBasedDataSink output = null;
+
+ /**
+ * The local request to be sent to the device.
+ */
+ public LocalRequest localRequest = null;
+
+ /**
+ * The response properties of the local request.
+ */
+ public Properties response_properties = null;
+
+ /**
+ * Tells if the sign request has been processed and the signed document is
+ * available in the DataSink.
+ */
+ public boolean outputAvailable = false;
+
+
+ /**
+ * @see javax.servlet.http.HttpSessionBindingListener#valueBound(javax.servlet.http.HttpSessionBindingEvent)
+ */
+ public void valueBound(HttpSessionBindingEvent event)
+ {
+ log.debug("Bound SignSessionInformation to session.");
+ }
+
+ /**
+ * @see javax.servlet.http.HttpSessionBindingListener#valueUnbound(javax.servlet.http.HttpSessionBindingEvent)
+ */
+ public void valueUnbound(HttpSessionBindingEvent event)
+ {
+ log.debug("Unbound SignSessionInformation from session.");
+
+ if (this.pdfDataSource != null)
+ {
+ TempDirHelper.deleteDataSourceIfFileBased(this.pdfDataSource);
+ }
+ if (this.output != null)
+ {
+ TempDirHelper.deleteDataSinkIfFileBased(this.output);
+ }
+ }
+}