Package org.everestWeather.wsdm.samples.x2005.x04.schema.impl

Examples of org.everestWeather.wsdm.samples.x2005.x04.schema.impl.WeatherStationPropertiesDocumentImpl


    {
        XmlObject[] capabilityElems = m_resource.getResourceProperty(
                ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
        assertContainsURI( capabilityElems, OperationalStatusCapability.URI );
        assertContainsURI( capabilityElems, CAPABILITY_URI_SERVER_ALERT_STATUS );
        AttentionLedOnDocument attentionLedOnDoc = AttentionLedOnDocument.Factory.newInstance();
        attentionLedOnDoc.setAttentionLedOn( true );
        setSingleProperty( m_resource, attentionLedOnDoc );
        System.out.println( "svr:AttentionLedOn property has been set to true." );
        System.out.println( "*** Please verify that the front panel attention LED blinks for approximately ten seconds." );
    }
View Full Code Here


        getCurrentTemperatureResponse.setGetCurrentTemperatureResult(aDouble.doubleValue());

        try
        {
            InitialContext initialContext = new InitialContext();
            WeatherstationHome home = (WeatherstationHome) initialContext.lookup(WeatherstationHome.HOME_LOCATION);
            SimpleTypeResourceKey simpleTypeResourceKey = new SimpleTypeResourceKey(new QName(WeatherstationPropertyQNames.FCCID.getNamespaceURI(), "ResourceID"),
                                                                                    InteropConstants.WEATHERSTATION_KEY1);
            WeatherstationResource resource = (WeatherstationResource) home.find(simpleTypeResourceKey);
            Topic topic = resource.getTopicSpaceSet().getTopicSpace(MowsConstants.NSURI_MOWS_TOPICS).getTopic("RequestProcessingObservations");
            Calendar currentTime = Calendar.getInstance();

            //RequestProcessingNotification
            RequestProcessingNotificationDocument notifDocument = RequestProcessingNotificationDocument.Factory.newInstance();
View Full Code Here

        {
            InitialContext initialContext = new InitialContext();
            WeatherstationHome home = (WeatherstationHome) initialContext.lookup(WeatherstationHome.HOME_LOCATION);
            SimpleTypeResourceKey simpleTypeResourceKey = new SimpleTypeResourceKey(new QName(WeatherstationPropertyQNames.FCCID.getNamespaceURI(), "ResourceID"),
                                                                                    InteropConstants.WEATHERSTATION_KEY1);
            WeatherstationResource resource = (WeatherstationResource) home.find(simpleTypeResourceKey);
            Topic topic = resource.getTopicSpaceSet().getTopicSpace(MowsConstants.NSURI_MOWS_TOPICS).getTopic("RequestProcessingObservations");
            Calendar currentTime = Calendar.getInstance();

            //RequestProcessingNotification
            RequestProcessingNotificationDocument notifDocument = RequestProcessingNotificationDocument.Factory.newInstance();
            RequestProcessingNotificationDocument.RequestProcessingNotification notif = notifDocument.addNewRequestProcessingNotification();
View Full Code Here

            getProperties(  ).setBlockSize( m_backendDiskBean.getBlockSize(  ) );
         }
      }
      else if ( propQName.equals( PropertyQNames.ACTIVETIME ) )
      {
         DurationMetric activeTime = getProperties(  ).getActiveTime(  );

         if ( activeTime == null )
         {
            activeTime = DurationMetric.Factory.newInstance(  );
            activeTime.setChangeType( DurationMetric.ChangeType.COUNTER );
            activeTime.setTimeScope( DurationMetric.TimeScope.POINT_IN_TIME );
         }

         activeTime.setGDurationValue( m_backendDiskBean.getActiveTime(  ) );
         activeTime.setLastUpdated( Calendar.getInstance(  ) );
         getProperties(  ).setActiveTime( activeTime );
      }
      else if ( propQName.equals( PropertyQNames.CAPACITY ) )
      {
         IntegerMetric capacity = getProperties(  ).getCapacity(  );
View Full Code Here

      {
         getProperties(  ).setVersion( "$Revision: 1.1 $" );
      }
      else if ( qname.equals( PropertyQNames.TEMPERATURE ) )
      {
         IntegerMetric tempProp = getProperties(  ).getTemperature(  );

         if ( tempProp == null )
         {
            tempProp = getProperties(  ).addNewTemperature(  );
            tempProp.setChangeType( IntegerMetric.ChangeType.GAUGE );
            tempProp.setTimeScope( IntegerMetric.TimeScope.POINT_IN_TIME );
            tempProp.setStringValue("-1");
         }
      }
      else if ( qname.equals(PropertyQNames.RESOURCESTATE ) )
      {
         // just make sure the property exists
View Full Code Here

    */
   public void takeTemperatureReading(  )
   {
      TemperatureDocument tempDoc = TemperatureDocument.Factory.newInstance(  );

      IntegerMetric       tempMetric =
         (IntegerMetric) XmlBeansUtils.copyXmlBean( getProperties(  ).getTemperature(  ) ).changeType( IntegerMetric.type );
      tempMetric.setLastUpdated( Calendar.getInstance(  ) );
      tempMetric.setBigIntegerValue( new BigInteger( "" + m_temperatureScanner.getLastTemperature(  ) ) );
      tempDoc.setTemperature( tempMetric );

      try
      {
         updateResourceProperties( new SOAPElement[]
View Full Code Here

         activeTime.setLastUpdated( Calendar.getInstance(  ) );
         getProperties(  ).setActiveTime( activeTime );
      }
      else if ( propQName.equals( PropertyQNames.CAPACITY ) )
      {
         IntegerMetric capacity = getProperties(  ).getCapacity(  );

         if ( capacity == null )
         {
            capacity = IntegerMetric.Factory.newInstance(  );
            capacity.setChangeType( IntegerMetric.ChangeType.GAUGE );
            capacity.setTimeScope( IntegerMetric.TimeScope.POINT_IN_TIME );
         }

         capacity.setBigIntegerValue( m_backendDiskBean.getCapacity(  ) );
         capacity.setLastUpdated( Calendar.getInstance(  ) );
         getProperties(  ).setCapacity( capacity );
      }
      else if ( propQName.equals( PropertyQNames.FILESYSTEM ) )
      {
         if ( m_backendDiskBean.getFilesystems(  ).length != 0 )
View Full Code Here

         NotificationMessageHolderType[] notifMsg = notify.getNotificationMessage();
         ResourcePropertyValueChangeNotificationDocument valChanged = (ResourcePropertyValueChangeNotificationDocument) XmlObject.Factory.parse((Node) notifMsg[0].getMessage());
         NewValue newValue = valChanged.getResourcePropertyValueChangeNotification().getNewValue();
         XmlCursor cursor = newValue.newCursor();
         cursor.toFirstChild();
         IntegerMetric newValueIntegerMetric = (IntegerMetric) cursor.getObject();

         Integer newTemp = new Integer(newValueIntegerMetric.getStringValue());

         // if the new temperature is too hot, turn on AC; turn it off when the
         // temperature cools down

         if (newTemp.intValue() > 400)
View Full Code Here

            }
         }
      }
      else if ( qname.equals(PropertyQNames.MINIMUMTEMPERATURE ) )
      {
         IntegerMetric minTempMetric = getProperties( ).getMinimumTemperature();

         if (minTempMetric == null)
         {
            minTempMetric = getProperties( ).addNewMinimumTemperature();
            minTempMetric.setChangeType(IntegerMetric.ChangeType.GAUGE);
            minTempMetric.setLastUpdated(Calendar.getInstance());
            minTempMetric.setTimeScope(IntegerMetric.TimeScope.INTERVAL);
         }

         minTempMetric.setStringValue( m_sensorData.minimum().toString() );
      }
      else if ( qname.equals(PropertyQNames.MAXIMUMTEMPERATURE ) )
      {
         IntegerMetric maxTempMetric = getProperties( ).getMaximumTemperature();

         if (maxTempMetric == null)
         {
            maxTempMetric = getProperties( ).addNewMaximumTemperature();
            maxTempMetric.setChangeType(IntegerMetric.ChangeType.GAUGE);
            maxTempMetric.setLastUpdated(Calendar.getInstance());
            maxTempMetric.setTimeScope(IntegerMetric.TimeScope.INTERVAL);
         }

         maxTempMetric.setStringValue( m_sensorData.maximum().toString() );
      }
      else if ( qname.equals(PropertyQNames.AVERAGETEMPERATURE ) )
      {
         IntegerMetric avgTempMetric = getProperties( ).getAverageTemperature();

         if (avgTempMetric == null)
         {
            avgTempMetric = getProperties( ).addNewAverageTemperature();
            avgTempMetric.setChangeType(IntegerMetric.ChangeType.GAUGE);
            avgTempMetric.setLastUpdated(Calendar.getInstance());
            avgTempMetric.setTimeScope(IntegerMetric.TimeScope.INTERVAL);
         }

         avgTempMetric.setStringValue( m_sensorData.average(400).toString() );
      }
      return;
   }
View Full Code Here

         NotificationMessageHolderType[] notifMsg = notify.getNotificationMessage();
         ResourcePropertyValueChangeNotificationDocument msg = (ResourcePropertyValueChangeNotificationDocument) XmlObject.Factory.parse((Node) notifMsg[0].getMessage());
         NewValue newValue = msg.getResourcePropertyValueChangeNotification().getNewValue();
         XmlCursor cursor = newValue.newCursor();
         cursor.toFirstChild();
         IntegerMetric newValueIntegerMetric = (IntegerMetric) cursor.getObject();

         Integer newTemp = new Integer(newValueIntegerMetric.getStringValue());

         // add the new temperature data to our data storage object
         m_sensorData.addData(newTemp);
      }
      catch (XmlException e)
View Full Code Here

TOP

Related Classes of org.everestWeather.wsdm.samples.x2005.x04.schema.impl.WeatherStationPropertiesDocumentImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.