ws-muse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r158950 - in incubator/muse/trunk/src: java/org/apache/ws/muws/v1_0/events/ java/org/apache/ws/muws/v1_0/topics/ site/content/interop/src/java/org/apache/ws/resource/example/blackberry/ site/content/interop/src/java/org/apache/ws/resource/example/ipmiserver/ site/content/interop/src/java/org/everestWeather/wsdm/samples/x2005/x04/schema/
Date Thu, 24 Mar 2005 22:05:19 GMT
Author: scamp
Date: Thu Mar 24 14:05:18 2005
New Revision: 158950

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


Added:
    incubator/muse/trunk/src/java/org/apache/ws/muws/v1_0/events/
    incubator/muse/trunk/src/java/org/apache/ws/muws/v1_0/topics/
Modified:
    incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/blackberry/BlackberryResource.java
    incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/ipmiserver/IpmiserverResource.java
    incubator/muse/trunk/src/site/content/interop/src/java/org/everestWeather/wsdm/samples/x2005/x04/schema/WeatherstationResource.java

Modified: incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/blackberry/BlackberryResource.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/blackberry/BlackberryResource.java?view=diff&r1=158949&r2=158950
==============================================================================
--- incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/blackberry/BlackberryResource.java
(original)
+++ incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/blackberry/BlackberryResource.java
Thu Mar 24 14:05:18 2005
@@ -1,14 +1,22 @@
 
 package org.apache.ws.resource.example.blackberry;
 
-import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.mows.v1_0.capability.OperationalStatusCapability;
+import org.apache.ws.muws.v1_0.capability.ConfigurationCapability;
 import org.apache.ws.muws.v1_0.capability.IdentityCapability;
 import org.apache.ws.muws.v1_0.capability.MetricsCapability;
-import org.apache.ws.muws.v1_0.capability.ConfigurationCapability;
-import org.apache.ws.mows.v1_0.capability.OperationalStatusCapability;
+import org.apache.ws.resource.properties.ResourceProperty;
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument;
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.CurrentTimeDocument;
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument;
+import rim.pda.AllocatedStorageDocument;
+import rim.pda.DateDocument;
+import rim.pda.FreeStorageDocument;
+import rim.pda.TimeDocument;
+import rim.pda.TotalCodeModuleSizeDocument;
+
+import java.util.Calendar;
 
 /**
  * A Blackberry WS-Resource.
@@ -76,7 +84,7 @@
         manageabilityCapabilityDocument.setManageabilityCapability(OperationalStatusCapability.URI);
         resourceProperty.add(manageabilityCapabilityDocument);
 
-        //todo
+
         /** Properties **/
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.RESOURCEID);
         ResourceIdDocument resourceIdDocument = ResourceIdDocument.Factory.newInstance();
@@ -84,18 +92,63 @@
         resourceProperty.add(resourceIdDocument);
 
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.ALLOCATEDSTORAGE);
+        AllocatedStorageDocument allocatedStorageDocument = AllocatedStorageDocument.Factory.newInstance();
+        allocatedStorageDocument.setAllocatedStorage(1024);
+        resourceProperty.add(allocatedStorageDocument);
+
+        //Calendar for use in a few properties
+        Calendar calendarInstance = Calendar.getInstance();
+
+        //current time is done like in Apollo
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.CURRENTTIME);
+        rim.pda.CurrentTimeDocument rimCurrentTime = rim.pda.CurrentTimeDocument.Factory.newInstance();
+        rimCurrentTime.setCurrentTime(calendarInstance.toString());
+        resourceProperty.add(rimCurrentTime);
+        //todo this won't work expects string
+        // resourceProperty.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback(
 ) );
+
+
+        //current time is done like in Apollo
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.CURRENTTIME2);
+        CurrentTimeDocument currentTimeDocument = CurrentTimeDocument.Factory.newInstance();
+        currentTimeDocument.setCurrentTime(calendarInstance);
+        resourceProperty.add(currentTimeDocument);
+        resourceProperty.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback(
 ) );
+
+
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.DATE);
+        DateDocument dateDocument = DateDocument.Factory.newInstance();
+        DateDocument.Date date = dateDocument.addNewDate();
+        date.setDay(calendarInstance.get(Calendar.DAY_OF_MONTH));
+        date.setMonth(calendarInstance.get(Calendar.MONTH));
+        date.setYear(calendarInstance.get(Calendar.YEAR));
+        dateDocument.setDate(date);
+        resourceProperty.add(dateDocument);
+
+
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.FREESTORAGE);
-        
+        FreeStorageDocument freeStorageDocument = FreeStorageDocument.Factory.newInstance();
+        freeStorageDocument.setFreeStorage(384);
+        resourceProperty.add(freeStorageDocument);
+
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.OPERATIONALSTATUS);
         OperationalStatusDocument operationalStatusDocument = OperationalStatusDocument.Factory.newInstance();
         operationalStatusDocument.setOperationalStatus(OperationalStatusDocument.OperationalStatus.AVAILABLE);
         resourceProperty.add(operationalStatusDocument);
 
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.TIME);
+        TimeDocument timeDocument = TimeDocument.Factory.newInstance();
+        TimeDocument.Time time = timeDocument.addNewTime();
+        time.setHour(calendarInstance.get(Calendar.HOUR_OF_DAY));//24 hr clock..no indication
in spec
+        time.setMinute(calendarInstance.get(Calendar.MINUTE));
+        resourceProperty.add(timeDocument);
+
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.TOTALCODEMODULESIZE);
+        TotalCodeModuleSizeDocument totalCodeModuleSizeDocument = TotalCodeModuleSizeDocument.Factory.newInstance();
+        totalCodeModuleSizeDocument.setTotalCodeModuleSize(256);
+        resourceProperty.add(totalCodeModuleSizeDocument);
+        //todo this need a callback which MAY trigger a periodic change...we need this to
generate a event..no indication how to trigger
+
     }
 
 }

