You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2006/07/12 19:33:28 UTC

svn commit: r421335 - in /webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata: MetadataDescriptor.java MetadataResource.java OpenMetadataDescriptor.java ResourceMetadataCapability.java WsrmdConstants.java

Author: danj
Date: Wed Jul 12 10:33:27 2006
New Revision: 421335

URL: http://svn.apache.org/viewvc?rev=421335&view=rev
Log:
Updated these interfaces to reflect changes between WSRMD 2004 draft and WSRMD CD 01. Also added 
two new interfaces to represent the new "metadata resource" concept that is present in CD 01; one 
is the capability that exposes and EPR to the metadata resource,  the other is for the metadata 
resource itself.


Added:
    webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataResource.java
    webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/ResourceMetadataCapability.java
Modified:
    webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataDescriptor.java
    webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/OpenMetadataDescriptor.java
    webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/WsrmdConstants.java

Modified: webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataDescriptor.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataDescriptor.java?rev=421335&r1=421334&r2=421335&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataDescriptor.java (original)
+++ webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataDescriptor.java Wed Jul 12 10:33:27 2006
@@ -20,6 +20,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.muse.util.xml.XmlSerializable;
 import org.apache.muse.ws.addressing.soap.SoapFault;
 
 /**
@@ -35,7 +36,7 @@
  *
  */
 
