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/06/09 17:03:21 UTC

svn commit: r189764 [2/3] - in /incubator/muse/trunk/src/ieeedemo/client: ./ lib/ lib/src/ src/ src/org/ src/org/apache/ src/org/apache/interop/ src/org/apache/interop/smgr/ src/org/apache/interop/wcdisplay/ src/org/apache/interop/wcmgr/ src/org/apache/ws/ src/org/apache/ws/muws/ src/org/apache/ws/muws/interop/ src/org/apache/ws/muws/interop/client/ src/org/apache/wsdm/ src/org/apache/wsdm/interop/ src/org/apache/wsdm/interop/wcm/ src/org/apache/wsdm/interop/wcm/impl/ src/org/apache/wsdm/interop/wcm/impl/ui/ src/org/apache/wsdm/interop/wcm/impl/ui/jgraph/ src/org/apache/wsdm/interop/wcm/model/ src/org/apache/wsdm/interop/wcm/simulator/

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/AbstractWsdmInteropTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/AbstractWsdmInteropTestCase.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/AbstractWsdmInteropTestCase.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/AbstractWsdmInteropTestCase.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,218 @@
+/*=============================================================================*
+ *  Copyright 2005 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.ws.muws.interop.client;
+
+import org.apache.ws.muws.v1_0.MuwsConstants;
+import org.apache.ws.muws.v1_0.capability.IdentityCapability;
+import org.apache.ws.muws.v1_0.capability.ManageabilityCharacteristicsCapability;
+import org.apache.ws.muws.v1_0.capability.OperationalStatusCapability;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.ws.util.jndi.XmlBeanJndiUtils;
+import org.apache.ws.util.test.PortListen;
+import org.apache.ws.util.test.axis.AbstractOneAxisTestCase;
+import org.apache.xmlbeans.XmlAnyURI;
+import org.apache.xmlbeans.XmlError;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlOptions;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManagementEventType;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.NotificationMessageHolderType;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.NotifyDocument;
+import org.xmlsoap.schemas.soap.envelope.Body;
+import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceDocument;
+
+import javax.xml.namespace.QName;
+import java.net.InetAddress;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * TODO
+ */
+public abstract class AbstractWsdmInteropTestCase extends AbstractOneAxisTestCase
+{
+
+    protected static final int NOTIF_LISTENER_TIMEOUT = 20000;
+    protected static final int NOTIF_LISTENER_PORT = 9101;
+    protected static String s_consumerURL;
+
+    private static final boolean RUN_AXIS_SERVER = Boolean.getBoolean( "runAxis" );
+    static final boolean DEBUG = true;//Boolean.getBoolean( "debug" );
+
+    public AbstractWsdmInteropTestCase()
+    {
+        super( RUN_AXIS_SERVER );
+    }
+
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        s_consumerURL = "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + NOTIF_LISTENER_PORT + "/";
+        if ( RUN_AXIS_SERVER )
+        {
+            //init jndi from config
+            XmlBeanJndiUtils.initializeFromInputStream( Thread.currentThread().getContextClassLoader()
+                    .getResourceAsStream( XmlBeanJndiUtils.JNDI_CONFIG_FILENAME ) );
+        }
+    }
+
+    protected void performMuwsIdentityCharacteristicsAct( ResourceStub resource ) throws FaultException
+    {
+        XmlObject idPropElem = getSingleProperty( resource, IdentityCapability.PROP_NAME_RESOURCE_ID );
+        assertTrue( idPropElem instanceof XmlAnyURI );
+        XmlObject[] capabilityElems = resource.getResourceProperty(
+                ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
+        assertContainsURI( capabilityElems, IdentityCapability.URI );
+    }
+
+    protected void performMuwsStatusAct( ResourceStub resource ) throws FaultException
+    {
+        XmlObject[] capabilityPropElems = resource.getResourceProperty(
+                ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
+        assertContainsURI( capabilityPropElems, OperationalStatusCapability.URI );
+        XmlObject[] statusPropElems = resource.getResourceProperty(
+                OperationalStatusCapability.PROP_NAME_OPERATIONAL_STATUS );
+        assertEquals( 1, statusPropElems.length );
+        assertTrue( statusPropElems[0] instanceof OperationalStatusDocument.OperationalStatus );
+    }
+
+    protected XmlObject getSingleProperty( ResourceStub resource, QName propName )
+            throws FaultException
+    {
+        XmlObject[] propElems = resource.getResourceProperty( propName );
+        assertEquals(
+                "Incorrect number of " + propName.getPrefix() + ":" + propName.getLocalPart() + " property elements -",
+                1, propElems.length );
+        return propElems[0];
+    }
+
+    protected void setSingleProperty( ResourceStub resource, XmlObject propElem )
+            throws FaultException
+    {
+        resource.updateResourceProperty( new XmlObject[]{propElem} );
+    }
+
+    protected void assertContainsURI( XmlObject[] capabilityPropElems, String uri )
+    {
+        boolean result = false;
+        for ( int i = 0; i < capabilityPropElems.length; i++ )
+        {
+            XmlAnyURI capabilityElem = (XmlAnyURI) capabilityPropElems[i];
+            if ( capabilityElem.getStringValue().equals( uri ) )
+            {
+                result = true;
+                break;
+            }
+        }
+        assertTrue( "List of manageability capabilities does not include the URI: " + uri, result );
+    }
+
+    /**
+     * Reads a wsa03:EndpointReference XML document from the specified URL.
+     *
+     * @param url
+     *
+     * @return
+     *
+     * @throws Exception
+     */
+    protected EndpointReferenceDocument getEndpointReference( URL url ) throws Exception
+    {
+        XmlObject stuff=XmlObject.Factory.parse( url );
+    	return (EndpointReferenceDocument)stuff; 
+    }
+
+    protected ManagementEventType waitForManagementEvent( PortListen notifListener ) throws XmlException
+    {
+        String incomingMsg = notifListener.waitForIncomingMessage();
+        assertTrue( incomingMsg, incomingMsg.indexOf( "ERROR" ) == -1 );
+
+        //get envelope
+        XmlObject xmlObject = XmlObject.Factory.parse( incomingMsg );
+        assertTrue( "The returned message was not a SOAP Envelope.", xmlObject instanceof EnvelopeDocument );
+        EnvelopeDocument envelope = (EnvelopeDocument) xmlObject;
+        Body body = envelope.getEnvelope().getBody();
+
+        XmlObject mgmtEventElem = null;
+        if ( ResourceStub.USE_WRAPPED_NOTIFICATIONS ) //wrapped
+        {
+            //get notify
+            XmlObject bodyElems[] = XmlBeanUtils.getChildElements( body,
+                    new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "Notify" ) );
+            assertEquals( "The SOAP Body does not contain exactly one wsnt:Notify element.", 1, bodyElems.length );
+            XmlObject notifyDoc = bodyElems[0];
+            assertTrue( "The SOAP Body does not contain a wrapped notification with a Notify element.",
+                    notifyDoc instanceof NotifyDocument.Notify );
+            NotifyDocument.Notify notify = (NotifyDocument.Notify) notifyDoc;
+
+            //get contained management event
+            NotificationMessageHolderType notificationMessageType = notify.getNotificationMessageArray( 0 );
+            XmlObject message = notificationMessageType.getMessage();
+
+            XmlObject mgmtEventElems[] = XmlBeanUtils.getChildElements( message,
+                    new QName( MuwsConstants.NSURI_MUWS_PART1_SCHEMA, "ManagementEvent" ) );
+            assertEquals( "The Notify element does not contain exactly one muws-p1-xs:ManagementEvent element.", 1,
+                    mgmtEventElems.length );
+            mgmtEventElem = mgmtEventElems[0];
+            assertTrue( "The Notify element does not contain a ManagementEvent.",
+                    mgmtEventElem instanceof ManagementEventType );
+        }
+        else //unwrapped
+        {
+            XmlObject mgmtEventElems[] = XmlBeanUtils.getChildElements( body,
+                    new QName( MuwsConstants.NSURI_MUWS_PART1_SCHEMA, "ManagementEvent" ) );
+            assertEquals( "The SOAP Body does not contain exactly one muws-p1-xs:ManagementEvent element.", 1,
+                    mgmtEventElems.length );
+            mgmtEventElem = mgmtEventElems[0];
+            assertTrue( "The SOAP Body did not contain an unwrapped ManagementEvent.",
+                    mgmtEventElem instanceof ManagementEventType );
+        }
+        ManagementEventType mgmtEvent = (ManagementEventType) mgmtEventElem;
+        return mgmtEvent;
+    }
+
+    protected static boolean validate( XmlObject xBean )
+    {
+        // Create an XmlOptions instance and set the error listener.
+        XmlOptions validateOptions = new XmlOptions();
+        List errorList = new ArrayList();
+        validateOptions.setErrorListener( errorList );
+
+        // Validate the XML.
+        boolean isValid = xBean.validate( validateOptions );
+
+        // If the XML isn't valid, loop through the listener's contents,
+        // printing contained messages.
+        if ( !isValid )
+        {
+            for ( int i = 0; i < errorList.size(); i++ )
+            {
+                XmlError error = (XmlError) errorList.get( i );
+
+                System.out.println( "\n" );
+                System.out.println( "Message: " + error.getMessage() + "\n" );
+                System.out.println( "Location of invalid XML: " +
+                        error.getCursorLocation().xmlText() + "\n" );
+            }
+        }
+        return isValid;
+    }
+
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/FaultException.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/FaultException.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/FaultException.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/FaultException.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,30 @@
+/*=============================================================================*
+ *  Copyright 2005 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.ws.muws.interop.client;
+
+/**
+ * TODO
+ */
+public class FaultException extends Exception
+{
+
+    public FaultException( String message )
+    {
+        super( message );
+    }
+
+}
+

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/ResourceStub.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/ResourceStub.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/ResourceStub.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/ResourceStub.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,196 @@
+/*=============================================================================*
+ *  Copyright 2005 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.ws.muws.interop.client;
+
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.addressing.XmlBeansEndpointReference;
+import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.ws.util.soap.SoapClient;
+import org.apache.ws.XmlObjectWrapper;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlOptions;
+import org.apache.axis.message.addressing.Constants;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeResponseDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionType;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyResponseDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesResponseDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.UpdateType;
+import org.xmlsoap.schemas.soap.envelope.Envelope;
+import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument;
+import org.xmlsoap.schemas.soap.envelope.Header;
+
+import javax.xml.namespace.QName;
+import java.net.URI;
+import java.net.URL;
+import java.util.Calendar;
+import java.util.Observable;
+
+/**
+ * TODO
+ */
+public class ResourceStub extends Observable
+{
+    static final boolean DEBUG = true;//Boolean.getBoolean( "debug" );
+
+    private EndpointReference m_epr;
+
+    public static boolean USE_WRAPPED_NOTIFICATIONS = Boolean.valueOf(System.getProperty("wrapped_notifications", "true")).booleanValue();
+
+    public ResourceStub( EndpointReference epr )
+    {
+       m_epr = epr;
+    }
+
+    public XmlObject[] getResourceProperty( QName propName ) throws FaultException
+    {
+        GetResourcePropertyDocument requestDoc = GetResourcePropertyDocument.Factory.newInstance();
+       
+        requestDoc.setGetResourceProperty( propName );
+        setChanged();
+        XmlObject response = sendRequest( requestDoc, "http://xyz.com/action/GetResourceProperty" );
+        XmlOptions xmlOpts = new XmlOptions().setSaveOuter();
+        xmlOpts.setSavePrettyPrint();
+		notifyObservers(new WcmMessage(requestDoc.xmlText(xmlOpts), response.xmlText(xmlOpts)));
+        if ( ! ( response instanceof GetResourcePropertyResponseDocument.GetResourcePropertyResponse ) )
+        {
+            throw new FaultException( response.toString() );
+        }
+        return XmlBeanUtils.getChildElements( response );
+    }
+
+    public void updateResourceProperty( XmlObject[] propElems ) throws FaultException
+    {
+        SetResourcePropertiesDocument requestDoc = SetResourcePropertiesDocument.Factory.newInstance();
+        SetResourcePropertiesDocument.SetResourceProperties setResourceProperties = requestDoc.addNewSetResourceProperties();
+        UpdateType updateType = setResourceProperties.addNewUpdate();
+        for ( int i = 0; i < propElems.length; i++ )
+        {
+            XmlBeanUtils.addChildElement( updateType, propElems[i] );
+        }
+        XmlObject response = sendRequest( requestDoc, "http://xyz.com/action/SetResourceProperties" );
+        if ( ! ( response instanceof SetResourcePropertiesResponseDocument.SetResourcePropertiesResponse ) )
+        {
+            throw new FaultException( response.toString() );
+        }
+    }
+
+    public EndpointReference subscribe( String consumerURL, QName topic ) throws FaultException
+    {
+        SubscribeDocument requestDoc = SubscribeDocument.Factory.newInstance();
+        SubscribeDocument.Subscribe subscribe = requestDoc.addNewSubscribe();
+        subscribe.setUseNotify(USE_WRAPPED_NOTIFICATIONS);
+        Calendar instance = Calendar.getInstance();
+        instance.setTimeInMillis(instance.getTimeInMillis() + 20000);
+        subscribe.setInitialTerminationTime( instance );
+        org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType consumerRef = subscribe.addNewConsumerReference();
+        org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI address = consumerRef.addNewAddress();
+        address.setStringValue( consumerURL );
+        TopicExpressionType topicExpr = subscribe.addNewTopicExpression();
+        topicExpr.setDialect( TopicsConstants.TOPIC_EXPR_DIALECT_SIMPLE );
+        XmlBeanUtils.setValueAsQName( topicExpr, topic );
+        XmlObject response = sendRequest( requestDoc, "http://xyz.com/action/Subscribe" );
+        if ( ! ( response instanceof SubscribeResponseDocument.SubscribeResponse ) )
+        {
+            throw new FaultException( response.toString() );
+        }
+        SubscribeResponseDocument.SubscribeResponse subscribeResponse = (SubscribeResponseDocument.SubscribeResponse) response;
+        return new XmlBeansEndpointReference( subscribeResponse.getSubscriptionReference() );
+    }
+
+    private EnvelopeDocument createEnvelope()
+    {
+        EnvelopeDocument envelopeDoc = EnvelopeDocument.Factory.newInstance();
+        Envelope envelope = envelopeDoc.addNewEnvelope();
+        envelope.addNewHeader();
+        envelope.addNewBody();
+        return envelopeDoc;
+    }
+
+    private XmlObject sendRequest( XmlObject requestDoc, String action )
+    {
+        EnvelopeDocument requestEnvelopeDoc = createEnvelope();
+        Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
+        addAddressingHeaders( requestEnvelope.getHeader(), action );
+        XmlBeanUtils.addChildElement( requestEnvelope.getBody(), requestDoc );
+        try
+        {
+            URL endpointURL = new URL( m_epr.getAddress() );
+            URI actionURI = new URI( action );
+            if ( DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelopeDoc ); }
+            String response = SoapClient.sendRequest( endpointURL, requestEnvelopeDoc.newInputStream(), actionURI );
+            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
+            if (DEBUG ) { System.out.println( "Received response: \n" + responseEnvelopeDoc ); }
+            Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
+            XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements( responseEnvelope.getBody() );
+            if ( responseBodyElems.length == 0 )
+            {
+                return null;
+            }
+            else
+            {
+                return responseBodyElems[0];
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+    }
+
+    private void addAddressingHeaders( Header header, String action )
+    {
+        XmlObject eprXBean = ((XmlObjectWrapper)m_epr).getXmlObject();
+        XmlObject toElem;
+        XmlObject actionElem;
+        if ( eprXBean.schemaType().getName().getNamespaceURI().equals( Constants.NS_URI_ADDRESSING_2003_03 ) )
+        {
+            org.xmlsoap.schemas.ws.x2003.x03.addressing.ToDocument toDoc = org.xmlsoap.schemas.ws.x2003.x03.addressing.ToDocument.Factory.newInstance();
+            org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI attributedURI = toDoc.addNewTo();
+            attributedURI.setStringValue(m_epr.getAddress());
+            toElem = toDoc;
+            org.xmlsoap.schemas.ws.x2003.x03.addressing.ActionDocument actionDoc = org.xmlsoap.schemas.ws.x2003.x03.addressing.ActionDocument.Factory.newInstance();
+            org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI actionType = actionDoc.addNewAction();
+            actionType.setStringValue( action );
+            actionElem = actionDoc;
+        }
+        else
+        {
+            org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument toDoc = org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument.Factory.newInstance();
+            org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI attributedURI = toDoc.addNewTo();
+            attributedURI.setStringValue(m_epr.getAddress());
+            toElem = toDoc;
+            org.xmlsoap.schemas.ws.x2004.x08.addressing.ActionDocument actionDoc = org.xmlsoap.schemas.ws.x2004.x08.addressing.ActionDocument.Factory.newInstance();
+            org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI actionType = actionDoc.addNewAction();
+            actionType.setStringValue( action );
+            actionElem = actionDoc;
+        }
+        XmlBeanUtils.addChildElement( header, toElem );
+        XmlBeanUtils.addChildElement( header, actionElem );
+        if (m_epr.getReferenceProperties() != null)
+        {
+            XmlObject[] refPropElems = (XmlObject[]) m_epr.getReferenceProperties();
+            for (int i = 0; i < refPropElems.length; i++)
+            {
+                XmlBeanUtils.addChildElement(header, refPropElems[i]);
+            }
+        }
+    }
+
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/ServiceStub.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/ServiceStub.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/ServiceStub.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/ServiceStub.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,149 @@
+/*=============================================================================*
+ *  Copyright 2005 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.ws.muws.interop.client;
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.ws.util.soap.SoapClient;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.oasisOpen.docs.wsdm.x2004.x12.mows.wsdmMows.GetManageabilityReferencesDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.mows.wsdmMows.GetManageabilityReferencesResponseDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.QueryRelationshipsByTypeDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.QueryRelationshipsByTypeResponseDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipType;
+import org.xmlsoap.schemas.soap.envelope.Envelope;
+import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument;
+import org.xmlsoap.schemas.soap.envelope.Header;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType;
+
+/**
+ * TODO
+ */
+public class ServiceStub
+{
+
+    protected URL m_url;
+
+    public ServiceStub( URL url )
+    {
+        m_url = url;
+    }
+
+    protected EndpointReferenceType[] getManageabilityReferences() throws FaultException
+    {
+        GetManageabilityReferencesDocument requestDoc = GetManageabilityReferencesDocument.Factory.newInstance();
+        requestDoc.addNewGetManageabilityReferences();
+        XmlObject response = sendRequest( requestDoc, "http://xyz.com/action/GetManageabilityReferences", m_url);
+        if ( ! ( response instanceof GetManageabilityReferencesResponseDocument.GetManageabilityReferencesResponse ) )
+        {
+            throw new FaultException( response.toString() );
+        }
+        return ((GetManageabilityReferencesResponseDocument.GetManageabilityReferencesResponse)response).getManageabilityEndpointReferenceArray();
+    }
+
+
+
+    protected EnvelopeDocument createEnvelope()
+    {
+        EnvelopeDocument envelopeDoc = EnvelopeDocument.Factory.newInstance();
+        Envelope envelope = envelopeDoc.addNewEnvelope();
+        envelope.addNewHeader();
+        envelope.addNewBody();
+        return envelopeDoc;
+    }
+
+    protected XmlObject sendRequest(XmlObject requestDoc, String action, URL url)
+    {
+        EnvelopeDocument requestEnvelopeDoc = createEnvelope();
+        Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
+        XmlBeanUtils.addChildElement( requestEnvelope.getBody(), requestDoc );
+        try
+        {
+            URI actionURI = new URI( action );
+            if ( ResourceStub.DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelopeDoc ); }
+            String response = SoapClient.sendRequest( url, requestEnvelopeDoc.newInputStream(), actionURI );
+            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
+            if ( ResourceStub.DEBUG ) { System.out.println( "Received response: \n" + responseEnvelopeDoc ); }
+            Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
+            XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements( responseEnvelope.getBody() );
+            if ( responseBodyElems.length == 0 )
+            {
+                return null;
+            }
+            else
+            {
+                return responseBodyElems[0];
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+    }
+    protected XmlObject sendRequest(EnvelopeDocument requestEnvelope, String action, URL url)
+    {
+
+        try
+        {
+            URI actionURI = new URI( action );
+            if ( ResourceStub.DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelope ); }
+            String response = SoapClient.sendRequest( url, requestEnvelope.newInputStream(), actionURI );
+            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
+            if ( ResourceStub.DEBUG ) { System.out.println( "Received response: \n" + responseEnvelopeDoc ); }
+            Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
+            XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements( responseEnvelope.getBody() );
+            if ( responseBodyElems.length == 0 )
+            {
+                return null;
+            }
+            else
+            {
+                return responseBodyElems[0];
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+    }
+
+    protected void addAddressingHeader(Header header, String action, String address, QName keyHeaderName, String weatherstationKey1)
+    {
+        XmlObject toElem;
+        XmlObject actionElem;
+        org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument toDoc = org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument.Factory.newInstance();
+        org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI attributedURI = toDoc.addNewTo();
+        attributedURI.setStringValue(address);
+        toElem = toDoc;
+        org.xmlsoap.schemas.ws.x2004.x08.addressing.ActionDocument actionDoc = org.xmlsoap.schemas.ws.x2004.x08.addressing.ActionDocument.Factory.newInstance();
+        org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI actionType = actionDoc.addNewAction();
+        actionType.setStringValue(action);
+        actionElem = actionDoc;
+
+        XmlBeanUtils.addChildElement(header, toElem);
+        XmlBeanUtils.addChildElement(header, actionElem);
+
+
+        XmlObject resourceKeyHeader = XmlBeanUtils.addChildElement(header, keyHeaderName);
+        XmlBeanUtils.setValue(resourceKeyHeader, weatherstationKey1);
+    }
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/SpecificServiceStub.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/SpecificServiceStub.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/SpecificServiceStub.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/SpecificServiceStub.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,77 @@
+/*
+ * Created on Jun 3, 2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.apache.ws.muws.interop.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.QueryRelationshipsByTypeDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.QueryRelationshipsByTypeResponseDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipType;
+import org.xmlsoap.schemas.soap.envelope.Envelope;
+import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument;
+
+/**
+ * @author wire
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class SpecificServiceStub extends ServiceStub {
+
+	/**
+	 * @param url
+	 */
+	public SpecificServiceStub(URL url) {
+		super(url);
+		// TODO Auto-generated constructor stub
+	}
+    public double getCurrentTemperature() throws FaultException
+    {
+		return 0;
+//        GetCurrentTemperatureDocument requestDoc = GetCurrentTemperatureDocument.Factory.newInstance();
+//        GetCurrentTemperatureDocument.GetCurrentTemperature getCurrentTemperature = requestDoc.addNewGetCurrentTemperature();
+//        getCurrentTemperature.setAltitude( 643.0 );
+//        XmlObject response = sendRequest( requestDoc, "http://xyz.com/action/GetCurrentTemperature", m_url);
+//        if ( ! ( response instanceof GetCurrentTemperatureResponseDocument.GetCurrentTemperatureResponse ) )
+//        {
+//            throw new FaultException( response.toString() );
+//        }
+//        return ((GetCurrentTemperatureResponseDocument.GetCurrentTemperatureResponse)response).getGetCurrentTemperatureResult();
+    }
+
+    public RelationshipType[] queryRelationshipsByType( QName type )  throws FaultException, MalformedURLException, XmlException
+    {
+		return null;
+//        QueryRelationshipsByTypeDocument requestDoc = QueryRelationshipsByTypeDocument.Factory.newInstance();
+//        QueryRelationshipsByTypeDocument.QueryRelationshipsByType queryRelationshipsByType = requestDoc.addNewQueryRelationshipsByType();
+//        queryRelationshipsByType.setRequestedType(type);
+//        URL url = new URL(m_url,"weatherstation");
+//
+//        EnvelopeDocument requestEnvelopeDoc = createEnvelope();
+//        Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
+//        XmlBeanUtils.addChildElement( requestEnvelope.getBody(), requestDoc );
+//
+//        QName qName = new QName(WeatherstationPropertyQNames.FCCID.getNamespaceURI(),"ResourceID");
+//
+//
+//        addAddressingHeader(requestEnvelope.getHeader(), "http://xyz.com/action/QueryRelationship", url.toString(),qName,InteropConstants.WEATHERSTATION_KEY1);
+//
+//        XmlObject response = sendRequest( requestEnvelopeDoc, "http://xyz.com/action/QueryRelationship", url);
+//        if ( ! ( response instanceof QueryRelationshipsByTypeResponseDocument.QueryRelationshipsByTypeResponse ) )
+//        {
+//            throw new FaultException( response.toString() );
+//        }
+//        return ((QueryRelationshipsByTypeResponseDocument.QueryRelationshipsByTypeResponse)response).getRelationshipArray();
+    }
+
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/TestWcConfigAccess.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/TestWcConfigAccess.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/TestWcConfigAccess.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/TestWcConfigAccess.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,69 @@
+/*
+ * Created on Jun 6, 2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.apache.ws.muws.interop.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ws.addressing.XmlBeansEndpointReference;
+import org.apache.xmlbeans.XmlObject;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceDocument;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType;
+
+import junit.framework.TestCase;
+
+/**
+ * @author wire
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class TestWcConfigAccess extends AbstractWsdmInteropTestCase {
+
+	private static final String WEATHER_STATION_CONF_EPR_URL = "http://12.35.246.160:8080/muse/epr/weather-client-config-epr.xml";
+	private static final String WEATHER_STATION_CONFIG_URL = "http://12.35.246.160:8080/muse/services/WeatherClientConfig";
+	private ServiceStub m_service;
+	private EndpointReferenceDocument weatherStationEprDoc;
+	private ResourceStub m_resource;
+
+	/*
+	 * @see TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+        weatherStationEprDoc = getEndpointReference( new URL( WEATHER_STATION_CONF_EPR_URL ) );
+		//if ( DEBUG ) { System.out.println( "*** Using Weather Station EPR:\n" + weatherStationEprDoc ); }
+        //m_service = new ServiceStub( new URL( WEATHER_STATION_CONFIG_URL ) );
+        m_resource = new ResourceStub( new XmlBeansEndpointReference( weatherStationEprDoc.getEndpointReference() ) );
+	}
+
+	/*
+	 * @see TestCase#tearDown()
+	 */
+	protected void tearDown() throws Exception {
+		super.tearDown();
+	}
+	
+	/**
+	 * Objective: Get the current weather station reference
+	 * @throws MalformedURLException
+	 * @throws Exception
+	 */
+	public void testStuff() throws MalformedURLException, Exception{
+		
+		XmlObject[] Ws=m_resource.getResourceProperty(new QName("http://wsdmdemo.org/service/weather-client-config","WeatherStationReference"));
+		assertEquals(1,Ws.length);
+		XmlObject xWs=Ws[0];
+		assertTrue(xWs instanceof EndpointReferenceType);
+		System.out.println("Holy!");
+	}
+	
+	
+
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/WcmMessage.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/WcmMessage.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/WcmMessage.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/WcmMessage.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,72 @@
+/*
+ * Created on May 23, 2005
+ *
+ */
+package org.apache.ws.muws.interop.client;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+/**
+ * @author wire
+ *
+ */
+public class WcmMessage {
+	DateFormat df =  DateFormat.getTimeInstance(DateFormat.MEDIUM);
+	Date time = new Date();
+	String request;
+	String response;
+	
+	/**
+	 * @return Returns the request.
+	 */
+	public String getRequest() {
+		return request;
+	}
+	/**
+	 * @param request The request to set.
+	 */
+	public void setRequest(String request) {
+		this.request = request;
+	}
+	/**
+	 * @param request
+	 * @param response
+	 */
+	public WcmMessage(String request, String response) {
+		super();
+		this.request = request;
+		this.response = response;
+	}
+	/**
+	 * @return Returns the response.
+	 */
+	public String getResponse() {
+		return response;
+	}
+	/**
+	 * @param response The response to set.
+	 */
+	public void setResponse(String response) {
+		this.response = response;
+	}
+	/**
+	 * @return Returns the time.
+	 */
+	public Date getTime() {
+		return time;
+	}
+	/**
+	 * @param time The time to set.
+	 */
+	public void setTime(Date time) {
+		this.time = time;
+	}
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		// TODO Auto-generated method stub
+		return df.format(time);		
+	}
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/WebServicesMgmtTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/WebServicesMgmtTestCase.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/WebServicesMgmtTestCase.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/ws/muws/interop/client/WebServicesMgmtTestCase.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,286 @@
+/*=============================================================================*
+ *  Copyright 2005 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.ws.muws.interop.client;
+
+import org.apache.ws.addressing.XmlBeansEndpointReference;
+import org.apache.ws.mows.v1_0.MowsConstants;
+import org.apache.ws.mows.v1_0.capability.IdentificationCapability;
+import org.apache.ws.mows.v1_0.capability.MetricsCapability;
+import org.apache.ws.mows.v1_0.capability.RequestProcessingStateCapability;
+import org.apache.ws.muws.v1_0.MuwsConstants;
+import org.apache.ws.muws.v1_0.capability.CorrelatablePropertiesCapability;
+import org.apache.ws.muws.v1_0.capability.IdentityCapability;
+import org.apache.ws.muws.v1_0.capability.ManageabilityCharacteristicsCapability;
+import org.apache.ws.muws.v1_0.capability.RelationshipsCapability;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.ws.util.test.PortListen;
+import org.apache.xmlbeans.XmlAnyURI;
+import org.apache.xmlbeans.XmlDateTime;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlQName;
+import org.apache.xmlbeans.XmlString;
+import org.apache.xmlbeans.XmlOptions;
+//import org.everestWeather.wsdm.samples.x2005.x04.schema.WeatherstationPropertyQNames;
+//import org.everestWeather.wsdm.samples.x2005.x04.schema.WeatherstationResource;
+import org.oasisOpen.docs.wsdm.x2004.x12.mows.wsdmMows.DurationMetric;
+import org.oasisOpen.docs.wsdm.x2004.x12.mows.wsdmMows.EndpointDescriptionsDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.mows.wsdmMows.IntegerCounter;
+import org.oasisOpen.docs.wsdm.x2004.x12.mows.wsdmMows.RequestProcessingNotificationDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.CorrelatablePropertiesType;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManagementEventType;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipParticipantType;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipType;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceDocument;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * A test case containing a test for each act in the "Web Services Management"
+ * playbook, as defined in the WSDM 1.0 interop scenarios doc.
+ *
+ * @author Ian Springer
+ */
+public class WebServicesMgmtTestCase extends AbstractWsdmInteropTestCase
+{
+
+    public static final String SYSPROP_WEATHER_STATION_URL = "weather_station.url"; // this is the Weather Station business Web service
+    public static final String SYSPROP_WEATHER_STATION_EPR_URL = "weather_station.epr";
+    public static final String SYSPROP_WEATHER_STATION_2_EPR_URL = "weather_station_2.epr";
+
+    private static final String HP_WEATHER_STATION_EPR_URL = "http://people.apache.org/~ips/interop/weather_station-epr.xml";
+    private static final String HP_WEATHER_STATION_2_EPR_URL = "http://people.apache.org/~ips/interop/weather_station_2-epr.xml";
+    private static final String HP_WEATHER_STATION_URL = "http://localhost:8080/muse/services/WeatherStationSoap";
+
+    private static final String IBM_WEATHER_STATION_EPR_URL = "http://24.211.145.38:4400/ettk/wsdm/InteropServlet?getepr=true";
+    private static final String IBM_WEATHER_STATION_URL = "http://24.211.145.38:4400/ettk/wsdm/services/WeatherStationSoap";
+
+    private static final String WEATHER_STATION_EPR_URL = System.getProperty( SYSPROP_WEATHER_STATION_EPR_URL, HP_WEATHER_STATION_EPR_URL );
+    private static final String WEATHER_STATION_2_EPR_URL = System.getProperty( SYSPROP_WEATHER_STATION_2_EPR_URL, HP_WEATHER_STATION_2_EPR_URL );
+    private static final String WEATHER_STATION_URL = System.getProperty( SYSPROP_WEATHER_STATION_URL, HP_WEATHER_STATION_URL );
+
+    private ServiceStub m_service;
+    private ResourceStub m_resource;
+
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        EndpointReferenceDocument weatherStationEprDoc = getEndpointReference( new URL( WEATHER_STATION_EPR_URL ) );
+        if ( DEBUG ) { System.out.println( "*** Using Weather Station EPR:\n" + weatherStationEprDoc ); }
+        m_service = new ServiceStub( new URL( WEATHER_STATION_URL ) );
+        m_resource = new ResourceStub( new XmlBeansEndpointReference( weatherStationEprDoc.getEndpointReference() ) );
+    }
+
+    public void testMuwsIdentityCharacteristics() throws FaultException
+    {
+        performMuwsIdentityCharacteristicsAct( m_resource );
+    }
+
+    public void testMowsIdentification() throws FaultException, WSDLException
+    {
+        XmlObject[] capabilityElems = m_resource.getResourceProperty( ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
+        assertContainsURI( capabilityElems, IdentificationCapability.URI );
+        XmlObject eprPropElem = getSingleProperty( m_resource, IdentificationCapability.PROP_NAME_ENDPOINT_REFERENCE );
+        assertTrue( eprPropElem instanceof EndpointReferenceType );
+        EndpointReferenceType epr = (EndpointReferenceType) eprPropElem;
+        assertTrue( "mows-xs:EndpointReference element is not valid", epr.validate() );
+        String address = epr.getAddress().getStringValue();
+        XmlObject epDescsPropElem = getSingleProperty( m_resource, IdentificationCapability.PROP_NAME_ENDPOINT_DESCRIPTIONS );
+        assertTrue( epDescsPropElem instanceof EndpointDescriptionsDocument.EndpointDescriptions );
+        EndpointDescriptionsDocument.EndpointDescriptions epDescs = (EndpointDescriptionsDocument.EndpointDescriptions)epDescsPropElem;
+        assertTrue( "mows-xs:EndpointDescriptions element is not valid", epDescs.validate() );
+        String[] wsdlURLs = epDescs.getDescriptionArray();
+        for (int i = 0; i < wsdlURLs.length; i++)
+        {
+            String wsdlURL = wsdlURLs[i];
+            WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+            Definition definition = wsdlReader.readWSDL(wsdlURL);
+            assertNotNull("WSDL at location: " + wsdlURL + " was null.",definition);//valid wsdls
+            assertEquals("There must only be exactly one service in the WSDL file.", 1, definition.getServices().size()); //single service
+            Service service = (Service) definition.getServices().values().iterator().next();
+            assertEquals("There must only be exactly one port associated with the service in the WSDL file.", 1, service.getPorts().size());  //single port
+            Port port = (Port) service.getPorts().values().iterator().next();
+            SOAPAddress soapAddress = (SOAPAddress) port.getExtensibilityElements().get(0);
+            assertEquals("The soap:address in WSDL at " + wsdlURL + " did not match the EPR address.", address, soapAddress.getLocationURI()); //EPR address matches that contained in soap:address
+        }
+    }
+
+    public void testMowsManageabilityReferences() throws FaultException
+    {
+        EndpointReferenceType[] mgmtEPRs = m_service.getManageabilityReferences();
+        assertTrue( "Response to GetManageabilityReferences operation did not contain any EPRs.", mgmtEPRs.length != 0 );
+        for ( int i = 0; i < mgmtEPRs.length; i++ )
+        {
+            ResourceStub mgmtResource = new ResourceStub( new XmlBeansEndpointReference( mgmtEPRs[i] ) );
+            XmlObject idPropElem = getSingleProperty( mgmtResource, IdentityCapability.PROP_NAME_RESOURCE_ID );
+            assertTrue( idPropElem instanceof XmlAnyURI );
+            XmlObject[] capabilityElems = mgmtResource.getResourceProperty(
+                    ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
+            assertContainsURI( capabilityElems, IdentificationCapability.URI );
+        }
+    }
+
+    public void testMowsMetrics() throws FaultException
+    {
+        XmlObject[] capabilityElems = m_resource.getResourceProperty( ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
+        assertContainsURI( capabilityElems, org.apache.ws.muws.v1_0.capability.MetricsCapability.URI );
+        assertContainsURI( capabilityElems, MetricsCapability.URI );
+        XmlObject currentTimePropElem = getSingleProperty( m_resource, org.apache.ws.muws.v1_0.capability.MetricsCapability.PROP_NAME_CURRENT_TIME );
+        assertTrue( currentTimePropElem instanceof XmlDateTime );
+        XmlObject numRequestsPropElem = getSingleProperty( m_resource, MetricsCapability.PROP_NAME_NUMBER_OF_REQUESTS );
+        assertTrue( numRequestsPropElem instanceof IntegerCounter );
+        IntegerCounter numRequestsMetric = ((IntegerCounter)numRequestsPropElem);
+        long numRequests = numRequestsMetric.getBigIntegerValue().longValue();
+        assertTrue( "ResetAt metadata attribute is not set", numRequestsMetric.isSetResetAt() );
+        assertFalse( "Duration metadata attribute is set", numRequestsMetric.isSetDuration() );
+        XmlObject numFailedRequestsPropElem = getSingleProperty( m_resource, MetricsCapability.PROP_NAME_NUMBER_OF_FAILED_REQUESTS );
+        assertTrue( numFailedRequestsPropElem instanceof IntegerCounter );
+        IntegerCounter numFailedRequestsMetric = ((IntegerCounter)numFailedRequestsPropElem);
+        long numFailedRequests = numFailedRequestsMetric.getBigIntegerValue().longValue();
+        assertTrue( "ResetAt metadata attribute is not set", numFailedRequestsMetric.isSetResetAt() );
+        assertFalse( "Duration metadata attribute is set", numFailedRequestsMetric.isSetDuration() );
+        XmlObject numSuccessfulRequestsPropElem = getSingleProperty( m_resource, MetricsCapability.PROP_NAME_NUMBER_OF_SUCCESSFUL_REQUESTS );
+        assertTrue( numSuccessfulRequestsPropElem instanceof IntegerCounter );
+        IntegerCounter numSuccessfulRequestsMetric = ((IntegerCounter)numSuccessfulRequestsPropElem);
+        long numSuccessfulRequests = numSuccessfulRequestsMetric.getBigIntegerValue().longValue();
+        assertTrue( "ResetAt metadata attribute is not set", numSuccessfulRequestsMetric.isSetResetAt() );
+        assertFalse( "Duration metadata attribute is set", numSuccessfulRequestsMetric.isSetDuration() );
+        assertTrue( numRequests >= numFailedRequests + numSuccessfulRequests );
+        XmlObject serviceTimePropElem = getSingleProperty( m_resource, MetricsCapability.PROP_NAME_SERVICE_TIME );
+        assertTrue( serviceTimePropElem instanceof DurationMetric );
+        DurationMetric serviceTimeMetric = ((DurationMetric)serviceTimePropElem);
+        assertTrue( "Duration metadata attribute is not set", serviceTimeMetric.isSetDuration() );
+        XmlObject maxResponseTimePropElem = getSingleProperty( m_resource, MetricsCapability.PROP_NAME_MAX_RESPONSE_TIME );
+        assertTrue( maxResponseTimePropElem instanceof DurationMetric );
+        DurationMetric maxResponseTimeMetric = ((DurationMetric)maxResponseTimePropElem);
+        assertTrue( "Duration metadata attribute is not set", maxResponseTimeMetric.isSetDuration() );
+        XmlObject lastResponseTimePropElem = getSingleProperty( m_resource, MetricsCapability.PROP_NAME_LAST_RESPONSE_TIME );
+        assertTrue( lastResponseTimePropElem instanceof DurationMetric );
+    }
+
+    public void testMuwsStatus() throws FaultException
+    {
+        performMuwsStatusAct( m_resource );
+    }
+
+//    public void testMowsRequestProcessingNotification() throws FaultException, XmlException
+//    {
+//        XmlObject[] capabilityElems = m_resource.getResourceProperty( ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
+//        assertContainsURI( capabilityElems, RequestProcessingStateCapability.URI );
+//
+//        m_resource.subscribe( s_consumerURL, new QName( MowsConstants.NSURI_MOWS_TOPICS, "RequestProcessingObservations", MowsConstants.NSPREFIX_MOWS_TOPICS ) );
+//
+//        PortListen notifListener = new PortListen( NOTIF_LISTENER_PORT, NOTIF_LISTENER_TIMEOUT );
+//
+//        m_service.getCurrentTemperature();
+//
+//        ManagementEventType mgmtEvent = waitForManagementEvent( notifListener );
+//        if ( DEBUG ) { System.out.println( "Received ManagementEvent:\n" + mgmtEvent.xmlText( new XmlOptions().setSaveOuter().setSavePrettyPrint() ) ); }
+//
+//        XmlObject[] requestProcessingNotifElems = XmlBeanUtils.getChildElements(mgmtEvent, new QName(MowsConstants.NSURI_MOWS_SCHEMA, "RequestProcessingNotification", MowsConstants.NSPREFIX_MOWS_SCHEMA));
+//        assertEquals( 1, requestProcessingNotifElems.length );
+//        assertTrue( requestProcessingNotifElems[0] instanceof RequestProcessingNotificationDocument.RequestProcessingNotification );
+//        RequestProcessingNotificationDocument.RequestProcessingNotification requestProcessingNotif = (RequestProcessingNotificationDocument.RequestProcessingNotification) requestProcessingNotifElems[0];
+//
+//        System.out.println( requestProcessingNotif.xmlText( new XmlOptions().setSaveOuter().setSavePrettyPrint() ) );
+//        assertTrue( validate( requestProcessingNotif ) );
+//    }
+
+//    public void testMuwsRelationships() throws FaultException
+//    {
+//        XmlObject[] capabilityElems = m_resource.getResourceProperty( ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
+//        assertContainsURI( capabilityElems, RelationshipsCapability.URI );
+//        XmlObject[] idElems = m_resource.getResourceProperty( IdentityCapability.PROP_NAME_RESOURCE_ID );
+//        assertEquals( 1, idElems.length );
+//        assertTrue( idElems[0] instanceof XmlAnyURI );
+//        XmlObject[] relationshipPropElems = m_resource.getResourceProperty( RelationshipsCapability.PROP_NAME_RELATIONSHIP );
+//        assertTrue( "muws-p2-xs:Relationship property does not contain any elements", relationshipPropElems.length >= 1 );
+//        for ( int i = 0; i < relationshipPropElems.length; i++ )
+//        {
+//            XmlObject relationshipPropElem = relationshipPropElems[i];
+//            assertTrue( relationshipPropElem instanceof RelationshipType );
+//            RelationshipType relationship = (RelationshipType)relationshipPropElem;
+//            assertTrue( "muws-p2-xs:Relationship element is not valid", relationship.validate() );
+//            RelationshipParticipantType[] participantArray = relationship.getParticipantArray();
+//            for (int j = 0; j < participantArray.length; j++)
+//            {
+//                RelationshipParticipantType relationshipParticipantType = participantArray[j];
+//                EndpointReferenceType[] manageabilityEndpointReferenceArray = relationshipParticipantType.getManageabilityEndpointReferenceArray();
+//                for (int k = 0; k < manageabilityEndpointReferenceArray.length; k++)
+//                {
+//                    EndpointReferenceType endpointReferenceType = manageabilityEndpointReferenceArray[k];
+//                    ResourceStub resource = new ResourceStub(new XmlBeansEndpointReference(endpointReferenceType));
+//                    XmlObject[] resourceProperty = resource.getResourceProperty(WeatherstationPropertyQNames.FCCID);
+//                    assertTrue("Unable to invoke operation on resource.",resourceProperty.length == 1);
+//                }
+//            }
+//        }
+//    }
+
+//    public void testWeatherStationCorrelateableProperties() throws Exception, MalformedURLException
+//    {
+//        XmlObject[] capabilityElems = m_resource.getResourceProperty( ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
+//        assertContainsURI( capabilityElems, CorrelatablePropertiesCapability.URI );
+//        XmlObject correlatablePropertiesPropElem = getSingleProperty( m_resource, CorrelatablePropertiesCapability.PROP_NAME_CORRELATABLE_PROPERTIES );
+//        assertTrue( correlatablePropertiesPropElem instanceof CorrelatablePropertiesType );
+//        CorrelatablePropertiesType correlatableProperties = (CorrelatablePropertiesType)correlatablePropertiesPropElem;
+//        assertEquals( "Incorrect dialect", MuwsConstants.PBM_DIALECT, correlatableProperties.getDialect() );
+//        XmlObject[] matchElems = XmlBeanUtils.getChildElements( correlatableProperties, new QName( MuwsConstants.NSURI_PBM, "Match", MuwsConstants.NSPREFIX_PBM ) );
+//        assertEquals( "muws-p1-xs:CorrelatableProperties element does not contain exactly one pbm:Match element.", 1, matchElems.length );
+//        assertTrue( matchElems[0] instanceof XmlQName );
+//        XmlQName match = (XmlQName) matchElems[0];
+//        assertEquals( WeatherstationPropertyQNames.FCCID, match.getQNameValue() );
+//
+//        // get weather station resource #2
+//        EndpointReferenceDocument weatherStation2EprDoc = getEndpointReference( new URL( WEATHER_STATION_2_EPR_URL ) );
+//        ResourceStub resource2 = new ResourceStub(new XmlBeansEndpointReference( weatherStation2EprDoc.getEndpointReference()) ); //resource2
+//
+//        assertEquals("FCCIDs did not match.", getFCCID(m_resource), getFCCID(resource2));
+//    }
+
+//    public void testQueryRelationshipsByType() throws FaultException, MalformedURLException, XmlException
+//    {
+//        RelationshipType[] relationshipTypes = m_service.queryRelationshipsByType(WeatherstationResource.RELATIONSHIP_RELATION);
+//        assertNotNull(relationshipTypes);
+//        assertTrue(relationshipTypes.length == 1);
+//        XmlObject[] childElements = XmlBeanUtils.getChildElements(relationshipTypes[0].getType());
+//
+//        XmlObject childElement = childElements[0];
+//        QName typeName = XmlBeanUtils.getName(childElement);
+//
+//        assertEquals(WeatherstationResource.RELATIONSHIP_RELATION, typeName);
+//    }
+//
+//    private String getFCCID(ResourceStub resource)
+//            throws FaultException
+//    {
+//        XmlObject fccIdPropElem = getSingleProperty(resource, WeatherstationPropertyQNames.FCCID);
+//        assertTrue("FCCID was not an xs:String", fccIdPropElem instanceof XmlString);
+//        XmlString fccId = (XmlString) fccIdPropElem;
+//        return fccId.getStringValue();
+//    }
+
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WcImpl.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WcImpl.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WcImpl.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WcImpl.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,48 @@
+/*
+ * Created on May 23, 2005
+ *
+ */
+package org.apache.wsdm.interop.wcm.impl;
+
+import org.apache.wsdm.interop.wcm.model.IWc;
+import org.apache.wsdm.interop.wcm.model.IWs;
+
+/**
+ * @author wire
+ *
+ */
+public class WcImpl extends WsImpl implements IWc {
+	IWs active;
+	
+	/**
+	 * @param status
+	 * @param name
+	 * @param backup
+	 * @param active
+	 */
+	public WcImpl(int status, String name, IWs active) {
+		super(status, name, null);
+		this.active = active;
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWc#getActive()
+	 */
+	public IWs getActive() {
+		
+		return active;
+	}
+	
+
+	/**
+	 * @param active The active to set.
+	 */
+	public void setActive(IWs active) {
+		this.active = active;
+	}
+	
+	public String toString() {
+		
+		return "WC: "+getName()+" Using: "+getActive().getName()+" Temp:"+getActive();
+	}
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WcmImpl.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WcmImpl.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WcmImpl.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WcmImpl.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,85 @@
+/*
+ * Created on May 23, 2005
+ *
+ */
+package org.apache.wsdm.interop.wcm.impl;
+
+import java.net.URL;
+
+import org.apache.wsdm.interop.wcm.impl.ui.WcJFrame;
+import org.apache.wsdm.interop.wcm.model.IWcm;
+import org.apache.wsdm.interop.wcm.model.IWs;
+
+
+/**
+ * @author wire
+ *
+ */
+public class WcmImpl implements IWcm {
+	private URL wcUrl;
+	private boolean showUi;
+	private WcJFrame wcUI;
+	private IWcm app;
+	
+	/**
+	 * @param wcUrl
+	 * @param showUi
+	 */
+	public WcmImpl(URL wcUrl, boolean showUi) {
+		super();
+		this.wcUrl = wcUrl;
+		this.showUi = showUi;
+		if(showUi)
+			buildUI();
+	}
+
+	/**
+	 * 
+	 */
+	private void buildUI() {
+		wcUI=new WcJFrame();
+		app=(IWcm)wcUI;
+		wcUI.show();
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWcm#setCurrentTempurature(int)
+	 */
+	public void setCurrentTempurature(int temp) {
+		app.setCurrentTempurature(temp);
+		System.out.println("The temp is "+temp);
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWcm#setCurrentCost(float)
+	 */
+	public void setCurrentCost(double cost) {
+		app.setCurrentCost(cost);
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWcm#setCurrentBackup(java.lang.String)
+	 */
+	public void setCurrentBackup(String backupName) {
+		app.setCurrentBackup(backupName);
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWcm#setCurrentMessage(java.lang.String, java.lang.String)
+	 */
+	public void setCurrentMessage(String request, String response) {
+		app.setCurrentMessage(request,response);
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWcm#setServiceModel(com.hp.wsdm.interop.wcm.IWs[])
+	 */
+	public void setServiceModel(IWs[] services) {
+		app.setServiceModel(services);		
+	}
+	
+
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WsImpl.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WsImpl.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WsImpl.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/WsImpl.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,103 @@
+/*
+ * Created on May 23, 2005
+ *
+ */
+package org.apache.wsdm.interop.wcm.impl;
+
+import org.apache.wsdm.interop.wcm.model.IWs;
+
+import sun.rmi.runtime.GetThreadPoolAction;
+
+
+/**
+ * @author wire
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class WsImpl implements IWs {
+	int status;
+	String name;
+	IWs backup;
+	double temp;
+	
+	/**
+	 * @param status
+	 * @param name
+	 * @param backup
+	 */
+	public WsImpl(int status, String name, IWs backup) {
+		super();
+		this.status = status;
+		this.name = name;
+		this.backup = backup;
+	}
+	
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWs#setStatus(int)
+	 */
+	public void setStatus(int status) {
+		this.status=status;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWs#getStatus()
+	 */
+	public int getStatus() {
+		// TODO Auto-generated method stub
+		return status;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWs#setName(java.lang.String)
+	 */
+	public void setName(String name) {
+		this.name=name;
+
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWs#getName()
+	 */
+	public String getName() {
+
+		return name;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWs#getBackup()
+	 */
+	public IWs getBackup() {
+		
+		return backup;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWs#setBackup(com.hp.wsdm.interop.wcm.IWs)
+	 */
+	public void setBackup(IWs backup) {
+		this.backup=backup;
+		
+	}
+
+	public String toString() {
+		
+		return "WS: "+getName()+" Temp:"+getTemperature();
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWs#getTemperature()
+	 */
+	public double getTemperature() {
+		// TODO Auto-generated method stub
+		return temp;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.hp.wsdm.interop.wcm.IWs#setTemperatire(double)
+	 */
+	public void setTemperature(double temp) {
+		this.temp=temp;
+	}
+
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/ui/MessagesJPanel.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/ui/MessagesJPanel.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/ui/MessagesJPanel.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/ui/MessagesJPanel.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,310 @@
+package org.apache.wsdm.interop.wcm.impl.ui;
+
+import java.awt.BorderLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.DefaultListModel;
+import javax.swing.JEditorPane;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.ListModel;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingUtilities;
+import javax.swing.border.LineBorder;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.JCheckBox;
+
+import org.apache.ws.muws.interop.client.WcmMessage;
+/**
+* This code was generated using CloudGarden's Jigloo
+* SWT/Swing GUI Builder, which is free for non-commercial
+* use. If Jigloo is being used commercially (ie, by a corporation,
+* company or business for any purpose whatever) then you
+* should purchase a license for each developer using Jigloo.
+* Please visit www.cloudgarden.com for details.
+* Use of Jigloo implies acceptance of these licensing terms.
+* *************************************
+* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED
+* for this machine, so Jigloo or this code cannot be used legally
+* for any corporate or commercial purpose.
+* *************************************
+*/
+public class MessagesJPanel extends javax.swing.JPanel implements Observer {
+	private JLabel jLabelTitle;
+	private JList jListTime;
+	private JScrollPane jScrollPaneTime;
+	private JScrollPane jScrollPaneRequest;
+	private JCheckBox jCheckBoxUpdate;
+	private JLabel jLabelTime;
+	private JLabel jLabelRequest;
+	private JPanel jPanelRequest;
+	private JLabel jLabelResponse;
+	private JPanel jPanelResponse;
+	private JEditorPane response;
+	private JEditorPane request;
+	private JScrollPane jScrollPaneResponse;
+	private JSplitPane jSplitPaneReqRes;
+	private JPanel jPanelTimePanel;
+	private JPanel jPanelMessageBody;
+	private DefaultListModel listModel;
+
+	/**
+	* Auto-generated main method to display this 
+	* JPanel inside a new JFrame.
+	*/
+	public static void main(String[] args) {
+		JFrame frame = new JFrame();
+		MessagesJPanel mp = new MessagesJPanel();
+		frame.getContentPane().add(mp);
+		frame.pack();
+		frame.show();
+		
+		mp.setMessage(new WcmMessage("Blah,blah,blah","boogies are cool\nthen U die"));
+		try {
+			Thread.sleep(5000);
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		mp.setMessage(new WcmMessage("tookie tookie\ntonga","flabber\nwiggle\nwoo\n"));
+		try {
+			Thread.sleep(10000);
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		mp.setMessage(new WcmMessage("Boom Boom Voom","dwaddle wingle woodel\n pew"));
+	}
+	
+	public MessagesJPanel() {
+		super();
+		initGUI();
+		listModel=new DefaultListModel();
+		jListTime.setModel(listModel);
+	}
+	
+	private void initGUI() {
+		try {
+			BorderLayout thisLayout = new BorderLayout();
+			this.setLayout(thisLayout);
+			this.setPreferredSize(new java.awt.Dimension(583, 196));
+			{
+				jLabelTitle = new JLabel();
+				this.add(jLabelTitle, BorderLayout.NORTH);
+				jLabelTitle.setText(" Messages");
+				jLabelTitle.setBackground(new java.awt.Color(0,0,160));
+				jLabelTitle.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
+			}
+			{
+				jPanelMessageBody = new JPanel();
+				GridBagLayout jPanel1Layout = new GridBagLayout();
+				jPanelMessageBody.setPreferredSize(new java.awt.Dimension(400, 284));
+				this.add(jPanelMessageBody, BorderLayout.CENTER);
+				jPanelMessageBody.setLayout(jPanel1Layout);
+				{
+					jPanelTimePanel = new JPanel();
+					BorderLayout jPanel1Layout1 = new BorderLayout();
+					jPanelTimePanel.setLayout(jPanel1Layout1);
+					jPanelMessageBody.add(
+						jPanelTimePanel,
+						new GridBagConstraints(
+							0,
+							0,
+							1,
+							1,
+							0.0,
+							1.0,
+							GridBagConstraints.NORTHEAST,
+							GridBagConstraints.BOTH,
+							new Insets(0, 0, 0, 0),
+							0,
+							0));
+					jPanelTimePanel.setMinimumSize(new java.awt.Dimension(100, 10));
+					jPanelTimePanel.setPreferredSize(new java.awt.Dimension(90, 10));
+					jPanelTimePanel.setRequestFocusEnabled(false);
+					jPanelTimePanel.setMaximumSize(new java.awt.Dimension(100, 32767));
+					jPanelTimePanel.setSize(90, 278);
+					{
+						jLabelTime = new JLabel();
+						jPanelTimePanel.add(jLabelTime, BorderLayout.NORTH);
+						jLabelTime.setText(" Time");
+					}
+					{
+						jScrollPaneTime = new JScrollPane();
+						jPanelTimePanel.add(jScrollPaneTime, BorderLayout.CENTER);
+						jScrollPaneTime.setSize(90, 262);
+						jScrollPaneTime.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+						{
+							ListModel jListTimeModel = new DefaultComboBoxModel(
+								new String[] { "Item One", "Item Two" });
+							jListTime = new JList();
+							jScrollPaneTime.setViewportView(jListTime);
+							jListTime.setModel(jListTimeModel);
+							jListTime.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+							jListTime.setFocusable(false);
+							jListTime
+								.addListSelectionListener(new ListSelectionListener() {
+								public void valueChanged(ListSelectionEvent evt) {
+									updateMessages(evt.getSource());
+									
+								}
+								});
+						}
+					}
+					{
+						jCheckBoxUpdate = new JCheckBox();
+						jPanelTimePanel
+							.add(jCheckBoxUpdate, BorderLayout.SOUTH);
+						jCheckBoxUpdate.setText("Auto Update");
+						jCheckBoxUpdate.setFont(new java.awt.Font("Dialog",0,9));
+					}
+
+				}
+				{
+					jSplitPaneReqRes = new JSplitPane();
+					jPanelMessageBody.add(
+						jSplitPaneReqRes,
+						new GridBagConstraints(
+							5,
+							0,
+							1,
+							GridBagConstraints.REMAINDER,
+							0.85,
+							1.0,
+							GridBagConstraints.CENTER,
+							GridBagConstraints.BOTH,
+							new Insets(0, 0, 0, 0),
+							0,
+							0));
+					jSplitPaneReqRes.setDividerLocation(200);
+					jSplitPaneReqRes.setMinimumSize(new java.awt.Dimension(5, 28));
+					{
+						jScrollPaneRequest = new JScrollPane();
+						jSplitPaneReqRes.add(jScrollPaneRequest, JSplitPane.LEFT);
+						jScrollPaneRequest.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+						{
+							jPanelRequest = new JPanel();
+							BorderLayout jPanelRequestLayout = new BorderLayout();
+							jPanelRequest.setEnabled(false);
+							jPanelRequest.setLayout(jPanelRequestLayout);
+							jScrollPaneRequest.setViewportView(jPanelRequest);
+							{
+								request = new JEditorPane();
+								jPanelRequest.add(getRequest(), BorderLayout.CENTER);
+								request.setPreferredSize(new java.awt.Dimension(200, 257));
+								request.setEditable(false);
+								request.setMinimumSize(new java.awt.Dimension(50, 22));
+							}
+							{
+								jLabelRequest = new JLabel();
+								jPanelRequest.add(
+									jLabelRequest,
+									BorderLayout.NORTH);
+								jLabelRequest.setText(" Request");
+							}
+						}
+					}
+					{
+						jScrollPaneResponse = new JScrollPane();
+						jSplitPaneReqRes.add(
+							jScrollPaneResponse,
+							JSplitPane.RIGHT);
+						jScrollPaneResponse.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+						{
+							jPanelResponse = new JPanel();
+							BorderLayout jPanelResponseLayout = new BorderLayout();
+							jPanelResponse.setLayout(jPanelResponseLayout);
+							jScrollPaneResponse.setViewportView(jPanelResponse);
+							{
+								response = new JEditorPane();
+								jPanelResponse.add(
+									getResponse(),
+									BorderLayout.CENTER);
+								response.setPreferredSize(new java.awt.Dimension(200, 257));
+								response.setEditable(false);
+								response.setMinimumSize(new java.awt.Dimension(5, 22));
+							}
+							{
+								jLabelResponse = new JLabel();
+								jPanelResponse.add(
+									jLabelResponse,
+									BorderLayout.NORTH);
+								jLabelResponse.setText(" Response");
+							}
+						}
+					}
+				}
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * @param source
+	 */
+	protected void updateMessages(Object source) {
+		if(jListTime.getSelectedValue()==null){
+			response.setText("");
+			request.setText("");				
+			return;
+		}
+		WcmMessage value=(WcmMessage) jListTime.getSelectedValue();
+		response.setText(value.getResponse());
+		request.setText(value.getRequest());				
+	}
+
+	public JEditorPane getRequest() {
+		return request;
+	}
+	
+	public JEditorPane getResponse() {
+		return response;
+	}
+	
+	public void setMessage(final WcmMessage message){
+		
+		//listModel.addElement(message);
+		SwingUtilities.invokeLater(new Runnable(){
+
+			public void run() {
+				listModel.add(0,message);
+				if(listModel.getSize()==1){
+					jListTime.setSelectedIndex(0);
+				}
+				
+				if(jCheckBoxUpdate.isSelected()){
+					jListTime.setSelectedIndex(0);
+				}				
+			}});
+
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
+	 */
+	public void update(Observable o, Object arg) {
+		if(arg instanceof WcmMessage){
+			setMessage((WcmMessage)arg);
+		}
+	}
+	
+	public void clearMessages(){
+		listModel.removeAllElements();
+		response.setText("");
+		request.setText("");
+
+	}
+
+}

Added: incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/ui/StatusJPanel.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/ui/StatusJPanel.java?rev=189764&view=auto
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/ui/StatusJPanel.java (added)
+++ incubator/muse/trunk/src/ieeedemo/client/src/org/apache/wsdm/interop/wcm/impl/ui/StatusJPanel.java Thu Jun  9 08:03:19 2005
@@ -0,0 +1,275 @@
+package org.apache.wsdm.interop.wcm.impl.ui;
+
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
+import javax.swing.JFrame;
+import javax.swing.SwingConstants;
+
+import java.awt.Color;
+import java.awt.Dimension;
+
+
+import org.apache.wsdm.interop.wcm.impl.ui.jgraph.CustomCellViewFactory;
+import org.apache.wsdm.interop.wcm.impl.ui.jgraph.WcGraphCell;
+import org.apache.wsdm.interop.wcm.impl.ui.jgraph.WsGraphCell;
+import org.apache.wsdm.interop.wcm.model.IWc;
+import org.apache.wsdm.interop.wcm.model.IWs;
+import org.jgraph.JGraph;
+import org.jgraph.graph.AttributeMap;
+import org.jgraph.graph.ConnectionSet;
+import org.jgraph.graph.DefaultEdge;
+import org.jgraph.graph.DefaultGraphCell;
+import org.jgraph.graph.DefaultGraphModel;
+import org.jgraph.graph.DefaultPort;
+import org.jgraph.graph.GraphConstants;
+import org.jgraph.graph.GraphModel;
+
+
+import java.awt.BorderLayout;
+import java.awt.geom.Rectangle2D;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.swing.JScrollPane;
+import javax.swing.tree.TreeNode;
+/**
+* This code was generated using CloudGarden's Jigloo
+* SWT/Swing GUI Builder, which is free for non-commercial
+* use. If Jigloo is being used commercially (ie, by a corporation,
+* company or business for any purpose whatever) then you
+* should purchase a license for each developer using Jigloo.
+* Please visit www.cloudgarden.com for details.
+* Use of Jigloo implies acceptance of these licensing terms.
+* *************************************
+* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED
+* for this machine, so Jigloo or this code cannot be used legally
+* for any corporate or commercial purpose.
+* *************************************
+*/
+public class StatusJPanel extends javax.swing.JPanel {
+	private JGraph jGraphMain;
+	private JScrollPane jScrollPaneGraph;
+
+	/**
+	* Auto-generated main method to display this 
+	* JPanel inside a new JFrame.
+	*/
+	public static void main(String[] args) {
+		JFrame frame = new JFrame();
+		frame.getContentPane().add(new StatusJPanel());
+		frame.pack();
+		frame.show();
+	}
+	
+	public StatusJPanel() {
+		super();
+		initGUI();
+		changeRengerView();
+		emptyGraph();
+	}
+	
+	private void changeRengerView(){
+	    // Work on the Graph's View
+		jGraphMain.getGraphLayoutCache().setFactory(new CustomCellViewFactory());
+	}
+	
+	/**
+	 * 
+	 */
+	private void emptyGraph() {
+		//GraphModel model = jGraphMain.getModel();
+		GraphModel model = new DefaultGraphModel();
+		jGraphMain.setModel(model);				
+		
+	}
+
+	public static DefaultGraphCell createVertex(String name, double x,
+			double y, double w, double h, Color bg, boolean raised,int type) {
+
+			// Create vertex with the given name
+		DefaultGraphCell cell =null;
+		if(type==0)
+			cell = new WsGraphCell(name);		
+		else
+			cell = new WcGraphCell(name);
+
+			// Set bounds
+			GraphConstants.setBounds(cell.getAttributes(),
+					new Rectangle2D.Double(x, y, w, h));
+
+			//horizontalTextPosition
+			GraphConstants.setHorizontalAlignment(cell.getAttributes(), SwingConstants.RIGHT);//Color.orange
+			GraphConstants.setVerticalAlignment(cell.getAttributes(), SwingConstants.BOTTOM);//Color.orange
+			
+			// Set fill color
+			if (bg != null) {
+				GraphConstants.setGradientColor(
+					cell.getAttributes(), bg);//Color.orange
+				GraphConstants.setOpaque(
+					cell.getAttributes(), true);
+			}
+
+			// Set raised border
+			if (raised)
+				GraphConstants.setBorder(
+					cell.getAttributes(), 
+					BorderFactory.createRaisedBevelBorder());
+			else
+				// Set black border
+				GraphConstants.setBorderColor(
+					cell.getAttributes(), Color.black);
+
+			// Add a Port
+			DefaultPort port = new DefaultPort();
+			cell.add(port);
+			port.setParent(cell);
+
+			return cell;
+		}
+
+
+	private void initGUI() {
+		try {
+			BorderLayout thisLayout = new BorderLayout();
+			this.setLayout(thisLayout);
+			setPreferredSize(new Dimension(400, 300));
+			{
+				jScrollPaneGraph = new JScrollPane();
+				this.add(jScrollPaneGraph, BorderLayout.CENTER);
+				{
+					jGraphMain = new JGraph();
+					jScrollPaneGraph.setViewportView(jGraphMain);
+					jGraphMain.setBackground(new java.awt.Color(0,0,0));
+				}
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * @param wc
+	 */
+	public void setModel(IWs[] wsArry) {		
+		//GraphModel model = jGraphMain.getModel();
+		GraphModel model = new DefaultGraphModel();
+		jGraphMain.setModel(model);
+		
+		
+		
+		// Insert all three cells in one call, so we need an 
+		// array to store them
+		DefaultGraphCell[] cells = new DefaultGraphCell[wsArry.length+1];
+
+		// Create WC
+		cells[0] = createVertex(wsArry[0].getName(), 20, 20, 50, 50, 
+				Color.GREEN, true,1);
+
+		// Remaining WSs
+		for(int index=1;index<wsArry.length;index++){
+			cells[index] = createVertex(wsArry[index].getName(), 20+100*(index-1), 140, 50, 50, 
+						Color.ORANGE, true,0);
+		}
+		
+		// Create Edge
+		DefaultEdge edge = new DefaultEdge();
+		// Fetch the ports from the new vertices, 
+		// and connect them with the edge
+		edge.setSource(cells[0].getChildAt(0));
+		edge.setTarget(cells[1].getChildAt(0));
+		
+		cells[wsArry.length] = edge;
+
+		// Set Arrow Style for edge
+		int arrow = GraphConstants.ARROW_CLASSIC;
+		GraphConstants.setLineEnd(edge.getAttributes(), arrow);
+		GraphConstants.setEndFill(edge.getAttributes(), true);
+		setLineAttribs(edge);
+
+		// Insert the cells via the cache, so they get selected		
+		jGraphMain.getGraphLayoutCache().setSelectsAllInsertedCells(false);
+		jGraphMain.getGraphLayoutCache().insert(cells);
+
+	}
+
+	/**
+	 * @param node
+	 */
+	public void updateNode(IWs node) {
+		DefaultGraphModel model = (DefaultGraphModel)jGraphMain.getModel();
+		List theRoots = model.getRoots();
+		DefaultGraphCell selectedElement=null;
+		findNode(node.getName());
+		
+		System.out.println();
+	}
+	
+	/**
+	 * @param node
+	 * @param theRoots
+	 */
+	private DefaultGraphCell findNode(String nodeName) {
+		System.out.println("FindNode "+nodeName);
+		DefaultGraphModel model = (DefaultGraphModel)jGraphMain.getModel();
+		List theRoots = model.getRoots();
+		DefaultGraphCell selectedElement;
+		for (Iterator iter = theRoots.iterator(); iter.hasNext();) {
+			DefaultGraphCell element = (DefaultGraphCell) iter.next();
+				if(element.toString()!=null)
+					if(element.toString().equals(nodeName)){
+					// Update this node
+						return element;
+					}						
+		}
+		return null;
+	}
+
+	public void setCurrentWc(String name){
+		DefaultGraphCell wcCell=findNode("Wc");
+		DefaultGraphCell wsCell=findNode(name);
+		
+		if(wcCell==null||wsCell==null)  
+			return;
+		
+		DefaultPort zeroChild = (DefaultPort)wcCell.getChildAt(0);
+		Set edges = zeroChild.getEdges();
+		DefaultEdge edge1=(DefaultEdge)edges.iterator().next();
+
+		DefaultGraphModel model = (DefaultGraphModel)jGraphMain.getModel();
+		model.remove(new Object[]{edge1});
+		
+		// Create Edge
+	    DefaultEdge edge = new DefaultEdge();
+		int arrow = GraphConstants.ARROW_CLASSIC;
+		GraphConstants.setLineEnd(edge.getAttributes(), arrow);
+		GraphConstants.setEndFill(edge.getAttributes(), true);
+		setLineAttribs(edge);
+
+	    // Create ConnectionSet for Insertion
+	    ConnectionSet cs = new ConnectionSet(edge, wcCell.getChildAt(0), wsCell.getChildAt(0));
+
+	    // Add Edge and Connections to the Model
+	    Object[] insert = new Object[]{edge};
+	    model.insert(insert, null,cs, null, null);
+
+	}
+
+	public void setColor(String name, Color color){
+		DefaultGraphCell wsCell=findNode(name);
+		if(wsCell!=null){
+			AttributeMap attribs = wsCell.getAttributes();
+			attribs.put("gradientColor",color);
+			wsCell.setAttributes(attribs);
+			//System.out.println();
+		}
+	}
+	
+	private void setLineAttribs(DefaultEdge edge){
+		
+		GraphConstants.setLineColor(edge.getAttributes(), Color.GREEN);
+		GraphConstants.setLineWidth(edge.getAttributes(), 4);
+		
+	}
+}



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