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 ip...@apache.org on 2005/06/21 01:28:44 UTC
svn commit: r191585 [27/30] - in /incubator/muse/site: ./ dev_guide/
example/ example/epr/ example/images/ example/lib/ example/logic/
example/logic/src/ example/logic/src/java/ example/logic/src/java/org/
example/logic/src/java/org/apache/ example/log...
Added: incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/ResourceadminResource.java
URL: http://svn.apache.org/viewcvs/incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/ResourceadminResource.java?rev=191585&view=auto
==============================================================================
--- incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/ResourceadminResource.java (added)
+++ incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/ResourceadminResource.java Mon Jun 20 16:28:31 2005
@@ -0,0 +1,330 @@
+/*=============================================================================*
+ * 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.muse.example.resourceadmin;
+
+import org.apache.ws.mows.v1_0.capability.OperationalStatusCapability;
+import org.apache.ws.muse.example.ExampleConstants;
+import org.apache.ws.muse.example.resourceadmin.properties.DiscoveryType;
+import org.apache.ws.muse.example.resourceadmin.properties.SupportedResourceType;
+import org.apache.ws.muws.v1_0.MuwsConstants;
+import org.apache.ws.muws.v1_0.capability.AdvertisementCapability;
+import org.apache.ws.muws.v1_0.capability.DescriptionCapability;
+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.MetricsCapability;
+import org.apache.ws.muws.v1_0.impl.advertiser.ResourceAdvertiserPropertyQNames;
+import org.apache.ws.muws.v1_0.topics.ManagementEventTopic;
+import org.apache.ws.muws.v1_0.topics.impl.XmlBeansAdvertisementTopicImpl;
+import org.apache.ws.muws.v1_0.topics.impl.XmlBeansManagementEventTopicImpl;
+import org.apache.ws.notification.topics.Topic;
+import org.apache.ws.notification.topics.TopicSpace;
+import org.apache.ws.notification.topics.impl.TopicSpaceImpl;
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.CurrentTimeDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.LangString;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType;
+import javax.naming.InitialContext;
+import java.util.Calendar;
+
+/**
+ *
+ * @author Kinga Dziembowski
+ *
+ * A Resourceadmin WS-Resource.
+ * <p/>
+ * NOTE: This class is generated but IS meant to be modified.
+ */
+public class ResourceadminResource
+ extends AbstractResourceadminResource
+{
+ /**
+ * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
+ */
+ public static final org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl SPEC_NAMESPACE_SET =
+ new org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl( );
+
+ /**
+ * A constant resource Id for singleton
+ */
+ public static final String ADMIN_RESOURCE_ID = "Resource-Admin";
+
+ /**
+ * A ResourceAdnin resource version
+ */
+ public static final String VERSION = "1.0";
+
+ /**
+ * A ResourceAdnin resource caption
+ */
+ public static final String CAPTION = "RESOURCE-ADMIN";
+
+ /**
+ * A ResourceAdnin resource Resource Type
+ */
+ public static final String RESOURCE_TYPE = "AdminForResources";
+
+ /**
+ * Initializes this resource's state (properties, etc.).
+ */
+ public void init( )
+ {
+ super.init( );
+
+ /**
+ * The ResourcePropertySet which contains all the defined ResourceProperties
+ */
+ org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet( );
+ org.apache.ws.resource.properties.ResourceProperty resourceProperty = null;
+
+ try
+ {
+ // init the {http://org.apache.ws.muse.example.resourceadmin.properties}SupportedResources Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.SUPPORTEDRESOURCES );
+ org.apache.ws.muse.example.resourceadmin.properties.SupportedResourcesDocument prop_supportedresources =
+ org.apache.ws.muse.example.resourceadmin.properties.SupportedResourcesDocument.Factory.newInstance( );
+ SupportedResourceType supportedTypes =
+ SupportedResourceType.Factory.newInstance( );
+
+ String[] resourceTypes =
+ ExampleConstants.getKnownResourceTypes( );
+ for ( int i = 0; i < resourceTypes.length; i++ )
+ {
+ supportedTypes.addNewResourceType( ).setStringValue( resourceTypes[i] );
+ }
+
+ prop_supportedresources.setSupportedResources( supportedTypes );
+ resourceProperty.add( prop_supportedresources );
+
+ // Topics
+ org.apache.ws.notification.topics.TopicSpaceSet topicSpaceSet = getTopicSpaceSet( );
+ TopicSpace muwsTopicSpace =
+ new TopicSpaceImpl( MuwsConstants.NSURI_MUWS_PART2_TOPICS );
+
+ Topic manageabilityEndpointCreation =
+ new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_CREATION_NAME,
+ false );
+ Topic manageabilityEndpointDestruction =
+ new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_DESTRUCTION_NAME,
+ false );
+
+ XmlBeansAdvertisementTopicImpl manageableResourceCreation =
+ new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_CREATION_NAME );
+ XmlBeansAdvertisementTopicImpl manageableResourceDestruction =
+ new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_DESTRUCTION_NAME );
+
+ //register listeners for those topics with all known to resourceadmin homes....
+ addListenersToHomes( manageableResourceCreation, manageableResourceDestruction );
+
+ manageabilityEndpointCreation.addTopic( manageableResourceCreation );
+ manageabilityEndpointDestruction.addTopic( manageableResourceDestruction );
+ muwsTopicSpace.addTopic( manageabilityEndpointCreation );
+ muwsTopicSpace.addTopic( manageabilityEndpointDestruction );
+ topicSpaceSet.addTopicSpace( muwsTopicSpace );
+
+ ManagementEventTopic identityCapability =
+ new XmlBeansManagementEventTopicImpl( IdentityCapability.TOPIC_NAME );
+ muwsTopicSpace.addTopic( identityCapability );
+ ManagementEventTopic manageabilityCharacteristicsCapability =
+ new XmlBeansManagementEventTopicImpl( ManageabilityCharacteristicsCapability.TOPIC_NAME );
+ muwsTopicSpace.addTopic( manageabilityCharacteristicsCapability );
+ ManagementEventTopic operationalStatusCapability =
+ new XmlBeansManagementEventTopicImpl( OperationalStatusCapability.TOPIC_NAME );
+ muwsTopicSpace.addTopic( operationalStatusCapability );
+ ManagementEventTopic muwsDescriptionCapability =
+ new XmlBeansManagementEventTopicImpl( DescriptionCapability.TOPIC_NAME );
+ muwsTopicSpace.addTopic( muwsDescriptionCapability );
+ ManagementEventTopic metricCapability =
+ new XmlBeansManagementEventTopicImpl( MetricsCapability.TOPIC_NAME );
+ muwsTopicSpace.addTopic( metricCapability );
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ResourceId Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.RESOURCEID );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument prop_resourceid =
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument.Factory.newInstance( );
+ prop_resourceid.setResourceId( ADMIN_RESOURCE_ID );
+ resourceProperty.add( prop_resourceid );
+
+ // init the {http://org.apache.ws.namespaces.muse.muwsExt1}ResourceHostname Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.RESOURCEHOSTNAME );
+ org.apache.ws.namespaces.muse.muwsExt1.ResourceHostnameDocument prop_resourcehostname =
+ org.apache.ws.namespaces.muse.muwsExt1.ResourceHostnameDocument.Factory.newInstance( );
+ prop_resourcehostname.setResourceHostname( getHostName( ) );
+ resourceProperty.add( prop_resourcehostname );
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}Version Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.VERSION );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.VersionDocument prop_version =
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.VersionDocument.Factory.newInstance( );
+ prop_version.setVersion( VERSION );
+ resourceProperty.add( prop_version );
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ManageabilityCapability Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceAdvertiserPropertyQNames.MANAGEABILITYCAPABILITY );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument prop_manageabilitycapability =
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument.Factory
+ .newInstance( );
+ prop_manageabilitycapability.setManageabilityCapability( AdvertisementCapability.URI );
+ resourceProperty.add( prop_manageabilitycapability );
+
+ prop_manageabilitycapability = ManageabilityCapabilityDocument.Factory.newInstance( );
+ prop_manageabilitycapability.setManageabilityCapability( IdentityCapability.URI );
+ resourceProperty.add( prop_manageabilitycapability );
+
+ prop_manageabilitycapability = ManageabilityCapabilityDocument.Factory.newInstance( );
+ prop_manageabilitycapability.setManageabilityCapability( DescriptionCapability.URI );
+ resourceProperty.add( prop_manageabilitycapability );
+
+ prop_manageabilitycapability = ManageabilityCapabilityDocument.Factory.newInstance( );
+ prop_manageabilitycapability.setManageabilityCapability( MetricsCapability.URI );
+ resourceProperty.add( prop_manageabilitycapability );
+
+ prop_manageabilitycapability = ManageabilityCapabilityDocument.Factory.newInstance( );
+ prop_manageabilitycapability.setManageabilityCapability( ExampleConstants.MUWS_EXT_CAPABILITY_URI );
+ resourceProperty.add( prop_manageabilitycapability );
+
+ resourceProperty.addChangeListener( manageabilityCharacteristicsCapability );
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}Caption Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.CAPTION );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.CaptionDocument prop_caption =
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.CaptionDocument.Factory.newInstance( );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.LangString lStringC =
+ LangString.Factory.newInstance( );
+ lStringC.setStringValue( CAPTION );
+ lStringC.setLang( "en" );
+ prop_caption.setCaption( lStringC );
+ resourceProperty.add( prop_caption );
+
+ // init the {http://ws.apache.org/muse/example/resourceadmin/properties}Discovery Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.DISCOVERY );
+ org.apache.ws.muse.example.resourceadmin.properties.DiscoveryDocument prop_discovery =
+ org.apache.ws.muse.example.resourceadmin.properties.DiscoveryDocument.Factory.newInstance( );
+ DiscoveryType discType =
+ prop_discovery.addNewDiscovery( );
+
+ // During the initialisation the list of EPR is empty
+ EndpointReferenceType[] eprs = new EndpointReferenceType[0];
+ discType.setEndpointReferenceArray( eprs );
+ resourceProperty.setCallback( new DiscoveryCallback( this ) );
+ resourceProperty.add( prop_discovery );
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}Description Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.DESCRIPTION );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.DescriptionDocument prop_description =
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.DescriptionDocument.Factory.newInstance( );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.LangString lString =
+ LangString.Factory.newInstance( );
+ lString.setStringValue( "This is an Admin for resources objects" );
+ lString.setLang( "en" );
+ prop_description.setDescription( lString );
+ resourceProperty.add( prop_description );
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}OperationalStatus Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.OPERATIONALSTATUS );
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument prop_operationalstatus =
+ org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.Factory.newInstance( );
+ prop_operationalstatus.setOperationalStatus( OperationalStatusDocument.OperationalStatus.AVAILABLE );
+ resourceProperty.add( prop_operationalstatus );
+
+ // init the {http://org.apache.ws.namespaces.muse.muwsExt1}ResourceType Resource Property
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.RESOURCETYPE );
+ org.apache.ws.namespaces.muse.muwsExt1.ResourceTypeDocument prop_resourcetype =
+ org.apache.ws.namespaces.muse.muwsExt1.ResourceTypeDocument.Factory.newInstance( );
+ prop_resourcetype.setResourceType( RESOURCE_TYPE );
+ resourceProperty.add( prop_resourcetype );
+
+ // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}CurrentTime ResourceProperty
+ resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.CURRENTTIME );
+ CurrentTimeDocument currentTimeDocument = CurrentTimeDocument.Factory.newInstance( );
+ currentTimeDocument.setCurrentTime( Calendar.getInstance( ) );
+ resourceProperty.add( currentTimeDocument );
+ resourceProperty.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback( ) );
+ resourceProperty.addChangeListener( metricCapability );
+ }
+ catch ( Exception e )
+ {
+ throw new javax.xml.rpc.JAXRPCException( "There was a problem in initializing your resource properties. Please check your init() method. Cause: "
+ + e.getLocalizedMessage( ) );
+ }
+
+ // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}FixedTopicSet is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}Topic is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}TopicExpressionDialects is implemented by the framework.
+ /**
+ * Initializes the Topic, TopicExpressionDialects and FixedTopicSet resource properties
+ * </br>
+ * FixedTopicSet will be set based on the value returned from the {@see TopicSpaceSet#isFixed()} method.
+ * </br>
+ * Topic will have all root topics in the TopicSpaceSet, set to Simple dialect AND all child topics set to
+ * Concrete dialect.
+ * </br>
+ *
+ * TopicExpressionDialects will be set to the engine's known Topic Dialects acquired from the TopicExpressionEngine
+ *
+ * If this is not the behavior you would like, you will need to remove the following line of code and initialize the properties
+ * individually.
+ */
+ org.apache.ws.notification.topics.util.TopicUtils.initNotificationProducerProperties( getTopicSpaceSet( ),
+ getResourcePropertySet( ) );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected String getHostName( )
+ {
+ String name = null;
+ try
+ {
+ java.net.InetAddress localMachine = java.net.InetAddress.getLocalHost( );
+ name = localMachine.getHostName( );
+ }
+ catch ( java.net.UnknownHostException uhe )
+ {
+ System.out.println( "Error getting HostName" );
+ }
+
+ return name;
+ }
+
+ /**
+ * Connects the homes for the resources withe the topics for creation/destruction of resources.
+ * This way when the resource is created/destroyed the AdvertisementCapability
+ * notifications will be sent to subscribers.
+ *
+ * @param manageableResourceCreation
+ * @param manageableResourceDestruction
+ * @throws Exception
+ */
+ protected void addListenersToHomes( XmlBeansAdvertisementTopicImpl manageableResourceCreation,
+ XmlBeansAdvertisementTopicImpl manageableResourceDestruction )
+ throws Exception
+ {
+ InitialContext ctx = new InitialContext( );
+ ResourceadminHome aHome = (ResourceadminHome) ( ctx.lookup( ResourceadminHome.HOME_LOCATION ) );
+ String[] homes = aHome.getKnownHomes( );
+ for ( int i = 0; i < homes.length; i++ )
+ {
+ AbstractResourceHome absHome = (AbstractResourceHome) ctx.lookup( homes[i] );
+ absHome.addResourceCreationListener( manageableResourceCreation );
+ absHome.addResourceDestructionListener( manageableResourceDestruction );
+ }
+ }
+}
\ No newline at end of file
Added: incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/ResourceadminService.java
URL: http://svn.apache.org/viewcvs/incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/ResourceadminService.java?rev=191585&view=auto
==============================================================================
--- incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/ResourceadminService.java (added)
+++ incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/ResourceadminService.java Mon Jun 20 16:28:31 2005
@@ -0,0 +1,570 @@
+/*=============================================================================*
+ * 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.muse.example.resourceadmin;
+
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.addressing.XmlBeansEndpointReference;
+import org.apache.ws.muse.example.ExampleConstants;
+import org.apache.ws.muse.example.application.ApplicationHome;
+import org.apache.ws.muse.example.application.ApplicationResource;
+import org.apache.ws.muse.example.businessprocesstype.BusinessprocesstypeHome;
+import org.apache.ws.muse.example.businessprocesstype.BusinessprocesstypeResource;
+import org.apache.ws.muse.example.host.HostHome;
+import org.apache.ws.muse.example.host.HostResource;
+import org.apache.ws.muse.example.integrationserver.IntegrationserverHome;
+import org.apache.ws.muse.example.integrationserver.IntegrationserverResource;
+import org.apache.ws.muse.example.resourceadmin.properties.CreateParamsType;
+import org.apache.ws.muse.example.utils.ResourceKeyFactory;
+import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.impl.SimpleTypeResourceKey;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.xmlbeans.XmlObject;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.ReferencePropertiesType;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+/**
+ *
+ * @author Kinga Dziembowski
+ *
+ * This class should be generated ONCE (and not overwritten) to maintain user-added code.
+ * If there is a change to the WSDL, then the generated implemented interfaces
+ * (representing the "base" portTypes) will change, thus showing a compile error to the
+ * user.
+ *
+ * NOTE: This class is generated. However, it will not be overwritten by subsequent
+ * calls to the code generator.
+ *
+ */
+public class ResourceadminService
+ extends AbstractResourceadminService
+ implements ResourceadminCustomOperationsPortType
+{
+ /**
+ * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
+ */
+ public static final org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl SPEC_NAMESPACE_SET =
+ new org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl( );
+
+ /**
+ * A Namespace for 2004 addressing to compensate the wsdm spec inconsistency in usage of addressing namespace
+ *
+ */
+ public static final String ADRESSING_2004_08_NAMESPACE = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
+
+ /**
+ * Creates a new {@link ResourceadminService } object.
+ *
+ * @param resourceContext DOCUMENT_ME
+ */
+ public ResourceadminService( ResourceContext resourceContext )
+ {
+ super( resourceContext );
+ init( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws org.apache.ws.muse.example.resourceadmin.InvalidResourcePropertiesException DOCUMENT_ME
+ * @throws org.apache.ws.muse.example.resourceadmin.ResourceUnknownFaultException DOCUMENT_ME
+ * @throws org.apache.ws.muse.example.resourceadmin.CreateFaultException DOCUMENT_ME
+ * @throws CreateFaultException DOCUMENT_ME
+ */
+ public org.apache.ws.muse.example.resourceadmin.properties.CreateResponseDocument Create( org.apache.ws.muse.example.resourceadmin.properties.CreateDocument requestDoc )
+ throws org.apache.ws.muse.example.resourceadmin.InvalidResourcePropertiesException,
+ org.apache.ws.muse.example.resourceadmin.ResourceUnknownFaultException,
+ org.apache.ws.muse.example.resourceadmin.CreateFaultException
+ {
+ EndpointReference epr =
+ null;
+ org.apache.ws.muse.example.resourceadmin.properties.CreateResponseDocument responseDocument =
+ org.apache.ws.muse.example.resourceadmin.properties.CreateResponseDocument.Factory.newInstance( );
+ org.apache.ws.muse.example.resourceadmin.properties.CreateResponseDocument.CreateResponse response =
+ responseDocument.addNewCreateResponse( );
+ try
+ {
+ String reqType = requestDoc.getCreate( ).getCreateParams( ).getResourceType( );
+
+ if ( reqType.compareTo( "HostMachine" ) == 0 )
+ {
+ epr = createHost( getResourceContext( ),
+ requestDoc.getCreate( ).getCreateParams( ) );
+ }
+ else if ( reqType.compareTo( "BusinessProcess" ) == 0 )
+ {
+ epr = createBusinessProcess( getResourceContext( ),
+ requestDoc.getCreate( ).getCreateParams( ) );
+ }
+ else if ( reqType.compareTo( "EnterpriseApplication" ) == 0 )
+ {
+ epr =
+ createEnterpriseApplication( getResourceContext( ),
+ requestDoc.getCreate( ).getCreateParams( ) );
+ }
+ else if ( reqType.compareTo( "IntegrationServer" ) == 0 )
+ {
+ epr = createIntegretionServer( getResourceContext( ),
+ requestDoc.getCreate( ).getCreateParams( ) );
+ }
+
+ if ( epr instanceof XmlBeansEndpointReference )
+ {
+ XmlBeansEndpointReference eprType = (XmlBeansEndpointReference) epr;
+ XmlObject obj = eprType.getXmlObject( ADRESSING_2004_08_NAMESPACE );
+ if ( obj instanceof EndpointReferenceType )
+ {
+ response.setEndpointReference( (EndpointReferenceType) obj );
+ }
+ else
+ {
+ throw new Exception( "Expected type - EndpointReferenceType" );
+ }
+ }
+ else
+ {
+ throw new Exception( "no resourcetype specified" );
+ }
+ }
+ catch ( Exception e )
+ {
+ throw new CreateFaultException( getNamespaceSet( ), "Error when creating new resource " + e.toString( ) );
+ }
+
+ return responseDocument;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws org.apache.ws.muse.example.resourceadmin.InvalidResourcePropertiesException DOCUMENT_ME
+ * @throws org.apache.ws.muse.example.resourceadmin.DestroyResourceFaultException DOCUMENT_ME
+ * @throws org.apache.ws.muse.example.resourceadmin.ResourceUnknownFaultException DOCUMENT_ME
+ * @throws ResourceUnknownFaultException DOCUMENT_ME
+ */
+ public org.apache.ws.muse.example.resourceadmin.properties.DestroyResourceResponseDocument DestroyResource( org.apache.ws.muse.example.resourceadmin.properties.DestroyResourceDocument requestDoc )
+ throws org.apache.ws.muse.example.resourceadmin.InvalidResourcePropertiesException,
+ org.apache.ws.muse.example.resourceadmin.DestroyResourceFaultException,
+ org.apache.ws.muse.example.resourceadmin.ResourceUnknownFaultException
+ {
+ ResourceadminHome aResourceAdminHome =
+ (ResourceadminHome) getResourceHome( );
+ org.apache.ws.muse.example.resourceadmin.properties.DestroyResourceResponseDocument responseDocument =
+ org.apache.ws.muse.example.resourceadmin.properties.DestroyResourceResponseDocument.Factory.newInstance( );
+ org.apache.ws.muse.example.resourceadmin.properties.DestroyResourceResponseDocument.DestroyResourceResponse response =
+ responseDocument.addNewDestroyResourceResponse( );
+ try
+ {
+ Context initialContext = new InitialContext( );
+ ResourceadminHome aHome = (ResourceadminHome) getResourceHome( );
+ QName[] resourceIDQNames = aHome.getResourcesKeyNameQnames( );
+ String reqType =
+ requestDoc.getDestroyResource( ).getDestroyResourceParams( ).getResourceType( );
+ if ( !validateType( reqType ) )
+ {
+ throw new DestroyResourceFaultException( getNamespaceSet( ),
+ "Try to destroy Resource of unknown type " );
+ }
+
+ ReferencePropertiesType refProp =
+ requestDoc.getDestroyResource( ).getDestroyResourceParams( ).getEndpointReference( )
+ .getReferenceProperties( );
+
+ boolean found = false;
+ for ( int i = 0; i < resourceIDQNames.length; i++ )
+ {
+ XmlObject[] childElems = XmlBeanUtils.getChildElements( refProp, resourceIDQNames[i] );
+ if ( childElems.length > 0 )
+ {
+ XmlObject obj = childElems[0];
+ QName tag = XmlBeanUtils.getName( obj );
+ String value = XmlBeanUtils.getValue( obj );
+ SimpleTypeResourceKey aKey = ResourceKeyFactory.createKey( tag, value );
+ Map resources = aHome.getResources( );
+ if ( resources.containsKey( value ) )
+ {
+ found = true;
+ Resource resource = (Resource) resources.get( value );
+ if ( resource instanceof ApplicationResource )
+ {
+ ApplicationResource appResource = (ApplicationResource) resource;
+ ApplicationHome appHome =
+ (ApplicationHome) initialContext.lookup( ApplicationHome.HOME_LOCATION );
+ appHome.remove( aKey );
+ aResourceAdminHome.getResources( ).remove( appResource.getID( ) );
+ }
+ else if ( resource instanceof HostResource )
+ {
+ HostResource hostResource = (HostResource) resource;
+ HostHome hostHome = (HostHome) initialContext.lookup( HostHome.HOME_LOCATION );
+ hostHome.remove( aKey );
+ aResourceAdminHome.getResources( ).remove( hostResource.getID( ) );
+ }
+ else if ( resource instanceof IntegrationserverResource )
+ {
+ IntegrationserverResource isResource = (IntegrationserverResource) resource;
+ IntegrationserverHome isHome =
+ (IntegrationserverHome) initialContext.lookup( IntegrationserverHome.HOME_LOCATION );
+ isHome.remove( aKey );
+ aResourceAdminHome.getResources( ).remove( isResource.getID( ) );
+ }
+ else if ( resource instanceof BusinessprocesstypeResource )
+ {
+ BusinessprocesstypeResource bpResource = (BusinessprocesstypeResource) resource;
+ BusinessprocesstypeHome bpHome =
+ (BusinessprocesstypeHome) initialContext.lookup( BusinessprocesstypeHome.HOME_LOCATION );
+ bpHome.remove( aKey );
+ aResourceAdminHome.getResources( ).remove( bpResource.getID( ) );
+ }
+ else
+ {
+ throw new Exception( "The EPR is unregistered " );
+ }
+
+ break;
+ }
+ }
+ }
+
+ if ( !found )
+ {
+ throw new Exception( "Error finding Resource" );
+ }
+ }
+ catch ( Exception e )
+ {
+ throw new ResourceUnknownFaultException( getNamespaceSet( ),
+ "Error destroying resource " + e.toString( ) );
+ }
+
+ return responseDocument;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws org.apache.ws.muse.example.resourceadmin.RemoveRelationshipFaultException DOCUMENT_ME
+ * @throws org.apache.ws.muse.example.resourceadmin.ResourceUnknownFaultException DOCUMENT_ME
+ * @throws ResourceUnknownFaultException DOCUMENT_ME
+ */
+ public org.apache.ws.muse.example.resourceadmin.properties.RemoveRelationshipResponseDocument RemoveRelationship( org.apache.ws.muse.example.resourceadmin.properties.RemoveRelationshipDocument requestDoc )
+ throws org.apache.ws.muse.example.resourceadmin.RemoveRelationshipFaultException,
+ org.apache.ws.muse.example.resourceadmin.ResourceUnknownFaultException
+ {
+ org.apache.ws.muse.example.resourceadmin.properties.RemoveRelationshipResponseDocument responseDocument =
+ org.apache.ws.muse.example.resourceadmin.properties.RemoveRelationshipResponseDocument.Factory
+ .newInstance( );
+ org.apache.ws.muse.example.resourceadmin.properties.RemoveRelationshipResponseDocument.RemoveRelationshipResponse response =
+ responseDocument.addNewRemoveRelationshipResponse( );
+ try
+ {
+ ResourceadminHome aHome = (ResourceadminHome) getResourceHome( );
+ QName[] resourceIDQNames = aHome.getResourcesKeyNameQnames( );
+
+ // Assume that the first partici[pant in the relationship own the relationship
+ // then the remove relationship will be dispatched to the resource identified
+ // in the first participant.
+ ReferencePropertiesType refProp =
+ requestDoc.getRemoveRelationship( ).getRelationship( ).getParticipantArray( 0 )
+ .getManageabilityEndpointReferenceArray( 0 ).getReferenceProperties( );
+
+ boolean found = false;
+ for ( int i = 0; i < resourceIDQNames.length; i++ )
+ {
+ XmlObject[] childElems = XmlBeanUtils.getChildElements( refProp, resourceIDQNames[i] );
+ if ( childElems.length > 0 )
+ {
+ found = true;
+ XmlObject obj = childElems[0];
+ QName tag = XmlBeanUtils.getName( obj );
+ String value = XmlBeanUtils.getValue( obj );
+ SimpleTypeResourceKey aKey = ResourceKeyFactory.createKey( tag, value );
+
+ Map resources = aHome.getResources( );
+ if ( resources.containsKey( value ) )
+ {
+ Resource resource = (Resource) resources.get( value );
+ if ( resource instanceof ApplicationResource )
+ {
+ ApplicationResource appServer = (ApplicationResource) resource;
+ appServer.removeRelationship( requestDoc );
+ }
+ else if ( resource instanceof HostResource )
+ {
+ throw new Exception( "HostResource do not support Relationship Capability - cannot be contain relationships " );
+ }
+ else if ( resource instanceof IntegrationserverResource )
+ {
+ IntegrationserverResource integrationServer = (IntegrationserverResource) resource;
+ integrationServer.removeRelationship( requestDoc );
+ }
+ else if ( resource instanceof BusinessprocesstypeResource )
+ {
+ BusinessprocesstypeResource bpServer = (BusinessprocesstypeResource) resource;
+ bpServer.removeRelationship( requestDoc );
+ }
+ else
+ {
+ throw new Exception( "Paticipant is unregistered " );
+ }
+
+ break;
+ }
+ }
+ }
+
+ if ( !found )
+ {
+ throw new Exception( "Error finding Participant" );
+ }
+ }
+ catch ( Exception e )
+ {
+ throw new ResourceUnknownFaultException( getNamespaceSet( ),
+ "Error removing relationship " + e.toString( ) );
+ }
+
+ return responseDocument;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws org.apache.ws.muse.example.resourceadmin.ResourceUnknownFaultException DOCUMENT_ME
+ * @throws org.apache.ws.muse.example.resourceadmin.SetRelationshipFaultException DOCUMENT_ME
+ * @throws ResourceUnknownFaultException DOCUMENT_ME
+ */
+ public org.apache.ws.muse.example.resourceadmin.properties.SetRelationshipResponseDocument SetRelationship( org.apache.ws.muse.example.resourceadmin.properties.SetRelationshipDocument requestDoc )
+ throws org.apache.ws.muse.example.resourceadmin.ResourceUnknownFaultException,
+ org.apache.ws.muse.example.resourceadmin.SetRelationshipFaultException
+ {
+ org.apache.ws.muse.example.resourceadmin.properties.SetRelationshipResponseDocument responseDocument =
+ org.apache.ws.muse.example.resourceadmin.properties.SetRelationshipResponseDocument.Factory.newInstance( );
+ org.apache.ws.muse.example.resourceadmin.properties.SetRelationshipResponseDocument.SetRelationshipResponse response =
+ responseDocument.addNewSetRelationshipResponse( );
+ try
+ {
+ ResourceadminHome aHome = (ResourceadminHome) getResourceHome( );
+ QName[] resourceIDQNames = aHome.getResourcesKeyNameQnames( );
+ ReferencePropertiesType refProp =
+ requestDoc.getSetRelationship( ).getRelationshipFrom( ).getParticipant( )
+ .getManageabilityEndpointReferenceArray( 0 ).getReferenceProperties( );
+
+ boolean found = false;
+ for ( int i = 0; i < resourceIDQNames.length; i++ )
+ {
+ XmlObject[] childElems = XmlBeanUtils.getChildElements( refProp, resourceIDQNames[i] );
+ if ( childElems.length > 0 )
+ {
+ found = true;
+ XmlObject obj = childElems[0];
+ QName tag = XmlBeanUtils.getName( obj );
+ String value = XmlBeanUtils.getValue( obj );
+ SimpleTypeResourceKey aKey = ResourceKeyFactory.createKey( tag, value );
+
+ Map resources = aHome.getResources( );
+ if ( resources.containsKey( value ) )
+ {
+ Resource resource = (Resource) resources.get( value );
+ if ( resource instanceof ApplicationResource )
+ {
+ ApplicationResource appServer = (ApplicationResource) resource;
+ appServer.setRelationship( requestDoc );
+ }
+ else if ( resource instanceof HostResource )
+ {
+ throw new Exception( "HostResource do not support Relationship Capability - cannot be contain relationships " );
+ }
+ else if ( resource instanceof IntegrationserverResource )
+ {
+ IntegrationserverResource integrationServer = (IntegrationserverResource) resource;
+ integrationServer.setRelationship( requestDoc );
+ }
+ else if ( resource instanceof BusinessprocesstypeResource )
+ {
+ BusinessprocesstypeResource bpServer = (BusinessprocesstypeResource) resource;
+ bpServer.setRelationship( requestDoc );
+ }
+ else
+ {
+ throw new Exception( "Paticipant is unregistered " );
+ }
+
+ break;
+ }
+ }
+ }
+
+ if ( !found )
+ {
+ throw new Exception( "Error finding Participant" );
+ }
+ }
+ catch ( Exception e )
+ {
+ throw new ResourceUnknownFaultException( getNamespaceSet( ),
+ "Error setting relationship " + e.toString( ) );
+ }
+
+ return responseDocument;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param context DOCUMENT_ME
+ * @param createparams DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public EndpointReference createBusinessProcess( ResourceContext context,
+ CreateParamsType createparams )
+ throws Exception
+ {
+ Context initialContext = new InitialContext( );
+ BusinessprocesstypeHome home =
+ (BusinessprocesstypeHome) initialContext.lookup( BusinessprocesstypeHome.HOME_LOCATION );
+ BusinessprocesstypeResource resource = (BusinessprocesstypeResource) home.create( context, createparams );
+ ResourceadminHome aHome = (ResourceadminHome) getResourceHome( );
+ aHome.getResources( ).put( resource.getID( ),
+ resource );
+ return resource.getEndpointReference( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param context DOCUMENT_ME
+ * @param createparams DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public EndpointReference createEnterpriseApplication( ResourceContext context,
+ CreateParamsType createparams )
+ throws Exception
+ {
+ Context initialContext = new InitialContext( );
+ ApplicationHome home = (ApplicationHome) initialContext.lookup( ApplicationHome.HOME_LOCATION );
+ ApplicationResource resource = (ApplicationResource) home.create( context, createparams );
+ ResourceadminHome aHome = (ResourceadminHome) getResourceHome( );
+ aHome.getResources( ).put( resource.getID( ),
+ resource );
+ return resource.getEndpointReference( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param context DOCUMENT_ME
+ * @param createparams DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public EndpointReference createHost( ResourceContext context,
+ CreateParamsType createparams )
+ throws Exception
+ {
+ Context initialContext = new InitialContext( );
+ HostHome home = (HostHome) initialContext.lookup( HostHome.HOME_LOCATION );
+ HostResource resource = (HostResource) home.create( context, createparams );
+ ResourceadminHome aHome = (ResourceadminHome) getResourceHome( );
+ aHome.getResources( ).put( resource.getID( ),
+ resource );
+ return resource.getEndpointReference( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param context DOCUMENT_ME
+ * @param createparams DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public EndpointReference createIntegretionServer( ResourceContext context,
+ CreateParamsType createparams )
+ throws Exception
+ {
+ Context initialContext = new InitialContext( );
+ IntegrationserverHome home =
+ (IntegrationserverHome) initialContext.lookup( IntegrationserverHome.HOME_LOCATION );
+ IntegrationserverResource resource = (IntegrationserverResource) home.create( context, createparams );
+ ResourceadminHome aHome = (ResourceadminHome) getResourceHome( );
+ aHome.getResources( ).put( resource.getID( ),
+ resource );
+ return resource.getEndpointReference( );
+ }
+
+ /**
+ * Returns a collection of Spec Namespaces associated with this Service
+ *
+ * @return A NamespaceVersionHolder impl which represents the collection of spec namespaces
+ * associated with this service.
+ */
+ protected org.apache.ws.resource.properties.NamespaceVersionHolder getNamespaceSet( )
+ {
+ return SPEC_NAMESPACE_SET;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param aType DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected boolean validateType( String aType )
+ {
+ String[] knownTypes = ExampleConstants.getKnownResourceTypes( );
+ for ( int i = 0; i < knownTypes.length; i++ )
+ {
+ if ( knownTypes[i].compareTo( aType ) == 0 )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
\ No newline at end of file
Added: incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/Resourceadmin_deploy.wsdd
URL: http://svn.apache.org/viewcvs/incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/Resourceadmin_deploy.wsdd?rev=191585&view=auto
==============================================================================
--- incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/Resourceadmin_deploy.wsdd (added)
+++ incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/Resourceadmin_deploy.wsdd Mon Jun 20 16:28:31 2005
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<deployment xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+
+ <service name="resourceadmin" provider="java:WSRF" style="document" use="literal">
+
+ <wsdlFile>/wsdl/resourceadmin.wsdl</wsdlFile>
+
+ <requestFlow>
+ <handler type="java:org.apache.axis.handlers.JAXRPCHandler">
+ <parameter name="className" value="org.apache.axis.message.addressing.handler.AxisServerSideAddressingHandler" />
+ <parameter name="referencePropertyNames" value="*" />
+ </handler>
+ </requestFlow>
+
+ <responseFlow>
+ <handler type="java:org.apache.axis.handlers.JAXRPCHandler">
+ <parameter name="className" value="org.apache.axis.message.addressing.handler.AxisServerSideAddressingHandler" />
+ <parameter name="referencePropertyNames" value="*" />
+ </handler>
+ </responseFlow>
+
+ </service>
+
+</deployment>
Added: incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/Resourceadmin_jndi-config.xml
URL: http://svn.apache.org/viewcvs/incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/Resourceadmin_jndi-config.xml?rev=191585&view=auto
==============================================================================
--- incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/Resourceadmin_jndi-config.xml (added)
+++ incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/Resourceadmin_jndi-config.xml Mon Jun 20 16:28:31 2005
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+ <service name="resourceadmin">
+ <resource name="home" type="org.apache.ws.muse.example.resourceadmin.ResourceadminHome">
+ <resourceParams>
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.muse.example.resourceadmin.ResourceadminService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.muse.example.resourceadmin.ResourceadminResource</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/muse/example/resourceadmin</value>
+ </parameter>
+
+
+
+ </resourceParams>
+ </resource>
+ </service>
+
+</jndiConfig>
+
Added: incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/SetRelationshipFaultException.java
URL: http://svn.apache.org/viewcvs/incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/SetRelationshipFaultException.java?rev=191585&view=auto
==============================================================================
--- incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/SetRelationshipFaultException.java (added)
+++ incubator/muse/site/example/services/resourceadmin/src/java/org/apache/ws/muse/example/resourceadmin/SetRelationshipFaultException.java Mon Jun 20 16:28:31 2005
@@ -0,0 +1,60 @@
+/*=============================================================================*
+ * 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.muse.example.resourceadmin;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
+import org.apache.ws.resource.i18n.MessagesImpl;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.ws.util.i18n.Messages;
+import javax.xml.namespace.QName;
+
+/**
+ * DOCUMENT_ME
+ *
+ * @author Kinga Dziembowski
+ */
+public class SetRelationshipFaultException
+ extends AbstractBaseFaultException
+{
+ private static final Messages MSG = MessagesImpl.getInstance( );
+ private static final Log LOG = LogFactory.getLog( SetRelationshipFaultException.class );
+ private QName m_name;
+
+ /**
+ * Constructs a new SetRelationshipFaultException .
+ *
+ * @param namespaces
+ * @param faultString
+ */
+ public SetRelationshipFaultException( NamespaceVersionHolder namespaces,
+ String faultString )
+ {
+ super( namespaces, faultString );
+ m_name = new QName( "http://ws.apache.org/muse/example/resourceadmin", "SetRelationshipFaultException" );
+ }
+
+ /**
+ * Returns the element name for this base fault.
+ *
+ * @return the element name for this base fault
+ */
+ public QName getBaseFaultName( )
+ {
+ return m_name;
+ }
+}
\ No newline at end of file
Added: incubator/muse/site/example/services/resourceadmin/src/wsdl/resourceadmin.wsdl
URL: http://svn.apache.org/viewcvs/incubator/muse/site/example/services/resourceadmin/src/wsdl/resourceadmin.wsdl?rev=191585&view=auto
==============================================================================
--- incubator/muse/site/example/services/resourceadmin/src/wsdl/resourceadmin.wsdl (added)
+++ incubator/muse/site/example/services/resourceadmin/src/wsdl/resourceadmin.wsdl Mon Jun 20 16:28:31 2005
@@ -0,0 +1,656 @@
+<?xml version="1.0"?>
+
+<definitions name="ResourceAdmin"
+ targetNamespace="http://ws.apache.org/muse/example/resourceadmin"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://ws.apache.org/muse/example/resourceadmin"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
+ xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
+ xmlns:wsrlw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
+ xmlns:wsntw="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl"
+ xmlns:muws-p2-wsdl="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.wsdl"
+ xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
+ xmlns:resAdm-prop="http://ws.apache.org/muse/example/resourceadmin/properties" >
+
+ <!-- Created by Kinga Dziembowski -->
+ <import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
+ location="../spec/wsrf/WS-ResourceProperties-1_2-Draft_01.wsdl"/>
+
+ <import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
+ location="../spec/wsrf/WS-ResourceLifetime-1_2-Draft_01.wsdl"/>
+
+ <import namespace="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl"
+ location="../spec/wsn/WS-BaseNotification-1_2-Draft_01.wsdl"/>
+
+ <import namespace="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.wsdl"
+ location="../spec/wsdm/MUWS-Part2-1_0.wsdl"/>
+ <import namespace="http://schemas.xmlsoap.org/ws/2004/09/mex"
+ location="../spec/wsx/WS-MetadataExchange-2004_09.wsdl" />
+
+ <types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://ws.apache.org/muse/example/resourceadmin"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsrl="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
+ xmlns:wsbf="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd"
+ xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
+ xmlns:muws-p1-xs="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd"
+ xmlns:muws-p2-xs="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd"
+ xmlns:ws-ext="http://ws.apache.org/namespaces/muse/muws-ext-1.xsd"
+ xmlns:resAdm-prop="http://ws.apache.org/muse/example/resourceadmin/properties" >
+
+ <xsd:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd"
+ schemaLocation="../spec/wsrf/WS-BaseFaults-1_2-Draft_01.xsd"/>
+
+ <xsd:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
+ schemaLocation="../spec/wsrf/WS-ResourceLifetime-1_2-Draft_01.xsd"/>
+
+ <xsd:import namespace="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
+ schemaLocation="../spec/wsn/WS-BaseNotification-1_2-Draft_01.xsd"/>
+
+ <xsd:import namespace="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd"
+ schemaLocation="../spec/wsdm/MUWS-Part1-1_0.xsd"/>
+
+ <xsd:import namespace="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd"
+ schemaLocation="../spec/wsdm/MUWS-Part2-1_0.xsd"/>
+ <xsd:import namespace="http://ws.apache.org/namespaces/muse/muws-ext-1.xsd"
+ schemaLocation="../wsdl/muws-ext-1.xsd"/>
+ <xsd:import namespace="http://ws.apache.org/muse/example/resourceadmin/properties"
+ schemaLocation="../wsdl/resourceadmin.xsd"/>
+
+ <!-- *** Add an element definition here for each of your custom resource properties *** -->
+ <!-- *** e.g.: <element name="MyProperty" type="xsd:string" /> *** -->
+
+
+
+ <!-- Resource Properties Document Schema -->
+ <element name="ResourceAdminProperties">
+ <complexType>
+ <sequence>
+
+ <!-- *** If you wish to implement the wsrl:ScheduledResourceTermination portType,
+ uncomment the below two lines *** -->
+ <!--
+ <element ref="wsrl:CurrentTime" />
+ <element ref="wsrl:TerminationTime" />
+ -->
+
+ <!-- *** If you wish to implement the wsnt:NotificationProducer portType,
+ uncomment the below three lines *** -->
+
+ <element ref="wsnt:Topic" minOccurs="1" maxOccurs="unbounded" />
+ <element ref="wsnt:FixedTopicSet" />
+ <element ref="wsnt:TopicExpressionDialects" minOccurs="1" maxOccurs="unbounded" />
+
+ <!-- *** The ResourceId property is _required_ by the MUWS spec *** -->
+ <element ref="muws-p1-xs:ResourceId"/>
+
+ <!-- *** If you wish to implement the MUWS ManageabilityCharacteristics capability,
+ uncomment the below line *** -->
+
+ <element ref="muws-p1-xs:ManageabilityCapability" minOccurs="0" maxOccurs="unbounded"/>
+
+
+ <!-- *** If you wish to implement the MUWS CorrelatableProperties capability,
+ uncomment the below line *** -->
+ <!--
+ <element ref="muws-p1-xs:CorrelatableProperties" minOccurs="0" maxOccurs="unbounded"/>
+ -->
+
+ <!-- *** If you wish to implement the MUWS Description capability,
+ uncomment the below three lines *** -->
+
+ <element ref="muws-p2-xs:Caption" minOccurs="1" maxOccurs="1"/>
+ <element ref="muws-p2-xs:Description" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="muws-p2-xs:Version" minOccurs="0"/>
+
+
+ <!-- *** If you wish to implement the MUWS OperationalStatus capability,
+ uncomment the below line *** -->
+
+ <element ref="muws-p2-xs:OperationalStatus"/>
+
+
+ <!-- *** If you wish to implement the MUWS Metrics capability,
+ uncomment the below line *** -->
+
+ <element ref="muws-p2-xs:CurrentTime"/>
+
+
+ <!-- *** If you wish to implement the MUWS Relationships capability,
+ uncomment the below line *** -->
+ <!--
+ <element ref="muws-p2-xs:Relationship" minOccurs="0" maxOccurs="unbounded"/>
+ -->
+
+ <!-- SHARED PROPERTIES DEFINED muws-ext-1.xsd
+ Resource exposing this properties should add to the list returned by GetProperty for muws-p1-xs:ManageabilityCapability property, the string "http://ws.apache.org/namespaces/muse/capabilities/muws-ext-1". This signals that the resource support extended management capability.
+
+ -->
+
+
+ <element ref="ws-ext:ResourceType" minOccurs="1" maxOccurs="1" />
+ <element ref="ws-ext:ResourceHostname" minOccurs="1" maxOccurs="1" />
+
+ <!-- PROPERTIES DEFINED resourceadmin.xsd -->
+ <element ref="resAdm-prop:SupportedResources" minOccurs="1" maxOccurs="1" />
+ <element ref="resAdm-prop:Discovery" minOccurs="1" maxOccurs="1" />
+
+
+ <!-- *** Uncomment the below any element if you want to permit resource property elements
+ with arbitrary names (not generally recommended) *** -->
+ <!--
+ <any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/>
+ -->
+
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- *** Add element definitions for custom request/response/fault types here *** -->
+
+ </schema>
+ </types>
+
+
+ <!-- *** Add message definitions for custom request/response/fault types here *** -->
+
+ <!-- Create operation definitions -->
+
+ <message name="CreateRequest">
+ <part name="document" element="resAdm-prop:Create"/>
+ </message>
+
+ <message name="CreateResponse">
+ <part name="document" element="resAdm-prop:CreateResponse"/>
+ </message>
+
+ <message name="CreateFaultMessage">
+ <part name="document" element="resAdm-prop:CreateFault"/>
+ </message>
+
+ <!-- DestroyResourceResource operation definitions -->
+
+ <message name="DestroyResourceRequest">
+ <part name="document" element="resAdm-prop:DestroyResource"/>
+ </message>
+
+ <message name="DestroyResourceResponse">
+ <part name="document" element="resAdm-prop:DestroyResourceResponse"/>
+ </message>
+
+ <message name="DestroyResourceFaultMessage">
+ <part name="document" element="resAdm-prop:DestroyResourceFault"/>
+ </message>
+
+ <message name="InvalidResourceProperties">
+ <part name="document" element="resAdm-prop:InvalidResourceProperties"/>
+ </message>
+
+ <!-- definitions for custom operation SetRelationships -->
+
+ <message name="SetRelationshipRequest">
+ <part name="document" element="resAdm-prop:SetRelationship"/>
+ </message>
+
+ <message name="SetRelationshipResponse">
+ <part name="document" element="resAdm-prop:SetRelationshipResponse"/>
+ </message>
+
+ <message name="SetRelationshipFaultMessage">
+ <part name="document" element="resAdm-prop:SetRelationshipFault"/>
+ </message>
+
+ <!-- RemoveRelationship -->
+ <message name="RemoveRelationshipRequest">
+ <part name="document" element="resAdm-prop:RemoveRelationship"/>
+ </message>
+
+ <message name="RemoveRelationshipResponse">
+ <part name="document" element="resAdm-prop:RemoveRelationshipResponse"/>
+ </message>
+
+ <message name="RemoveRelationshipFaultMessage">
+ <part name="document" element="resAdm-prop:RemoveRelationshipFault"/>
+ </message>
+
+
+
+ <portType name="ResourceAdminPortType" wsrp:ResourceProperties="tns:ResourceAdminProperties">
+
+ <operation name="GetResourceProperty">
+ <input name="GetResourcePropertyRequest" message="wsrpw:GetResourcePropertyRequest"/>
+ <output name="GetResourcePropertyResponse" message="wsrpw:GetResourcePropertyResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+ <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+ </operation>
+
+ <!-- *** If you wish to implement the WSRP GetMultipleResourceProperties portType,
+ uncomment the below operation block *** -->
+
+ <operation name="GetMultipleResourceProperties">
+ <input name="GetMultipleResourcePropertiesRequest" message="wsrpw:GetMultipleResourcePropertiesRequest"/>
+ <output name="GetMultipleResourcePropertiesResponse" message="wsrpw:GetMultipleResourcePropertiesResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+ <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+ </operation>
+
+
+ <!-- *** If you wish to implement the WSRP SetResourceProperties portType,
+ uncomment the below operation block *** -->
+ <!--
+ <operation name="SetResourceProperties">
+ <input name="SetResourcePropertiesRequest" message="wsrpw:SetResourcePropertiesRequest"/>
+ <output name="SetResourcePropertiesResponse" message="wsrpw:SetResourcePropertiesResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+ <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+ <fault name="InvalidSetResourcePropertiesRequestContentFault" message="wsrpw:InvalidSetResourcePropertiesRequestContentFault"/>
+ <fault name="UnableToModifyResourcePropertyFault" message="wsrpw:UnableToModifyResourcePropertyFault"/>
+ <fault name="SetResourcePropertyRequestFailedFault" message="wsrpw:SetResourcePropertyRequestFailedFault"/>
+ </operation>
+ -->
+
+ <!-- *** If you wish to implement the WSRP QueryResourceProperties portType,
+ uncomment the below operation block *** -->
+
+ <operation name="QueryResourceProperties">
+ <input name="QueryResourcePropertiesRequest" message="wsrpw:QueryResourcePropertiesRequest"/>
+ <output name="QueryResourcePropertiesResponse" message="wsrpw:QueryResourcePropertiesResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+ <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+ <fault name="UnknownQueryExpressionDialectFault" message="wsrpw:UnknownQueryExpressionDialectFault"/>
+ <fault name="InvalidQueryExpressionFault" message="wsrpw:InvalidQueryExpressionFault"/>
+ <fault name="QueryEvaluationErrorFault" message="wsrpw:QueryEvaluationErrorFault"/>
+ </operation>
+
+
+ <!-- *** If you wish to implement the WSRL ImmediateResourceTermination portType,
+ uncomment the below operation block *** -->
+ <!--
+ <operation name="DestroyResource">
+ <input message="wsrlw:DestroyResourceRequest"/>
+ <output message="wsrlw:DestroyResourceResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrlw:ResourceUnknownFault"/>
+ <fault name="ResourceNotDestroyedFault" message="wsrlw:ResourceNotDestroyedFault"/>
+ </operation>
+ -->
+
+ <!-- *** If you wish to implement the WSRL ScheduledResourceTermination portType,
+ uncomment the below operation block *** -->
+ <!--
+ <operation name="SetTerminationTime">
+ <input message="wsrlw:SetTerminationTimeRequest"/>
+ <output message="wsrlw:SetTerminationTimeResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrlw:ResourceUnknownFault"/>
+ <fault name="UnableToSetTerminationTimeFault" message="wsrlw:UnableToSetTerminationTimeFault"/>
+ <fault name="TerminationTimeChangeRejectedFault" message="wsrlw:TerminationTimeChangeRejectedFault"/>
+ </operation>
+ -->
+
+ <!-- *** If you wish to implement the WSNT NotificationProducer portType,
+ uncomment the below two operation blocks *** -->
+
+ <operation name="Subscribe">
+ <input message="wsntw:SubscribeRequest" />
+ <output message="wsntw:SubscribeResponse" />
+ <fault name="ResourceUnknownFault" message="wsntw:ResourceUnknownFault" />
+ <fault name="SubscribeCreationFailedFault" message="wsntw:SubscribeCreationFailedFault" />
+ <fault name="TopicPathDialectUnknownFault" message="wsntw:TopicPathDialectUnknownFault" />
+ </operation>
+
+ <operation name="GetCurrentMessage">
+ <input message="wsntw:GetCurrentMessageRequest" />
+ <output message="wsntw:GetCurrentMessageResponse" />
+ <fault name="ResourceUnknownFault" message="wsntw:ResourceUnknownFault" />
+ <fault name="InvalidTopicExpressionFault" message="wsntw:InvalidTopicExpressionFault" />
+ <fault name="TopicNotSupportedFault" message="wsntw:TopicNotSupportedFault" />
+ <fault name="NoCurrentMessageOnTopicFault" message="wsntw:NoCurrentMessageOnTopicFault" />
+ </operation>
+
+
+ <!-- *** If you wish to implement the MUWS QueryRelationshipsByType operation,
+ uncomment the below operation block *** -->
+ <!--
+ <operation name="QueryRelationshipsByType">
+ <input message="muws-p2-wsdl:QueryRelationshipsByTypeRequest"/>
+ <output message="muws-p2-wsdl:QueryRelationshipsByTypeResponse"/>
+ </operation>
+ -->
+
+ <!-- *** Add an operation block here for each of your custom operations *** -->
+
+ <operation name="Create">
+ <input name="CreateRequest" message="tns:CreateRequest"/>
+ <output name="CreateResponse" message="tns:CreateResponse" />
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault" />
+ <fault name="CreateFault" message="tns:CreateFaultMessage" />
+ <fault name="InvalidResourceProperties" message="tns:InvalidResourceProperties"/>
+ </operation>
+
+ <!-- *** DestroyResource resource -->
+
+ <operation name="DestroyResource">
+ <input name="DestroyResourceRequest" message="tns:DestroyResourceRequest"/>
+ <output name="DestroyResourceResponse" message="tns:DestroyResourceResponse" />
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault" />
+ <fault name="DestroyResourceFault" message="tns:DestroyResourceFaultMessage" />
+ <fault name="InvalidResourceProperties" message="tns:InvalidResourceProperties"/>
+ </operation>
+
+
+ <!-- *** SetRelationship *** -->
+ <operation name="SetRelationship">
+ <input name="SetRelationshipRequest" message="tns:SetRelationshipRequest"/>
+ <output name="SetRelationshipResponse" message="tns:SetRelationshipResponse" />
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault" />
+ <fault name="SetRelationshipFault" message="tns:SetRelationshipFaultMessage" />
+ </operation>
+
+ <!-- *** RemoveRelationship *** -->
+ <operation name="RemoveRelationship">
+ <input name="RemoveRelationshipRequest" message="tns:RemoveRelationshipRequest"/>
+ <output name="RemoveRelationshipResponse" message="tns:RemoveRelationshipResponse" />
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault" />
+ <fault name="RemoveRelationshipFault" message="tns:RemoveRelationshipFaultMessage" />
+ </operation>
+
+
+ </portType>
+
+ <binding name="ResourceAdminSoapHttpBinding" type="tns:ResourceAdminPortType">
+
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <operation name="GetResourceProperty">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourcePropertyQNameFault">
+ <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+ </fault>
+ </operation>
+
+ <!-- *** If you wish to implement the WSRP GetMultipleResourceProperties portType,
+ uncomment the below operation block *** -->
+
+ <operation name="GetMultipleResourceProperties">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourcePropertyQNameFault">
+ <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+ </fault>
+ </operation>
+
+
+ <!-- *** If you wish to implement the WSRP SetResourceProperties portType,
+ uncomment the below operation block *** -->
+ <!--
+ <operation name="SetResourceProperties">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourcePropertyQNameFault">
+ <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+ </fault>
+ <fault name="UnableToModifyResourcePropertyFault">
+ <soap:fault name="UnableToModifyResourcePropertyFault" use="literal"/>
+ </fault>
+ <fault name="InvalidSetResourcePropertiesRequestContentFault">
+ <soap:fault name="InvalidSetResourcePropertiesRequestContentFault" use="literal"/>
+ </fault>
+ <fault name="SetResourcePropertyRequestFailedFault">
+ <soap:fault name="SetResourcePropertyRequestFailedFault" use="literal"/>
+ </fault>
+ </operation>
+ -->
+
+ <!-- *** If you wish to implement the WSRP QueryResourceProperties portType,
+ uncomment the below operation block *** -->
+
+ <operation name="QueryResourceProperties">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourcePropertyQNameFault">
+ <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+ </fault>
+ <fault name="UnknownQueryExpressionDialectFault">
+ <soap:fault name="UnknownQueryExpressionDialectFault" use="literal"/>
+ </fault>
+ <fault name="InvalidQueryExpressionFault">
+ <soap:fault name="InvalidQueryExpressionFault" use="literal"/>
+ </fault>
+ <fault name="QueryEvaluationErrorFault">
+ <soap:fault name="QueryEvaluationErrorFault" use="literal"/>
+ </fault>
+ </operation>
+
+
+ <!-- *** If you wish to implement the WSRL ImmediateResourceTermination portType,
+ uncomment the below operation block *** -->
+ <!--
+ <operation name="DestroyResource">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="ResourceNotDestroyedFault">
+ <soap:fault name="ResourceNotDestroyedFault" use="literal"/>
+ </fault>
+ </operation>
+ -->
+
+ <!-- *** If you wish to implement the WSRL ScheduledResourceTermination portType,
+ uncomment the below operation block *** -->
+ <!--
+ <operation name="SetTerminationTime">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="UnableToSetTerminationTimeFault">
+ <soap:fault name="UnableToSetTerminationTimeFault" use="literal"/>
+ </fault>
+ <fault name="TerminationTimeChangeRejectedFault">
+ <soap:fault name="TerminationTimeChangeRejectedFault" use="literal"/>
+ </fault>
+ </operation>
+ -->
+
+ <!-- *** If you wish to implement the WSNT NotificationProducer portType,
+ uncomment the below two operation blocks *** -->
+
+ <operation name="Subscribe">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="SubscribeCreationFailedFault">
+ <soap:fault name="SubscribeCreationFailedFault" use="literal"/>
+ </fault>
+ <fault name="TopicPathDialectUnknownFault">
+ <soap:fault name="TopicPathDialectUnknownFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="GetCurrentMessage">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="InvalidTopicExpressionFault">
+ <soap:fault name="InvalidTopicExpressionFault" use="literal"/>
+ </fault>
+ <fault name="TopicNotSupportedFault">
+ <soap:fault name="TopicPathDialectUnknownFault" use="literal"/>
+ </fault>
+ <fault name="NoCurrentMessageOnTopicFault">
+ <soap:fault name="NoCurrentMessageOnTopicFault" use="literal"/>
+ </fault>
+ </operation>
+
+
+ <!-- *** If you wish to implement the MUWS QueryRelationshipsByType operation,
+ uncomment the below operation block *** -->
+ <!--
+ <operation name="QueryRelationshipsByType">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ -->
+
+ <!-- *** Add an operation block here for each of your custom operations *** -->
+
+ <!-- Create operation for creatoin of Resources -->
+
+ <operation name="Create">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="CreateFault">
+ <soap:fault name="CreateFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourceProperties">
+ <soap:fault name="InvalidResourceProperties" use="literal"/>
+ </fault>
+
+ </operation>
+
+
+ <!-- DestroyResource operation for destruction of Resources -->
+
+ <operation name="DestroyResource">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="DestroyResourceFault">
+ <soap:fault name="DestroyResourceFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourceProperties">
+ <soap:fault name="InvalidResourceProperties" use="literal"/>
+ </fault>
+
+ </operation>
+
+ <!-- SetRelationship operation -->
+
+ <operation name="SetRelationship">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="SetRelationshipFault">
+ <soap:fault name="SetRelationshipFault" use="literal"/>
+ </fault>
+
+ </operation>
+
+ <operation name="RemoveRelationship">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="RemoveRelationshipFault">
+ <soap:fault name="RemoveRelationshipFault" use="literal"/>
+ </fault>
+
+ </operation>
+
+
+ </binding>
+
+ <service name="ResourceAdminService">
+ <!-- Note: the port name becomes the service name in the wsdd generated by Wsdl2Java -->
+ <!-- *** Change the port name and the soap:address location below to reflect the desired endpoint URL *** -->
+ <port name="resourceadmin" binding="tns:ResourceAdminSoapHttpBinding">
+ <soap:address location="http://localhost:8080/muse/services/resourceadmin" />
+ </port>
+ </service>
+
+</definitions>
Added: incubator/muse/site/example/soapclient.xml
URL: http://svn.apache.org/viewcvs/incubator/muse/site/example/soapclient.xml?rev=191585&view=auto
==============================================================================
--- incubator/muse/site/example/soapclient.xml (added)
+++ incubator/muse/site/example/soapclient.xml Mon Jun 20 16:28:31 2005
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+
+<project name="soapClient" default="sendRequest" basedir=".">
+
+ <property environment="env" />
+ <property file="build.properties" />
+
+ <!-- workaround for those IDEs that dont set ant.home as per the ant script -->
+ <property name="ant.home" value="env.ANT_HOME"/>
+
+
+ <target name="init">
+
+ <available file="${muse.webapp.dir}" type="dir" property="dist.muse.webapp.dir" value="${muse.webapp.dir}" />
+ <condition property="muse.webapp.dir" value="${dist.muse.webapp.dir}">
+ <isset property="dist.muse.webapp.dir"/>
+ </condition>
+ <fail unless="muse.webapp.dir" message="webapp dir wsdm does not exist." />
+ <echo>Using webapp dir: ${muse.webapp.dir}</echo>
+
+ <path id="wsdm.classpath.id">
+ <pathelement location="${muse.webapp.dir}/WEB-INF/classes" />
+ <fileset dir="${muse.webapp.dir}/WEB-INF/lib" includes="*.jar" />
+ <pathelement location="${activation.jar}" />
+ <pathelement location="${mail.jar}" />
+ </path>
+ <property name="wsdm.classpath" refid="wsdm.classpath.id" />
+
+ </target>
+
+ <target name="sendRequest"
+ depends="init"
+ description="sends a SOAP request">
+
+ <fail unless="url" message="Please set the url property via -Durl=... when invoking this script." />
+ <fail unless="xml" message="Please set the xml property via -Dxml=... when invoking this script." />
+ <echo>Reading SOAP request from: ${xml} ,,,</echo>
+ <available file="${xml}" property="xml.exists" />
+ <fail unless="xml.exists" message="The specified request XML file ${xml} does not exist." />
+ <available file="${xml}" type="file" property="xml.is.file" />
+ <fail unless="xml.is.file" message="The specified request XML file ${xml} exists but is not a file." />
+
+ <echo>Sending SOAP request to ${url} ...</echo>
+ <echo />
+ <echo>========================== REQUEST ============================</echo>
+ <concat><path><pathelement location="${xml}" /></path></concat>
+ <echo />
+ <echo>========================== RESPONSE ============================</echo>
+ <taskdef name="soapClient" classname="org.apache.ws.util.soap.SoapClientTask" classpath="${wsdm.classpath}" />
+ <soapClient serviceURL="${url}" requestFile="${xml}" soapAction="${action}" />
+
+ </target>
+
+ <target name="usage">
+ <java classname="org.apache.tools.ant.Main">
+ <arg value="-buildfile" />
+ <arg value="${ant.file}" />
+ <arg value="-projecthelp" />
+ </java>
+ </target>
+
+</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org