You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by wi...@apache.org on 2005/09/30 20:14:57 UTC
svn commit: r292825 - in /webservices/muse/trunk/client/src: java/
java/org/apache/ws/client/muse/client/
java/org/apache/ws/client/muse/client/impl/
java/org/apache/ws/client/muse/client/impl/exceptions/
java/org/apache/ws/client/muse/client/impl/noti...
Author: wire
Date: Fri Sep 30 11:14:47 2005
New Revision: 292825
URL: http://svn.apache.org/viewcvs?rev=292825&view=rev
Log:
Added apache header to files and Changed public interface of subscriptions to SubscriptionManager
Added:
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SubscriptionManagerImpl.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SubscriptionManager.java
Modified:
webservices/muse/trunk/client/src/java/Sample2.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/ManageableResource.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/NotificationConsumer.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/ManageableResourceImpl.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/exceptions/UnexpectedServerResponseException.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/ChangeNotificationImpl.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/HttpHeader.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotificationImpl.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceImpl.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/QueryImpl.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SituationImpl.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/TopicExpressionImpl.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ResourceStub.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ServiceStub.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/ChangeNotification.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Notification.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Query.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SetPropertiesRequest.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Situation.java
webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/TopicExpression.java
webservices/muse/trunk/client/src/test/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceTest.java
Modified: webservices/muse/trunk/client/src/java/Sample2.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/Sample2.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/Sample2.java (original)
+++ webservices/muse/trunk/client/src/java/Sample2.java Fri Sep 30 11:14:47 2005
@@ -16,6 +16,7 @@
import org.apache.ws.client.muse.client.model.ChangeNotification;
import org.apache.ws.client.muse.client.model.Notification;
import org.apache.ws.client.muse.client.model.Situation;
+import org.apache.ws.client.muse.client.model.SubscriptionManager;
import org.apache.ws.client.muse.client.model.TopicExpression;
import org.apache.xmlbeans.XmlException;
@@ -29,7 +30,7 @@
private URL eprURL;
- private ManageableResource subscription;
+ private SubscriptionManager subscription;
public Sample2() {
super();
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/ManageableResource.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/ManageableResource.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/ManageableResource.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/ManageableResource.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client;
import java.io.IOException;
@@ -10,14 +25,13 @@
import org.apache.ws.addressing.EndpointReference;
import org.apache.ws.addressing.XmlBeansEndpointReference;
-import org.apache.ws.client.muse.client.impl.ManageableResourceImpl;
import org.apache.ws.client.muse.client.impl.exceptions.FaultException;
import org.apache.ws.client.muse.client.impl.exceptions.UnexpectedServerResponseException;
import org.apache.ws.client.muse.client.impl.notification.NotifyableResourceImpl;
-import org.apache.ws.client.muse.client.impl.wsrf.SetPropertiesRequestImpl;
import org.apache.ws.client.muse.client.model.Notification;
import org.apache.ws.client.muse.client.model.Query;
import org.apache.ws.client.muse.client.model.SetPropertiesRequest;
+import org.apache.ws.client.muse.client.model.SubscriptionManager;
import org.apache.ws.client.muse.client.model.TopicExpression;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
@@ -195,7 +209,7 @@
/* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.Temp#subscribe(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl, org.apache.ws.addressing.XmlBeansEndpointReference)
*/
- public abstract ManageableResource subscribe(TopicExpression topic,
+ public abstract SubscriptionManager subscribe(TopicExpression topic,
XmlBeansEndpointReference consumerReference)
throws URISyntaxException, IOException, XmlException,
UnexpectedServerResponseException, FaultException;
@@ -203,7 +217,7 @@
/* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.Temp#subscribe(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl, org.apache.ws.addressing.XmlBeansEndpointReference, java.util.Calendar, boolean)
*/
- public abstract ManageableResource subscribe(TopicExpression topic,
+ public abstract SubscriptionManager subscribe(TopicExpression topic,
XmlBeansEndpointReference consumerReference,
Calendar terminationTime, boolean notify)
throws URISyntaxException, IOException, XmlException,
@@ -212,7 +226,7 @@
/* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.Temp#subscribe(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl[], org.apache.ws.addressing.XmlBeansEndpointReference, java.util.Calendar, boolean, org.apache.ws.client.muse.client.impl.notification.QueryImpl, org.apache.ws.client.muse.client.impl.notification.QueryImpl, org.apache.xmlbeans.XmlObject)
*/
- public abstract ManageableResource subscribe(
+ public abstract SubscriptionManager subscribe(
TopicExpression[] topics,
XmlBeansEndpointReference consumerReference,
Calendar terminationTime, boolean useNotify,
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/NotificationConsumer.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/NotificationConsumer.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/NotificationConsumer.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/NotificationConsumer.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client;
import java.io.IOException;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/ManageableResourceImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/ManageableResourceImpl.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/ManageableResourceImpl.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/ManageableResourceImpl.java Fri Sep 30 11:14:47 2005
@@ -272,7 +272,7 @@
cursor.setTextValue("/");
cursor.dispose();
- XmlObject parts = rs.sendRequest(queryDocument,"http://queryresourcepropertydocument","M");
+ XmlObject parts = rs.sendRequest(queryDocument,"http://queryresourcepropertydocument");
if(!(parts instanceof QueryResourcePropertiesResponseDocument.QueryResourcePropertiesResponse))
throw new UnexpectedServerResponseException("Expected QueryResourcePropertiesResponseDocument but received "+parts.getClass().getName());
@@ -310,7 +310,7 @@
}
//Now send the request
- XmlObject parts = rs.sendRequest(gmpDoc,"http://getmultipleresourcepropertydocument","M");
+ XmlObject parts = rs.sendRequest(gmpDoc,"http://getmultipleresourcepropertydocument");
if(!(parts instanceof GetMultipleResourcePropertiesResponseDocumentImpl.GetMultipleResourcePropertiesResponseImpl))
throw new UnexpectedServerResponseException("Expected GetMultipleResourcePropertiesResponseDocumentImpl but received "+parts.getClass().getName());
@@ -412,7 +412,7 @@
cursor.setTextValue(xpathExp);
cursor.dispose();
- XmlObject parts = rs.sendRequest(queryDocument,"http://queryresourcepropertydocument","M");
+ XmlObject parts = rs.sendRequest(queryDocument,"http://queryresourcepropertydocument");
if(parts instanceof FaultImpl)
throw new FaultException(parts.toString());
if(!(parts instanceof QueryResourcePropertiesResponseDocument.QueryResourcePropertiesResponse))
@@ -561,7 +561,7 @@
validateXmlBean(setPropsDocument);
- XmlObject parts = rs.sendRequest(setPropsDocument,"http://docs.oasis-open.org/wsrf/2004/06/WS-ResourceProperties/SetResourceProperties","M");
+ XmlObject parts = rs.sendRequest(setPropsDocument,"http://docs.oasis-open.org/wsrf/2004/06/WS-ResourceProperties/SetResourceProperties");
if(parts instanceof FaultImpl)
throw new FaultException(parts.toString());
if(!(parts instanceof SetResourcePropertiesResponseDocumentImpl.SetResourcePropertiesResponseImpl))
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/exceptions/UnexpectedServerResponseException.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/exceptions/UnexpectedServerResponseException.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/exceptions/UnexpectedServerResponseException.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/exceptions/UnexpectedServerResponseException.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.impl.exceptions;
public class UnexpectedServerResponseException extends Exception {
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/ChangeNotificationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/ChangeNotificationImpl.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/ChangeNotificationImpl.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/ChangeNotificationImpl.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.impl.notification;
import java.util.ArrayList;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/HttpHeader.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/HttpHeader.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/HttpHeader.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/HttpHeader.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.impl.notification;
import java.util.HashMap;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotificationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotificationImpl.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotificationImpl.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotificationImpl.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.impl.notification;
import java.util.Calendar;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceImpl.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceImpl.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceImpl.java Fri Sep 30 11:14:47 2005
@@ -33,6 +33,7 @@
import org.apache.ws.client.muse.client.impl.exceptions.UnexpectedServerResponseException;
import org.apache.ws.client.muse.client.model.Notification;
import org.apache.ws.client.muse.client.model.Query;
+import org.apache.ws.client.muse.client.model.SubscriptionManager;
import org.apache.ws.client.muse.client.model.TopicExpression;
import org.apache.ws.muws.v1_0.impl.advertiser.ResourceAdvertiserPropertyQNames;
import org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType;
@@ -50,11 +51,9 @@
import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.impl.TopicExpressionTypeImpl;
import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.impl.SubscribeResponseDocumentImpl.SubscribeResponseImpl;
import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyDocument;
-import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyDocument.Destroy;
import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.impl.DestroyResponseDocumentImpl;
import org.w3.x2003.x05.soapEnvelope.impl.FaultImpl;
-// TODO Support Preconditions and selectors and Policies
-// TODO deal with nil=true on subscription durations
+
public class NotifyableResourceImpl extends ManageableResourceImpl implements ManageableResource {
public NotifyableResourceImpl(EndpointReference epr)
@@ -73,9 +72,6 @@
}
/* (non-Javadoc)
- * @see org.apache.ws.client.muse.client.impl.notification.Temp#getTopics()
- */
- /* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.NotifyableResource#getTopics()
*/
public TopicExpression[] getTopics() throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException{
@@ -94,9 +90,6 @@
}
/* (non-Javadoc)
- * @see org.apache.ws.client.muse.client.impl.notification.Temp#isFixedTopicSet()
- */
- /* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.NotifyableResource#isFixedTopicSet()
*/
public boolean isFixedTopicSet() throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException{
@@ -104,9 +97,6 @@
}
/* (non-Javadoc)
- * @see org.apache.ws.client.muse.client.impl.notification.Temp#getTopicExpressionDialects()
- */
- /* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.NotifyableResource#getTopicExpressionDialects()
*/
public String[] getTopicExpressionDialects() throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException{
@@ -124,36 +114,27 @@
}
/* (non-Javadoc)
- * @see org.apache.ws.client.muse.client.impl.notification.Temp#subscribe(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl, org.apache.ws.addressing.XmlBeansEndpointReference)
- */
- /* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.NotifyableResource#subscribe(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl, org.apache.ws.addressing.XmlBeansEndpointReference)
*/
- public ManageableResource subscribe(TopicExpression topic,
+ public SubscriptionManager subscribe(TopicExpression topic,
XmlBeansEndpointReference consumerReference) throws URISyntaxException, IOException, XmlException, UnexpectedServerResponseException, FaultException{
TopicExpression[] topics={topic};
return subscribe(topics,consumerReference,null,false,null,null,null);
}
/* (non-Javadoc)
- * @see org.apache.ws.client.muse.client.impl.notification.Temp#subscribe(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl, org.apache.ws.addressing.XmlBeansEndpointReference, java.util.Calendar, boolean)
- */
- /* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.NotifyableResource#subscribe(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl, org.apache.ws.addressing.XmlBeansEndpointReference, java.util.Calendar, boolean)
*/
- public ManageableResource subscribe(TopicExpression topic,
+ public SubscriptionManager subscribe(TopicExpression topic,
XmlBeansEndpointReference consumerReference,Calendar terminationTime,boolean notify) throws URISyntaxException, IOException, XmlException, UnexpectedServerResponseException, FaultException{
TopicExpression[] topics={topic};
return subscribe(topics,consumerReference,terminationTime,notify,null,null,null);
}
/* (non-Javadoc)
- * @see org.apache.ws.client.muse.client.impl.notification.Temp#subscribe(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl[], org.apache.ws.addressing.XmlBeansEndpointReference, java.util.Calendar, boolean, org.apache.ws.client.muse.client.impl.notification.QueryImpl, org.apache.ws.client.muse.client.impl.notification.QueryImpl, org.apache.xmlbeans.XmlObject)
- */
- /* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.NotifyableResource#subscribe(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl[], org.apache.ws.addressing.XmlBeansEndpointReference, java.util.Calendar, boolean, org.apache.ws.client.muse.client.impl.notification.QueryImpl, org.apache.ws.client.muse.client.impl.notification.QueryImpl, org.apache.xmlbeans.XmlObject)
*/
- public ManageableResource subscribe(TopicExpression[] topics,
+ public SubscriptionManager subscribe(TopicExpression[] topics,
XmlBeansEndpointReference consumerReference,Calendar terminationTime,boolean useNotify,
Query precondition,Query selector, XmlObject policy)
throws URISyntaxException, IOException, XmlException, UnexpectedServerResponseException, FaultException{
@@ -188,7 +169,7 @@
// Send request
- XmlObject response = rs.sendRequest(subscribeDocument,"http://Subscribe","M");
+ XmlObject response = rs.sendRequest(subscribeDocument,"http://Subscribe");
if(!(response instanceof SubscribeResponseDocumentImpl.SubscribeResponseImpl)){
throw new UnexpectedServerResponseException(
"Server returned either an unrecognizable response or no response at all. Expected SubscribeResponseDocument but found "+response.getClass().getName());
@@ -197,14 +178,11 @@
// return newply created resource describing the subscription
SubscribeResponseDocumentImpl.SubscribeResponseImpl subscribeResponse=(SubscribeResponseImpl) response;
org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType subscriptionEpr = subscribeResponse.getSubscriptionReference();
- return new NotifyableResourceImpl(new XmlBeansEndpointReference(subscriptionEpr)); // change this later
+ return new SubscriptionManagerImpl(new XmlBeansEndpointReference(subscriptionEpr)); // change this later
}
/* (non-Javadoc)
- * @see org.apache.ws.client.muse.client.impl.notification.Temp#getCurrentMessage(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl)
- */
- /* (non-Javadoc)
* @see org.apache.ws.client.muse.client.impl.notification.NotifyableResource#getCurrentMessage(org.apache.ws.client.muse.client.impl.notification.TopicExpressionImpl)
*/
public Notification getCurrentMessage(TopicExpression topic) throws URISyntaxException, IOException, XmlException, UnexpectedServerResponseException, FaultException{
@@ -217,7 +195,7 @@
XmlBeanUtils.setValueAsQName(tm,topic.getName());
// Send request
- XmlObject parts = rs.sendRequest(cmd,"http://GetCurrentMessage","M");
+ XmlObject parts = rs.sendRequest(cmd,"http://GetCurrentMessage");
// Process response
if(!(parts instanceof GetCurrentMessageResponseDocument.GetCurrentMessageResponse))
@@ -234,7 +212,7 @@
DestroyDocument destroyDocument=DestroyDocument.Factory.newInstance();
destroyDocument.addNewDestroy();
- XmlObject response = rs.sendRequest(destroyDocument,"http://Destroy","M");
+ XmlObject response = rs.sendRequest(destroyDocument,"http://Destroy");
if(!(response instanceof FaultImpl)){
throw new FaultException(
response.xmlText());
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/QueryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/QueryImpl.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/QueryImpl.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/QueryImpl.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.impl.notification;
import org.apache.ws.client.muse.client.model.Query;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SituationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SituationImpl.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SituationImpl.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SituationImpl.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.impl.notification;
import java.util.Calendar;
@@ -5,10 +20,8 @@
import javax.xml.namespace.QName;
import org.apache.ws.client.muse.client.impl.exceptions.UnexpectedServerResponseException;
-import org.apache.ws.client.muse.client.model.Notification;
import org.apache.ws.client.muse.client.model.Situation;
import org.apache.ws.util.XmlBeanUtils;
-import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.impl.ManagementEventTypeImpl;
import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.SituationCategoryType;
Added: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SubscriptionManagerImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SubscriptionManagerImpl.java?rev=292825&view=auto
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SubscriptionManagerImpl.java (added)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/SubscriptionManagerImpl.java Fri Sep 30 11:14:47 2005
@@ -0,0 +1,124 @@
+/*=============================================================================*
+ * 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.client.muse.client.impl.notification;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Calendar;
+
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.client.muse.client.model.Query;
+import org.apache.ws.client.muse.client.model.SubscriptionManager;
+import org.apache.ws.client.muse.client.model.TopicExpression;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+
+public class SubscriptionManagerImpl extends NotifyableResourceImpl implements SubscriptionManager {
+
+ public SubscriptionManagerImpl(EndpointReference epr) throws MalformedURLException {
+ super(epr);
+ }
+
+ public SubscriptionManagerImpl(String txt) throws MalformedURLException, XmlException, IOException {
+ super(txt);
+ }
+
+ public SubscriptionManagerImpl(URL url) throws MalformedURLException, XmlException, IOException {
+ super(url);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#getConsumerReference()
+ */
+ public EndpointReference getConsumerReference(){
+ return epr;
+ }
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#getTopicExpression()
+ */
+ public TopicExpression getTopicExpression(){
+ return null;}
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#isUseNotify()
+ */
+ public boolean isUseNotify(){
+ return false;
+ }
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#getPrecondition()
+ */
+ public Query getPrecondition(){
+ return null;
+ }
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#getSelector()
+ */
+ public Query getSelector(){
+ return null;
+ }
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#getSubscriptionPolicy()
+ */
+ public XmlObject getSubscriptionPolicy(){
+ return null;
+ }
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#getCreationTime()
+ */
+ public Calendar getCreationTime(){
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#setConsumerReference(org.apache.ws.addressing.EndpointReference)
+ */
+ public void setConsumerReference(EndpointReference reference){}
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#setTopicExpression(org.apache.ws.client.muse.client.model.TopicExpression)
+ */
+ public void setTopicExpression(TopicExpression topicExpression){}
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#setUseNotify(boolean)
+ */
+ public void setUseNotify(boolean use){}
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#setPrecondition(org.apache.ws.client.muse.client.model.Query)
+ */
+ public void setPrecondition(Query precondition){}
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#setSelector(org.apache.ws.client.muse.client.model.Query)
+ */
+ public void setSelector(Query selector){}
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#setSubscriptionPolicy(org.apache.xmlbeans.XmlObject)
+ */
+ public void setSubscriptionPolicy(XmlObject policy){}
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#setCreationTime(java.util.Calendar)
+ */
+ public void setCreationTime(Calendar subsciptionTime){}
+
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#pauseSubscription()
+ */
+ public void pauseSubscription(){}
+ /* (non-Javadoc)
+ * @see org.apache.ws.client.muse.client.impl.notification.SubscriptionManager#resumeSubscription()
+ */
+ public void resumeSubscription(){}
+
+}
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/TopicExpressionImpl.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/TopicExpressionImpl.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/TopicExpressionImpl.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/notification/TopicExpressionImpl.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.impl.notification;
import javax.xml.namespace.QName;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ResourceStub.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ResourceStub.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ResourceStub.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ResourceStub.java Fri Sep 30 11:14:47 2005
@@ -56,233 +56,237 @@
/**
* A stub for a WSDM Resource.
*/
-public class ResourceStub extends Observable
-{
- private static Log LOG=LogFactory.getLog(ResourceStub.class);
-
-
- static final boolean DEBUG = false;//Boolean.getBoolean( "debug" );
-
- private EndpointReference m_epr;
- private EndpointReference m_epr2003;
- private EndpointReference m_epr2004;
-
- public static boolean USE_WRAPPED_NOTIFICATIONS = Boolean.valueOf(System.getProperty("wrapped_notifications", "true")).booleanValue();
-
- public ResourceStub( EndpointReference epr )
- {
- XmlBeansEndpointReference xBeansEpr=(XmlBeansEndpointReference)epr;
- m_epr = epr;
- XmlObject eprXBean = ((XmlObjectWrapper)m_epr).getXmlObject();
- if ( eprXBean.schemaType().getName().getNamespaceURI().equals( Constants.NS_URI_ADDRESSING_2003_03 ) )
- {
- m_epr2003=m_epr;
- m_epr2004=new XmlBeansEndpointReference((org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType)xBeansEpr.getXmlObject(org.apache.ws.addressing.v2004_08_10.AddressingConstants.NSURI_ADDRESSING_SCHEMA));
-
- } else {
- m_epr2004=m_epr;
- m_epr2003=new XmlBeansEndpointReference((org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType)xBeansEpr.getXmlObject(org.apache.ws.addressing.v2003_03.AddressingConstants.NSURI_ADDRESSING_SCHEMA));
- }
- }
-
- public XmlObject[] getResourceProperty( QName propName ) throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException
- {
- GetResourcePropertyDocument requestDoc = GetResourcePropertyDocument.Factory.newInstance();
-
- requestDoc.setGetResourceProperty( propName );
- XmlObject response = sendRequest( requestDoc, "http://xyz.com/action/GetResourceProperty","P" );
- if ( ! ( response instanceof GetResourcePropertyResponseDocument.GetResourcePropertyResponse ) )
- {
- throw new FaultException( response.toString() );
- }
- return XmlBeanUtils.getChildElements( response );
- }
-
- public void updateResourceProperty( XmlObject[] propElems ) throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException
- {
- 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","U" );
- if ( ! ( response instanceof SetResourcePropertiesResponseDocument.SetResourcePropertiesResponse ) )
- {
- throw new FaultException( response.toString() );
- }
- }
-
- public EndpointReference subscribe( String consumerURL, QName topic,long duration ) throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException
- {
- SubscribeDocument requestDoc = SubscribeDocument.Factory.newInstance();
- SubscribeDocument.Subscribe subscribe = requestDoc.addNewSubscribe();
- subscribe.setUseNotify(USE_WRAPPED_NOTIFICATIONS);
- Calendar instance = Calendar.getInstance();
- instance.setTimeInMillis(instance.getTimeInMillis() + duration);
- 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","S" );
- if ( ! ( response instanceof SubscribeResponseDocument.SubscribeResponse ) )
- {
- throw new FaultException( response.toString() );
- }
- SubscribeResponseDocument.SubscribeResponse subscribeResponse = (SubscribeResponseDocument.SubscribeResponse) response;
- return new XmlBeansEndpointReference( subscribeResponse.getSubscriptionReference() );
-
- }
-
- public void destroySubscription( ) throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException
- {
- DestroyDocument requestDoc = DestroyDocument.Factory.newInstance();
- requestDoc.addNewDestroy();
- XmlObject response = sendRequest( requestDoc, "http://xyz.com/action/Destroy","D" );
- if ( ! ( response instanceof DestroyResponseDocumentImpl.DestroyResponseImpl) )
- {
- throw new FaultException( response.toString() );
- }
- }
-
- public EndpointReference subscribe( String consumerURL, QName topic ) throws FaultException, URISyntaxException, IOException, XmlException, UnexpectedServerResponseException
- {
- return subscribe( consumerURL, topic,7200000);
- }
-
- private EnvelopeDocument createEnvelope()
- {
- EnvelopeDocument envelopeDoc = EnvelopeDocument.Factory.newInstance();
- Envelope envelope = envelopeDoc.addNewEnvelope();
- envelope.addNewHeader();
- envelope.addNewBody();
- return envelopeDoc;
- }
-
- public XmlObject sendRequest( XmlObject requestDoc, String action ,String type ) throws URISyntaxException, IOException, XmlException, UnexpectedServerResponseException, FaultException
- {
- // Hack for internal network
- String addr=m_epr.getAddress();
- //addr=addr.replaceAll("192\\.168\\.0\\.20","12.35.246.160");
-
- EnvelopeDocument requestEnvelopeDoc = createEnvelope();
- Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
- addAddressingHeaders( requestEnvelope.getHeader(), action );
- XmlBeanUtils.addChildElement( requestEnvelope.getBody(), requestDoc );
- URL endpointURL = new URL( addr );//m_epr.getAddress()
- URI actionURI = new URI( action );
- LOG.debug( "Sending request: ---------------------------- \n" + requestEnvelopeDoc );
- String response = SoapClient.sendRequest( endpointURL, requestEnvelopeDoc.newInputStream(), actionURI );
- LOG.debug( "---------------------------------------- ");
- setChanged();
- XmlOptions xmlOpts = new XmlOptions().setSaveOuter();
- xmlOpts.setSavePrettyPrint();
-
- //notifyObservers(new WcmMessage("<?xml version=\"1.0\" encoding=\"UTF8\" ?>"+requestEnvelopeDoc.xmlText(xmlOpts), response,type));
- EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
- LOG.debug( "Received response: -------------------------- \n" + responseEnvelopeDoc );
- LOG.debug( "---------------------------------------- ");
- Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
- XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements( responseEnvelope.getBody() );
- if ( responseBodyElems.length == 0 )
- {
- throw new UnexpectedServerResponseException();
- }
- else
- {
- if(responseBodyElems[0] instanceof FaultImpl)
- throw new FaultException(responseBodyElems[0].xmlText());
- return responseBodyElems[0];
- }
- }
-
- /**
- * All resource proerpties request must you 2003 addressing
- * @param header
- * @param action
- */
- 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]);
- }
- }
- }
-
- private void addAddressingHeadersOld( 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]);
- }
- }
- }
+public class ResourceStub extends Observable {
+ private static Log LOG = LogFactory.getLog(ResourceStub.class);
+
+ static final boolean DEBUG = false;
+
+ 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, URISyntaxException, IOException,
+ XmlException, UnexpectedServerResponseException {
+ GetResourcePropertyDocument requestDoc = GetResourcePropertyDocument.Factory
+ .newInstance();
+
+ requestDoc.setGetResourceProperty(propName);
+ XmlObject response = sendRequest(requestDoc,
+ "http://xyz.com/action/GetResourceProperty");
+ if (!(response instanceof GetResourcePropertyResponseDocument.GetResourcePropertyResponse)) {
+ throw new FaultException(response.toString());
+ }
+ return XmlBeanUtils.getChildElements(response);
+ }
+
+ public void updateResourceProperty(XmlObject[] propElems)
+ throws FaultException, URISyntaxException, IOException,
+ XmlException, UnexpectedServerResponseException {
+ 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,
+ long duration) throws FaultException, URISyntaxException,
+ IOException, XmlException, UnexpectedServerResponseException {
+ SubscribeDocument requestDoc = SubscribeDocument.Factory.newInstance();
+ SubscribeDocument.Subscribe subscribe = requestDoc.addNewSubscribe();
+ subscribe.setUseNotify(USE_WRAPPED_NOTIFICATIONS);
+ Calendar instance = Calendar.getInstance();
+ instance.setTimeInMillis(instance.getTimeInMillis() + duration);
+ 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());
+
+ }
+
+ public void destroySubscription() throws FaultException,
+ URISyntaxException, IOException, XmlException,
+ UnexpectedServerResponseException {
+ DestroyDocument requestDoc = DestroyDocument.Factory.newInstance();
+ requestDoc.addNewDestroy();
+ XmlObject response = sendRequest(requestDoc,
+ "http://xyz.com/action/Destroy");
+ if (!(response instanceof DestroyResponseDocumentImpl.DestroyResponseImpl)) {
+ throw new FaultException(response.toString());
+ }
+ }
+
+ public EndpointReference subscribe(String consumerURL, QName topic)
+ throws FaultException, URISyntaxException, IOException,
+ XmlException, UnexpectedServerResponseException {
+ return subscribe(consumerURL, topic, 7200000);
+ }
+
+ private EnvelopeDocument createEnvelope() {
+ EnvelopeDocument envelopeDoc = EnvelopeDocument.Factory.newInstance();
+ Envelope envelope = envelopeDoc.addNewEnvelope();
+ envelope.addNewHeader();
+ envelope.addNewBody();
+ return envelopeDoc;
+ }
+
+ public XmlObject sendRequest(XmlObject requestDoc, String action)
+ throws URISyntaxException, IOException, XmlException,
+ UnexpectedServerResponseException, FaultException {
+ // Hack for internal network
+ String addr = m_epr.getAddress();
+ // addr=addr.replaceAll("192\\.168\\.0\\.20","12.35.246.160");
+
+ EnvelopeDocument requestEnvelopeDoc = createEnvelope();
+ Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
+ addAddressingHeaders(requestEnvelope.getHeader(), action);
+ XmlBeanUtils.addChildElement(requestEnvelope.getBody(), requestDoc);
+ URL endpointURL = new URL(addr);// m_epr.getAddress()
+ URI actionURI = new URI(action);
+ LOG.debug("Sending request:\n---------------------------- \n"
+ + requestEnvelopeDoc);
+ String response = SoapClient.sendRequest(endpointURL,
+ requestEnvelopeDoc.newInputStream(), actionURI);
+ LOG.debug("---------------------------------------- ");
+ setChanged();
+ XmlOptions xmlOpts = new XmlOptions().setSaveOuter();
+ xmlOpts.setSavePrettyPrint();
+
+ EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory
+ .parse(response);
+ LOG.debug("Received response:\n-------------------------- \n"
+ + responseEnvelopeDoc);
+ LOG.debug("---------------------------------------- ");
+ Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
+ XmlObject[] responseBodyElems = XmlBeanUtils
+ .getChildElements(responseEnvelope.getBody());
+ if (responseBodyElems.length == 0) {
+ throw new UnexpectedServerResponseException();
+ } else {
+ if (responseBodyElems[0] instanceof FaultImpl)
+ throw new FaultException(responseBodyElems[0].xmlText());
+ return responseBodyElems[0];
+ }
+ }
+
+ /**
+ * All resource proerpties request must you 2003 addressing
+ *
+ * @param header
+ * @param action
+ */
+ 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]);
+ }
+ }
+ }
+
+ private void addAddressingHeadersOld(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]);
+ }
+ }
+ }
}
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ServiceStub.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ServiceStub.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ServiceStub.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/impl/stubs/ServiceStub.java Fri Sep 30 11:14:47 2005
@@ -18,15 +18,12 @@
import java.net.URI;
import java.net.URL;
import java.util.Observable;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.xml.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ws.client.muse.client.impl.exceptions.FaultException;
-import org.apache.ws.client.muse.client.impl.notification.NotificationConsumerImpl;
import org.apache.ws.util.XmlBeanUtils;
import org.apache.ws.util.soap.SoapClient;
import org.apache.xmlbeans.XmlObject;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/ChangeNotification.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/ChangeNotification.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/ChangeNotification.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/ChangeNotification.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.model;
import javax.xml.namespace.QName;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Notification.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Notification.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Notification.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Notification.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.model;
import java.util.Calendar;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Query.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Query.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Query.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Query.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.model;
import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryExpressionType;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SetPropertiesRequest.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SetPropertiesRequest.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SetPropertiesRequest.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SetPropertiesRequest.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.model;
import java.util.ArrayList;
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Situation.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Situation.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Situation.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/Situation.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.model;
import java.util.Calendar;
Added: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SubscriptionManager.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SubscriptionManager.java?rev=292825&view=auto
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SubscriptionManager.java (added)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/SubscriptionManager.java Fri Sep 30 11:14:47 2005
@@ -0,0 +1,72 @@
+/*=============================================================================*
+ * 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.client.muse.client.model;
+
+import java.util.Calendar;
+
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.client.muse.client.ManageableResource;
+import org.apache.xmlbeans.XmlObject;
+
+public interface SubscriptionManager extends ManageableResource {
+
+ public abstract EndpointReference getConsumerReference();
+
+ public abstract TopicExpression getTopicExpression();
+
+ public abstract boolean isUseNotify();
+
+ public abstract Query getPrecondition();
+
+ public abstract Query getSelector();
+
+ public abstract XmlObject getSubscriptionPolicy();
+
+ public abstract Calendar getCreationTime();
+
+ public abstract void setConsumerReference(EndpointReference reference);
+
+ public abstract void setTopicExpression(TopicExpression topicExpression);
+
+ public abstract void setUseNotify(boolean use);
+
+ public abstract void setPrecondition(Query precondition);
+
+ public abstract void setSelector(Query selector);
+
+ public abstract void setSubscriptionPolicy(XmlObject policy);
+
+ public abstract void setCreationTime(Calendar subsciptionTime);
+
+ /**
+ * To temporarily suspend the delivery of NotificationMessages on the given
+ * Subscription, a requestor MUST send a PauseSubscription request message
+ * to the SubscriptionManager.
+ *
+ * Upon successful processing of this message the Subscription is in the paused
+ * state. Delivery of NotificationMessages can be resumed by sending the
+ * ResumeSubscription request message
+ */
+ public abstract void pauseSubscription();
+
+ /**
+ * If a requestor wishes to resume the delivery of NotificationMessages on
+ * the given Subscription, it must send a ResumeSubscription request message.
+ *
+ */
+ public abstract void resumeSubscription();
+
+}
\ No newline at end of file
Modified: webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/TopicExpression.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/TopicExpression.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/TopicExpression.java (original)
+++ webservices/muse/trunk/client/src/java/org/apache/ws/client/muse/client/model/TopicExpression.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.model;
import java.net.MalformedURLException;
Modified: webservices/muse/trunk/client/src/test/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceTest.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/client/src/test/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceTest.java?rev=292825&r1=292824&r2=292825&view=diff
==============================================================================
--- webservices/muse/trunk/client/src/test/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceTest.java (original)
+++ webservices/muse/trunk/client/src/test/org/apache/ws/client/muse/client/impl/notification/NotifyableResourceTest.java Fri Sep 30 11:14:47 2005
@@ -1,3 +1,18 @@
+/*=============================================================================*
+ * 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.client.muse.client.impl.notification;
import java.io.IOException;
@@ -6,12 +21,12 @@
import java.util.Observable;
import java.util.Observer;
-import org.apache.ws.client.muse.client.ManageableResource;
import org.apache.ws.client.muse.client.NotificationConsumer;
import org.apache.ws.client.muse.client.impl.exceptions.FaultException;
import org.apache.ws.client.muse.client.impl.exceptions.UnexpectedServerResponseException;
import org.apache.ws.client.muse.client.impl.wsrf.SetPropertiesRequestImpl;
import org.apache.ws.client.muse.client.model.Notification;
+import org.apache.ws.client.muse.client.model.SubscriptionManager;
import org.apache.ws.client.muse.client.model.TopicExpression;
import org.apache.ws.service.testresource.TestResourcePropertyQNames;
import org.apache.ws.util.test.axis.MuseClientTestCase;
@@ -75,7 +90,7 @@
NotificationConsumer testConsumer=new NotificationConsumerImpl(8085,20000);
testConsumer.addObserver(this);
testConsumer.start();
- ManageableResource subscriptionResource = testResource.subscribe(topics[3],testConsumer.getEndpointReference());
+ SubscriptionManager subscriptionResource = testResource.subscribe(topics[3],testConsumer.getEndpointReference());
assertNotNull(subscriptionResource);
// force a notification to be sent
@@ -112,7 +127,7 @@
NotificationConsumer testConsumer=new NotificationConsumerImpl(8085,20000);
testConsumer.addObserver(this);
testConsumer.start();
- ManageableResource subscriptionResource = testResource.subscribe(topics[3],testConsumer.getEndpointReference());
+ SubscriptionManager subscriptionResource = testResource.subscribe(topics[3],testConsumer.getEndpointReference());
assertNotNull(subscriptionResource);
// force a notification to be sent