You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pubscribe-dev@ws.apache.org by li...@apache.org on 2005/02/11 18:11:54 UTC
svn commit: r153423 - in
incubator/hermes/trunk/src/java/org/apache/ws/eventing: ./ app/broker/
app/broker/WEB-INF/ app/client/ app/client/WEB-INF/ porttype/
porttype/impl/ services/broker/ services/subscriber/
Author: lischke
Date: Fri Feb 11 09:11:47 2005
New Revision: 153423
URL: http://svn.apache.org/viewcvs?view=rev&rev=153423
Log:
with test application
Added:
incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/jndi-config.xml
incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/jndi-config.xml
incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/NotificationPortType.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/broker/BrokerService.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/subscriber/SubscriberService.java
Removed:
incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/broker/deploy.wsdd
incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/broker/undeploy.wsdd
Modified:
incubator/hermes/trunk/src/java/org/apache/ws/eventing/AbstractSubscription.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/ForwardConsumer.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscription.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscriptionHome.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscriber.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscription.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/SubscriptionHome.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/JettyBroker.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/WEB-INF/server-config.wsdd
incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubClient.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSmanager.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSsyntactic.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/WEB-INF/server-config.wsdd
incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/EventSourcePortTypeImpl.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/NotificationPortTypeImpl.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionEndPortTypeImpl.java
incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionManagerPortTypeImpl.java
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/AbstractSubscription.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/AbstractSubscription.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/AbstractSubscription.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/AbstractSubscription.java Fri Feb 11 09:11:47 2005
@@ -23,6 +23,9 @@
import org.apache.xmlbeans.*;
import org.w3c.dom.*;
import edu.berkeley.cs.db.yfilterplus.queryparser.Query;
+import java.util.Calendar;
+import org.apache.ws.resource.ResourceHome;
+import org.apache.ws.resource.ResourceKey;
public abstract class AbstractSubscription implements org.apache.ws.pubsub.Subscription, org.apache.ws.resource.Resource {
@@ -30,11 +33,20 @@
private EndpointReference epr;
private String QueryID;
protected String m_id;
+ protected Calendar m_terminationTime;
+ protected Calendar m_creationTime;
+ protected ResourceHome rH;
+ protected ResourceKey rK;
public EndpointReference getEpr(){
return this.epr;
}
-
+ public void setResourceKey(ResourceKey rK){
+ this.rK=rK;
+ }
+ public void setResourceHome(ResourceHome rH){
+ this.rH=rH;
+ }
public void setEpr(EndpointReference epr){
this.epr=epr;
}
@@ -77,7 +89,7 @@
return null;
}
public java.util.Calendar getCreationTime() {
- return null;
+ return m_creationTime;
}
public Object getSubscriptionPolicy() {
@@ -91,8 +103,10 @@
return null;
}
- public void setTerminationTime( java.util.Calendar terminationTime ){}
- public java.util.Calendar getTerminationTime(){return null;}
+ public java.util.Calendar getTerminationTime(){
+ return m_terminationTime;
+ }
public boolean isPaused(){return false;}
+ public abstract void notify(String xml);
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/ForwardConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/ForwardConsumer.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/ForwardConsumer.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/ForwardConsumer.java Fri Feb 11 09:11:47 2005
@@ -15,16 +15,31 @@
*/
package org.apache.ws.eventing;
import org.apache.ws.addressing.*;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.pubsub.emitter.EmitterTask;
+import javax.xml.soap.*;
public class ForwardConsumer implements org.apache.ws.pubsub.NotificationConsumer {
- private EndpointReference epr;
+ private static final Log LOG = LogFactory.getLog( ForwardConsumer.class.getName() );
+
+ public EndpointReference notifyTOepr;
+ public EndpointReference endTOepr;
+
+ public ForwardConsumer(EndpointReference ntepr, EndpointReference etepr){
+ this.notifyTOepr=ntepr;
+ if(etepr!=null)
+ this.endTOepr=etepr;
+ else
+ this.endTOepr=ntepr;
+ }
public EndpointReference getEPR(){
- return this.epr;
+ return this.notifyTOepr;
}
public void setEPR( EndpointReference epr ){
- this.epr=epr;
+ this.notifyTOepr=epr;
}
public int getMode(){
@@ -36,10 +51,14 @@
}
public void notify( org.apache.ws.pubsub.Subscription subscription, Object message ){
- System.out.println("ForwardConsumer ");
+ LOG.info("ForwardConsumer ");
try{
-// SOAPEnvelope env=(SOAPEnvelope)message;
-// Publisher.publish((Subscription)subscription, env.getBody());
+ MessageFactory mf = MessageFactory.newInstance();
+ SOAPMessage soapm = mf.createMessage();
+ //put SOAPBody
+ soapm.getSOAPBody().addDocument((org.w3c.dom.Document) message);
+
+ EmitterTask.createEmitterTask( soapm, new java.net.URL( this.notifyTOepr.getAddress().toString() ) );
}catch(Exception e){
e.printStackTrace();
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscription.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscription.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscription.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscription.java Fri Feb 11 09:11:47 2005
@@ -12,38 +12,44 @@
* 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.eventing;
import org.apache.ws.util.uuid.UuidGenerator;
import org.apache.ws.util.uuid.UuidGeneratorFactory;
-import org.apache.ws.resource.ResourceHome;
-import org.apache.ws.resource.ResourceKey;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import java.util.Calendar;
+import org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource;
+
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscriptionEndDocument;
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscriptionEndDocument.SubscriptionEnd;
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.LanguageSpecificStringType;
+import javax.xml.soap.*;
/**
*
* @author Stefan Lischke
*/
-public class RemoteSubscription extends AbstractSubscription {
- private static final UuidGenerator UUID_GEN =
- UuidGeneratorFactory.createUUIdGenerator();
+public class RemoteSubscription extends AbstractSubscription implements ScheduledResourceTerminationResource{
+ private static final Log LOG = LogFactory.getLog( Subscriber.class.getName() );
+
+ private static final UuidGenerator UUID_GEN = UuidGeneratorFactory.createUUIdGenerator();
private org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscribeDocument subdom;
- private ResourceHome rH;
- private ResourceKey rK;
+
- public RemoteSubscription(org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscribeDocument subdom, ResourceHome rH){
+ public RemoteSubscription(org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscribeDocument subdom){
m_id = UUID_GEN.generateUuid();
+ m_creationTime= Calendar.getInstance();
+ setTerminationTime((org.apache.xmlbeans.XmlCalendar)subdom.getSubscribe().getExpires());
this.subdom =subdom;
- this.rH= rH;
}
public String getFilterString()throws Exception{
- System.out.println("getFilterString : "+this.subdom.getSubscribe().getFilter().newCursor().getTextValue());
+ LOG.info("getFilterString : "+this.subdom.getSubscribe().getFilter().newCursor().getTextValue());
return this.subdom.getSubscribe().getFilter().newCursor().getTextValue();
}
- public void setResourceKey(ResourceKey rK){
- this.rK=rK;
- }
+
public void unsubscribe(){
try{
this.rH.remove(this.rK);
@@ -51,13 +57,47 @@
e.printStackTrace();
//TODO
}
+ destroy();
}
public void destroy() {
- System.out.println("destroy");
+ //TODO maybe unsubscribe myself
+
+ //send SubscriptionEnd Notification
+ SubscriptionEndDocument sedom = SubscriptionEndDocument.Factory.newInstance();
+ SubscriptionEndDocument.SubscriptionEnd se = sedom.addNewSubscriptionEnd();
+ LanguageSpecificStringType reason = se.addNewReason();
+ reason.setStringValue("destroy was called on RemoteSubscription");
+ try{
+ //now call
+ wsaSOAPConnection sconn = wsaSOAPConnection.newInstance();
+ MessageFactory mf = MessageFactory.newInstance();
+ SOAPMessage soapm = mf.createMessage();
+ //put XMLbean into SOAPBody
+ soapm.getSOAPBody().addDocument((org.w3c.dom.Document) sedom.newDomNode());
+ sconn.call(soapm, getNotificationConsumer().getEPR().getAddress().toString());
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+ LOG.info("destroyed");
}
public void init() {
- System.out.println("init");
+ LOG.info("init");
}
+
+ public void setTerminationTime(java.util.Calendar terminationTime) {
+ LOG.info("Remote setTerminationTime "+terminationTime);
+ m_terminationTime = terminationTime;
+ }
+
+ public Calendar getCurrentTime()
+ {
+ return Calendar.getInstance();
+ }
+
+ public void notify(String xml) {
+ ((RemoteSubscriptionHome)this.rH).notify(xml);
+ }
+
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscriptionHome.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscriptionHome.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscriptionHome.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/RemoteSubscriptionHome.java Fri Feb 11 09:11:47 2005
@@ -22,7 +22,7 @@
import edu.berkeley.cs.db.yfilterplus.xmltree.*;
import org.apache.axis.message.*;
-import org.apache.axis.utils.XMLUtils;
+
import org.apache.ws.resource.impl.SimpleTypeResourceKey;
import org.apache.ws.resource.*;
@@ -38,7 +38,7 @@
import org.apache.commons.logging.LogFactory;
public class RemoteSubscriptionHome extends org.apache.ws.resource.impl.AbstractResourceHome{
- private static final Log LOG = LogFactory.getLog( Subscriber.class.getName() );
+ private static final Log LOG = LogFactory.getLog( RemoteSubscriptionHome.class.getName() );
private static final String SERVICE_NAME = "SubscriptionManagerPort";
public static final String HOME_LOCATION = JndiConstants.CONTEXT_NAME_SERVICES + "/" + SERVICE_NAME + "/" + JndiConstants.ATOMIC_NAME_HOME;
@@ -57,16 +57,17 @@
subs= new java.util.HashMap();
queriesBack= new java.util.HashMap();
queries= new String[1000000];
- System.out.println("ResourceHome"+this.toString());
+ LOG.info("ResourceHome"+this.toString());
}
public org.apache.ws.resource.Resource getInstance(org.apache.ws.resource.ResourceContext resourceContext) throws org.apache.ws.resource.ResourceException, org.apache.ws.resource.ResourceContextException, org.apache.ws.resource.ResourceUnknownException {
- System.out.println("getInstance ResourceHome");
+ LOG.info("getInstance ResourceHome");
return find( resourceContext.getResourceKey() );
}
public RemoteSubscription create(SubscribeDocument subdom){
- RemoteSubscription rs = new RemoteSubscription(subdom,this);
+ RemoteSubscription rs = new RemoteSubscription(subdom);
+ rs.setResourceHome(this);
String id = (String) rs.getID();
SimpleTypeResourceKey resourceKey = new SimpleTypeResourceKey( QName.valueOf( getResourceKeyName()), id);
@@ -85,10 +86,10 @@
try{
c++;
Query query = XPQuery.parseQuery(s.getFilterString(),c);
- System.out.println("addSubscription "+s.getID()+" query :"+query);
+ LOG.info("addSubscription "+s.getID()+" query :"+query);
yfilter.addQuery(query);
- s.setNotificationConsumer(new ForwardConsumer());
+// s.setNotificationConsumer(new ForwardConsumer());
subs.put(s.getID(), s);
queriesBack.put(s.getID(),query);
@@ -116,32 +117,30 @@
* @throws ResourceException if any other error occurs.
*/
public void remove( ResourceKey key ) throws ResourceException, NoSuchResourceException, InvalidResourceKeyException, RemoveNotSupportedException{
- System.out.println("removeSubscription : "+key.getValue());
+ LOG.info("removeSubscription : "+key.getValue());
Query q=(Query)queriesBack.get(key.getValue());
yfilter.deleteQuery(q,q.getQueryId());
//TODO remove from Hashmap
}
public void notify(Object message) {
- org.apache.axis.message.SOAPEnvelope env = (org.apache.axis.message.SOAPEnvelope)message;
+ String xml = (String)message;
//first check dialect
try{
- System.out.println("Notify: ");
- String xml =XMLUtils.ElementToString(env.getBody());
- System.out.println("--"+xml+"--");
+ LOG.info("Notify: ");
+ LOG.info("--"+xml+"--");
//copy
//first parse and drive YFilter,
XMLTree tree = new XMLTree(new java.io.StringReader(xml));
yfilter.setEventSequence(tree.getEvents());
yfilter.startParsing();
- //xfilterTest.startParsing(xmlFile);
// print the matched queries //
if (SystemGlobals.hasQueries) {
yfilter.printQueryResults(System.out);
}else{
- System.out.println("no match");
+ LOG.info("no match");
}
//get matches
java.util.Iterator it= yfilter.getMatchedQueries().iterator();
@@ -150,8 +149,8 @@
String sid = queries[qid.intValue()];
RemoteSubscription s = (RemoteSubscription)(RemoteSubscription)subs.get(sid);
//notify matches
- System.out.println("notify : "+sid);
- s.getNotificationConsumer().notify(s,message);
+ LOG.info("notify : "+sid);
+ s.getNotificationConsumer().notify(s,xml);
}
yfilter.clear();
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscriber.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscriber.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscriber.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscriber.java Fri Feb 11 09:11:47 2005
@@ -55,12 +55,12 @@
private SubscriptionHome sH;
// private SubscriberStore store;
- public Subscriber(String url){
+ public Subscriber(String url,String configfile){
//Axis stuff to enable Addressing HandlerChain
AxisProperties.setProperty(EngineConfigurationFactoryDefault.OPTION_CLIENT_CONFIG_FILE,"/org/apache/ws/eventing/client-config.wsdd");
try{
//read jndi-config.xml
- init();
+ init(configfile);
//create EPR TODO clean
org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType e = org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType.Factory.newInstance();
@@ -72,7 +72,6 @@
//getlocal SubscriptionHome from jndi-config
Context initialContext = new InitialContext( );
- System.out.println("get SubscriptionHome " + SubscriptionHome.HOME_LOCATION);
sH = (SubscriptionHome) initialContext.lookup( SubscriptionHome.HOME_LOCATION );
}catch (Exception e){
@@ -83,15 +82,16 @@
* runs resource discovery.
*
*/
- public void init()
+ public void init(String configfile)
throws Exception
{
LOG.info(this.getClass().getName()+" : initialize with jndi-config.xml");
- XmlBeanJndiUtils.initializeFromInputStream(Thread.currentThread().getContextClassLoader().getResourceAsStream(XmlBeanJndiUtils.JNDI_CONFIG_FILENAME));
+ XmlBeanJndiUtils.initializeFromInputStream(new java.io.FileInputStream(configfile));
}
- //TODO
+
public Object getCurrentMessage(org.apache.ws.pubsub.Filter[] filters) {
+ //TODO maybe subscribe for the past
return null;
}
@@ -135,6 +135,7 @@
sresres= sresdom.addNewSubscribeResponse();
sresres.set(sres.getEnvelope().getBody());
*/
+ //TODO handle faults
SubscribeResponseDocument sresdom = SubscribeResponseDocument.Factory.parse(sres.getEnvelope().getBody().xmlText());
sresres= sresdom.getSubscribeResponse();
}catch(Exception e){
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscription.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscription.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscription.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/Subscription.java Fri Feb 11 09:11:47 2005
@@ -16,13 +16,15 @@
package org.apache.ws.eventing;
import org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscribeResponseDocument;
import org.xmlsoap.schemas.ws.x2004.x08.eventing.UnsubscribeDocument;
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.RenewDocument;
import org.xmlsoap.schemas.ws.x2004.x08.eventing.UnsubscribeDocument.Unsubscribe;
import org.xmlsoap.schemas.ws.x2004.x08.addressing.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
+import java.util.Calendar;
import org.apache.xmlbeans.XmlCursor;
+import org.apache.ws.addressing.*;
import javax.xml.soap.*;
/**
*
@@ -36,13 +38,17 @@
/** Creates a new instance of Subscription */
public Subscription(SubscribeResponseDocument.SubscribeResponse sresdom) {
sMan = sresdom.getSubscriptionManager();
+ super.setEpr(new XmlBeansEndpointReference(sMan));
//get id with XmlCursor;
XmlCursor xc = sMan.getReferenceProperties().newCursor();
xc.toChild("http://schemas.xmlsoap.org/ws/2004/08/eventing","Identifier");
setID(xc.getTextValue());
if(getID()==null)
throw new RuntimeException("There is no Subscription Id");
- LOG.info("new local Subscription : "+getID());
+
+ this.m_creationTime = Calendar.getInstance();
+ LOG.info("new local Subscription : "+getID()+" SubscriptionManager: "+ sMan.getAddress());
+ //TODO HACK
}
public void unsubscribe(){
@@ -61,7 +67,29 @@
e.printStackTrace();
}
}
+ public void setTerminationTime( java.util.Calendar terminationTime ){
+ //TODO call SubscriptionManager
+ RenewDocument rdom = RenewDocument.Factory.newInstance();
+ RenewDocument.Renew r = rdom.addNewRenew();
+ r.setExpires(terminationTime);
+ try{
+ //now call
+ wsaSOAPConnection sconn = wsaSOAPConnection.newInstance();
+ MessageFactory mf = MessageFactory.newInstance();
+ SOAPMessage soapm = mf.createMessage();
+ //put XMLbean into SOAPBody
+ soapm.getSOAPBody().addDocument((org.w3c.dom.Document) rdom.newDomNode());
+
+ sconn.call(soapm,sMan.getAddress().getStringValue(),(String) getID());
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+ }
+ public java.util.Calendar getTerminationTime(){
+ //TODO maybe call GetStatus to get Termination time
+ return m_terminationTime;
+ }
public void destroy() {
System.out.println("local destroy");
}
@@ -69,4 +97,9 @@
public void init() {
System.out.println("local init");
}
+
+ public void notify(String xml) {
+ getNotificationConsumer().notify(this,xml);
+ }
+
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/SubscriptionHome.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/SubscriptionHome.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/SubscriptionHome.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/SubscriptionHome.java Fri Feb 11 09:11:47 2005
@@ -24,6 +24,8 @@
import org.apache.ws.resource.impl.SimpleTypeResourceKey;
import javax.xml.namespace.QName;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
*
* @author Stefan Lischke
@@ -31,13 +33,8 @@
public class SubscriptionHome extends org.apache.ws.resource.impl.AbstractResourceHome {
private static final String SERVICE_NAME = "NotificationPort";
public static final String HOME_LOCATION = JndiConstants.CONTEXT_NAME_SERVICES + "/" + SERVICE_NAME + "/" + JndiConstants.ATOMIC_NAME_HOME;
-
- private java.util.HashMap subs;
-
- public SubscriptionHome() {
- System.out.println("local SubscriptionHome "+this.toString());
- subs= new java.util.HashMap();
- }
+
+ private static final Log LOG = LogFactory.getLog( RemoteSubscriptionHome.class.getName() );
public Subscription create(SubscribeResponseDocument.SubscribeResponse sresdom){
Subscription s = new Subscription(sresdom);
@@ -47,53 +44,9 @@
add(resourceKey,s);
return s;
}
- public String addSubscription(org.apache.ws.pubsub.Subscription ss) {
- Subscription s = (Subscription)ss;
- subs.put(s.getID(),s);
- return(s.getID().toString());
- }
-
- public org.apache.ws.pubsub.Subscription getSubscription(String id) {
- if(subs.containsKey(id)){
- Subscription s = (Subscription)subs.get(id);
- return s;
- }else
- return null;// throw new RuntimeException("Cannot find Subscription with id "+id);
-
- }
-
- public void notify(Object message) {
- org.apache.axis.message.SOAPEnvelope env = (org.apache.axis.message.SOAPEnvelope)message;
- String id;
- try{
- javax.xml.soap.SOAPHeader h = env.getHeader();
- NodeList it = h.getElementsByTagNameNS("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Identifier");
- if(it.getLength()==0)
- throw new javax.xml.soap.SOAPException("<wse:Identifier> Tag is missing in the Header.... i dunno which Subscription you mean");
- Node idnode = it.item(0);
- if((idnode.getFirstChild()!=null)&&(idnode.getFirstChild().getNodeType()==Node.TEXT_NODE))
- id = idnode.getFirstChild().getNodeValue();
- else
- throw new javax.xml.soap.SOAPException("<wse:Identifier> Tag is empty in the Header.... i dunno which Subscription you mean");
-
- //check ResourceProperties for SubscriptionID
-
- System.out.println("SubscriberStore notify "+id);
- org.apache.ws.pubsub.Subscription s = getSubscription(id);
- if(s!=null)
- s.getNotificationConsumer().notify(s,message);
- }catch(javax.xml.soap.SOAPException e){
- e.printStackTrace();
- }
- }
-
- public void removeSubscription(String id) {
- subs.remove(id);
- }
public org.apache.ws.resource.Resource getInstance(org.apache.ws.resource.ResourceContext resourceContext) throws org.apache.ws.resource.ResourceException, org.apache.ws.resource.ResourceContextException, org.apache.ws.resource.ResourceUnknownException {
- System.out.println("local SubscriptionHome getInstance");
- return null;
- }
-
+ LOG.info("getInstance SubscriptionHome");
+ return find( resourceContext.getResourceKey() );
+ }
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/JettyBroker.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/JettyBroker.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/JettyBroker.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/JettyBroker.java Fri Feb 11 09:11:47 2005
@@ -41,7 +41,7 @@
* @param args the command line arguments
*/
public static void main(String[] args) {
- JettyBroker jB = new JettyBroker("d:\\projects\\hermes");
+ JettyBroker jB = new JettyBroker(args[0]);
}
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/WEB-INF/server-config.wsdd
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/WEB-INF/server-config.wsdd?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/WEB-INF/server-config.wsdd (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/WEB-INF/server-config.wsdd Fri Feb 11 09:11:47 2005
@@ -31,49 +31,15 @@
</service>
<service name="EventSourcePort" provider="java:WSRF" style="document" use="literal">
-<!--
- <wsdlFile>/wsdl/SubscriptionManager.wsdl</wsdlFile>
- <parameter name="wsdlTargetNamespace" value="http://schemas.xmlsoap.org/ws/2004/08/eventing/services"/>
- <parameter name="wsdlServiceElement" value="EventingService"/>
- <parameter name="wsdlServicePort" value="EventSourcePort"/>
-
- <parameter name="className" value="org.apache.ws.eventing.services.publisher.EventSourceBindingSkeleton"/>
- <parameter name="wsdlPortType" value="EventSource"/>
- <parameter name="allowedMethods" value="*"/>
--->
-</service>
+ </service>
<service name="SubscriptionManagerPort" provider="java:WSRF" style="document" use="literal">
-<!--
- <parameter name="wsdlTargetNamespace" value="http://schemas.xmlsoap.org/ws/2004/08/eventing/services"/>
- <parameter name="wsdlServiceElement" value="EventingService"/>
- <parameter name="wsdlServicePort" value="SubscriptionManagerPort"/>
-
-<parameter name="className" value="org.apache.ws.eventing.services.publisher.SubscriptionManagerBindingSkeleton"/>
- <parameter name="wsdlPortType" value="SubscriptionManager"/>
- <parameter name="allowedMethods" value="*"/>
--->
-
</service>
<service name="SubscriptionEndPort" provider="java:WSRF" style="document" use="literal">
- <!--
- <parameter name="allowedMethods" value="*"/>
- <parameter name="wsdlPortType" value="SubscriptionEnd"/>
- <parameter name="className" value="org.apache.ws.eventing.services.subscriber.SubscriptionEndPort"/>
- <parameter name="wsdlServicePort" value="SubscriptionEndPort"/>
- <parameter name="wsdlTargetNamespace" value="http://schemas.xmlsoap.org/ws/2004/08/eventing/services"/>
- <parameter name="wsdlServiceElement" value="EventingService"/>
- -->
</service>
- <service name="NotificationPort" provider="java:MSG" style="message" use="literal">
- <parameter name="allowedMethods" value="filter"/>
- <parameter name="wsdlPortType" value="Notification"/>
- <parameter name="className" value="org.apache.ws.eventing.services.NotificationPort"/>
- <parameter name="wsdlServicePort" value="NotificationPort"/>
- <parameter name="wsdlTargetNamespace" value="http://schemas.xmlsoap.org/ws/2004/08/eventing/services"/>
- <parameter name="wsdlServiceElement" value="NotificationService"/>
+ <service name="NotificationPort" provider="java:WSRFMsg" style="message" use="literal">
</service>
<transport name="http">
Added: incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/jndi-config.xml
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/jndi-config.xml?view=auto&rev=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/jndi-config.xml (added)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/broker/jndi-config.xml Fri Feb 11 09:11:47 2005
@@ -0,0 +1,118 @@
+<?xml version="1.0"?>
+
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+ <global>
+
+ <resource name="DefaultParameters" type="org.apache.ws.util.jndi.DefaultParameters">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyClassName</name>
+ <value>org.apache.ws.resource.impl.SimpleTypeResourceKey</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="timer/ContainerTimer" type="org.apache.ws.util.timer.TimerManagerImpl">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="topic/eval/simple" type="org.apache.ws.notification.topics.impl.SimpleTopicExpressionEvaluator">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="topic/ContainerTopicExpressionEngine" type="org.apache.ws.notification.topics.impl.TopicExpressionEngineImpl">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ </global>
+
+ <service name="SubscriptionManagerPort">
+ <resource name="home" type="org.apache.ws.eventing.RemoteSubscriptionHome">
+ <resourceParams>
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.eventing.services.broker.BrokerService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.eventing.RemoteSubscription</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/eventing/services/SubscriptionManager</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyName</name>
+ <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </service>
+
+ <service name="EventSourcePort">
+ <resource name="home" type="org.apache.ws.eventing.RemoteSubscriptionHome">
+ <resourceParams>
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.eventing.services.broker.BrokerService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.eventing.RemoteSubscription</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/eventing/services/EventSourcePort</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyName</name>
+ <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </service>
+
+ <service name="NotificationPort">
+ <resource name="home" type="org.apache.ws.eventing.RemoteSubscriptionHome">
+ <resourceParams>
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.eventing.services.broker.BrokerService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.eventing.RemoteSubscription</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/eventing/services/NotificationPort</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyName</name>
+ <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </service>
+</jndiConfig>
+
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubClient.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubClient.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubClient.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubClient.java Fri Feb 11 09:11:47 2005
@@ -72,351 +72,6 @@
private static final int DEFAULT_PORT=8080;
/**
- * this is the admin page
- */
- class AdminPage extends JPanel {
- public JRadioButton listenerButton, proxyButton ;
- public JLabel hostLabel, tportLabel;
- public NumberField port;
- public HostnameField host;
- public NumberField tport ;
- public JTabbedPane noteb ;
- public JCheckBox HTTPProxyBox ;
- public HostnameField HTTPProxyHost;
- public NumberField HTTPProxyPort ;
- public JLabel HTTPProxyHostLabel, HTTPProxyPortLabel ;
- public JLabel delayTimeLabel, delayBytesLabel;
- public NumberField delayTime, delayBytes;
- public JCheckBox delayBox;
-
- public AdminPage( JTabbedPane notebook, String name ) {
- JPanel mainPane = null ;
- JButton addButton = null ;
-
- this.setLayout( new BorderLayout() );
- noteb = notebook ;
-
- GridBagLayout layout = new GridBagLayout();
- GridBagConstraints c = new GridBagConstraints();
-
- mainPane = new JPanel(layout);
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER;
- mainPane.add( new JLabel(getMessage("newTCP00", "Create a new TCP/IP Monitor...") + " "), c );
-
- // Add some blank space
- mainPane.add( Box.createRigidArea(new Dimension(1, 5)), c );
-
- // The listener info
- ///////////////////////////////////////////////////////////////////
- JPanel tmpPanel = new JPanel(new GridBagLayout());
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = 1 ;
- tmpPanel.add( new JLabel(getMessage("listenPort00", "Listen Port #") + " "), c );
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- tmpPanel.add( port = new NumberField(4), c );
-
- mainPane.add( tmpPanel, c );
-
- mainPane.add( Box.createRigidArea(new Dimension(1, 5)), c );
-
- // Group for the radio buttons
- ButtonGroup btns = new ButtonGroup();
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- mainPane.add( new JLabel(getMessage("actAs00", "Act as a...") ), c );
-
- // Target Host/Port section
- ///////////////////////////////////////////////////////////////////
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
-
- final String listener = getMessage("listener00", "Listener");
-
- mainPane.add( listenerButton = new JRadioButton( listener ), c );
- btns.add( listenerButton );
- listenerButton.setSelected( true );
-
- listenerButton.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- if (listener.equals(event.getActionCommand())) {
- boolean state = listenerButton.isSelected();
-
- tport.setEnabled( state );
- host.setEnabled( state );
- hostLabel.setForeground(state ? Color.black : Color.gray);
- tportLabel.setForeground(state ? Color.black : Color.gray);
- }
- }
- }
- );
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = 1 ;
- mainPane.add( Box.createRigidArea(new Dimension(25, 0)) );
- mainPane.add( hostLabel = new JLabel(getMessage("targetHostname00", "Target Hostname") + " "), c );
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- host = new HostnameField(30);
- mainPane.add( host, c );
- host.setText(DEFAULT_HOST);
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = 1 ;
- mainPane.add( Box.createRigidArea(new Dimension(25, 0)) );
- mainPane.add( tportLabel = new JLabel(getMessage("targetPort00", "Target Port #") + " "), c );
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- tport = new NumberField(4);
- mainPane.add( tport, c );
- tport.setValue(DEFAULT_PORT);
-
- // Act as proxy section
- ///////////////////////////////////////////////////////////////////
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- final String proxy = getMessage("proxy00", "Proxy");
-
- mainPane.add( proxyButton = new JRadioButton( proxy ), c);
- btns.add( proxyButton );
-
- proxyButton.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- if (proxy.equals(event.getActionCommand())) {
- boolean state = proxyButton.isSelected();
-
- tport.setEnabled( !state );
- host.setEnabled( !state );
- hostLabel.setForeground(state ? Color.gray : Color.black);
- tportLabel.setForeground(state ? Color.gray : Color.black);
- }
- }
- }
- );
-
- // Spacer
- /////////////////////////////////////////////////////////////////
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- mainPane.add( Box.createRigidArea(new Dimension(1, 10)), c );
-
- // Options section
- ///////////////////////////////////////////////////////////////////
- JPanel opts = new JPanel(new GridBagLayout());
-
- opts.setBorder( new TitledBorder(getMessage("options00", "Options")) );
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- mainPane.add( opts, c );
-
- // HTTP Proxy Support section
- ///////////////////////////////////////////////////////////////////
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- final String proxySupport = getMessage("proxySupport00", "HTTP Proxy Support");
-
- opts.add(HTTPProxyBox = new JCheckBox(proxySupport), c);
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = 1 ;
- opts.add( HTTPProxyHostLabel = new JLabel(getMessage("hostname00", "Hostname") + " "), c );
- HTTPProxyHostLabel.setForeground( Color.gray );
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- opts.add( HTTPProxyHost = new HostnameField(30), c );
- HTTPProxyHost.setEnabled( false );
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = 1 ;
- opts.add( HTTPProxyPortLabel = new JLabel(getMessage("port00", "Port #") + " "), c );
- HTTPProxyPortLabel.setForeground( Color.gray );
-
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- opts.add( HTTPProxyPort = new NumberField(4), c );
- HTTPProxyPort.setEnabled( false );
-
- HTTPProxyBox.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- if (proxySupport.equals(event.getActionCommand())) {
- boolean b = HTTPProxyBox.isSelected();
- Color color = b ? Color.black : Color.gray ;
-
- HTTPProxyHost.setEnabled( b );
- HTTPProxyPort.setEnabled( b );
- HTTPProxyHostLabel.setForeground( color );
- HTTPProxyPortLabel.setForeground( color );
- }
- }
- }
- );
-
- // Set default proxy values...
- String tmp = System.getProperty( "http.proxyHost" );
-
- if ( tmp != null && tmp.equals("") ) {
- tmp = null ;
- }
-
- HTTPProxyBox.setSelected( tmp != null );
- HTTPProxyHost.setEnabled( tmp != null );
- HTTPProxyPort.setEnabled( tmp != null );
- HTTPProxyHostLabel.setForeground( tmp != null ? Color.black : Color.gray);
- HTTPProxyPortLabel.setForeground( tmp != null ? Color.black : Color.gray);
-
- if ( tmp != null ) {
- HTTPProxyBox.setSelected( true );
- HTTPProxyHost.setText( tmp );
- tmp = System.getProperty( "http.proxyPort" );
- if ( tmp != null && tmp.equals("") ) {
- tmp = null ;
- }
- if ( tmp == null ) {
- tmp = "80" ;
- }
- HTTPProxyPort.setText( tmp );
- }
-
- //add byte delay fields
- opts.add(Box.createRigidArea(new Dimension(1, 10)), c);
- c.anchor = GridBagConstraints.WEST;
- c.gridwidth = GridBagConstraints.REMAINDER;
- final String delaySupport = getMessage("delay00", "Simulate Slow Connection");
- opts.add(delayBox = new JCheckBox(delaySupport), c);
-
- //bytes per pause
- c.anchor = GridBagConstraints.WEST;
- c.gridwidth = 1;
- delayBytesLabel=new JLabel(getMessage("delay01", "Bytes per Pause"));
- opts.add(delayBytesLabel, c);
- delayBytesLabel.setForeground(Color.gray);
- c.anchor = GridBagConstraints.WEST;
- c.gridwidth = GridBagConstraints.REMAINDER;
- opts.add(delayBytes = new NumberField(6), c);
- delayBytes.setEnabled(false);
-
- //delay interval
- c.anchor = GridBagConstraints.WEST;
- c.gridwidth = 1;
- delayTimeLabel = new JLabel(getMessage("delay02", "Delay in Milliseconds"));
- opts.add(delayTimeLabel, c);
- delayTimeLabel.setForeground(Color.gray);
- c.anchor = GridBagConstraints.WEST;
- c.gridwidth = GridBagConstraints.REMAINDER;
- opts.add(delayTime = new NumberField(6), c);
- delayTime.setEnabled(false);
-
- //enabler callback
- delayBox.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- if (delaySupport.equals(event.getActionCommand())) {
- boolean b = delayBox.isSelected();
- Color color = b ? Color.black : Color.gray;
-
- delayBytes.setEnabled(b);
- delayTime.setEnabled(b);
- delayBytesLabel.setForeground(color);
- delayTimeLabel.setForeground(color);
- }
- }
- }
- );
-
- // Spacer
- //////////////////////////////////////////////////////////////////
- mainPane.add( Box.createRigidArea(new Dimension(1, 10)), c );
-
- // ADD Button
- ///////////////////////////////////////////////////////////////////
- c.anchor = GridBagConstraints.WEST ;
- c.gridwidth = GridBagConstraints.REMAINDER ;
- final String add = getMessage("add00", "Add");
-
- mainPane.add( addButton = new JButton( add ), c );
-
-
- this.add( new JScrollPane( mainPane ), BorderLayout.CENTER );
-
- // addButton.setEnabled( false );
- addButton.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- if ( add.equals(event.getActionCommand()) ) {
- String text ;
- Listener l = null ;
- int lPort;
- lPort=port.getValue(0);
- if(lPort==0) {
- //no port, button does nothing
- return;
- }
- String tHost = host.getText();
- int tPort = 0 ;
- tPort=tport.getValue(0);
- SlowLinkSimulator slowLink=null;
- if(delayBox.isSelected()) {
- int bytes= delayBytes.getValue(0);
- int time = delayTime.getValue(0);
- slowLink=new SlowLinkSimulator(bytes,time);
- }
- try {
- l = new Listener( noteb, null, lPort, tHost, tPort,
- proxyButton.isSelected(), slowLink);
- } catch (Exception e){
- e.printStackTrace();
- }
- // Pick-up the HTTP Proxy settings
- ///////////////////////////////////////////////////
- text = HTTPProxyHost.getText();
- if ( "".equals(text) ) {
- text = null ;
- }
- l.HTTPProxyHost = text ;
- text = HTTPProxyPort.getText();
- int proxyPort=HTTPProxyPort.getValue(-1);
- if(proxyPort!=-1) {
- l.HTTPProxyPort = Integer.parseInt(text);
- }
- //reset the port
- port.setText(null);
-
- /* but not, any more, the target port and host
- values
- host.setText(null);
- tport.setText(null);
- */
- }
- }
- }
- );
-try{
- PubSubWSmanager pman = new PubSubWSmanager();
-
- // notebook.addTab( name, this );
- PubSubWSsyntactic app = new PubSubWSsyntactic(noteb,pman);
- PubSubWSsemantic app2 = new PubSubWSsemantic(noteb,pman);
- Listener outgoing= new Listener( noteb, "Outgoing", pman.outport, "localhost", 8080, false,null);
- Listener incoming= new Listener( noteb, "Incoming", pman.inportL, "localhost", pman.inportS, false,null);
-}catch(Exception e){
- throw new RuntimeException(e);
-}
- notebook.repaint();
- notebook.setSelectedIndex( 0 );
-
-
- }
-
-
- }
-
- /**
* wait for incoming connections, spawn a connection thread when
* stuff comes in.
*/
@@ -1769,56 +1424,24 @@
}
- public PubSubClient(int listenPort, String targetHost, int targetPort, boolean embedded) {
- super ( getMessage("tcpmon00", "TCPMonitor") );
+ public PubSubClient(String hermes_home) throws Exception{
+ super ( "Apache Hermes Client" );
notebook = new JTabbedPane();
this.getContentPane().add( notebook );
- new AdminPage( notebook, getMessage("admin00", "Admin") );
-
- if ( listenPort != 0 ) {
- Listener l = null ;
-
- if ( targetHost == null ) {
- l = new Listener( notebook, null, listenPort,
- targetHost, targetPort, true, null);
- } else {
- l = new Listener( notebook, null, listenPort,
- targetHost, targetPort, false, null);
- }
- notebook.setSelectedIndex( 1 );
-
- l.HTTPProxyHost = System.getProperty( "http.proxyHost" );
- if ( l.HTTPProxyHost != null && l.HTTPProxyHost.equals("") ) {
- l.HTTPProxyHost = null ;
- }
+ PubSubWSmanager pman = new PubSubWSmanager(hermes_home);
- if ( l.HTTPProxyHost != null ) {
- String tmp = System.getProperty( "http.proxyPort" );
+ // notebook.addTab( name, this );
+ PubSubWSsyntactic app = new PubSubWSsyntactic(notebook,pman);
+ PubSubWSsemantic app2 = new PubSubWSsemantic(notebook,pman);
+ Listener outgoing= new Listener( notebook, "Outgoing", pman.outport, "localhost", 8080, false,null);
+ Listener incoming= new Listener( notebook, "Incoming", pman.inportL, "localhost", pman.inportS, false,null);
- if ( tmp != null && tmp.equals("") ) {
- tmp = null ;
- }
- if ( tmp == null ) {
- l.HTTPProxyPort = 80 ;
- } else {
- l.HTTPProxyPort = Integer.parseInt( tmp );
- }
- }
- }
-
- if(!embedded) {
- this.setDefaultCloseOperation(EXIT_ON_CLOSE);
- }
this.pack();
this.setSize( 600, 600 );
this.setVisible( true );
}
-
- public PubSubClient(int listenPort, String targetHost, int targetPort) {
- this(listenPort, targetHost, targetPort, false);
- }
/**
* set up the L&F
@@ -1850,28 +1473,9 @@
*/
public static void main(String[] args) {
try {
- //switch between swing L&F here
setupLookAndFeel(true);
- if ( args.length == 3 ) {
- int p1 = Integer.parseInt( args[0] );
- int p2 = Integer.parseInt( args[2] );
-
- new PubSubClient( p1, args[1], p2 );
- }
- else if ( args.length == 1 ) {
- int p1 = Integer.parseInt( args[0] );
-
- new PubSubClient( p1, null, 0 );
- }
- else if ( args.length != 0 ) {
- System.err.println( getMessage("usage00", "Usage:")
- + " tcpmon [listenPort targetHost targetPort]\n");
- }
- else {
- new PubSubClient(0, null, 0);
- }
- }
- catch ( Throwable exp ) {
+ new PubSubClient(args[0]);
+ }catch ( Throwable exp ) {
exp.printStackTrace();
}
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSmanager.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSmanager.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSmanager.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSmanager.java Fri Feb 11 09:11:47 2005
@@ -25,7 +25,7 @@
public int inportS;
/** Creates a new instance of PubSubWSmanager */
- public PubSubWSmanager() throws Exception{
+ public PubSubWSmanager(String hermes_home) throws Exception{
java.util.Random r = new java.util.Random(System.currentTimeMillis());
outport= r.nextInt(60000)+1024;
inportL =r.nextInt(60000)+1024;
@@ -33,12 +33,12 @@
JettyAxisServer jas = new JettyAxisServer();
jas.setPort(inportS);
- jas.setResourceBase(System.getProperty("HERMES_HOME")+"/trunk/src/java/org/apache/ws/eventing/app/client");
+ jas.setResourceBase(hermes_home+"/trunk/src/java/org/apache/ws/eventing/app/client");
jas.start();
System.out.println("JAS started"+jas.log.toString());
- nprod= new Subscriber("http://localhost:"+outport+"/axis/services/EventSourcePort");
+ nprod= new Subscriber("http://localhost:"+outport+"/axis/services/EventSourcePort",hermes_home+"/trunk/src/java/org/apache/ws/eventing/app/client/jndi-config.xml");
}
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSsyntactic.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSsyntactic.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSsyntactic.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/PubSubWSsyntactic.java Fri Feb 11 09:11:47 2005
@@ -25,12 +25,14 @@
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
+import java.util.Calendar;
public class PubSubWSsyntactic extends JPanel{
public JTabbedPane notebook = null ;
public JTextField filterstr =null;
public JTextField filtername =null;
public JButton subscribeButton= null;
public JButton unsubscribeButton= null;
+ public JButton renewButton= null;
public JButton publishButton= null;
public JTextArea pubtext=null;
public JList subs=null;
@@ -98,7 +100,7 @@
// remove();
//}
try{
- // Publisher.publish("http://localhost:"+pman.outport+"/axis/services/NotificationPort", pubtext.getText());
+ Publisher.publish("http://localhost:"+pman.outport+"/axis/services/NotificationPort", pubtext.getText());
}catch(Exception e){
e.printStackTrace();
}
@@ -132,8 +134,8 @@
};
nots.addMouseListener(mouseListener);
ls.add(scrollPane2);
-
this.add(ls);
+ /*
this.add(unsubscribeButton = new JButton("Unsubscribe"));
unsubscribeButton.addActionListener( new ActionListener() {
public void actionPerformed(ActionEvent event) {
@@ -142,7 +144,18 @@
s.unsubscribe();
}
}
- }
+ }*/
+ this.add(renewButton = new JButton("Renew"));
+ renewButton.addActionListener( new ActionListener() {
+ public void actionPerformed(ActionEvent event) {
+ if(subs.getSelectedIndex()!=-1){
+ org.apache.ws.pubsub.Subscription s = (org.apache.ws.pubsub.Subscription)sublistmodel.getElementAt(subs.getSelectedIndex());
+ Calendar c = Calendar.getInstance();
+ c.add(Calendar.HOUR, 1);
+ s.setTerminationTime(c);
+ }
+ }
+ }
);
notebook.addTab( "PubSubWSsyntactic", this );
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/WEB-INF/server-config.wsdd
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/WEB-INF/server-config.wsdd?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/WEB-INF/server-config.wsdd (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/WEB-INF/server-config.wsdd Fri Feb 11 09:11:47 2005
@@ -30,22 +30,10 @@
<parameter name="className" value="org.apache.axis.Version"/>
</service>
- <service name="SubscriptionEndPort" provider="java:RPC" style="document" use="literal">
- <parameter name="allowedMethods" value="*"/>
- <parameter name="wsdlPortType" value="SubscriptionEnd"/>
- <parameter name="className" value="org.apache.ws.eventing.services.subscriber.SubscriptionEndPort"/>
- <parameter name="wsdlServicePort" value="SubscriptionEndPort"/>
- <parameter name="wsdlTargetNamespace" value="http://schemas.xmlsoap.org/ws/2004/08/eventing/services"/>
- <parameter name="wsdlServiceElement" value="EventingService"/>
+ <service name="SubscriptionEndPort" provider="java:WSRF" style="document" use="literal">
</service>
- <service name="NotificationPort" provider="java:MSG" style="message" use="literal">
- <parameter name="allowedMethods" value="filter"/>
- <parameter name="wsdlPortType" value="Notification"/>
- <parameter name="className" value="org.apache.ws.eventing.services.subscriber.NotificationPort"/>
- <parameter name="wsdlServicePort" value="NotificationPort"/>
- <parameter name="wsdlTargetNamespace" value="http://schemas.xmlsoap.org/ws/2004/08/eventing/services"/>
- <parameter name="wsdlServiceElement" value="NotificationService"/>
+ <service name="NotificationPort" provider="java:WSRFMsg" style="message" use="literal">
</service>
<transport name="http">
Added: incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/jndi-config.xml
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/jndi-config.xml?view=auto&rev=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/jndi-config.xml (added)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/app/client/jndi-config.xml Fri Feb 11 09:11:47 2005
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+ <global>
+
+ <resource name="DefaultParameters" type="org.apache.ws.util.jndi.DefaultParameters">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyClassName</name>
+ <value>org.apache.ws.resource.impl.SimpleTypeResourceKey</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="timer/ContainerTimer" type="org.apache.ws.util.timer.TimerManagerImpl">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="topic/eval/simple" type="org.apache.ws.notification.topics.impl.SimpleTopicExpressionEvaluator">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="topic/ContainerTopicExpressionEngine" type="org.apache.ws.notification.topics.impl.TopicExpressionEngineImpl">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ </global>
+
+
+
+ <service name="NotificationPort">
+ <resource name="home" type="org.apache.ws.eventing.SubscriptionHome">
+ <resourceParams>
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.eventing.services.subscriber.SubscriberService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.eventing.Subscription</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/eventing/services/NotificationPort</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyName</name>
+ <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </service>
+
+ <service name="SubscriptionEndPort">
+ <resource name="home" type="org.apache.ws.eventing.SubscriptionHome">
+ <resourceParams>
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.eventing.services.subscriber.SubscriberService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.eventing.Subscription</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/eventing/services/SubscriptionEndPort</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyName</name>
+ <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </service>
+</jndiConfig>
+
Added: incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/NotificationPortType.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/NotificationPortType.java?view=auto&rev=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/NotificationPortType.java (added)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/NotificationPortType.java Fri Feb 11 09:11:47 2005
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2001-2004 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.eventing.porttype;
+import org.apache.axis.message.SOAPEnvelope;
+
+public interface NotificationPortType {
+ void filter(SOAPEnvelope req, SOAPEnvelope resp);
+}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/EventSourcePortTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/EventSourcePortTypeImpl.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/EventSourcePortTypeImpl.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/EventSourcePortTypeImpl.java Fri Feb 11 09:11:47 2005
@@ -31,6 +31,7 @@
import org.apache.ws.eventing.ForwardConsumer;
+import org.apache.ws.addressing.*;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -40,11 +41,20 @@
try{
//create Subscription
Context initialContext = new InitialContext( );
- System.out.println("get RemoteResourceSubscriptionHome " + RemoteSubscriptionHome.HOME_LOCATION);
+ //System.out.println("get RemoteResourceSubscriptionHome " + RemoteSubscriptionHome.HOME_LOCATION);
RemoteSubscriptionHome sH = (RemoteSubscriptionHome) initialContext.lookup( RemoteSubscriptionHome.HOME_LOCATION );
RemoteSubscription subscription = sH.create(body);
- subscription.setNotificationConsumer(new ForwardConsumer());
+ //create NotifyTO EPR
+ EndpointReference notifyto=null;
+ if(body.getSubscribe().getDelivery().getNotifyTo()!=null)
+ notifyto= new XmlBeansEndpointReference(body.getSubscribe().getDelivery().getNotifyTo());
+ //create EndTO EPR
+ EndpointReference endto=null;
+ if(body.getSubscribe().getEndTo()!=null)
+ endto= new XmlBeansEndpointReference(body.getSubscribe().getEndTo());
+
+ subscription.setNotificationConsumer(new ForwardConsumer(notifyto,endto));
//build response
SubscribeResponseDocument responseDom= SubscribeResponseDocument.Factory.newInstance();
SubscribeResponseDocument.SubscribeResponse response = responseDom.addNewSubscribeResponse();
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/NotificationPortTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/NotificationPortTypeImpl.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/NotificationPortTypeImpl.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/NotificationPortTypeImpl.java Fri Feb 11 09:11:47 2005
@@ -16,18 +16,50 @@
package org.apache.ws.eventing.porttype.impl;
-import org.apache.axis.message.*;
+import org.apache.axis.message.SOAPEnvelope;
+import org.apache.ws.resource.properties.v1_2.porttype.impl.AbstractResourcePropertiesPortType;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.eventing.Subscription;
+import org.apache.axis.utils.XMLUtils;
-public class NotificationPortTypeImpl{
-
+import org.apache.ws.eventing.RemoteSubscriptionHome;
+
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+
+public class NotificationPortTypeImpl extends AbstractResourcePropertiesPortType implements org.apache.ws.eventing.porttype.NotificationPortType{
+ private static final Log LOG = LogFactory.getLog( NotificationPortTypeImpl.class.getName() );
+ private boolean m_broker;
+
+ public NotificationPortTypeImpl( ResourceContext resourceContext,boolean broker)
+ {
+ super( resourceContext );
+ m_broker=broker;
+ }
//TODO maybe remove Axis dep
//TODO use WSRF Provider with Message styler
- public void filter(SOAPEnvelope req, SOAPEnvelope resp){
-/* SubscriberStore b = SubscriberStore.instance();
- System.out.println("Notifier.filter()");
- b.notify(req);
- */
- }
+ public void filter(SOAPEnvelope req, SOAPEnvelope resp){
+ try{
+ String xml =XMLUtils.ElementToString(req.getBody());
+ if(m_broker==false){
+ Subscription subscription = (Subscription) getResource();
+ LOG.info("notification for subscription : "+ subscription.getID());
+ subscription.getNotificationConsumer().notify(subscription,xml);
+ }else{
+ LOG.info("filtering ");
+ Context initialContext = new InitialContext( );
+ RemoteSubscriptionHome sH = (RemoteSubscriptionHome) initialContext.lookup( RemoteSubscriptionHome.HOME_LOCATION );
+ sH.notify(xml);
+ }
+ }catch(Exception e){
+ //TODO
+ e.printStackTrace();
+ }
+ }
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionEndPortTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionEndPortTypeImpl.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionEndPortTypeImpl.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionEndPortTypeImpl.java Fri Feb 11 09:11:47 2005
@@ -18,8 +18,19 @@
import java.rmi.RemoteException;
import org.apache.ws.eventing.porttype.SubscriptionEndPortType;
-public class SubscriptionEndPortTypeImpl implements SubscriptionEndPortType{
+import org.apache.ws.eventing.Subscription;
+
+import org.apache.ws.resource.properties.v1_2.porttype.impl.AbstractResourcePropertiesPortType;
+import org.apache.ws.resource.ResourceContext;
+
+public class SubscriptionEndPortTypeImpl extends AbstractResourcePropertiesPortType implements SubscriptionEndPortType{
+ public SubscriptionEndPortTypeImpl( ResourceContext resourceContext )
+ {
+ super( resourceContext );
+ }
+
public void subscriptionEnd(org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscriptionEndDocument body) throws RemoteException {
- System.out.println("SubscriptionEnd"+body.xmlText());
+ Subscription subscription = (Subscription) getResource();
+ subscription.destroy();
}
}
Modified: incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionManagerPortTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionManagerPortTypeImpl.java?view=diff&r1=153422&r2=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionManagerPortTypeImpl.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/porttype/impl/SubscriptionManagerPortTypeImpl.java Fri Feb 11 09:11:47 2005
@@ -36,62 +36,32 @@
}
public RenewResponseDocument renew(RenewDocument body) throws RemoteException {
-/* String id = extractIdentifier();
-
- YFilterStore b = YFilterStore.instance();
- Subscription s = (org.apache.ws.eventing.Subscription)b.getSubscription(id);
- //update expiration
- //TODO test Calendar
- s.setTerminationTime((java.util.Calendar)body.getRenew().getExpires());
-
- RenewResponseDocument responseDom = RenewResponseDocument.Factory.newInstance();
- RenewResponseDocument.RenewResponse response = responseDom.addNewRenewResponse();
- //TODO test Calendar
- response.setExpires(s.getTerminationTime());
+ RemoteSubscription subscription = (RemoteSubscription) getResource();
+ //TODO why no ExpirationType
+ org.apache.xmlbeans.XmlCalendar et = (org.apache.xmlbeans.XmlCalendar)body.getRenew().getExpires();
+ subscription.setTerminationTime(et);
+ RenewResponseDocument responseDom = RenewResponseDocument.Factory.newInstance();
+ RenewResponseDocument.RenewResponse response = responseDom.addNewRenewResponse();
+ //TODO response with new expirationType
+ response.setExpires(subscription.getTerminationTime());
return(responseDom);
- */
- //TODO
- return null;
}
public GetStatusResponseDocument getStatus(GetStatusDocument body) throws RemoteException {
-/*// try{
- String id = extractIdentifier();
- //ask the Broker about the Status
- YFilterStore b = YFilterStore.instance();
- Subscription s = (org.apache.ws.eventing.Subscription)b.getSubscription(id);
+ RemoteSubscription subscription = (RemoteSubscription) getResource();
- //build response
- GetStatusResponseDocument responseDom = GetStatusResponseDocument.Factory.newInstance();
- GetStatusResponseDocument.GetStatusResponse response = responseDom.addNewGetStatusResponse();
- //TODO check calendar
- response.setExpires(s.getTerminationTime());
- return(responseDom);
- */
-/* }catch(Exception e){
- e.printStackTrace();
- throw new java.rmi.RemoteException("getStatusMsg",e);
- }
- **/
- //TODO
- return null;
+ //build response
+ GetStatusResponseDocument responseDom = GetStatusResponseDocument.Factory.newInstance();
+ GetStatusResponseDocument.GetStatusResponse response = responseDom.addNewGetStatusResponse();
+ //TODO check calendar
+ response.setExpires(subscription.getTerminationTime());
+ return(responseDom);
}
public void unsubscribe(UnsubscribeDocument body) throws RemoteException {
RemoteSubscription subscription = (RemoteSubscription) getResource();
subscription.unsubscribe();
- /* try{
- String id = extractIdentifier();
- System.out.println("unsubscribe Subscription: "+id);
- YFilterStore b = YFilterStore.instance();
- b.removeSubscription(id);
-
- }catch(Exception e){
- e.printStackTrace();
- throw new java.rmi.RemoteException("unsubscribeMsg",e);
- }
- */
}
Added: incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/broker/BrokerService.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/broker/BrokerService.java?view=auto&rev=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/broker/BrokerService.java (added)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/broker/BrokerService.java Fri Feb 11 09:11:47 2005
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2001-2004 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.eventing.services.broker;
+
+import org.apache.ws.eventing.services.AbstractService;
+import org.apache.ws.resource.ResourceContext;
+
+import org.apache.ws.eventing.porttype.*;
+import org.apache.ws.eventing.porttype.impl.*;
+
+public class BrokerService extends AbstractService implements SubscriptionEndPortType, NotificationPortType,EventSourcePortType, SubscriptionManagerPortType {
+
+ public BrokerService(ResourceContext resourceContext)
+ {
+ m_resourceContext = resourceContext;
+ init();
+ }
+ public org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscribeResponseDocument subscribe(org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscribeDocument body) throws java.rmi.RemoteException {
+ return new EventSourcePortTypeImpl().subscribe(body);
+ }
+
+ public org.xmlsoap.schemas.ws.x2004.x08.eventing.GetStatusResponseDocument getStatus(org.xmlsoap.schemas.ws.x2004.x08.eventing.GetStatusDocument body) throws java.rmi.RemoteException {
+ return new SubscriptionManagerPortTypeImpl(getResourceContext()).getStatus(body);
+ }
+
+ public org.xmlsoap.schemas.ws.x2004.x08.eventing.RenewResponseDocument renew(org.xmlsoap.schemas.ws.x2004.x08.eventing.RenewDocument body) throws java.rmi.RemoteException {
+ return new SubscriptionManagerPortTypeImpl(getResourceContext()).renew(body);
+ }
+
+
+ public void unsubscribe(org.xmlsoap.schemas.ws.x2004.x08.eventing.UnsubscribeDocument body) throws java.rmi.RemoteException {
+ new SubscriptionManagerPortTypeImpl(getResourceContext()).unsubscribe(body);
+ }
+
+ public void subscriptionEnd(org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscriptionEndDocument body) throws java.rmi.RemoteException {
+ new SubscriptionEndPortTypeImpl(getResourceContext()).subscriptionEnd(body);
+ }
+
+ public void filter(org.apache.axis.message.SOAPEnvelope req, org.apache.axis.message.SOAPEnvelope resp) {
+ new NotificationPortTypeImpl(getResourceContext(),true).filter(req, resp);
+ }
+
+}
Added: incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/subscriber/SubscriberService.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/subscriber/SubscriberService.java?view=auto&rev=153423
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/subscriber/SubscriberService.java (added)
+++ incubator/hermes/trunk/src/java/org/apache/ws/eventing/services/subscriber/SubscriberService.java Fri Feb 11 09:11:47 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2001-2004 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.eventing.services.subscriber;
+
+import org.apache.ws.eventing.services.AbstractService;
+import org.apache.ws.resource.ResourceContext;
+
+import org.apache.ws.eventing.porttype.NotificationPortType;
+import org.apache.ws.eventing.porttype.impl.NotificationPortTypeImpl;
+
+import org.apache.ws.eventing.porttype.SubscriptionEndPortType;
+import org.apache.ws.eventing.porttype.impl.SubscriptionEndPortTypeImpl;
+
+public class SubscriberService extends AbstractService implements SubscriptionEndPortType, NotificationPortType {
+
+ public SubscriberService(ResourceContext resourceContext)
+ {
+ m_resourceContext = resourceContext;
+ init();
+ }
+
+ public void subscriptionEnd(org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscriptionEndDocument body) throws java.rmi.RemoteException {
+ new SubscriptionEndPortTypeImpl(getResourceContext()).subscriptionEnd(body);
+ }
+
+ public void filter(org.apache.axis.message.SOAPEnvelope req, org.apache.axis.message.SOAPEnvelope resp) {
+ new NotificationPortTypeImpl(getResourceContext(),false).filter(req, resp);
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: hermes-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: hermes-dev-help@ws.apache.org