sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1626345 [7/14] - in /sis/trunk: ./ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/ core/sis-metadat...
Date Fri, 19 Sep 2014 21:46:44 GMT
Copied: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationChainMetadata.java (from r1625241, sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationChainMetadata.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationChainMetadata.java?p2=sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationChainMetadata.java&p1=sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationChainMetadata.java&r1=1625241&r2=1626345&rev=1626345&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationChainMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationChainMetadata.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -20,17 +20,29 @@ import java.util.List;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.identification.OperationChainMetadata;
-import org.opengis.metadata.identification.OperationMetadata;
 import org.opengis.util.InternationalString;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.xml.Namespaces;
 
+// Branch-specific imports
+import org.opengis.annotation.UML;
+import static org.opengis.annotation.Obligation.OPTIONAL;
+import static org.opengis.annotation.Obligation.MANDATORY;
+import static org.opengis.annotation.Specification.ISO_19115;
+
 
 /**
  * Operation chain information.
  *
+ * <div class="warning"><b>Note on International Standard versions</b><br>
+ * This class is derived from a new type defined in the ISO 19115 international standard published in 2014,
+ * while GeoAPI 3.0 is based on the version published in 2003. Consequently this implementation class does
+ * not yet implement a GeoAPI interface, but is expected to do so after the next GeoAPI releases.
+ * When the interface will become available, all references to this implementation class in Apache SIS will
+ * be replaced be references to the corresponding interface.
+ * </div>
+ *
  * <p><b>Limitations:</b></p>
  * <ul>
  *   <li>Instances of this class are not synchronized for multi-threading.
@@ -52,11 +64,12 @@ import org.apache.sis.xml.Namespaces;
     "operations"
 })
 @XmlRootElement(name = "SV_OperationChainMetadata", namespace = Namespaces.SRV)
-public class DefaultOperationChainMetadata extends ISOMetadata implements OperationChainMetadata {
+@UML(identifier="SV_OperationChainMetadata", specification=ISO_19115)
+public class DefaultOperationChainMetadata extends ISOMetadata {
     /**
      * Serial number for compatibility with different versions.
      */
-    private static final long serialVersionUID = 4132508877114835287L;
+    private static final long serialVersionUID = 4132508877114835286L;
 
     /**
      * The name as used by the service for this chain.
@@ -71,7 +84,7 @@ public class DefaultOperationChainMetada
     /**
      * Information about the operations applied by the chain.
      */
-    private List<OperationMetadata> operations;
+    private List<DefaultOperationMetadata> operations;
 
     /**
      * Constructs an initially empty operation chain metadata.
@@ -97,47 +110,22 @@ public class DefaultOperationChainMetada
      *
      * @see #castOrCopy(OperationChainMetadata)
      */
-    public DefaultOperationChainMetadata(final OperationChainMetadata object) {
+    public DefaultOperationChainMetadata(final DefaultOperationChainMetadata object) {
         super(object);
         if (object != null) {
             this.name        = object.getName();
             this.description = object.getDescription();
-            this.operations  = copyList(object.getOperations(), OperationMetadata.class);
+            this.operations  = copyList(object.getOperations(), DefaultOperationMetadata.class);
         }
     }
 
     /**
-     * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
-     * This method performs the first applicable action in the following choices:
-     *
-     * <ul>
-     *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
-     *   <li>Otherwise if the given object is already an instance of
-     *       {@code DefaultOperationChainMetadata}, then it is returned unchanged.</li>
-     *   <li>Otherwise a new {@code DefaultOperationChainMetadata} instance is created using the
-     *       {@linkplain #DefaultOperationChainMetadata(OperationChainMetadata) copy constructor}
-     *       and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
-     *       metadata contained in the given object are not recursively copied.</li>
-     * </ul>
-     *
-     * @param  object The object to get as a SIS implementation, or {@code null} if none.
-     * @return A SIS implementation containing the values of the given object (may be the
-     *         given object itself), or {@code null} if the argument was null.
-     */
-    public static DefaultOperationChainMetadata castOrCopy(final OperationChainMetadata object) {
-        if (object == null || object instanceof DefaultOperationChainMetadata) {
-            return (DefaultOperationChainMetadata) object;
-        }
-        return new DefaultOperationChainMetadata(object);
-    }
-
-    /**
      * Returns the name as used by the service for this chain.
      *
      * @return Name as used by the service for this chain.
      */
-    @Override
     @XmlElement(name = "name", namespace = Namespaces.SRV, required = true)
+    @UML(identifier="name", obligation=MANDATORY, specification=ISO_19115)
     public InternationalString getName() {
         return name;
     }
@@ -157,8 +145,8 @@ public class DefaultOperationChainMetada
      *
      * @return Narrative explanation of the services in the chain and resulting output, or {@code null} if none.
      */
-    @Override
     @XmlElement(name = "description", namespace = Namespaces.SRV)
+    @UML(identifier="description", obligation=OPTIONAL, specification=ISO_19115)
     public InternationalString getDescription() {
         return description;
     }
@@ -176,20 +164,30 @@ public class DefaultOperationChainMetada
     /**
      * Returns information about the operations applied by the chain.
      *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code OperationMetadata} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
      * @return Information about the operations applied by the chain.
      */
-    @Override
     @XmlElement(name = "operation", namespace = Namespaces.SRV, required = true)
-    public List<OperationMetadata> getOperations() {
-        return operations = nonNullList(operations, OperationMetadata.class);
+    @UML(identifier="operation", obligation=MANDATORY, specification=ISO_19115)
+    public List<DefaultOperationMetadata> getOperations() {
+        return operations = nonNullList(operations, DefaultOperationMetadata.class);
     }
 
     /**
      * Sets the information about the operations applied by the chain.
      *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code OperationMetadata} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
      * @param newValues The new information about the operations applied by the chain.
      */
-    public void setOperations(final List<? extends OperationMetadata> newValues) {
-        operations = writeList(newValues, operations, OperationMetadata.class);
+    public void setOperations(final List<? extends DefaultOperationMetadata> newValues) {
+        operations = writeList(newValues, operations, DefaultOperationMetadata.class);
     }
 }

Copied: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationMetadata.java (from r1625241, sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationMetadata.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationMetadata.java?p2=sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationMetadata.java&p1=sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationMetadata.java&r1=1625241&r2=1626345&rev=1626345&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultOperationMetadata.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -24,15 +24,27 @@ import javax.xml.bind.annotation.XmlRoot
 import org.opengis.util.InternationalString;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.opengis.metadata.citation.OnlineResource;
-import org.opengis.metadata.identification.DistributedComputingPlatform;
-import org.opengis.metadata.identification.OperationMetadata;
 import org.opengis.parameter.ParameterDescriptor;
 import org.apache.sis.xml.Namespaces;
 
+// Branch-specific imports
+import org.opengis.annotation.UML;
+import static org.opengis.annotation.Obligation.OPTIONAL;
+import static org.opengis.annotation.Obligation.MANDATORY;
+import static org.opengis.annotation.Specification.ISO_19115;
+
 
 /**
  * Parameter information.
  *
+ * <div class="warning"><b>Note on International Standard versions</b><br>
+ * This class is derived from a new type defined in the ISO 19115 international standard published in 2014,
+ * while GeoAPI 3.0 is based on the version published in 2003. Consequently this implementation class does
+ * not yet implement a GeoAPI interface, but is expected to do so after the next GeoAPI releases.
+ * When the interface will become available, all references to this implementation class in Apache SIS will
+ * be replaced be references to the corresponding interface.
+ * </div>
+ *
  * <p><b>Limitations:</b></p>
  * <ul>
  *   <li>Instances of this class are not synchronized for multi-threading.
@@ -58,11 +70,12 @@ import org.apache.sis.xml.Namespaces;
     "dependsOn"
 })
 @XmlRootElement(name = "SV_OperationMetadata", namespace = Namespaces.SRV)
-public class DefaultOperationMetadata extends ISOMetadata implements OperationMetadata {
+@UML(identifier="SV_OperationMetadata", specification=ISO_19115)
+public class DefaultOperationMetadata extends ISOMetadata {
     /**
      * Serial number for compatibility with different versions.
      */
-    private static final long serialVersionUID = -6120853428175790473L;
+    private static final long serialVersionUID = -3513177609655567627L;
 
     /**
      * An unique identifier for this interface.
@@ -72,7 +85,7 @@ public class DefaultOperationMetadata ex
     /**
      * Distributed computing platforms on which the operation has been implemented.
      */
-    private Collection<DistributedComputingPlatform> distributedComputingPlatforms;
+    private Collection<Object> distributedComputingPlatforms;
 
     /**
      * Free text description of the intent of the operation and the results of the operation.
@@ -97,7 +110,7 @@ public class DefaultOperationMetadata ex
     /**
      * List of operation that must be completed immediately.
      */
-    private List<OperationMetadata> dependsOn;
+    private List<DefaultOperationMetadata> dependsOn;
 
     /**
      * Constructs an initially empty operation metadata.
@@ -106,22 +119,6 @@ public class DefaultOperationMetadata ex
     }
 
     /**
-     * Constructs a new operation metadata initialized to the specified values.
-     *
-     * @param operationName An unique identifier for this interface.
-     * @param platform      Distributed computing platforms on which the operation has been implemented.
-     * @param connectPoint  Handle for accessing the service interface.
-     */
-    public DefaultOperationMetadata(final String operationName,
-                                    final DistributedComputingPlatform platform,
-                                    final OnlineResource connectPoint)
-    {
-        this.operationName                 = operationName;
-        this.distributedComputingPlatforms = singleton(platform, DistributedComputingPlatform.class);
-        this.connectPoints                 = singleton(connectPoint, OnlineResource.class);
-    }
-
-    /**
      * Constructs a new instance initialized with the values from the specified metadata object.
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
@@ -131,42 +128,17 @@ public class DefaultOperationMetadata ex
      * @see #castOrCopy(OperationMetadata)
      */
     @SuppressWarnings("unchecked")
-    public DefaultOperationMetadata(final OperationMetadata object) {
+    public DefaultOperationMetadata(final DefaultOperationMetadata object) {
         super(object);
         if (object != null) {
             this.operationName                 = object.getOperationName();
-            this.distributedComputingPlatforms = copyCollection(object.getDistributedComputingPlatforms(), DistributedComputingPlatform.class);
+            this.distributedComputingPlatforms = copyCollection(object.getDistributedComputingPlatforms(), Object.class);
             this.operationDescription          = object.getOperationDescription();
             this.invocationName                = object.getInvocationName();
             this.connectPoints                 = copyCollection(object.getConnectPoints(), OnlineResource.class);
             this.parameters                    = copySet(object.getParameters(), (Class) ParameterDescriptor.class);
-            this.dependsOn                     = copyList(object.getDependsOn(), OperationMetadata.class);
-        }
-    }
-
-    /**
-     * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
-     * This method performs the first applicable action in the following choices:
-     *
-     * <ul>
-     *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
-     *   <li>Otherwise if the given object is already an instance of
-     *       {@code DefaultOperationMetadata}, then it is returned unchanged.</li>
-     *   <li>Otherwise a new {@code DefaultOperationMetadata} instance is created using the
-     *       {@linkplain #DefaultOperationMetadata(OperationMetadata) copy constructor}
-     *       and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
-     *       metadata contained in the given object are not recursively copied.</li>
-     * </ul>
-     *
-     * @param  object The object to get as a SIS implementation, or {@code null} if none.
-     * @return A SIS implementation containing the values of the given object (may be the
-     *         given object itself), or {@code null} if the argument was null.
-     */
-    public static DefaultOperationMetadata castOrCopy(final OperationMetadata object) {
-        if (object == null || object instanceof DefaultOperationMetadata) {
-            return (DefaultOperationMetadata) object;
+            this.dependsOn                     = copyList(object.getDependsOn(), DefaultOperationMetadata.class);
         }
-        return new DefaultOperationMetadata(object);
     }
 
     /**
@@ -174,8 +146,8 @@ public class DefaultOperationMetadata ex
      *
      * @return An unique identifier for this interface.
      */
-    @Override
     @XmlElement(name = "operationName", namespace = Namespaces.SRV, required = true)
+    @UML(identifier="operationName", obligation=MANDATORY, specification=ISO_19115)
     public String getOperationName() {
         return operationName;
     }
@@ -193,12 +165,17 @@ public class DefaultOperationMetadata ex
     /**
      * Returns the distributed computing platforms (DCPs) on which the operation has been implemented.
      *
+     * <div class="warning"><b>Upcoming API change — specialization</b><br>
+     * The element type will be changed to the {@code DistributedComputingPlatform} code list
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
      * @return Distributed computing platforms on which the operation has been implemented.
      */
-    @Override
     @XmlElement(name = "DCP", namespace = Namespaces.SRV, required = true)
-    public Collection<DistributedComputingPlatform> getDistributedComputingPlatforms() {
-        return distributedComputingPlatforms = nonNullCollection(distributedComputingPlatforms, DistributedComputingPlatform.class);
+    @UML(identifier="distributedComputingPlatform", obligation=MANDATORY, specification=ISO_19115)
+    public Collection<Object> getDistributedComputingPlatforms() {
+        return distributedComputingPlatforms = nonNullCollection(distributedComputingPlatforms, Object.class);
     }
 
     /**
@@ -206,8 +183,8 @@ public class DefaultOperationMetadata ex
      *
      * @param newValues The new distributed computing platforms on which the operation has been implemented.
      */
-    public void setDistributedComputingPlatforms(final Collection<? extends DistributedComputingPlatform> newValues) {
-        distributedComputingPlatforms = writeCollection(newValues, distributedComputingPlatforms, DistributedComputingPlatform.class);
+    public void setDistributedComputingPlatforms(final Collection<?> newValues) {
+        distributedComputingPlatforms = writeCollection(newValues, distributedComputingPlatforms, Object.class);
     }
 
     /**
@@ -215,8 +192,8 @@ public class DefaultOperationMetadata ex
      *
      * @return Free text description of the intent of the operation and the results of the operation, or {@code null} if none.
      */
-    @Override
     @XmlElement(name = "operationDescription", namespace = Namespaces.SRV)
+    @UML(identifier="operationDescription", obligation=OPTIONAL, specification=ISO_19115)
     public InternationalString getOperationDescription() {
         return operationDescription;
     }
@@ -237,8 +214,8 @@ public class DefaultOperationMetadata ex
      * @return The name used to invoke this interface within the context of the distributed computing platforms,
      *         or {@code null} if none.
      */
-    @Override
     @XmlElement(name = "invocationName", namespace = Namespaces.SRV)
+    @UML(identifier="invocationName", obligation=OPTIONAL, specification=ISO_19115)
     public InternationalString getInvocationName() {
         return invocationName;
     }
@@ -258,8 +235,8 @@ public class DefaultOperationMetadata ex
      *
      * @return Handle for accessing the service interface.
      */
-    @Override
     @XmlElement(name = "connectPoint", namespace = Namespaces.SRV, required = true)
+    @UML(identifier="connectPoint", obligation=MANDATORY, specification=ISO_19115)
     public Collection<OnlineResource> getConnectPoints() {
         return connectPoints = nonNullCollection(connectPoints, OnlineResource.class);
     }
@@ -278,9 +255,9 @@ public class DefaultOperationMetadata ex
      *
      * @return The parameters that are required for this interface, or an empty collection if none.
      */
-    @Override
     @SuppressWarnings("unchecked")
     @XmlElement(name = "parameters", namespace = Namespaces.SRV)
+    @UML(identifier="parameters", obligation=OPTIONAL, specification=ISO_19115)
     public Collection<ParameterDescriptor<?>> getParameters() {
         return parameters = nonNullCollection(parameters, (Class) ParameterDescriptor.class);
     }
@@ -298,20 +275,30 @@ public class DefaultOperationMetadata ex
     /**
      * Returns the list of operation that must be completed immediately before current operation is invoked.
      *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code OperationMetadata} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
      * @return List of operation that must be completed immediately, or an empty list if none.
      */
-    @Override
     @XmlElement(name = "dependsOn", namespace = Namespaces.SRV)
-    public List<OperationMetadata> getDependsOn() {
-        return dependsOn = nonNullList(dependsOn, OperationMetadata.class);
+    @UML(identifier="dependsOn", obligation=OPTIONAL, specification=ISO_19115)
+    public List<DefaultOperationMetadata> getDependsOn() {
+        return dependsOn = nonNullList(dependsOn, DefaultOperationMetadata.class);
     }
 
     /**
      * Set the list of operation that must be completed before current operation is invoked.
      *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code OperationMetadata} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
      * @param newValues The new list of operation.
      */
-    public void setDependsOn(final List<? extends OperationMetadata> newValues) {
-        dependsOn = writeList(newValues, dependsOn, OperationMetadata.class);
+    public void setDependsOn(final List<? extends DefaultOperationMetadata> newValues) {
+        dependsOn = writeList(newValues, dependsOn, DefaultOperationMetadata.class);
     }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -48,11 +48,22 @@ import static org.apache.sis.util.collec
  *   <li>{@link #setScale(double)} for computing the denominator from a scale value.</li>
  * </ul>
  *
+ * {@section Limitations}
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.4)
  * @version 0.4
  * @module
+ *
+ * @see DefaultResolution#getEquivalentScale()
  */
 @XmlType(name = "MD_RepresentativeFraction_Type")
 @XmlRootElement(name = "MD_RepresentativeFraction")
@@ -239,6 +250,17 @@ public class DefaultRepresentativeFracti
         return (int) denominator;
     }
 
+    /**
+     * Returns a string representation of this scale, or {@code NaN} if undefined.
+     * If defined, the string representation uses the colon as in "1:20000".
+     *
+     * @return A string representation of this scale.
+     */
+    @Override
+    public String toString() {
+        return (denominator != 0) ? "1:" + denominator : "NaN";
+    }
+
 
 
 

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.opengis.util.InternationalString;
 import org.opengis.metadata.identification.RepresentativeFraction;
 import org.opengis.metadata.identification.Resolution;
 import org.apache.sis.internal.jaxb.gco.GO_Distance;
@@ -27,7 +28,6 @@ import org.apache.sis.internal.metadata.
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.util.resources.Messages;
-import org.apache.sis.util.Workaround;
 
 
 /**
@@ -40,12 +40,23 @@ import org.apache.sis.util.Workaround;
  * See the {@linkplain #DefaultResolution(Resolution) constructor javadoc}
  * for information about which property has precedence on copy operations.
  *
+ * {@section Limitations}
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
  * @version 0.3
  * @module
+ *
+ * @see AbstractIdentification#getSpatialResolutions()
  */
 @XmlType(name = "MD_Resolution_Type") // No need for propOrder since this structure is a union (see javadoc).
 @XmlRootElement(name = "MD_Resolution")
@@ -53,12 +64,46 @@ public class DefaultResolution extends I
     /**
      * Serial number for compatibility with different versions.
      */
-    private static final long serialVersionUID = 3856547985745400172L;
+    private static final long serialVersionUID = 4333582736458380544L;
+
+    /**
+     * Enumeration of possible values for {@link #property}.
+     */
+    private static final byte SCALE=1, DISTANCE=2, VERTICAL=3, ANGULAR=4, TEXT=5;
+
+    /**
+     * The names of the mutually exclusive properties.
+     * The index of each name shall be the value of the above {@code byte} constants minus one.
+     */
+    private static final String[] NAMES = {
+        "equivalentScale",
+        "distance",
+        "vertical",
+        "angularDistance",
+        "levelOfDetail"
+    };
+
+    /**
+     * The names of the setter methods, for logging purpose only.
+     */
+    private static final String[] SETTERS = {
+        "setEquivalentScale",
+        "setDistance",
+        "setVertical",
+        "setAngularDistance",
+        "setLevelOfDetail"
+    };
 
     /**
-     * Either the scale as a {@link RepresentativeFraction} instance or the distance as a {@code Double} instance.
+     * Specifies which property is set, or 0 if none.
      */
-    private Object scaleOrDistance;
+    private byte property;
+
+    /**
+     * Either the scale as a {@link RepresentativeFraction} instance, the distance, the angle,
+     * or the level of details as an {@link InternationalString} instance.
+     */
+    private Object value;
 
     /**
      * Constructs an initially empty resolution.
@@ -74,7 +119,7 @@ public class DefaultResolution extends I
      * @since 0.4
      */
     public DefaultResolution(final RepresentativeFraction scale) {
-        scaleOrDistance = scale;
+        value = scale;
     }
 
     // Note: there is not yet DefaultResolution(double) method because
@@ -85,8 +130,10 @@ public class DefaultResolution extends I
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * <p>If both {@linkplain #getEquivalentScale() scale} and {@linkplain #getDistance() distance}
-     * are specified, then the scale will have precedence and the distance is silently discarded.</p>
+     * <p>If more than one of the {@linkplain #getEquivalentScale() equivalent scale},
+     * {@linkplain #getDistance() distance}, {@linkplain #getVertical() vertical},
+     * {@linkplain #getAngularDistance() angular distance} and {@linkplain #getLevelOfDetail() level of detail}
+     * are specified, then the first of those values is taken and the other values are silently discarded.</p>
      *
      * @param object The metadata to copy values from, or {@code null} if none.
      *
@@ -95,9 +142,21 @@ public class DefaultResolution extends I
     public DefaultResolution(final Resolution object) {
         super(object);
         if (object != null) {
-            scaleOrDistance = object.getEquivalentScale();
-            if (scaleOrDistance == null) {
-                scaleOrDistance = object.getDistance();
+            for (byte p=SCALE; p<=TEXT; p++) {
+                Object c = null;
+                switch (p) {
+                    case SCALE:    c = object.getEquivalentScale(); break;
+                    case DISTANCE: c = object.getDistance(); break;
+                    case VERTICAL: if (c instanceof DefaultResolution) c = ((DefaultResolution) object).getVertical(); break;
+                    case ANGULAR:  if (c instanceof DefaultResolution) c = ((DefaultResolution) object).getAngularDistance(); break;
+                    case TEXT:     if (c instanceof DefaultResolution) c = ((DefaultResolution) object).getLevelOfDetail(); break;
+                    default:       throw new AssertionError(p);
+                }
+                if (c != null) {
+                    property = p;
+                    value = c;
+                    break;
+                }
             }
         }
     }
@@ -128,33 +187,34 @@ public class DefaultResolution extends I
     }
 
     /**
-     * Invoked every time the code needs to decide whether the provided information
-     * is scale or distance. Defined as a method in order to have a single word to
-     * search if we need to revisit the policy.
-     */
-    private boolean isDistance() {
-        return (scaleOrDistance instanceof Double);
-    }
-
-    /**
-     * Invoked when setting a property discards the other one.
+     * Sets the properties identified by the {@code code} argument, if non-null.
+     * This discards any other properties.
+     *
+     * @param code     The property which is going to be set.
+     * @param newValue The new value.
      */
-    private static void warning(final String method, final String oldName, final String newName) {
-        MetadataUtilities.warning(DefaultResolution.class, method,
-                Messages.Keys.DiscardedExclusiveProperty_2, oldName, newName);
+    private void setProperty(final byte code, final Object newValue) {
+        checkWritePermission();
+        if (value != null && property != code) {
+            if (newValue == null) {
+                return; // Do not erase the other property.
+            }
+            MetadataUtilities.warning(DefaultResolution.class, SETTERS[code-1],
+                    Messages.Keys.DiscardedExclusiveProperty_2, NAMES[property-1], NAMES[code-1]);
+        }
+        value = newValue;
+        property = code;
     }
 
     /**
      * Returns the level of detail expressed as the scale of a comparable hardcopy map or chart.
-     * Only one of {@linkplain #getEquivalentScale() equivalent scale} and
-     * {@linkplain #getDistance() ground sample distance} shall be provided.
      *
      * @return Level of detail expressed as the scale of a comparable hardcopy, or {@code null}.
      */
     @Override
     @XmlElement(name = "equivalentScale")
     public RepresentativeFraction getEquivalentScale()  {
-        return isDistance() ? null : (RepresentativeFraction) scaleOrDistance;
+        return (property == SCALE) ? (RepresentativeFraction) value : null;
     }
 
     /**
@@ -162,74 +222,117 @@ public class DefaultResolution extends I
      *
      * {@section Effect on other properties}
      * If and only if the {@code newValue} is non-null, then this method automatically
-     * discards the {@linkplain #setDistance distance}.
+     * discards all other properties.
      *
      * @param newValue The new equivalent scale.
      */
     public void setEquivalentScale(final RepresentativeFraction newValue) {
-        checkWritePermission();
-        if (isDistance()) {
-            if (newValue == null) {
-                return; // Do not erase the other property.
-            }
-            warning("setEquivalentScale", "distance", "equivalentScale");
-        }
-        scaleOrDistance = newValue;
+        setProperty(SCALE, newValue);
     }
 
     /**
      * Returns the ground sample distance.
-     * Only one of {@linkplain #getEquivalentScale equivalent scale} and
-     * {@linkplain #getDistance ground sample distance} shall be provided.
      *
      * @return The ground sample distance, or {@code null}.
      */
     @Override
+    @XmlElement(name = "distance")
+    @XmlJavaTypeAdapter(GO_Distance.class)
     @ValueRange(minimum=0, isMinIncluded=false)
     public Double getDistance() {
-        return isDistance() ? (Double) scaleOrDistance : null;
+        return (property == DISTANCE) ? (Double) value : null;
     }
 
     /**
      * Sets the ground sample distance.
      *
+     * {@section Effect on other properties}
+     * If and only if the {@code newValue} is non-null, then this method automatically
+     * discards all other properties.
+     *
      * @param newValue The new distance.
      */
     public void setDistance(final Double newValue) {
-        checkWritePermission();
-        if (scaleOrDistance != null && !isDistance()) {
-            if (newValue == null) {
-                return; // Do not erase the other property.
-            }
-            warning("setDistance", "equivalentScale", "distance");
-        }
-        scaleOrDistance = newValue;
+        setProperty(DISTANCE, newValue);
     }
 
     /**
-     * Workaround for a strange JAXB behavior (bug?). For an unknown reason, we are unable to annotate the
-     * {@link #getDistance()} method directly. Doing so cause JAXB to randomly ignores the {@code <gmd:distance>}
-     * property. Annotating a separated method which in turn invokes the real method seems to work.
+     * Returns the vertical sampling distance.
      *
-     * <p>In order to check if this workaround is still needed with more recent JAXB versions, move the
-     * {@link XmlElement} and {@link XmlJavaTypeAdapter} annotations to the {@link #getDistance()} method,
-     * then execute the {@link DefaultResolutionTest#testXML()} test at least 10 times (because the failure
-     * happen randomly). If the test succeeded every time, then the {@code getValue()} and {@code setValue(Double)}
-     * methods can be completely deleted.</p>
+     * @return The vertical sampling distance, or {@code null}.
      *
-     * @see DefaultResolutionTest#testXML()
+     * @since 0.5
      */
-    @XmlElement(name = "distance")
-    @XmlJavaTypeAdapter(GO_Distance.class)
-    @Workaround(library = "JAXB", version = "2.2.4-2")
-    private Double getValue() {
-        return getDistance();
+    @ValueRange(minimum=0, isMinIncluded=false)
+    public Double getVertical() {
+        return (property == VERTICAL) ? (Double) value : null;
+    }
+
+    /**
+     * Sets the vertical sampling distance.
+     *
+     * {@section Effect on other properties}
+     * If and only if the {@code newValue} is non-null, then this method automatically
+     * discards all other properties.
+     *
+     * @param newValue The new distance.
+     *
+     * @since 0.5
+     */
+    public void setVertical(final Double newValue) {
+        setProperty(VERTICAL, newValue);
+    }
+
+    /**
+     * Returns the angular sampling measure.
+     *
+     * @return The angular sampling measure, or {@code null}.
+     *
+     * @since 0.5
+     */
+    @ValueRange(minimum=0, isMinIncluded=false)
+    public Double getAngularDistance() {
+        return (property == ANGULAR) ? (Double) value : null;
+    }
+
+    /**
+     * Sets the angular sampling measure.
+     *
+     * {@section Effect on other properties}
+     * If and only if the {@code newValue} is non-null, then this method automatically
+     * discards all other properties.
+     *
+     * @param newValue The new distance.
+     *
+     * @since 0.5
+     */
+    public void setAngularDistance(final Double newValue) {
+        setProperty(ANGULAR, newValue);
+    }
+
+    /**
+     * Returns a brief textual description of the spatial resolution of the resource.
+     *
+     * @return Textual description of the spatial resolution, or {@code null}.
+     *
+     * @since 0.5
+     */
+    public InternationalString getLevelOfDetail() {
+        return (property == TEXT) ? (InternationalString) value : null;
     }
 
     /**
-     * The corresponding setter for the {@link #getValue()} workaround.
+     * Sets the textual description of the spatial resolution of the resource.
+     *
+     * {@section Effect on other properties}
+     * If and only if the {@code newValue} is non-null, then this method automatically
+     * discards all other properties.
+     *
+     * @param newValue The new distance.
+     *
+     * @since 0.5
      */
-    private void setValue(final Double newValue) {
-        setDistance(newValue);
+    public void setLevelOfDetail(final InternationalString newValue) {
+        setProperty(TEXT, newValue);
     }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentification.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentification.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentification.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentification.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -16,8 +16,15 @@
  */
 package org.apache.sis.metadata.iso.identification;
 
+import java.util.Collection;
+import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.GenericName;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.identification.DataIdentification;
+import org.opengis.metadata.distribution.StandardOrderProcess;
 import org.opengis.metadata.identification.ServiceIdentification;
 import org.apache.sis.xml.Namespaces;
 
@@ -26,20 +33,97 @@ import org.apache.sis.xml.Namespaces;
  * Identification of capabilities which a service provider makes available to a service user
  * through a set of interfaces that define a behaviour.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
- * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @author  Rémi Maréchal (Geomatys)
+ * @since   0.5
+ * @version 0.5
  * @module
  */
-@XmlType(name = "MD_ServiceIdentification_Type")
-@XmlRootElement(name = "SV_ServiceIdentification", namespace = Namespaces.SRV) // Prefix is really SV_ according ISO 19115 corrigendum.
+@XmlType(name = "MD_ServiceIdentification_Type", propOrder = { // ISO 19139 still use the old prefix.
+    "serviceType",
+    "serviceTypeVersions",
+/// "accessProperties",
+    "coupledResources",
+    "couplingType",
+/// "operatedDatasets",
+/// "profiles",
+/// "serviceStandards",
+    "containsOperations",
+    "operatesOn",
+/// "containsChain"
+})
+@XmlRootElement(name = "SV_ServiceIdentification", namespace = Namespaces.SRV)
 public class DefaultServiceIdentification extends AbstractIdentification implements ServiceIdentification {
     /**
      * Serial number for compatibility with different versions.
      */
-    private static final long serialVersionUID = 4988429302218128178L;
+    private static final long serialVersionUID = 7700836694236616300L;
+
+    /**
+     * A service type name.
+     */
+    private GenericName serviceType;
+
+    /**
+     * The version of the service, supports searching based on the version of serviceType.
+     */
+    private Collection<String> serviceTypeVersions;
+
+    /**
+     * Information about the availability of the service.
+     */
+    private StandardOrderProcess accessProperties;
+
+    /**
+     * Type of coupling between service and associated data (if exist).
+     */
+    private Object couplingType;
+
+    /**
+     * Further description of the data coupling in the case of tightly coupled services.
+     */
+    private Collection<DefaultCoupledResource> coupledResources;
+
+    /**
+     * References to the resource on which the service operates.
+     */
+    private Collection<Citation> operatedDatasets;
+
+    /**
+     * Profiles to which the service adheres.
+     */
+    private Collection<Citation> profiles;
+
+    /**
+     * Standards to which the service adheres.
+     */
+    private Collection<Citation> serviceStandards;
+
+    /**
+     * Information about the operations that comprise the service.
+     */
+    private Collection<DefaultOperationMetadata> containsOperations;
+
+    /**
+     * Information on the resources that the service operates on.
+     */
+    private Collection<DataIdentification> operatesOn;
+
+    /**
+     * Information about the chain applied by the service.
+     */
+    private Collection<DefaultOperationChainMetadata> containsChain;
 
     /**
      * Constructs an initially empty service identification.
@@ -48,6 +132,21 @@ public class DefaultServiceIdentificatio
     }
 
     /**
+     * Constructs a service identification initialized to the specified values.
+     *
+     * @param serviceType Service type name.
+     * @param citation    Citation data for the resource(s).
+     * @param abstracts   Brief narrative summary of the content of the resource(s).
+     */
+    public DefaultServiceIdentification(final GenericName  serviceType,
+                                        final Citation     citation,
+                                        final CharSequence abstracts)
+    {
+        super(citation, abstracts);
+        this.serviceType = serviceType;
+    }
+
+    /**
      * Constructs a new instance initialized with the values from the specified metadata object.
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
@@ -58,6 +157,20 @@ public class DefaultServiceIdentificatio
      */
     public DefaultServiceIdentification(final ServiceIdentification object) {
         super(object);
+        if (object instanceof DefaultServiceIdentification) {
+            final DefaultServiceIdentification c = (DefaultServiceIdentification) object;
+            serviceType         = c.getServiceType();
+            serviceTypeVersions = copyCollection(c.getServiceTypeVersions(), String.class);
+            accessProperties    = c.getAccessProperties();
+            couplingType        = c.getCouplingType();
+            coupledResources    = copyCollection(c.getCoupledResources(), DefaultCoupledResource.class);
+            operatedDatasets    = copyCollection(c.getOperatedDatasets(), Citation.class);
+            profiles            = copyCollection(c.getProfiles(), Citation.class);
+            serviceStandards    = copyCollection(c.getServiceStandards(), Citation.class);
+            containsOperations  = copyCollection(c.getContainsOperations(), DefaultOperationMetadata.class);
+            operatesOn          = copyCollection(c.getOperatesOn(), DataIdentification.class);
+            containsChain       = copyCollection(c.getContainsChain(), DefaultOperationChainMetadata.class);
+        }
     }
 
     /**
@@ -84,4 +197,268 @@ public class DefaultServiceIdentificatio
         }
         return new DefaultServiceIdentification(object);
     }
+
+    /**
+     * Returns a service type name.
+     *
+     * <div class="note"><b>Examples:</b> "discovery", "view", "download", "transformation", or "invoke"</div>
+     *
+     * @return A service type name.
+     */
+    @XmlElement(name = "serviceType", namespace = Namespaces.SRV, required = true)
+    public GenericName getServiceType() {
+        return serviceType;
+    }
+
+    /**
+     * Sets the service type name.
+     *
+     * @param newValue The new service type name.
+     */
+    public void setServiceType(final GenericName newValue) {
+        checkWritePermission();
+        serviceType = newValue;
+    }
+
+    /**
+     * Returns the versions of the service.
+     *
+     * @return The versions of the service.
+     */
+    @XmlElement(name = "serviceTypeVersion", namespace = Namespaces.SRV)
+    public Collection<String> getServiceTypeVersions() {
+        return serviceTypeVersions = nonNullCollection(serviceTypeVersions, String.class);
+    }
+
+    /**
+     * Sets the versions of the service.
+     *
+     * @param newValues The new versions of the service.
+     */
+    public void setServiceTypeVersions(final Collection<? extends String> newValues) {
+        serviceTypeVersions = writeCollection(newValues, serviceTypeVersions, String.class);
+    }
+
+    /**
+     * Returns information about the availability of the service.
+     *
+     * @return Information about the availability of the service, or {@code null} if none.
+     */
+/// @XmlElement(name = "accessProperties", namespace = Namespaces.SRV)
+    public StandardOrderProcess getAccessProperties() {
+        return accessProperties;
+
+    }
+
+    /**
+     * Sets information about the availability of the service.
+     *
+     * @param newValue The new information about the availability of the service.
+     */
+    public void setAccessProperties(final StandardOrderProcess newValue) {
+        checkWritePermission();
+        accessProperties = newValue;
+    }
+
+    /**
+     * Returns type of coupling between service and associated data (if exist).
+     *
+     * <div class="warning"><b>Upcoming API change — specialization</b><br>
+     * The return type will be changed to the {@code CouplingType} code list
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @return Type of coupling between service and associated data, or {@code null} if none.
+     */
+    @XmlElement(name = "couplingType", namespace = Namespaces.SRV)
+    public Object getCouplingType() {
+        return couplingType;
+    }
+
+    /**
+     * Sets the type of coupling between service and associated data.
+     *
+     * <div class="warning"><b>Upcoming API change — specialization</b><br>
+     * The argument type will be changed to the {@code CouplingType} code list
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @param newValue The new type of coupling between service and associated data.
+     */
+    public void setCouplingType(final Object newValue) {
+        checkWritePermission();
+        couplingType = newValue;
+    }
+
+    /**
+     * Returns further description(s) of the data coupling in the case of tightly coupled services.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code CoupledResource} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @return Further description(s) of the data coupling in the case of tightly coupled services.
+     */
+    @XmlElement(name = "coupledResource", namespace = Namespaces.SRV)
+    public Collection<DefaultCoupledResource> getCoupledResources() {
+        return coupledResources = nonNullCollection(coupledResources, DefaultCoupledResource.class);
+    }
+
+    /**
+     * Sets further description(s) of the data coupling in the case of tightly coupled services.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code CoupledResource} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @param newValues The new further description(s) of the data coupling.
+     */
+    public void setCoupledResources(final Collection<? extends DefaultCoupledResource> newValues) {
+        coupledResources = writeCollection(newValues, coupledResources, DefaultCoupledResource.class);
+    }
+
+    /**
+     * Returns the reference(s) to the resource on which the service operates.
+     *
+     * @return Reference(s) to the resource on which the service operates.
+     */
+/// @XmlElement(name = "operatedDataset", namespace = Namespaces.SRV)
+    public Collection<Citation> getOperatedDatasets() {
+        return operatedDatasets = nonNullCollection(operatedDatasets, Citation.class);
+    }
+
+    /**
+     * Sets the reference(s) to the resource on which the service operates.
+     *
+     * @param newValues The new reference(s) to the resource on which the service operates.
+     */
+    public void setOperatedDatasets(final Collection<? extends Citation> newValues) {
+        operatedDatasets = writeCollection(newValues, operatedDatasets, Citation.class);
+    }
+
+    /**
+     * Returns the profile(s) to which the service adheres.
+     *
+     * @return Profile(s) to which the service adheres.
+     */
+/// @XmlElement(name = "profile", namespace = Namespaces.SRV)
+    public Collection<Citation> getProfiles() {
+        return profiles = nonNullCollection(profiles, Citation.class);
+    }
+
+    /**
+     * Sets the profile(s) to which the service adheres.
+     *
+     * @param newValues The new profile(s) to which the service adheres.
+     */
+    public void setProfiles(final Collection<? extends Citation> newValues) {
+        profiles = writeCollection(newValues, profiles, Citation.class);
+    }
+
+    /**
+     * Returns the standard(s) to which the service adheres.
+     *
+     * @return Standard(s) to which the service adheres.
+     */
+/// @XmlElement(name = "serviceStandard", namespace = Namespaces.SRV)
+    public Collection<Citation> getServiceStandards() {
+        return serviceStandards = nonNullCollection(serviceStandards, Citation.class);
+    }
+
+    /**
+     * Sets the standard(s) to which the service adheres.
+     *
+     * @param newValues The new standard(s) to which the service adheres.
+     */
+    public void setServiceStandards(final Collection<? extends Citation> newValues) {
+        serviceStandards = writeCollection(newValues, serviceStandards, Citation.class);
+    }
+
+    /**
+     * Provides information about the operations that comprise the service.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code OperationMetadata} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @return Information about the operations that comprise the service.
+     */
+    @XmlElement(name = "containsOperations", namespace = Namespaces.SRV)
+    public Collection<DefaultOperationMetadata> getContainsOperations() {
+        return containsOperations = nonNullCollection(containsOperations, DefaultOperationMetadata.class);
+    }
+
+    /**
+     * Sets information(s) about the operations that comprise the service.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code OperationMetadata} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @param newValues The new information(s) about the operations that comprise the service.
+     */
+    public void setContainsOperations(final Collection<? extends DefaultOperationMetadata> newValues) {
+        containsOperations = writeCollection(newValues, containsOperations, DefaultOperationMetadata.class);
+    }
+
+    /**
+     * Provides information on the resources that the service operates on.
+     *
+     * @return Information on the resources that the service operates on.
+     */
+    @XmlElement(name = "operatesOn", namespace = Namespaces.SRV)
+    public Collection<DataIdentification> getOperatesOn() {
+        return operatesOn = nonNullCollection(operatesOn, DataIdentification.class);
+    }
+
+    /**
+     * Sets the information on the resources that the service operates on.
+     *
+     * @param newValues The new information on the resources that the service operates on.
+     */
+    public void setOperatesOn(final Collection<? extends DataIdentification> newValues) {
+        operatesOn = writeCollection(newValues, operatesOn, DataIdentification.class);
+    }
+
+    /**
+     * Provides information about the chain applied by the service.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code OperationChainMetadata} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @return Information about the chain applied by the service.
+     */
+/// @XmlElement(name = "containsChain", namespace = Namespaces.SRV)
+    public Collection<DefaultOperationChainMetadata> getContainsChain() {
+        return containsChain = nonNullCollection(containsChain, DefaultOperationChainMetadata.class);
+    }
+
+    /**
+     * Sets the information about the chain applied by the service.
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * The element type will be changed to the {@code OperationChainMetadata} interface
+     * when GeoAPI will provide it (tentatively in GeoAPI 3.1).
+     * </div>
+     *
+     * @param newValues The new information about the chain applied by the service.
+     */
+    public void setContainsChain(final Collection<? extends DefaultOperationChainMetadata>  newValues) {
+        containsChain = writeCollection(newValues, containsChain, DefaultOperationChainMetadata.class);
+    }
+
+    /**
+     * Invoked after JAXB has unmarshalled this object.
+     */
+    private void afterUnmarshal(final Unmarshaller u, final Object parent) {
+        if (containsOperations != null && coupledResources != null) {
+            OperationName.resolve(containsOperations, coupledResources);
+        }
+    }
 }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -22,8 +22,9 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.util.InternationalString;
-import org.opengis.metadata.identification.Usage;
+import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.ResponsibleParty;
+import org.opengis.metadata.identification.Usage;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.iso.Types;
 
@@ -32,13 +33,23 @@ import static org.apache.sis.internal.me
 
 
 /**
- * Brief description of ways in which the resource(s) is/are currently used.
+ * Brief description of ways in which the resource(s) is/are currently or has been used.
+ *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
+ * @author  Rémi Maréchal (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "MD_Usage_Type", propOrder = {
@@ -79,6 +90,22 @@ public class DefaultUsage extends ISOMet
     private Collection<ResponsibleParty> userContactInfo;
 
     /**
+     * Responses to the user-determined limitations.
+     */
+    private Collection<InternationalString> responses;
+
+    /**
+     * Publication that describe usage of data.
+     */
+    private Collection<Citation> additionalDocumentation;
+
+    /**
+     * Citation of a description of known issues associated with the resource
+     * along with proposed solutions if available.
+     */
+    private Collection<Citation> identifiedIssues;
+
+    /**
      * Constructs an initially empty usage.
      */
     public DefaultUsage() {
@@ -113,6 +140,12 @@ public class DefaultUsage extends ISOMet
             usageDate                 = toMilliseconds(object.getUsageDate());
             userDeterminedLimitations = object.getUserDeterminedLimitations();
             userContactInfo           = copyCollection(object.getUserContactInfo(), ResponsibleParty.class);
+            if (object instanceof DefaultUsage) {
+                final DefaultUsage c = (DefaultUsage) object;
+                responses                 = copyCollection(c.getResponses(), InternationalString.class);
+                additionalDocumentation   = copyCollection(c.getAdditionalDocumentation(), Citation.class);
+                identifiedIssues          = copyCollection(c.getIdentifiedIssues(), Citation.class);
+            }
         }
     }
 
@@ -163,8 +196,7 @@ public class DefaultUsage extends ISOMet
     }
 
     /**
-     * Returns the date and time of the first use or range of uses
-     * of the resource and/or resource series.
+     * Returns the date and time of the first use or range of uses of the resource and/or resource series.
      *
      * @return Date of the first use of the resource, or {@code null}.
      */
@@ -185,8 +217,7 @@ public class DefaultUsage extends ISOMet
     }
 
     /**
-     * Returns applications, determined by the user for which the resource and/or resource series
-     * is not suitable.
+     * Returns applications, determined by the user for which the resource and/or resource series is not suitable.
      *
      * @return Applications for which the resource and/or resource series is not suitable, or {@code null}.
      */
@@ -197,8 +228,7 @@ public class DefaultUsage extends ISOMet
     }
 
     /**
-     * Sets applications, determined by the user for which the resource and/or resource series
-     * is not suitable.
+     * Sets applications, determined by the user for which the resource and/or resource series is not suitable.
      *
      * @param newValue The new user determined limitations.
      */
@@ -208,8 +238,12 @@ public class DefaultUsage extends ISOMet
     }
 
     /**
-     * Returns identification of and means of communicating with person(s) and organization(s)
-     * using the resource(s).
+     * Returns identification of and means of communicating with person(s) and organization(s) using the resource(s).
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * As of ISO 19115:2014, {@code ResponsibleParty} is replaced by the {@link Responsibility} parent interface.
+     * This change may be applied in GeoAPI 4.0.
+     * </div>
      *
      * @return Means of communicating with person(s) and organization(s) using the resource(s).
      */
@@ -220,12 +254,87 @@ public class DefaultUsage extends ISOMet
     }
 
     /**
-     * Sets identification of and means of communicating with person(s) and organization(s)
-     * using the resource(s).
+     * Sets identification of and means of communicating with person(s) and organization(s) using the resource(s).
+     *
+     * <div class="warning"><b>Upcoming API change — generalization</b><br>
+     * As of ISO 19115:2014, {@code ResponsibleParty} is replaced by the {@link Responsibility} parent interface.
+     * This change may be applied in GeoAPI 4.0.
+     * </div>
      *
      * @param newValues The new user contact info.
      */
     public void setUserContactInfo(final Collection<? extends ResponsibleParty> newValues) {
         userContactInfo = writeCollection(newValues, userContactInfo, ResponsibleParty.class);
     }
+
+    /**
+     * Responses to the user-determined limitations.
+     *
+     * @return Response to the user-determined limitations.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "response")
+    public Collection<? extends InternationalString> getResponses() {
+        return responses = nonNullCollection(responses, InternationalString.class);
+    }
+
+    /**
+     * Sets a new response to the user-determined limitations.
+     *
+     * @param newValues The new response to the user-determined limitations.
+     *
+     * @since 0.5
+     */
+    public void setResponses(final Collection<? extends InternationalString> newValues) {
+        responses = writeCollection(newValues, responses, InternationalString.class);
+    }
+
+    /**
+     * Publications that describe usage of data.
+     *
+     * @return Publications that describe usage of data.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "additionalDocumentation")
+    public Collection<Citation> getAdditionalDocumentation() {
+        return additionalDocumentation = nonNullCollection(additionalDocumentation, Citation.class);
+    }
+
+    /**
+     * Sets the publications that describe usage of data.
+     *
+     * @param newValues The new publications.
+     *
+     * @since 0.5
+     */
+    public void setAdditionalDocumentation(final Collection<? extends Citation> newValues) {
+        additionalDocumentation = writeCollection(newValues, additionalDocumentation, Citation.class);
+    }
+
+    /**
+     * Citation of a description of known issues associated with the resource
+     * along with proposed solutions if available.
+     *
+     * @return Citation of a description of known issues associated with the resource.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "identifiedIssues")
+    public Collection<? extends Citation> getIdentifiedIssues() {
+        return identifiedIssues = nonNullCollection(identifiedIssues, Citation.class);
+    }
+
+    /**
+     * Sets a new citation of a description of known issues associated with the resource
+     * along with proposed solutions if available.
+     *
+     * @param newValues The new citation of a description.
+     *
+     * @since 0.5
+     */
+    public void setIdentifiedIssues(final Collection<? extends Citation> newValues) {
+        identifiedIssues = writeCollection(newValues, identifiedIssues, Citation.class);
+    }
 }

Copied: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/OperationName.java (from r1625241, sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/OperationName.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/OperationName.java?p2=sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/OperationName.java&p1=sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/OperationName.java&r1=1625241&r2=1626345&rev=1626345&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/OperationName.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/OperationName.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -16,18 +16,9 @@
  */
 package org.apache.sis.metadata.iso.identification;
 
-import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Collection;
-import java.util.Collections;
-import java.io.Serializable;
-import org.opengis.metadata.citation.OnlineResource;
-import org.opengis.metadata.identification.CoupledResource;
-import org.opengis.metadata.identification.DistributedComputingPlatform;
-import org.opengis.metadata.identification.OperationMetadata;
-import org.opengis.parameter.ParameterDescriptor;
-import org.opengis.util.InternationalString;
 
 
 /**
@@ -39,41 +30,25 @@ import org.opengis.util.InternationalStr
  * @since   0.5
  * @module
  */
-final class OperationName implements OperationMetadata, Serializable {
+final class OperationName extends DefaultOperationMetadata {
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = -7958898214063034276L;
-
-    /**
-     * The operation name.
-     */
-    private final String operationName;
+    private static final long serialVersionUID = 7221543581387125873L;
 
     /**
      * Creates a new placeholder for the operation of the given name.
      */
     OperationName(final String operationName) {
-        this.operationName = operationName;
+        setOperationName(operationName);
     }
 
     /**
-     * Returns the operation name.
-     */
-    @Override public String                                   getOperationName()                 {return operationName;}
-    @Override public InternationalString                      getInvocationName()                {return null;}
-    @Override public InternationalString                      getOperationDescription()          {return null;}
-    @Override public Collection<DistributedComputingPlatform> getDistributedComputingPlatforms() {return Collections.emptySet();}
-    @Override public Collection<OnlineResource>               getConnectPoints()                 {return Collections.emptySet();}
-    @Override public Collection<ParameterDescriptor<?>>       getParameters()                    {return Collections.emptySet();}
-    @Override public List<OperationMetadata>                  getDependsOn()                     {return Collections.emptyList();}
-
-    /**
      * Returns a string representation of this placeholder.
      */
     @Override
     public String toString() {
-        return "OperationMetadata[“" + operationName + "”]";
+        return "OperationMetadata[“" + getOperationName() + "”]";
     }
 
     /**
@@ -86,25 +61,23 @@ final class OperationName implements Ope
      * <p>This method is invoked at unmarshalling time for resolving the {@code OperationMetadata} instance which
      * were identified only by a name in a {@code <srv:operationName>} element.</p>
      */
-    static void resolve(final Collection<OperationMetadata> containsOperations, final Collection<CoupledResource> coupledResources) {
-        final Map<String,OperationMetadata> byName = new HashMap<String,OperationMetadata>();
-        for (final OperationMetadata operation : containsOperations) {
+    static void resolve(final Collection<DefaultOperationMetadata> containsOperations, final Collection<DefaultCoupledResource> coupledResources) {
+        final Map<String,DefaultOperationMetadata> byName = new HashMap<String,DefaultOperationMetadata>();
+        for (final DefaultOperationMetadata operation : containsOperations) {
             add(byName, operation.getOperationName(), operation);
         }
-        for (final CoupledResource resource : coupledResources) {
-            if (resource instanceof DefaultCoupledResource) {
-                OperationMetadata operation = resource.getOperation();
-                if (operation instanceof OperationName) {
-                    final String name = operation.getOperationName();
+        for (final DefaultCoupledResource resource : coupledResources) {
+            DefaultOperationMetadata operation = resource.getOperation();
+            if (operation instanceof OperationName) {
+                final String name = operation.getOperationName();
+                operation = byName.get(name);
+                if (operation == null) {
                     operation = byName.get(name);
                     if (operation == null) {
-                        operation = byName.get(name);
-                        if (operation == null) {
-                            continue;
-                        }
+                        continue;
                     }
-                    ((DefaultCoupledResource) resource).setOperation(operation);
                 }
+                resource.setOperation(operation);
             }
         }
     }
@@ -113,9 +86,9 @@ final class OperationName implements Ope
      * Adds the given operation in the given map under the given name. If an entry already exists for the given name,
      * then this method sets the value to {@code null} for meaning that we have duplicated values for that name.
      */
-    private static void add(final Map<String,OperationMetadata> byName, final String name, final OperationMetadata operation) {
+    private static void add(final Map<String,DefaultOperationMetadata> byName, final String name, final DefaultOperationMetadata operation) {
         final boolean exists = byName.containsKey(name);
-        final OperationMetadata previous = byName.put(name, operation);
+        final DefaultOperationMetadata previous = byName.put(name, operation);
         if (previous != operation && (previous != null || exists)) {
             byName.put(name, null); // Mark the entry as duplicated.
         }

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -43,23 +43,20 @@
  * {@code  ├─} {@linkplain org.opengis.metadata.identification.KeywordType     Keyword type}<br>
  * {@code  ├─} {@linkplain org.opengis.metadata.identification.AssociationType Association type}<br>
  * {@code  ├─} {@linkplain org.opengis.metadata.identification.InitiativeType  Initiative type}<br>
- * {@code  ├─} {@linkplain org.opengis.metadata.identification.TopicCategory   Topic category}<br>
- * {@code  └─} {@linkplain org.opengis.metadata.identification.CharacterSet    Character set}<br>
+ * {@code  └─} {@linkplain org.opengis.metadata.identification.TopicCategory   Topic category}<br>
  * </td><td class="sep" style="width: 50%; white-space: nowrap">
  *                 {@linkplain org.apache.sis.metadata.iso.identification.AbstractIdentification       Identification} «abstract»<br>
+ * {@code  ├─}     {@linkplain org.apache.sis.metadata.iso.identification.DefaultResolution            Resolution}<br>
+ * {@code  ├─}     {@linkplain org.opengis.metadata.identification.TopicCategory                       Topic category} «code list»<br>
  * {@code  ├─}     {@linkplain org.opengis.metadata.identification.Progress                            Progress} «code list»<br>
  * {@code  ├─}     {@linkplain org.apache.sis.metadata.iso.identification.DefaultBrowseGraphic         Browse graphic}<br>
  * {@code  ├─}     {@linkplain org.apache.sis.metadata.iso.identification.DefaultKeywords              Keywords}<br>
  * {@code  │   └─} {@linkplain org.opengis.metadata.identification.KeywordType                         Keyword type} «code list»<br>
  * {@code  ├─}     {@linkplain org.apache.sis.metadata.iso.identification.DefaultUsage                 Usage}<br>
- * {@code  └─}     {@linkplain org.apache.sis.metadata.iso.identification.DefaultAggregateInformation  Aggregate information}<br>
+ * {@code  └─}     {@linkplain org.apache.sis.metadata.iso.identification.DefaultAssociatedResource    Associated resource}<br>
  * {@code      ├─} {@linkplain org.opengis.metadata.identification.AssociationType                     Association type} «code list»<br>
  * {@code      └─} {@linkplain org.opengis.metadata.identification.InitiativeType                      Initiative type} «code list»<br>
  *                 {@linkplain org.apache.sis.metadata.iso.identification.DefaultDataIdentification    Data identification}<br>
- * {@code  ├─}     {@linkplain org.apache.sis.metadata.iso.identification.DefaultResolution            Resolution}<br>
- * {@code  └─}     {@linkplain org.opengis.metadata.identification.TopicCategory                       Topic category} «code list»<br>
- *                 {@linkplain org.apache.sis.metadata.iso.identification.DefaultServiceIdentification Service identification}<br>
- *                 {@linkplain org.opengis.metadata.identification.CharacterSet                        Character set} «code list»<br>
  * </td></tr></table>
  *
  * <p>In addition to the standard properties, SIS provides the following methods:</p>
@@ -69,7 +66,7 @@
  * </ul>
  *
  * {@section Null values, nil objects and collections}
- * All constructors (except the <cite>copy constructors</cite>) and setter methods accept {@code null} arguments.
+ * All constructors and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason for that is unspecified.
  * Alternatively, users can specify why a metadata element is missing by providing a value created by
  * {@link org.apache.sis.xml.NilReason#createNilObject NilReason.createNilObject(Class)}.
@@ -98,6 +95,8 @@
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({
     @XmlJavaTypeAdapter(CI_Citation.class),
+    @XmlJavaTypeAdapter(CI_OnlineResource.class),
+    @XmlJavaTypeAdapter(CI_Responsibility.class),
     @XmlJavaTypeAdapter(CI_ResponsibleParty.class),
     @XmlJavaTypeAdapter(DS_AssociationTypeCode.class),
     @XmlJavaTypeAdapter(DS_InitiativeTypeCode.class),
@@ -106,6 +105,7 @@
     @XmlJavaTypeAdapter(MD_BrowseGraphic.class),
     @XmlJavaTypeAdapter(MD_CharacterSetCode.class),
     @XmlJavaTypeAdapter(MD_Constraints.class),
+    @XmlJavaTypeAdapter(MD_DataIdentification.class),
     @XmlJavaTypeAdapter(MD_Format.class),
     @XmlJavaTypeAdapter(MD_Identifier.class),
     @XmlJavaTypeAdapter(MD_Keywords.class),
@@ -115,15 +115,22 @@
     @XmlJavaTypeAdapter(MD_RepresentativeFraction.class),
     @XmlJavaTypeAdapter(MD_Resolution.class),
     @XmlJavaTypeAdapter(MD_SpatialRepresentationTypeCode.class),
+    @XmlJavaTypeAdapter(MD_StandardOrderProcess.class),
     @XmlJavaTypeAdapter(MD_TopicCategoryCode.class),
     @XmlJavaTypeAdapter(MD_Usage.class),
+    @XmlJavaTypeAdapter(SV_CoupledResource.class),
+    @XmlJavaTypeAdapter(SV_OperationMetadata.class),
+    @XmlJavaTypeAdapter(SV_OperationChainMetadata.class),
+    @XmlJavaTypeAdapter(SV_Parameter.class),
 
     // Java types, primitive types and basic OGC types handling
     @XmlJavaTypeAdapter(URIAdapter.class),
     @XmlJavaTypeAdapter(LocaleAdapter.class),
     @XmlJavaTypeAdapter(StringAdapter.class),
     @XmlJavaTypeAdapter(InternationalStringAdapter.class),
-    @XmlJavaTypeAdapter(GO_DateTime.class)
+    @XmlJavaTypeAdapter(GO_DateTime.class),
+    @XmlJavaTypeAdapter(GO_GenericName.class),
+    @XmlJavaTypeAdapter(GO_Boolean.class), @XmlJavaTypeAdapter(type=boolean.class, value=GO_Boolean.class)
 })
 package org.apache.sis.metadata.iso.identification;
 

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -29,6 +29,15 @@ import org.apache.sis.xml.Namespaces;
 /**
  * Details of the methodology by which geographic information was derived from the instrument readings.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Cédric Briançon (Geomatys)
  * @author  Guilhem Legal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -21,30 +21,45 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.quality.Scope;
 import org.opengis.metadata.lineage.Source;
 import org.opengis.metadata.lineage.Lineage;
 import org.opengis.metadata.lineage.ProcessStep;
 import org.opengis.metadata.maintenance.ScopeCode;
 import org.apache.sis.metadata.iso.ISOMetadata;
-import org.apache.sis.metadata.iso.quality.DefaultScope;
+import org.apache.sis.metadata.iso.maintenance.DefaultScope;
 
 
 /**
  * Information about the events or source data used in constructing the data specified by
  * the scope or lack of knowledge about lineage.
  *
- * Only one of {@linkplain #getStatement statement}, {@linkplain #getProcessSteps process steps}
- * and {@link #getSources sources} should be provided.
+ * {@section Relationship between properties}
+ * At least one of {@linkplain #getStatement statement}, {@linkplain #getProcessSteps() process steps}
+ * and {@link #getSources() sources} shall be provided.
+ *
+ * {@section Limitations}
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
+ * @author  Rémi Maréchal (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "LI_Lineage_Type", propOrder = {
     "statement",
+/// "scope",
+/// "additionalResource",
     "processSteps",
     "sources"
 })
@@ -63,6 +78,17 @@ public class DefaultLineage extends ISOM
     private InternationalString statement;
 
     /**
+     * Type of resource and / or extent to which the lineage information applies.
+     */
+    private Scope scope;
+
+    /**
+     * A resources (for example publication) that describes the whole
+     * process to generate this resource (for example a dataset).
+     */
+    private Collection<Citation> additionalDocumentation;
+
+    /**
      * Information about an event in the creation process for the data specified by the scope.
      */
     private Collection<ProcessStep> processSteps;
@@ -90,9 +116,13 @@ public class DefaultLineage extends ISOM
     public DefaultLineage(final Lineage object) {
         super(object);
         if (object != null) {
-            statement    = object.getStatement();
-            processSteps = copyCollection(object.getProcessSteps(), ProcessStep.class);
-            sources      = copyCollection(object.getSources(), Source.class);
+            statement               = object.getStatement();
+            processSteps            = copyCollection(object.getProcessSteps(), ProcessStep.class);
+            sources                 = copyCollection(object.getSources(), Source.class);
+            if (object instanceof DefaultLineage) {
+                scope                   = ((DefaultLineage) object).getScope();
+                additionalDocumentation = copyCollection(((DefaultLineage) object).getAdditionalDocumentation(), Citation.class);
+            }
         }
     }
 
@@ -145,9 +175,56 @@ public class DefaultLineage extends ISOM
     }
 
     /**
-     * Returns the information about an event in the creation process for the data specified by the scope.
+     * Returns the type of resource and / or extents to which the lineage information applies.
+     *
+     * @return Type of resource and / or extents to which the lineage information applies.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "scope")
+    public Scope getScope() {
+        return scope;
+    }
+
+    /**
+     * Sets the type of resource and / or extents to which the lineage information applies.
+     *
+     * @param newValue The new type of resource.
+     *
+     * @since 0.5
+     */
+    public void setScope(final Scope newValue) {
+        checkWritePermission();
+        scope = newValue;
+    }
+
+    /**
+     * Returns additional documentation.
+     *
+     * @return Additional documentation.
+     *
+     * @since 0.5
+     */
+/// @XmlElement(name = "additionalDocumentation")
+    public Collection<Citation> getAdditionalDocumentation() {
+        return additionalDocumentation = nonNullCollection(additionalDocumentation, Citation.class);
+    }
+
+    /**
+     * Sets additional documentation.
+     *
+     * @param newValues Additional documentation.
+     *
+     * @since 0.5
+     */
+    public void setAdditionalDocumentation(final Collection<? extends Citation> newValues)  {
+        additionalDocumentation = writeCollection(newValues, additionalDocumentation, Citation.class);
+    }
+
+    /**
+     * Returns the information about about events in the life of a resource specified by the scope.
      *
-     * @return Information about an event in the creation process.
+     * @return Information about events in the life of a resource.
      */
     @Override
     @XmlElement(name = "processStep")
@@ -156,7 +233,7 @@ public class DefaultLineage extends ISOM
     }
 
     /**
-     * Sets information about an event in the creation process for the data specified by the scope.
+     * Sets information about events in the life of a resource specified by the scope.
      *
      * @param newValues The new process steps.
      */

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -28,6 +28,15 @@ import org.apache.sis.xml.Namespaces;
 /**
  * Distance between consistent parts of (centre, left side, right side) adjacent pixels.
  *
+ * <p><b>Limitations:</b></p>
+ * <ul>
+ *   <li>Instances of this class are not synchronized for multi-threading.
+ *       Synchronization, if needed, is caller's responsibility.</li>
+ *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ *       Serialization support is appropriate for short term storage or RMI between applications running the
+ *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.03)



Mime
View raw message