You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-dev@ws.apache.org by sc...@apache.org on 2005/03/17 17:37:29 UTC

svn commit: r157943 - in incubator/apollo/trunk/src: java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java java/org/apache/ws/resource/lifetime/impl/ResourceTerminationEventImpl.java site/content/example/test-build.properties

Author: scamp
Date: Thu Mar 17 08:37:27 2005
New Revision: 157943

URL: http://svn.apache.org/viewcvs?view=rev&rev=157943
Log: (empty)


Added:
    incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java
    incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/ResourceTerminationEventImpl.java
Modified:
    incubator/apollo/trunk/src/site/content/example/test-build.properties

Added: incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java?view=auto&rev=157943
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java (added)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/AbstractResourceTerminationEvent.java Thu Mar 17 08:37:27 2005
@@ -0,0 +1,85 @@
+package org.apache.ws.resource.lifetime.impl;
+
+import org.apache.ws.resource.lifetime.ResourceTerminationEvent;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.ws.XmlObjectWrapper;
+import org.apache.xmlbeans.XmlObject;
+
+import java.util.Calendar;
+
+
+/**
+ * @author Sal Campana
+ */
+public abstract class AbstractResourceTerminationEvent implements ResourceTerminationEvent
+{
+    private Calendar m_terminationTime;
+    private Object m_reason;
+    private Object m_resourceId;
+
+    /**
+     * Sets termination time and reason to passed in params.
+     *
+     * @param resourceId The resource Id of the resource being destroyed.
+     * @param terminationTime
+     * @param reason
+     */
+    public AbstractResourceTerminationEvent(Object resourceId, Calendar terminationTime, Object reason)
+    {
+        m_terminationTime = terminationTime;
+        m_reason = reason;
+        m_resourceId = resourceId;
+    }
+
+    /**
+     * Set the reson to the object specified and termination time is set upon construction.
+     *
+     * @param resourceId The resource Id of the resource being destroyed.
+     * @param reason
+     */
+    public AbstractResourceTerminationEvent(Object resourceId,Object reason)
+    {
+        this(resourceId, Calendar.getInstance(), reason);
+    }
+
+    /**
+     * Constructor creates termination time upon construction.  Reason is null.
+     *
+     * @param resourceId The resource Id of the resource being destroyed.
+     */
+    public AbstractResourceTerminationEvent(Object resourceId)
+    {
+        this(resourceId, Calendar.getInstance(), null);
+    }
+
+    /**
+     * Returns the termination time.
+     * <p/>
+     * minOccurs="1" maxOccurs="1" nillable="true"
+     *
+     * @return The termination time represented as a Calendar instance.
+     */
+    public Calendar getTerminationTime()
+    {
+        return m_terminationTime;
+    }
+
+    /**
+     * Returns the reason for temrination.
+     * <p/>
+     * minOccurs="0" maxOccurs="1"
+     *
+     * @return The reason for termination.
+     */
+    public Object getReason()
+    {
+        return m_reason;
+    }
+
+    public Object getResourceId()
+    {
+        return m_resourceId;
+    }
+
+    protected abstract XmlObject getTerminationNotifDocXmlBean( NamespaceVersionHolder namespaces );
+}

