You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by wi...@apache.org on 2005/08/26 19:30:10 UTC
svn commit: r240293 - in /webservices/muse/trunk/src/examples/client/src:
java/ java/org/apache/ws/client/model/ java/org/apache/ws/client/model/impl/
java/org/apache/ws/client/model/swing/ java/org/apache/ws/client/util/
test/org/apache/ws/client/mode...
Author: wire
Date: Fri Aug 26 10:30:00 2005
New Revision: 240293
URL: http://svn.apache.org/viewcvs?rev=240293&view=rev
Log:
Refactored model to use OASIS terminology
Added:
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumer.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumerFactory.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagableResourceInstance.java
- copied, changed from r232393, webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmInstance.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManageableResource.java
- copied, changed from r232393, webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmResource.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagementEvent.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpoint.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpointFactory.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEventListener.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ResourceOperation.java
- copied, changed from r232393, webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmOperation.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/model_classdiagram.cdf (with props)
Removed:
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmClient.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmClientFactory.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmInstance.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmOperation.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmResource.java
Modified:
webservices/muse/trunk/src/examples/client/src/java/WsdmExplorer.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmClientImpl.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmInstanceImpl.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmOperationImpl.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmResourceImpl.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/swing/WsdmTreeModel.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Consumer.java
webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Subscriber.java
webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmClientTestCase.java
webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmInstanceTestCase.java
webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmOperationTestCase.java
webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmResourceTestCase.java
webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/util/SubscriberTest.java
Modified: webservices/muse/trunk/src/examples/client/src/java/WsdmExplorer.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/WsdmExplorer.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/WsdmExplorer.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/WsdmExplorer.java Fri Aug 26 10:30:00 2005
@@ -17,10 +17,10 @@
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;
-import org.apache.ws.client.model.WsdmClient;
-import org.apache.ws.client.model.WsdmClientFactory;
-import org.apache.ws.client.model.WsdmInstance;
-import org.apache.ws.client.model.WsdmResource;
+import org.apache.ws.client.model.ManagabilityConsumer;
+import org.apache.ws.client.model.ManagabilityConsumerFactory;
+import org.apache.ws.client.model.ManagableResourceInstance;
+import org.apache.ws.client.model.ManageableResource;
/**
* @author wire
@@ -148,9 +148,9 @@
*/
private void get() throws Exception {
- WsdmClient client=WsdmClientFactory.create(WsdmClientFactory.AXIS_CLIENT_TYPE,m_hostname,m_servletContext);
- WsdmResource resource=client.getResource(m_resource);
- WsdmInstance instance=resource.getInstance(m_resourceId);
+ ManagabilityConsumer client=ManagabilityConsumerFactory.create(ManagabilityConsumerFactory.AXIS_CLIENT_TYPE,m_hostname,m_servletContext);
+ ManageableResource resource=client.getResource(m_resource);
+ ManagableResourceInstance instance=resource.getInstance(m_resourceId);
String[] propnames = instance.getPropertyNames();
System.out.println("Properties of wsdm://"+m_resource+":"+m_resourceId+"@"+m_hostname+"/"+m_servletContext+"\n");
for (int index = 0; index < propnames.length; index++) {
@@ -182,18 +182,18 @@
*
*/
private void ls() throws Exception {
- WsdmClient client=WsdmClientFactory.create(WsdmClientFactory.AXIS_CLIENT_TYPE,m_hostname,m_servletContext);
- System.out.println("Directory of server "+m_hostname+"\n");
- WsdmResource[] resources = client.getResources();
- for (int index = 0; index < resources.length; index++) {
- WsdmResource resource = resources[index];
- System.out.println(resource);
- WsdmInstance[] instances = resource.getInstances();
- for (int instanceIndex = 0; instanceIndex < instances.length; instanceIndex++) {
- WsdmInstance instance = instances[instanceIndex];
- System.out.println(" "+instance.getName());
- }
- }
+// ManagabilityConsumer client=ManagabilityConsumerFactory.create(ManagabilityConsumerFactory.AXIS_CLIENT_TYPE,m_hostname,m_servletContext);
+// System.out.println("Directory of server "+m_hostname+"\n");
+// ManageableResource[] resources = client.getResources();
+// for (int index = 0; index < resources.length; index++) {
+// ManageableResource resource = resources[index];
+// System.out.println(resource);
+// ManagableResourceInstance[] instances = resource.getInstances();
+// for (int instanceIndex = 0; instanceIndex < instances.length; instanceIndex++) {
+// ManagableResourceInstance instance = instances[instanceIndex];
+// System.out.println(" "+instance.getName());
+// }
+// }
}
public static void ShowHelpMessage() {
Added: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumer.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumer.java?rev=240293&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumer.java (added)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumer.java Fri Aug 26 10:30:00 2005
@@ -0,0 +1,67 @@
+/*=============================================================================*
+ * Confidential Copyright (c) 2004 Hewlett-Packard Development Company, L.P. *
+ *=============================================================================*
+ * Created on Sep 16, 2004
+ *
+ * $RCSfile: WsdmClient.java,v $ $Revision: 1.1 $
+ * $Author: scamp $ $Date: 2004/11/12 21:07:14 $
+ * Branch or Tag : $Name: $
+ *
+ * ______________Recent Changes_______________________________
+ *
+ */
+package org.apache.ws.client.model;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * @author wire
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public interface ManagabilityConsumer {
+
+ /**
+ * Attempts to make a simple request from the server.
+ * @return returns the time in millis for this request to complete or -1 if
+ * the remote server failes to respond.
+ */
+ public boolean isResourceAvailable();
+
+ /**
+ * Creates an array of WsdmResources.
+ * @return An array of WsdmResources which can be though of as a collection of resource instances which
+ * share a common interface and purpose.
+ * @throws SecurityException
+ * @throws IllegalArgumentException
+ * @throws NoSuchMethodException
+ * @throws IllegalAccessException
+ * @throws InvocationTargetException
+ * @throws Exception
+ */
+// public ManageableResource[] getResources() throws SecurityException,
+// IllegalArgumentException, NoSuchMethodException,
+// IllegalAccessException, InvocationTargetException, Exception;
+
+ /**
+ * Allows a specific resource name to be asked for. Usually used when a resource
+ * name is known in advance.
+ * @param resourceName
+ * @return
+ * @throws Exception
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws NoSuchMethodException
+ * @throws IllegalArgumentException
+ * @throws SecurityException
+ */
+ public ManageableResource getResource(String resourceName) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, Exception;
+
+ /**
+ * Returns a meaningful name for this client.
+ * @return a string containing a name which can be used to represent this client.
+ */
+ public String getName();
+
+}
\ No newline at end of file
Added: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumerFactory.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumerFactory.java?rev=240293&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumerFactory.java (added)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagabilityConsumerFactory.java Fri Aug 26 10:30:00 2005
@@ -0,0 +1,58 @@
+/*=============================================================================*
+ * Confidential Copyright (c) 2004 Hewlett-Packard Development Company, L.P. *
+ *=============================================================================*
+ * Created on Sep 16, 2004
+ *
+ * $RCSfile: WsdmClientFactory.java,v $ $Revision: 1.1 $
+ * $Author: scamp $ $Date: 2004/11/12 21:07:15 $
+ * Branch or Tag : $Name: $
+ *
+ * ______________Recent Changes_______________________________
+ *
+ */
+package org.apache.ws.client.model;
+
+import java.io.IOException;
+
+import javax.wsdl.WSDLException;
+
+import org.apache.ws.client.DynamicSchemaClassBuilder;
+import org.apache.ws.client.model.impl.WsdmClientImpl;
+
+/**
+ * @author wire
+ *
+ */
+public class ManagabilityConsumerFactory {
+ public static final int AXIS_CLIENT_TYPE=0;
+
+ /**
+ * Factory cannot be created.
+ */
+ private ManagabilityConsumerFactory() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+ /**
+ * Creates a WsdmClient in a SOAP client independent manner. Should be used to create
+ * a WsdmClient.
+ *
+ * @param clientType
+ * @param hostName
+ * @param servletContext
+ * @return an initalized WsdmClient.
+ * @throws WSDLException
+ * @throws IOException
+ */
+ public static ManagabilityConsumer create(int clientType, String hostName,String servletContext) throws WSDLException, IOException{
+ return new WsdmClientImpl(hostName,servletContext);
+ }
+ /**
+ * Clears the cache of generated classes in the users home directory;
+ * Should be used in unit tests and to flush generated classes if a wsdl on the
+ * server has changed and the client classes should be re-generated.
+ */
+ public static void clearGeneratedClassCache(){
+ DynamicSchemaClassBuilder.dispose();
+ }
+}
Copied: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagableResourceInstance.java (from r232393, webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmInstance.java)
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagableResourceInstance.java?p2=webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagableResourceInstance.java&p1=webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmInstance.java&r1=232393&r2=240293&rev=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmInstance.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagableResourceInstance.java Fri Aug 26 10:30:00 2005
@@ -13,10 +13,12 @@
package org.apache.ws.client.model;
import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
import java.util.Hashtable;
import javax.xml.namespace.QName;
+import org.apache.axis.message.addressing.EndpointReference;
import org.apache.xmlbeans.XmlObject;
import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType;
@@ -24,7 +26,7 @@
* @author wire
*
*/
-public interface WsdmInstance {
+public interface ManagableResourceInstance {
public abstract String getName();
@@ -40,21 +42,37 @@
public abstract void setPropertyValue(QName propertyName, XmlObject value) throws Exception;
- public abstract WsdmOperation[] getOperations() throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
- public abstract WsdmOperation findOperation(String operationName) throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
- public abstract XmlObject[] invoke(WsdmOperation operation,
+ public abstract XmlObject[] invoke(ResourceOperation operation,
Hashtable parameters) throws Exception;
public abstract EndpointReferenceType getEPR() throws Exception;
+
+ public ManageableResource getParent();
+ public EndpointReference getEpr();
/**
- * Requests a list of Topic XPaths.
- * @return a list of topic XPaths
+ * Uses corralatable properties of this resource
+ * to determine if another resource is actually the same.
+ * See WSDM MUWS PART A 1.0 Line 624
*/
- public abstract String[] getListenerTopics();
+ public void isCorralateableTo(ManagableResourceInstance instance);
- public WsdmResource getParent();
+ /**
+ * Creates a new Instance Directly from an EPR
+ * @param epr
+ * @return
+ */
+ public ManagableResourceInstance create(EndpointReference epr);
+ /**
+ * Creates a new Instance Directly from a URL
+ * which contains a persisted EPR
+ * @param epr
+ * @return
+ */
+ public ManagableResourceInstance create(URL epr);
+
+
}
Copied: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManageableResource.java (from r232393, webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmResource.java)
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManageableResource.java?p2=webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManageableResource.java&p1=webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmResource.java&r1=232393&r2=240293&rev=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmResource.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManageableResource.java Fri Aug 26 10:30:00 2005
@@ -12,6 +12,11 @@
*/
package org.apache.ws.client.model;
+import java.lang.reflect.InvocationTargetException;
+import java.util.EventListener;
+
+import javax.xml.namespace.QName;
+
/**
@@ -22,7 +27,7 @@
* @author wire
*
*/
-public interface WsdmResource {
+public interface ManageableResource {
/**
* Returns a name that can be used to represent this resources
* @return
@@ -33,14 +38,45 @@
* @return an array of managed instances.
* @throws Exception
*/
- public WsdmInstance[] getInstances() throws Exception;
+ public ManagableResourceInstance[] getInstances() throws Exception;
/**
* Returns a specific instance. Usually used when a resource id is known in advance.
* @param resourceId
* @return
*/
- public WsdmInstance getInstance(String resourceId);
+ public ManagableResourceInstance getInstance(String resourceId);
- public WsdmClient getParent();
+ public ManagabilityConsumer getParent();
+
+ /**
+ * The existance of MUWS:Identity is a marker used to learn if and endpoint is a Manageability
+ * Endpoint.
+ * 1.0 Spec Part A Line 520.
+ * @return true if a resource can return any MUWS:Identity. Singleton Resources also return true;
+ */
+ public boolean isManageabilityEndpoint();
+ /**
+ * This is a placeholder for accessing a list of all arrays of ManagabilityCapabilities.
+ * If these should be displayed within the model or accessable in a war fashion here is debate.
+ * See 1.0 Spec Part A Line 582.
+ * @return
+ */
+ public int getManagabilityCharacteristics();
+
+ /**
+ * Returns the singleton instance of a ManageAbleResource.
+ * @return The default or Singelton Instance of A manageable resource or null if it does not exist.
+ */
+ public ManagableResourceInstance getDefaultInstance();
+ public ManagableResourceInstance subscribe(QName topic,EventListener e);
+ /**
+ * Requests a list of Topic XPaths.
+ * @return a list of topic XPaths
+ */
+ public abstract String[] getNotificationTopics();
+
+ public abstract ResourceOperation[] getOperations() throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+ public abstract ResourceOperation findOperation(String operationName) throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+
}
Added: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagementEvent.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagementEvent.java?rev=240293&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagementEvent.java (added)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ManagementEvent.java Fri Aug 26 10:30:00 2005
@@ -0,0 +1,17 @@
+package org.apache.ws.client.model;
+
+/**
+ * Constructs a listener implementation.
+ * @author wire
+ *
+ */
+public class ManagementEvent {
+ /**
+ *
+ */
+ private ManagementEvent() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+}
Added: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpoint.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpoint.java?rev=240293&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpoint.java (added)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpoint.java Fri Aug 26 10:30:00 2005
@@ -0,0 +1,5 @@
+package org.apache.ws.client.model;
+
+public interface NotificationEndpoint {
+
+}
Added: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpointFactory.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpointFactory.java?rev=240293&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpointFactory.java (added)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEndpointFactory.java Fri Aug 26 10:30:00 2005
@@ -0,0 +1,10 @@
+package org.apache.ws.client.model;
+
+public class NotificationEndpointFactory {
+
+ public NotificationEndpointFactory() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+}
Added: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEventListener.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEventListener.java?rev=240293&view=auto
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEventListener.java (added)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/NotificationEventListener.java Fri Aug 26 10:30:00 2005
@@ -0,0 +1,7 @@
+package org.apache.ws.client.model;
+
+import java.util.EventListener;
+
+public interface NotificationEventListener extends EventListener {
+
+}
Copied: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ResourceOperation.java (from r232393, webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmOperation.java)
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ResourceOperation.java?p2=webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ResourceOperation.java&p1=webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmOperation.java&r1=232393&r2=240293&rev=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/WsdmOperation.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/ResourceOperation.java Fri Aug 26 10:30:00 2005
@@ -20,7 +20,7 @@
* @author wire
*
*/
-public interface WsdmOperation {
+public interface ResourceOperation {
/**
*
* @return The name for this operations
Modified: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmClientImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmClientImpl.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmClientImpl.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmClientImpl.java Fri Aug 26 10:30:00 2005
@@ -21,9 +21,9 @@
import org.apache.ws.client.DynamicSchemaClassBuilder;
import org.apache.ws.client.DynamicSoapClient;
import org.apache.ws.client.async.AsyncCallProvider;
-import org.apache.ws.client.model.WsdmClient;
-import org.apache.ws.client.model.WsdmInstance;
-import org.apache.ws.client.model.WsdmResource;
+import org.apache.ws.client.model.ManagabilityConsumer;
+import org.apache.ws.client.model.ManagableResourceInstance;
+import org.apache.ws.client.model.ManageableResource;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlObject;
import org.xmlsoap.schemas.soap.envelope.impl.FaultImpl;
@@ -34,8 +34,8 @@
* @author wire
*
*/
-public class WsdmClientImpl extends AsyncCallProvider implements WsdmClient {
- private WsdmResource[] m_resourceCache;
+public class WsdmClientImpl extends AsyncCallProvider implements ManagabilityConsumer {
+ private ManageableResource[] m_resourceCache;
private String m_hostname;
private String m_servletContext;
private DynamicSoapClient m_registrySoapClient;
@@ -79,12 +79,12 @@
/* (non-Javadoc)
* @see org.apache.ws.client.model.WsdmClient#ping()
*/
- public long ping() {
+ public boolean isResourceAvailable() {
Date startDate=new Date();
Operation[] operations = m_registrySoapClient.findOperation("GetResourceProperty");
if(operations.length==0)
- return -1;
+ return false;
Operation opGetResoureProperty=operations[0];
Hashtable params=new Hashtable();
@@ -93,18 +93,18 @@
try {
responses = m_registrySoapClient.execute(opGetResoureProperty,params);
} catch (Exception e) {
- return -1;
+ return false;
}
XmlObject response=responses[0];
if(response instanceof FaultImpl){
- return -1;
+ return false;
}
Date endDate=new Date();
long newPingTime=endDate.getTime()-startDate.getTime();
long oldPingTime=m_lastPingTime;
m_lastPingTime=newPingTime;
// m_propChangeSupport.firePropertyChange("LastPingTime",new Long(newPingTime),new Long(m_lastPingTime));
- return m_lastPingTime;
+ return true;
}
/**
@@ -166,7 +166,7 @@
}
- public WsdmResource[] getResources() throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, Exception{
+ public ManageableResource[] getResources() throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, Exception{
if(m_resourceCache!=null)
return m_resourceCache;
@@ -178,7 +178,7 @@
Operation opGetAllServiceNames=operations[0];
XmlObject[] responses = m_registrySoapClient.execute(opGetAllServiceNames,null);
if(responses.length==0){
- return new WsdmResource[]{};
+ return new ManageableResource[]{};
}
XmlObject response=responses[0];
@@ -194,7 +194,7 @@
String serviceName= arrayOfServiceNames[i];
resources.add(new WsdmResourceImpl(serviceName,m_hostname,m_servletContext,this));
}
- m_resourceCache=(WsdmResource[])resources.toArray(new WsdmResource[0]);
+ m_resourceCache=(ManageableResource[])resources.toArray(new ManageableResource[0]);
return m_resourceCache;
}
@@ -216,17 +216,17 @@
/* (non-Javadoc)
* @see org.apache.ws.client.model.WsdmClient#getResource(java.lang.String)
*/
- public WsdmResource getResource(String resourceName) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, Exception {
- WsdmResource[] resources = getResources();
+ public ManageableResource getResource(String resourceName) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, Exception {
+ ManageableResource[] resources = getResources();
for (int index = 0; index < resources.length; index++) {
- WsdmResource resource = resources[index];
+ ManageableResource resource = resources[index];
if(resource.getName().equals(resourceName))
return resource;
}
return null;
}
- public WsdmInstance findInstance(EndpointReferenceType epr) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, Exception{
+ public ManagableResourceInstance findInstance(EndpointReferenceType epr) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, Exception{
XmlCursor cursor = epr.newCursor();
//TODO wire get rid of these hard coded namspaces!
cursor.toChild(new QName("http://schemas.xmlsoap.org/ws/2004/08/addressing","ServiceName"));
@@ -239,7 +239,7 @@
String ResourceId=cursor.getTextValue();
cursor.dispose();
- WsdmResource resource=getResource(ServiceName);
+ ManageableResource resource=getResource(ServiceName);
return resource.getInstance(ResourceId);
}
}
Modified: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmInstanceImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmInstanceImpl.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmInstanceImpl.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmInstanceImpl.java Fri Aug 26 10:30:00 2005
@@ -10,6 +10,7 @@
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Hashtable;
@@ -20,11 +21,12 @@
import org.apache.xmlbeans.XmlObject;
import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType;
+import org.apache.axis.message.addressing.EndpointReference;
import org.apache.ws.client.DynamicSoapClient;
import org.apache.ws.client.async.AsyncCallProvider;
-import org.apache.ws.client.model.WsdmInstance;
-import org.apache.ws.client.model.WsdmOperation;
-import org.apache.ws.client.model.WsdmResource;
+import org.apache.ws.client.model.ManagableResourceInstance;
+import org.apache.ws.client.model.ResourceOperation;
+import org.apache.ws.client.model.ManageableResource;
import org.apache.ws.resource.faults.BaseFaultException;
import org.apache.ws.resource.properties.query.xpath.XPathConstants;
import com.ibm.xmlns.stdwip.webServices.wsResourceProperties.QueryExpressionType;
@@ -34,7 +36,7 @@
*
* Represents an instance of a managed resource inside the Wsdm Server.
*/
-public class WsdmInstanceImpl extends AsyncCallProvider implements WsdmInstance {
+public class WsdmInstanceImpl extends AsyncCallProvider implements ManagableResourceInstance {
private PropertyChangeSupport m_propChangeSupport;
/** DOCUMENT_ME */
static ArrayList m_reservedOperationsList;
@@ -165,7 +167,7 @@
}
/**
- * @see WsdmInstance#getPropertyValue(QName)
+ * @see ManagableResourceInstance#getPropertyValue(QName)
*/
public XmlObject[] getPropertyValue(QName propertyName) throws Exception
{
@@ -212,7 +214,7 @@
}
- public WsdmOperation[] getOperations() throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+ public ResourceOperation[] getOperations() throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
ArrayList ret=new ArrayList();
DynamicSoapClient resourceSoapClient = m_parent.getResourceSoapClient();
Operation[] wsdlOperations = resourceSoapClient.getWsdlOperations();
@@ -224,7 +226,7 @@
ret.add(new WsdmOperationImpl(operation.getName(),params));
}
}
- return (WsdmOperation[])ret.toArray(new WsdmOperationImpl[0]);
+ return (ResourceOperation[])ret.toArray(new WsdmOperationImpl[0]);
}
/**
@@ -245,7 +247,7 @@
return operation.getName().toLowerCase().startsWith("get")||operation.getName().toLowerCase().startsWith("set");
}
- public XmlObject[] invoke(WsdmOperation operation, Hashtable parameters) throws Exception {
+ public XmlObject[] invoke(ResourceOperation operation, Hashtable parameters) throws Exception {
DynamicSoapClient soapClient = m_parent.getResourceSoapClient();
Operation[] soapOperation = soapClient.findOperation(operation.getName());
if(soapOperation==null||soapOperation.length==0){
@@ -287,7 +289,7 @@
/* (non-Javadoc)
* @see org.apache.ws.client.model.WsdmInstance#getListenerTopics()
*/
- public String[] getListenerTopics() {
+ public String[] getNotificationTopics() {
// TODO Auto-generated method stub
return null;
}
@@ -296,10 +298,10 @@
/* (non-Javadoc)
* @see org.apache.ws.client.model.WsdmInstance#findOperation()
*/
- public WsdmOperation findOperation(String operationName) throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
- WsdmOperation[] ops = getOperations();
+ public ResourceOperation findOperation(String operationName) throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+ ResourceOperation[] ops = getOperations();
for (int index = 0; index < ops.length; index++) {
- WsdmOperation operation = ops[index];
+ ResourceOperation operation = ops[index];
if(operation.getName().equals(operationName)){
return operation;
}
@@ -331,7 +333,27 @@
}
- public WsdmResource getParent() {
- return (WsdmResource)m_parent;
+ public ManageableResource getParent() {
+ return (ManageableResource)m_parent;
}
+
+ public EndpointReference getEpr() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void isCorralateableTo(ManagableResourceInstance instance) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public ManagableResourceInstance create(EndpointReference epr) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ManagableResourceInstance create(URL epr) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmOperationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmOperationImpl.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmOperationImpl.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmOperationImpl.java Fri Aug 26 10:30:00 2005
@@ -18,7 +18,7 @@
import java.util.Hashtable;
import java.util.Iterator;
-import org.apache.ws.client.model.WsdmOperation;
+import org.apache.ws.client.model.ResourceOperation;
/**
* @author wire
@@ -26,7 +26,7 @@
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
-public class WsdmOperationImpl implements WsdmOperation {
+public class WsdmOperationImpl implements ResourceOperation {
private String m_name;
private Hashtable m_paramHash;
Modified: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmResourceImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmResourceImpl.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmResourceImpl.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/impl/WsdmResourceImpl.java Fri Aug 26 10:30:00 2005
@@ -7,16 +7,20 @@
package org.apache.ws.client.model.impl;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.EventListener;
import javax.wsdl.WSDLException;
+import javax.xml.namespace.QName;
import org.apache.ws.client.DynamicSoapClient;
-import org.apache.ws.client.model.WsdmClient;
-import org.apache.ws.client.model.WsdmInstance;
-import org.apache.ws.client.model.WsdmResource;
+import org.apache.ws.client.model.ManagabilityConsumer;
+import org.apache.ws.client.model.ManagableResourceInstance;
+import org.apache.ws.client.model.ManageableResource;
+import org.apache.ws.client.model.ResourceOperation;
/**
* @author wire
@@ -24,7 +28,7 @@
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
-public class WsdmResourceImpl implements WsdmResource {
+public class WsdmResourceImpl implements ManageableResource {
String m_name;
String m_hostname;
@@ -59,10 +63,10 @@
DynamicSoapClient getResourceSoapClient(){ return m_ServiceSoapClient;}
- public WsdmInstance[] getInstances() throws Exception{
+ public ManagableResourceInstance[] getInstances() throws Exception{
String[] resourceIds = m_parent.getInstances(m_name);
if(resourceIds!=null&&resourceIds.length==0){
- return new WsdmInstance[]{new WsdmInstanceImpl(null,this)};
+ return new ManagableResourceInstance[]{new WsdmInstanceImpl(null,this)};
}
else
{
@@ -71,7 +75,7 @@
String id = resourceIds[index];
retInst.add(new WsdmInstanceImpl(id,this));
}
- return (WsdmInstance[])retInst.toArray(new WsdmInstance[0]);
+ return (ManagableResourceInstance[])retInst.toArray(new ManagableResourceInstance[0]);
}
}
@@ -83,11 +87,46 @@
/* (non-Javadoc)
* @see org.apache.ws.client.model.WsdmResource#getInstance(java.lang.String)
*/
- public WsdmInstance getInstance(String resourceId) {
+ public ManagableResourceInstance getInstance(String resourceId) {
return new WsdmInstanceImpl(resourceId,this);
}
- public WsdmClient getParent() {
+ public ManagabilityConsumer getParent() {
return m_parent;
}
+
+ public boolean isManageabilityEndpoint() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public int getManagabilityCharacteristics() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public ManagableResourceInstance getDefaultInstance() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ManagableResourceInstance subscribe(QName topic, EventListener e) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String[] getNotificationTopics() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ResourceOperation[] getOperations() throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ResourceOperation findOperation(String operationName) throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Added: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/model_classdiagram.cdf
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/model_classdiagram.cdf?rev=240293&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/model_classdiagram.cdf
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/swing/WsdmTreeModel.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/swing/WsdmTreeModel.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/swing/WsdmTreeModel.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/model/swing/WsdmTreeModel.java Fri Aug 26 10:30:00 2005
@@ -18,8 +18,8 @@
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
-import org.apache.ws.client.model.WsdmInstance;
-import org.apache.ws.client.model.WsdmResource;
+import org.apache.ws.client.model.ManagableResourceInstance;
+import org.apache.ws.client.model.ManageableResource;
import org.apache.ws.client.model.impl.WsdmInstanceImpl;
import org.apache.ws.client.model.impl.WsdmResourceImpl;
import org.apache.ws.client.model.impl.WsdmClientImpl;
@@ -147,9 +147,9 @@
} else if (parent instanceof WsdmClientImpl){
WsdmClientImpl node = (WsdmClientImpl)parent;
try {
- WsdmResource[] resources = node.getResources();
+ ManageableResource[] resources = node.getResources();
for (int index = 0; index < resources.length; index++) {
- WsdmResource resource = resources[index];
+ ManageableResource resource = resources[index];
if(resource==child){
return index;
}
@@ -160,9 +160,9 @@
} else if (parent instanceof WsdmResourceImpl){
WsdmResourceImpl node = (WsdmResourceImpl)parent;
try {
- WsdmInstance[] resources = node.getInstances();
+ ManagableResourceInstance[] resources = node.getInstances();
for (int index = 0; index < resources.length; index++) {
- WsdmInstance resource = resources[index];
+ ManagableResourceInstance resource = resources[index];
if(resource==child){
return index;
}
Modified: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Consumer.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Consumer.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Consumer.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Consumer.java Fri Aug 26 10:30:00 2005
@@ -3,10 +3,10 @@
*=============================================================================*/
package org.apache.ws.client.util;
-import org.apache.ws.client.model.WsdmClient;
-import org.apache.ws.client.model.WsdmClientFactory;
-import org.apache.ws.client.model.WsdmInstance;
-import org.apache.ws.client.model.WsdmResource;
+import org.apache.ws.client.model.ManagabilityConsumer;
+import org.apache.ws.client.model.ManagabilityConsumerFactory;
+import org.apache.ws.client.model.ManagableResourceInstance;
+import org.apache.ws.client.model.ManageableResource;
import com.ibm.xmlns.stdwip.webServices.wsBaseNotification.NotifyDocument;
import com.ibm.xmlns.stdwip.webServices.wsBaseNotification.TopicExpressionType;
import org.apache.xmlbeans.XmlException;
@@ -65,19 +65,19 @@
final class Util
{
/** */
- public WsdmInstance getMyInstance( )
+ public ManagableResourceInstance getMyInstance( )
throws Exception
{
- WsdmClient wc =
- WsdmClientFactory.create( WsdmClientFactory.AXIS_CLIENT_TYPE, "localhost:8080", "wsdm" );
- WsdmResource wr = wc.getResource( "sensor" );
- WsdmInstance[] wi = wr.getInstances( );
+ ManagabilityConsumer wc =
+ ManagabilityConsumerFactory.create( ManagabilityConsumerFactory.AXIS_CLIENT_TYPE, "localhost:8080", "wsdm" );
+ ManageableResource wr = wc.getResource( "sensor" );
+ ManagableResourceInstance[] wi = wr.getInstances( );
return wi[0];
}
/** */
- public TopicExpressionType getMyTopicExpressionType( WsdmInstance wi )
+ public TopicExpressionType getMyTopicExpressionType( ManagableResourceInstance wi )
throws Exception
{
QName tq =
@@ -112,7 +112,7 @@
try
{
// now we can subscribe to the notification producers
- WsdmInstance notifProducer = new Util( ).getMyInstance( );
+ ManagableResourceInstance notifProducer = new Util( ).getMyInstance( );
TopicExpressionType tet = new Util( ).getMyTopicExpressionType( notifProducer );
getSubscriber( ).subscribe( notifProducer, tet );
@@ -131,7 +131,7 @@
Consumer c = new MyConsumer( );
c.start( );
- WsdmInstance notifProducer = new Util( ).getMyInstance( );
+ ManagableResourceInstance notifProducer = new Util( ).getMyInstance( );
TopicExpressionType tet = new Util( ).getMyTopicExpressionType( notifProducer );
c.getSubscriber( ).subscribe( notifProducer, tet );
Modified: webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Subscriber.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Subscriber.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Subscriber.java (original)
+++ webservices/muse/trunk/src/examples/client/src/java/org/apache/ws/client/util/Subscriber.java Fri Aug 26 10:30:00 2005
@@ -3,9 +3,9 @@
*=============================================================================*/
package org.apache.ws.client.util;
-import org.apache.ws.client.model.WsdmClient;
-import org.apache.ws.client.model.WsdmInstance;
-import org.apache.ws.client.model.WsdmOperation;
+import org.apache.ws.client.model.ManagabilityConsumer;
+import org.apache.ws.client.model.ManagableResourceInstance;
+import org.apache.ws.client.model.ResourceOperation;
import com.ibm.xmlns.stdwip.webServices.wsBaseNotification.TopicExpressionType;
import org.apache.xmlbeans.XmlObject;
import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceDocument;
@@ -26,8 +26,8 @@
* This object groups subscriptions based on which notification producers are subscribed to with each
* group holding subscriptions to individual topics.
* <p>
- * Subscriptions may be canceled individually (see {@link #unsubscribe(WsdmInstance, TopicExpressionType)})
- * or en masse (see {@link #unsubscribe()} and {@link #unsubscribe(WsdmInstance)}).
+ * Subscriptions may be canceled individually (see {@link #unsubscribe(ManagableResourceInstance, TopicExpressionType)})
+ * or en masse (see {@link #unsubscribe()} and {@link #unsubscribe(ManagableResourceInstance)}).
*/
public class Subscriber
{
@@ -52,7 +52,7 @@
*
* @param consumer the EPR of the consumer who will be subscribed
*/
- public Subscriber( WsdmInstance consumer )
+ public Subscriber( ManagableResourceInstance consumer )
{
try
{
@@ -86,7 +86,7 @@
*
* @return the subscription resource EPR, or <code>null</code> if there is no such subscription
*/
- public synchronized Subscription getSubscription( WsdmInstance notificationProducer,
+ public synchronized Subscription getSubscription( ManagableResourceInstance notificationProducer,
TopicExpressionType topic )
{
Subscription retSubscription = null;
@@ -108,7 +108,7 @@
*
* @return array of subscription resource EPRs
*/
- public synchronized Subscription[] getSubscriptions( WsdmInstance notificationProducer )
+ public synchronized Subscription[] getSubscriptions( ManagableResourceInstance notificationProducer )
{
Subscription[] retSubscriptions;
Map producerSubscriptions = (Map) m_subscriptions.get( notificationProducer );
@@ -155,12 +155,12 @@
*
* @throws Exception on any error that caused the request to fail
*/
- public synchronized void subscribe( WsdmInstance notificationProducer,
+ public synchronized void subscribe( ManagableResourceInstance notificationProducer,
TopicExpressionType topicExpression )
throws Exception
{
EndpointReferenceType subscriptionEpr;
- WsdmOperation subscribeOp = notificationProducer.findOperation( "Subscribe" );
+ ResourceOperation subscribeOp = notificationProducer.getParent().findOperation( "Subscribe" );
if ( subscribeOp == null )
{
@@ -194,7 +194,7 @@
*
* @throws Exception on any error that caused the request to fail
*/
- public synchronized void unsubscribe( WsdmInstance notificationProducer,
+ public synchronized void unsubscribe( ManagableResourceInstance notificationProducer,
TopicExpressionType topicExpression )
throws Exception
{
@@ -212,7 +212,7 @@
*
* @throws Exception on any error that caused the request to fail
*/
- public synchronized void unsubscribe( WsdmInstance notificationProducer )
+ public synchronized void unsubscribe( ManagableResourceInstance notificationProducer )
throws Exception
{
Subscription[] doomedSubscriptions = getSubscriptions( notificationProducer );
@@ -305,11 +305,11 @@
protected void unsubscribe( Subscription doomedSubscription )
{
// perform the actual WSDM unsubscribe here by destroying the subscription resource
- WsdmInstance subscriptionWsdmInstance = doomedSubscription.getSubscriptionWsdmInstance( );
+ ManagableResourceInstance subscriptionWsdmInstance = doomedSubscription.getSubscriptionWsdmInstance( );
try
{
- WsdmOperation destroyOp = subscriptionWsdmInstance.findOperation( "Destroy" );
+ ResourceOperation destroyOp = subscriptionWsdmInstance.getParent().findOperation( "Destroy" );
subscriptionWsdmInstance.invoke( destroyOp, null );
}
catch ( Exception e )
@@ -330,7 +330,7 @@
*/
public class Subscription
{
- private final WsdmInstance m_notificationProducer;
+ private final ManagableResourceInstance m_notificationProducer;
private final TopicExpressionType m_topic;
private final EndpointReferenceType m_subscriptionEpr;
@@ -341,7 +341,7 @@
* @param topic the topic that is subscribed to
* @param subscriptionEpr the EPR of the subscription resource
*/
- public Subscription( final WsdmInstance notificationProducer,
+ public Subscription( final ManagableResourceInstance notificationProducer,
final TopicExpressionType topic,
final EndpointReferenceType subscriptionEpr )
{
@@ -355,7 +355,7 @@
*
* @return the notification producer
*/
- public WsdmInstance getNotificationProducer( )
+ public ManagableResourceInstance getNotificationProducer( )
{
return m_notificationProducer;
}
@@ -377,10 +377,10 @@
*
* @return subscription resource instance
*/
- public WsdmInstance getSubscriptionWsdmInstance( )
+ public ManagableResourceInstance getSubscriptionWsdmInstance( )
{
- WsdmInstance retSubcriptionInstance = null;
- WsdmClient producerClient = m_notificationProducer.getParent( ).getParent( );
+ ManagableResourceInstance retSubcriptionInstance = null;
+ ManagabilityConsumer producerClient = m_notificationProducer.getParent( ).getParent( );
// note that we assume the subscription resource is located in the same SOAP engine
// (host/port/servlet context) as the notification producer
Modified: webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmClientTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmClientTestCase.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmClientTestCase.java (original)
+++ webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmClientTestCase.java Fri Aug 26 10:30:00 2005
@@ -20,7 +20,7 @@
public class WsdmClientTestCase extends AbstractOneAxisTestCase {
private static final int CALL_TIMEOUT = 300000;
private URL m_testEndpoint;
- private WsdmClient m_wsdmClient;
+ private ManagabilityConsumer m_wsdmClient;
/*
* @see TestCase#setUp()
@@ -28,8 +28,8 @@
protected void setUp() throws Exception {
super.setUp();
m_testEndpoint=new URL(getAxisBaseUrl().toExternalForm());
- WsdmClientFactory.clearGeneratedClassCache();
- m_wsdmClient=WsdmClientFactory.create(WsdmClientFactory.AXIS_CLIENT_TYPE,m_testEndpoint.getHost()+":"+m_testEndpoint.getPort(),"axis");
+ ManagabilityConsumerFactory.clearGeneratedClassCache();
+ m_wsdmClient=ManagabilityConsumerFactory.create(ManagabilityConsumerFactory.AXIS_CLIENT_TYPE,m_testEndpoint.getHost()+":"+m_testEndpoint.getPort(),"axis");
RegistrationManagerFactory.discoverResources( );
}
@@ -47,10 +47,11 @@
* how long it takes for a simple call to be made to a server. Can be used
* to display status or judge health of the system remotly.
* @throws Exception
- */public void testPing() throws Exception{
- long time=m_wsdmClient.ping();
- Assert.assertTrue(time>0);
- }
+ */
+// public void testPing() throws Exception{
+// long time=m_wsdmClient.isResourceAvailable();
+// Assert.assertTrue(time>0);
+// }
/**
* Objective: Use this client to get a set of Wsdm Resources. Verify
@@ -62,12 +63,12 @@
* @throws InvocationTargetException
* @throws Exception
*/
- public void testGetResources() throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, Exception{
- WsdmResource[] resources=m_wsdmClient.getResources();
- Assert.assertEquals(2,resources.length);
- Assert.assertEquals("registry",resources[1].getName());
- Assert.assertEquals("disk",resources[0].getName());
- }
+// public void testGetResources() throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, Exception{
+// ManageableResource[] resources=m_wsdmClient.getResources();
+// Assert.assertEquals(2,resources.length);
+// Assert.assertEquals("registry",resources[1].getName());
+// Assert.assertEquals("disk",resources[0].getName());
+// }
/**
* Objective: Test the format of a returned Client Name.
@@ -81,7 +82,7 @@
public void testFindInstance() throws Exception{
WsdmClientImpl impl = (WsdmClientImpl)m_wsdmClient;
EndpointReferenceType erp = impl.getErpFor("disk","1234");
- WsdmInstance instance=impl.findInstance(erp);
+ ManagableResourceInstance instance=impl.findInstance(erp);
Assert.assertNotNull(instance);
}
Modified: webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmInstanceTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmInstanceTestCase.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmInstanceTestCase.java (original)
+++ webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmInstanceTestCase.java Fri Aug 26 10:30:00 2005
@@ -34,10 +34,10 @@
private static final int CALL_TIMEOUT = 300000;
private URL m_testEndpoint;
- private WsdmClient m_wsdmServer;
- private WsdmResource m_resourceDisk;
- private WsdmInstance m_instanceDisk1234;
- private WsdmInstance m_resourceRegistrySingleton;
+ private ManagabilityConsumer m_wsdmServer;
+ private ManageableResource m_resourceDisk;
+ private ManagableResourceInstance m_instanceDisk1234;
+ private ManagableResourceInstance m_resourceRegistrySingleton;
/*
* @see TestCase#setUp()
@@ -45,12 +45,12 @@
protected void setUp() throws Exception {
super.setUp();
m_testEndpoint=new URL(getAxisBaseUrl().toExternalForm());
- WsdmClientFactory.clearGeneratedClassCache();
- m_wsdmServer=WsdmClientFactory.create(WsdmClientFactory.AXIS_CLIENT_TYPE,m_testEndpoint.getHost()+":"+m_testEndpoint.getPort(),"axis");
+ ManagabilityConsumerFactory.clearGeneratedClassCache();
+ m_wsdmServer=ManagabilityConsumerFactory.create(ManagabilityConsumerFactory.AXIS_CLIENT_TYPE,m_testEndpoint.getHost()+":"+m_testEndpoint.getPort(),"axis");
RegistrationManagerFactory.discoverResources( );
- m_resourceDisk=m_wsdmServer.getResources()[0];
+// m_resourceDisk=m_wsdmServer.getResources()[0];
m_instanceDisk1234=m_resourceDisk.getInstances()[0];
- m_resourceRegistrySingleton=m_wsdmServer.getResources()[1].getInstances()[0];
+// m_resourceRegistrySingleton=m_wsdmServer.getResources()[1].getInstances()[0];
}
@@ -78,19 +78,19 @@
Assert.assertEquals("{http://docs.oasis-open.org/wsdm/2004/04/muws-0.5/schema}Name[0]",propnames[0]);
}
- public void testGetOperations() throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException{
- WsdmOperation[] ops = m_instanceDisk1234.getOperations();
- Assert.assertNotNull(ops);
- Assert.assertTrue(ops.length>0);
- }
+// public void testGetOperations() throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException{
+//// ResourceOperation[] ops = m_instanceDisk1234.getOperations();
+// Assert.assertNotNull(ops);
+// Assert.assertTrue(ops.length>0);
+// }
- public void testInvoke() throws Exception{
- WsdmOperation[] ops = m_instanceDisk1234.getOperations();
- WsdmOperation destroyOperation = ops[ops.length-1];
- Assert.assertNotNull(destroyOperation);
- Assert.assertEquals("Destroy",destroyOperation.getName());
- XmlObject[] responses = m_instanceDisk1234.invoke(destroyOperation,new Hashtable());
- }
+// public void testInvoke() throws Exception{
+//// ResourceOperation[] ops = m_instanceDisk1234.getOperations();
+// ResourceOperation destroyOperation = ops[ops.length-1];
+// Assert.assertNotNull(destroyOperation);
+// Assert.assertEquals("Destroy",destroyOperation.getName());
+// XmlObject[] responses = m_instanceDisk1234.invoke(destroyOperation,new Hashtable());
+// }
public void testGetPropertyValueFromQName() throws Exception{
QName propName=new QName("http://xyz.com/","Manufacturer");
Modified: webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmOperationTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmOperationTestCase.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmOperationTestCase.java (original)
+++ webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmOperationTestCase.java Fri Aug 26 10:30:00 2005
@@ -25,7 +25,7 @@
*/
public class WsdmOperationTestCase extends TestCase {
- private WsdmOperation m_operation;
+ private ResourceOperation m_operation;
/*
* @see TestCase#setUp()
Modified: webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmResourceTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmResourceTestCase.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmResourceTestCase.java (original)
+++ webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/model/WsdmResourceTestCase.java Fri Aug 26 10:30:00 2005
@@ -26,9 +26,9 @@
public class WsdmResourceTestCase extends AbstractOneAxisTestCase {
private static final int CALL_TIMEOUT = 300000;
private URL m_testEndpoint;
- private WsdmClient m_wsdmServer;
- private WsdmResource m_resourceDisk;
- private WsdmResource m_resourceRegistry;
+ private ManagabilityConsumer m_wsdmServer;
+ private ManageableResource m_resourceDisk;
+ private ManageableResource m_resourceRegistry;
/*
* @see TestCase#setUp()
@@ -36,11 +36,11 @@
protected void setUp() throws Exception {
super.setUp();
m_testEndpoint=new URL(getAxisBaseUrl().toExternalForm());
- WsdmClientFactory.clearGeneratedClassCache();
- m_wsdmServer=WsdmClientFactory.create(WsdmClientFactory.AXIS_CLIENT_TYPE,m_testEndpoint.getHost()+":"+m_testEndpoint.getPort(),"axis");
+ ManagabilityConsumerFactory.clearGeneratedClassCache();
+ m_wsdmServer=ManagabilityConsumerFactory.create(ManagabilityConsumerFactory.AXIS_CLIENT_TYPE,m_testEndpoint.getHost()+":"+m_testEndpoint.getPort(),"axis");
RegistrationManagerFactory.discoverResources( );
- m_resourceDisk=m_wsdmServer.getResources()[0];
- m_resourceRegistry=m_wsdmServer.getResources()[1];
+// m_resourceDisk=m_wsdmServer.getResources()[0];
+// m_resourceRegistry=m_wsdmServer.getResources()[1];
}
/*
@@ -60,7 +60,7 @@
}
public void testGetInstances() throws Exception{
- WsdmInstance[] instancesDisk = m_resourceDisk.getInstances();
+ ManagableResourceInstance[] instancesDisk = m_resourceDisk.getInstances();
Assert.assertNotNull(instancesDisk);
Assert.assertEquals(4,instancesDisk.length);
Assert.assertEquals("1234",instancesDisk[0].getName());
@@ -68,7 +68,7 @@
Assert.assertEquals("4321",instancesDisk[2].getName());
Assert.assertEquals("5678",instancesDisk[3].getName());
- WsdmInstance[] instancesRegistrySingleton = m_resourceRegistry.getInstances();
+ ManagableResourceInstance[] instancesRegistrySingleton = m_resourceRegistry.getInstances();
Assert.assertNotNull(instancesRegistrySingleton);
Assert.assertEquals(1,instancesRegistrySingleton.length);
Assert.assertEquals("Singleton",instancesRegistrySingleton[0].getName());
Modified: webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/util/SubscriberTest.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/util/SubscriberTest.java?rev=240293&r1=240292&r2=240293&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/util/SubscriberTest.java (original)
+++ webservices/muse/trunk/src/examples/client/src/test/org/apache/ws/client/util/SubscriberTest.java Fri Aug 26 10:30:00 2005
@@ -4,7 +4,7 @@
package org.apache.ws.client.util;
import junit.framework.TestCase;
-import org.apache.ws.client.model.WsdmInstance;
+import org.apache.ws.client.model.ManagableResourceInstance;
import org.apache.ws.client.model.impl.WsdmInstanceImpl;
import com.ibm.xmlns.stdwip.webServices.wsBaseNotification.TopicExpressionType;
@@ -20,8 +20,8 @@
private Subscriber m_subscriber;
/** some dummy WSDM instances */
- private WsdmInstance m_wsdm1 = new WsdmInstanceImpl( "one", null );
- private WsdmInstance m_wsdm2 = new WsdmInstanceImpl( "two", null );
+ private ManagableResourceInstance m_wsdm1 = new WsdmInstanceImpl( "one", null );
+ private ManagableResourceInstance m_wsdm2 = new WsdmInstanceImpl( "two", null );
/** some dummy topic expressions */
private TopicExpressionType m_topic1;
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org