Modified: incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/ipmiserver/IpmiserverResource.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/ipmiserver/IpmiserverResource.java?view=diff&r1=158949&r2=158950
==============================================================================
--- incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/ipmiserver/IpmiserverResource.java
(original)
+++ incubator/muse/trunk/src/site/content/interop/src/java/org/apache/ws/resource/example/ipmiserver/IpmiserverResource.java
Thu Mar 24 14:05:18 2005
@@ -8,6 +8,10 @@
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument;
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument;
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument;
+import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.CurrentTimeDocument;
+import org.everestWeather.wsdm.samples.x2005.x04.schema.WeatherstationPropertyQNames;
+
+import java.util.Calendar;
 
 /**
  * A Ipmiserver WS-Resource.
@@ -60,15 +64,24 @@
         manageabilityCapabilityDocument.setManageabilityCapability("http://.../ServerReset");
         resourceProperty.add(manageabilityCapabilityDocument);
 
-        //todo
         /** Properties **/
         resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.RESOURCEID);
         ResourceIdDocument resourceIdDocument = ResourceIdDocument.Factory.newInstance();
         resourceIdDocument.setResourceId((String)getID());
         resourceProperty.add(resourceIdDocument);
 
-        resourceProperty = resourcePropertySet.get(IpmiserverPropertyQNames.CPUUSAGE);  
     
-        resourceProperty = resourcePropertySet.get(IpmiserverPropertyQNames.CURRENTTIME);
+        resourceProperty = resourcePropertySet.get(IpmiserverPropertyQNames.CPUUSAGE);
+        CpuUsageDocument cpuUsageDocument = CpuUsageDocument.Factory.newInstance();
+        //todo this should be some sort of metric..not sure if defined correctly
+        resourceProperty.add(cpuUsageDocument);
+
+        //current time is done like in Apollo
+        resourceProperty = resourcePropertySet.get(BlackberryPropertyQNames.CURRENTTIME);
+        CurrentTimeDocument currentTimeDocument = CurrentTimeDocument.Factory.newInstance();
+        currentTimeDocument.setCurrentTime(Calendar.getInstance());
+        resourceProperty.add(currentTimeDocument);
+        resourceProperty.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback(
 ) );
+
 
         resourceProperty = resourcePropertySet.get(IpmiserverPropertyQNames.OPERATIONALSTATUS);
         OperationalStatusDocument operationalStatusDocument = OperationalStatusDocument.Factory.newInstance();

Modified: incubator/muse/trunk/src/site/content/interop/src/java/org/everestWeather/wsdm/samples/x2005/x04/schema/WeatherstationResource.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/site/content/interop/src/java/org/everestWeather/wsdm/samples/x2005/x04/schema/WeatherstationResource.java?view=diff&r1=158949&r2=158950
==============================================================================
--- incubator/muse/trunk/src/site/content/interop/src/java/org/everestWeather/wsdm/samples/x2005/x04/schema/WeatherstationResource.java
(original)
+++ incubator/muse/trunk/src/site/content/interop/src/java/org/everestWeather/wsdm/samples/x2005/x04/schema/WeatherstationResource.java
Thu Mar 24 14:05:18 2005
@@ -21,6 +21,8 @@
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipTypeType;
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.CurrentTimeDocument;
 
+import java.util.Calendar;
+
 /**
  * A Weatherstation WS-Resource.
  * <p/>
@@ -96,7 +98,12 @@
         resourceIdDocument.setResourceId((String)getID());
         resourceProperty.add(resourceIdDocument);
 
+        //current time is done like in Apollo
         resourceProperty = resourcePropertySet.get(WeatherstationPropertyQNames.CURRENTTIME);
+        CurrentTimeDocument currentTimeDocument = CurrentTimeDocument.Factory.newInstance();
+        currentTimeDocument.setCurrentTime(Calendar.getInstance());
+        resourceProperty.add(currentTimeDocument);
+        resourceProperty.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback(
 ) );
 
 
         resourceProperty = resourcePropertySet.get(WeatherstationPropertyQNames.OPERATIONALSTATUS);



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


Mime
View raw message