-public interface MetadataDescriptor
+public interface MetadataDescriptor extends XmlSerializable
 {
     /**
      * 
@@ -58,16 +59,6 @@
     boolean canInsert(QName property);
     
     /**
-     *
-     * @param property
-     * 
-     * @return True if the property generates events to which users can 
-     *         subscribe.
-     *
-     */
-    boolean canSubscribe(QName property);
-    
-    /**
      * 
      * @param property
      * 
@@ -99,6 +90,46 @@
      * 
      * @param property
      * 
+     * @return The collection of initial values defined for this property.
+     *         <br><br>
+     *         The actual values are DOM Elements, since that is how they are 
+     *         described in the RMD. They can be compared to the results of a 
+     *         WS-RP GetResourceProperty call.
+     * 
+     * @see #getInitialValues(QName, Class)
+     * 
+     */
+    Collection getInitialValues(QName property);
+    
+    /**
+     * 
+     * @param property
+     * 
+     * @param javaType
+     *        The type whose serializer should be used to convert the 
+     *        property values (DOM Elements) into POJOs.
+     * 
+     * @return The array of getInitialValues(QName) in POJO form.
+     * 
+     * @throws SoapFault
+     *         <ul>
+     *         <li>If there is no Serializer registered for the given type.</li>
+     *         <li>If the property value XML can not be translated into an 
+     *         instance of the given type.</li>
+     *         </ul>
+     * 
+     * @see #getValidValues(QName)
+     *
+     */
+    Collection getInitialValues(QName property, Class javaType)
+        throws SoapFault;
+    
+    QName getInterface();
+    
+    /**
+     * 
+     * @param property
+     * 
      * @return The lower bound of the property's valid value range, if one 
      *         is defined. The user must interpret the string value in the 
      *         context of the property's type. The method returns null if 
@@ -159,7 +190,7 @@
      * @see #getStaticValues(QName)
      *
      */
-    Object getStaticValues(QName property, Class javaType)
+    Collection getStaticValues(QName property, Class javaType)
         throws SoapFault;
     
     /**
@@ -208,14 +239,15 @@
      *         <li>If the property value XML can not be translated into an 
      *         instance of the given type.</li>
      *         </ul>
-     * @throws SoapFault
      * 
      * @see #getValidValues(QName)
      *
      */
-    Object getValidValues(QName property, Class javaType)
+    Collection getValidValues(QName property, Class javaType)
         throws SoapFault;
     
+    String getWsdlLocation();
+    
     /**
      * 
      * @param property
@@ -224,6 +256,18 @@
      *
      */
     boolean hasProperty(QName property);
+    
+    /**
+     * 
+     * @param property
+     * @param value
+     * 
+     * @return True if the given value is found in the property's set of 
+     *         initial values. If the property has no initial values defined, 
+     *         the method returns "false".
+     *
+     */
+    boolean isInitialValue(QName property, Object value);
     
     /**
      * 

Added: webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataResource.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataResource.java?rev=421335&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataResource.java (added)
+++ webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/MetadataResource.java Wed Jul 12 10:33:27 2006
@@ -0,0 +1,46 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+ 
+package org.apache.muse.ws.resource.metadata;
+
+import javax.xml.namespace.QName;
+
+import org.apache.muse.ws.resource.WsResourceCapability;
+import org.apache.muse.ws.resource.basefaults.BaseFault;
+
+/**
+ * 
+ * MetadataResource is a capability that represents the WS-RMD metadata resource, 
+ * which is a resource type that exists solely to represent the metadata descriptor 
+ * of another WS-resource. Clients can query this resource's WS-RP doc to get the 
+ * metadata descriptor for the resource that created it.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public interface MetadataResource extends WsResourceCapability
+{
+    QName[] PROPERTIES = {
+        WsrmdConstants.DESCRIPTOR_QNAME 
+    };
+    
+    MetadataDescriptor getMetadataDescriptor()
+        throws BaseFault;
+    
+    void setMetadataDescriptor(MetadataDescriptor rmd)
+        throws BaseFault;
+}

Modified: webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/OpenMetadataDescriptor.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/OpenMetadataDescriptor.java?rev=421335&r1=421334&r2=421335&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/OpenMetadataDescriptor.java (original)
+++ webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/OpenMetadataDescriptor.java Wed Jul 12 10:33:27 2006
@@ -21,6 +21,10 @@
 
 import javax.xml.namespace.QName;
 
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import org.apache.muse.util.xml.XmlUtils;
 
 /**
  *
@@ -89,22 +93,37 @@
      * @return true
      * 
      */
-    public boolean canSubscribe(QName property)
+    public boolean canUpdate(QName property)
     {
         return true;
     }
 
+    public String getExtendedMetadata(QName property, QName elementName)
+    {
+        return null;
+    }
+
     /**
      *
-     * @return true
+     * @return An empty collection.
      * 
      */
-    public boolean canUpdate(QName property)
+    public Collection getInitialValues(QName property)
     {
-        return true;
+        return Collections.EMPTY_LIST;
     }
 
-    public String getExtendedMetadata(QName property, QName elementName)
+    /**
+     *
+     * @return An empty collection.
+     * 
+     */
+    public Collection getInitialValues(QName property, Class type)
+    {
+        return Collections.EMPTY_LIST;
+    }
+
+    public QName getInterface()
     {
         return null;
     }
@@ -154,7 +173,7 @@
      * @return An empty collection.
      * 
      */
-    public Object getStaticValues(QName property, Class type)
+    public Collection getStaticValues(QName property, Class type)
     {
         return Collections.EMPTY_LIST;
     }
@@ -184,11 +203,16 @@
      * @return An empty collection.
      * 
      */
-    public Object getValidValues(QName property, Class type)
+    public Collection getValidValues(QName property, Class type)
     {
         return Collections.EMPTY_LIST;
     }
 
+    public String getWsdlLocation()
+    {
+        return null;
+    }
+
     /**
      *
      * @return true
@@ -204,6 +228,16 @@
      * @return false
      * 
      */
+    public boolean isInitialValue(QName property, Object value)
+    {
+        return false;
+    }
+
+    /**
+     *
+     * @return false
+     * 
+     */
     public boolean isReadOnlyExternal(QName property)
     {
         return false;
@@ -229,4 +263,13 @@
         return true;
     }
 
+    public Element toXML()
+    {
+        return toXML(XmlUtils.EMPTY_DOC);
+    }
+
+    public Element toXML(Document doc)
+    {
+        return XmlUtils.createElement(doc, WsrmdConstants.DESCRIPTOR_QNAME);
+    }
 }

