From 3c4eac027bfd68bfce63a2eed010ccc2b7310802 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 16 Oct 2014 09:43:49 +0200 Subject: PreProcessor Interface added and API rebuild --- .../gv/egiz/pdfas/api/ws/PDFASPropertyEntry.java | 27 +++++++++++ .../at/gv/egiz/pdfas/api/ws/PDFASPropertyMap.java | 54 ++++++++++++++++++++++ .../gv/egiz/pdfas/api/ws/PDFASSignParameters.java | 13 ++++++ .../gv/egiz/pdfas/api/ws/PDFASVerifyRequest.java | 12 +++++ 4 files changed, 106 insertions(+) create mode 100644 pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASPropertyEntry.java create mode 100644 pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASPropertyMap.java (limited to 'pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws') diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASPropertyEntry.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASPropertyEntry.java new file mode 100644 index 00000000..8e6025f3 --- /dev/null +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASPropertyEntry.java @@ -0,0 +1,27 @@ +package at.gv.egiz.pdfas.api.ws; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="PropertyEntry") +public class PDFASPropertyEntry { + String key; + String value; + + @XmlElement(required = true, nillable = false, name="key") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + @XmlElement(required = true, nillable = false, name="value") + public String getValue() { + return value; + } + public void setvalue(String value) { + this.value = value; + } +} diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASPropertyMap.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASPropertyMap.java new file mode 100644 index 00000000..b83daab9 --- /dev/null +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASPropertyMap.java @@ -0,0 +1,54 @@ +package at.gv.egiz.pdfas.api.ws; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="PropertyMap") +public class PDFASPropertyMap { + List propertyEntries; + + @XmlElement(required = true, nillable = false, name="propertyEntries") + public List getPropertyEntries() { + return propertyEntries; + } + + public void setPropertyEntries(List propertyEntries) { + this.propertyEntries = propertyEntries; + } + + @XmlTransient + public Map getMap() { + if(propertyEntries != null) { + Map map = new HashMap(); + Iterator propsIt = propertyEntries.iterator(); + while(propsIt.hasNext()) { + PDFASPropertyEntry entry = propsIt.next(); + map.put(entry.getKey(), entry.value); + } + return map; + } + return null; + } + + public void setMap(Map map) { + + if(map != null) { + propertyEntries = new ArrayList(); + Iterator keyIt = map.keySet().iterator(); + while(keyIt.hasNext()) { + String key = keyIt.next(); + PDFASPropertyEntry entry = new PDFASPropertyEntry(); + entry.setKey(key); + entry.setvalue(map.get(key)); + propertyEntries.add(entry); + } + } + } +} diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASSignParameters.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASSignParameters.java index 9b295ff5..c6f3993e 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASSignParameters.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASSignParameters.java @@ -24,6 +24,8 @@ package at.gv.egiz.pdfas.api.ws; import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlEnumValue; @@ -76,6 +78,7 @@ public class PDFASSignParameters implements Serializable { String invokeErrorUrl; String transactionId; String profile; + PDFASPropertyMap preprocessor; @XmlElement(required = true, nillable = false, name="connector") public Connector getConnector() { @@ -133,5 +136,15 @@ public class PDFASSignParameters implements Serializable { public void setTransactionId(String transactionId) { this.transactionId = transactionId; } + + @XmlElement(required = false, nillable = true, name="preprocessorArguments") + public PDFASPropertyMap getPreprocessor() { + return preprocessor; + } + + public void setPreprocessor(PDFASPropertyMap preprocessor) { + this.preprocessor = preprocessor; + } + } diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASVerifyRequest.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASVerifyRequest.java index 7167e921..2afa1f08 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASVerifyRequest.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/api/ws/PDFASVerifyRequest.java @@ -1,6 +1,8 @@ package at.gv.egiz.pdfas.api.ws; import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @@ -17,6 +19,7 @@ public class PDFASVerifyRequest implements Serializable { byte[] inputData; VerificationLevel verificationLevel; Integer sigIdx; + PDFASPropertyMap preprocessor; @XmlElement(required = true, nillable = false, name="requestID") public String getRequestID() { @@ -53,4 +56,13 @@ public class PDFASVerifyRequest implements Serializable { public void setSignatureIndex(Integer sigIdx) { this.sigIdx = sigIdx; } + + @XmlElement(required = false, nillable = true, name="preprocessorArguments") + public PDFASPropertyMap getPreprocessor() { + return preprocessor; + } + + public void setPreprocessor(PDFASPropertyMap preprocessor) { + this.preprocessor = preprocessor; + } } -- cgit v1.2.3