diff --git a/src/main/java/net/ivoa/xml/vospace/v2/Transfer.java b/src/main/java/net/ivoa/xml/vospace/v2/Transfer.java index b156cb4ee416a382b987779c58124f631528780e..5758b36613beb7921733461c940a55f445624948 100644 --- a/src/main/java/net/ivoa/xml/vospace/v2/Transfer.java +++ b/src/main/java/net/ivoa/xml/vospace/v2/Transfer.java @@ -69,7 +69,8 @@ import javax.xml.bind.annotation.XmlType; "direction", "view", "protocols", - "keepBytes" + "keepBytes", + "param" }) // <edit> @XmlRootElement @@ -88,6 +89,9 @@ public class Transfer { @XmlAttribute protected String version; // </edit> + // <edit> Fix: param is missing in VOSpace XSD + @XmlElement(nillable = true) + protected List<Param> param; /** * Gets the value of the target property. @@ -223,5 +227,37 @@ public class Transfer { this.version = version; } // </edit> + + // <edit> + /** + * Gets the value of the param property. + * + * <p> + * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a <CODE>set</CODE> method for the param property. + * + * <p> + * For example, to add a new item, do as follows: + * <pre> + * getParam().add(newItem); + * </pre> + * + * + * <p> + * Objects of the following type(s) are allowed in the list + * {@link Param } + * + * + */ + public List<Param> getParam() { + if (param == null) { + param = new ArrayList<Param>(); + } + return this.param; + } + // </edit> + } diff --git a/src/test/java/net/ivoa/xml/vospace/v2/TransferTest.java b/src/test/java/net/ivoa/xml/vospace/v2/TransferTest.java index 740f6b0538a2c35b612d58c7866641f3896932eb..b8d514fe76734144959c2e5e4946e1566f161288 100644 --- a/src/test/java/net/ivoa/xml/vospace/v2/TransferTest.java +++ b/src/test/java/net/ivoa/xml/vospace/v2/TransferTest.java @@ -1,6 +1,7 @@ package net.ivoa.xml.vospace.v2; import com.fasterxml.jackson.databind.ObjectMapper; +import it.inaf.oats.vospace.datamodel.NodeProperties; import java.io.StringReader; import java.io.StringWriter; import javax.xml.bind.JAXB; @@ -37,13 +38,19 @@ public class TransferTest { Transfer transfer = new Transfer(); transfer.setTarget(URI_PREFIX + "/mynode"); - transfer.setDirection("pullFromVoSpace"); + transfer.setDirection("pullFromVoSpace"); Protocol protocol = new Protocol(); protocol.setUri("ivo://ivoa.net/vospace/core#httpget"); protocol.setEndpoint("http://ia2.inaf.it/data?param1=value1¶m2=value2"); transfer.getProtocols().add(protocol); + + Param groupWriteParam = new Param(); + groupWriteParam.setUri(NodeProperties.GROUP_WRITE_URI); + groupWriteParam.setValue("group1 group2"); + + transfer.getParam().add(groupWriteParam); return transfer; } @@ -53,6 +60,9 @@ public class TransferTest { assertEquals(serialized.getTarget(), deserialized.getTarget()); assertEquals(serialized.getDirection(), deserialized.getDirection()); assertEquals(serialized.getProtocols().size(), deserialized.getProtocols().size()); + assertEquals(serialized.getParam().size(), deserialized.getParam().size()); assertEquals(serialized.getProtocols().get(0).getEndpoint(), deserialized.getProtocols().get(0).getEndpoint()); + assertEquals(serialized.getParam().get(0).getUri(), deserialized.getParam().get(0).getUri()); + assertEquals(serialized.getParam().get(0).getValue(), deserialized.getParam().get(0).getValue()); } }