Added: webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/ResourceMetadataCapability.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/ResourceMetadataCapability.java?rev=421335&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/ResourceMetadataCapability.java (added)
+++ webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/ResourceMetadataCapability.java Wed Jul 12 10:33:27 2006
@@ -0,0 +1,44 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+ 
+package org.apache.muse.ws.resource.metadata;
+
+import javax.xml.namespace.QName;
+
+import org.apache.muse.ws.addressing.EndpointReference;
+import org.apache.muse.ws.resource.WsResourceCapability;
+import org.apache.muse.ws.resource.basefaults.BaseFault;
+
+/**
+ * 
+ * ResourceMetadataCapability is a capability for WSRF resource that wish to 
+ * expose their WSRMD metadata descriptors as "metadata resources". These 
+ * metadata resources have a WSRP document whose contents is the metadata 
+ * descriptor of the owner resource.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public interface ResourceMetadataCapability extends WsResourceCapability
+{
+    QName[] PROPERTIES = {
+        WsrmdConstants.DESCRIPTOR_EPR_QNAME 
+    };
+    
+    EndpointReference getMetadataDescriptorReference()
+        throws BaseFault;
+}

Modified: webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/WsrmdConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/WsrmdConstants.java?rev=421335&r1=421334&r2=421335&view=diff
==============================================================================
--- webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/WsrmdConstants.java (original)
+++ webservices/muse/trunk/modules/muse-wsrf/src-api/org/apache/muse/ws/resource/metadata/WsrmdConstants.java Wed Jul 12 10:33:27 2006
@@ -21,7 +21,7 @@
 /**
  *
  * WsrmdConstants is a collection of properties that are useful when programming 
- * against the WS-ResourceMetadata spec. This class uses WS-RMD v1.0, draft 01.
+ * against the WS-ResourceMetadata spec. This class uses WS-RMD v1.0 CD.
  *
  * @author Dan Jemiolo (danj)
  *
@@ -31,13 +31,16 @@
 {
     /**
      * 
-     * The current WS-RMD namespace URI - v1.0 draft 01.
+     * The current WS-RMD namespace URI - v1.0 CD.
      * 
      */
-    public static final String NAMESPACE_URI = 
-        "http://docs.oasis-open.org/wsrf/2004/10/wsrf-WS-ResourceMetadataDescriptor-1.0-draft-01.xsd";
+    public static final String NAMESPACE_URI = "http://docs.oasis-open.org/wsrf/rmd-1";
     
     public static final String PREFIX = "wsrmd";
+    
+    public static final String RESOURCE_METADATA_URI = NAMESPACE_URI + "/ResourceMetadata";
+    
+    public static final String METADATA_RESOURCE_URI = NAMESPACE_URI + "/MetadataResource";
 
     //
     // Elements for RMD definitions
@@ -47,13 +50,20 @@
         new QName(NAMESPACE_URI, "MetadataDescriptor", PREFIX);
     
     public static final QName DESCRIPTOR_ATTR_QNAME = 
-        new QName(NAMESPACE_URI, "metadataDescriptor", PREFIX);
+        new QName(NAMESPACE_URI, "Descriptor", PREFIX);
+    
+    public static final QName DESCRIPTOR_LOCATION_ATTR_QNAME = 
+        new QName(NAMESPACE_URI, "DescriptorLocation", PREFIX);
     
-    public static final QName LOCATION_ATTR_QNAME = 
-        new QName(NAMESPACE_URI, "metadataDescriptorLocation", PREFIX);
+    public static final QName DESCRIPTOR_EPR_QNAME = 
+        new QName(NAMESPACE_URI, "MetadataDescriptorReference", PREFIX);
     
     public static final String NAME = "name";
     
+    public static final String INTERFACE = "interface";
+    
+    public static final String WSDL_LOCATION = "wsdlLocation";
+    
     public static final QName PROPERTY_QNAME = 
         new QName(NAMESPACE_URI, "Property", PREFIX);
     
@@ -69,10 +79,9 @@
     public static final String APPENDABLE = "appendable";
     public static final String CONSTANT = "constant";
     public static final String MUTABLE = "mutable";
-    
-    public static final String PATH = "path";
 
-    public static final String SUBSCRIBABILITY = "subscribability";
+    public static final QName INITIAL_VALUES_QNAME = 
+        new QName(NAMESPACE_URI, "InitialValues", PREFIX);
 
     public static final QName STATIC_VALUES_QNAME = 
         new QName(NAMESPACE_URI, "StaticValues", PREFIX);



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org