Added: incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/ResourceTerminationEventImpl.java
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/ResourceTerminationEventImpl.java?view=auto&rev=157943
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/ResourceTerminationEventImpl.java (added)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/lifetime/impl/ResourceTerminationEventImpl.java Thu Mar 17 08:37:27 2005
@@ -0,0 +1,93 @@
+package org.apache.ws.resource.lifetime.impl;
+
+import org.apache.ws.resource.lifetime.impl.AbstractResourceTerminationEvent;
+import org.apache.ws.resource.lifetime.ResourceTerminationEvent;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlString;
+
+import java.util.Calendar;
+
+
+/**
+ * @author Sal Campana
+ */
+public class ResourceTerminationEventImpl extends AbstractResourceTerminationEvent
+        implements ResourceTerminationEvent
+{
+    /**
+     * Sets termination time and reason to passed in params.
+     *
+     * @param resourceId      The resource Id of the resource being destroyed.
+     * @param terminationTime
+     * @param reason
+     */
+    public ResourceTerminationEventImpl(Object resourceId, Calendar terminationTime, Object reason)
+    {
+        super(resourceId, terminationTime, reason);
+    }
+
+    /**
+     * Constructor creates termination time upon construction.  Reason is null.
+     *
+     * @param resourceId The resource Id of the resource being destroyed.
+     */
+    public ResourceTerminationEventImpl(Object resourceId)
+    {
+        super(resourceId);
+    }
+
+    /**
+     * Set the reson to the object specified and termination time is set upon construction.
+     *
+     * @param resourceId The resource Id of the resource being destroyed.
+     * @param reason
+     */
+    public ResourceTerminationEventImpl(Object resourceId, Object reason)
+    {
+        super(resourceId, reason);
+    }
+
+
+    public XmlObject getTerminationNotifDocXmlBean(NamespaceVersionHolder namespaces)
+    {
+        Object reason = getReason();
+        if (!(reason instanceof XmlObject))
+        {
+            reason = XmlString.Factory.newInstance();
+            ((XmlString) reason).setStringValue(reason.toString());
+        }
+
+        if (namespaces instanceof org.apache.ws.resource.properties.v1_2_draft05.impl.NamespaceVersionHolderImpl)
+        {
+            org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSResourceLifetime12Draft04.TerminationNotificationDocument notifDoc = org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSResourceLifetime12Draft04.TerminationNotificationDocument.Factory.newInstance();
+            org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSResourceLifetime12Draft04.TerminationNotificationDocument.TerminationNotification terminationNotification = notifDoc.addNewTerminationNotification();
+            terminationNotification.setTerminationTime(getTerminationTime());
+
+            if (reason != null)
+            {
+                terminationNotification.setTerminationReason((XmlObject) reason);
+            }
+
+            return notifDoc;
+        }
+        else if (namespaces instanceof org.apache.ws.resource.properties.v1_2_draft01.impl.NamespaceVersionHolderImpl)
+        {
+            org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationNotificationDocument notifDoc = org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationNotificationDocument.Factory.newInstance();
+            org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationNotificationDocument.TerminationNotification terminationNotification = notifDoc.addNewTerminationNotification();
+            terminationNotification.setTerminationTime(getTerminationTime());
+
+
+            if (reason != null)
+            {
+                terminationNotification.setTerminationReason((XmlObject) reason);
+            }
+
+            return notifDoc;
+        }
+        else throw new org.apache.ws.resource.impl.UnsupportedVersionException(namespaces);
+
+
+    }
+
+}

Modified: incubator/apollo/trunk/src/site/content/example/test-build.properties
URL: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/site/content/example/test-build.properties?view=diff&r1=157942&r2=157943
==============================================================================
--- incubator/apollo/trunk/src/site/content/example/test-build.properties (original)
+++ incubator/apollo/trunk/src/site/content/example/test-build.properties Thu Mar 17 08:37:27 2005
@@ -11,10 +11,10 @@
 #printerFactoryURL=http://localhost:8080/wsrf/services/PrinterFactory
 
 #Virginia.EDU
-printerFactoryURL=http://opteron6.cs.virginia.edu/WSRF/Test/Interop2/PrinterService.asmx
+#printerFactoryURL=http://opteron6.cs.virginia.edu/WSRF/Test/Interop2/PrinterService.asmx
 
 #Fujitsu
-#printerFactoryURL=http://193.133.239.220:8080/axis/services/PrinterFactory
+printerFactoryURL=http://193.133.239.220:8080/axis/services/PrinterFactory
 
 ##        
 # Determines if the unit test will run an embedded version of Axis



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