Examples of ResourcePropertyValueChangeNotificationType


Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

    }

    protected XmlObject buildPropValueChangeNotifDocXmlBean( Object[] oldValue, Object[] newValue )
    {
        ResourcePropertyValueChangeNotificationDocument propValueChangeNotifDocXBean = ResourcePropertyValueChangeNotificationDocument.Factory.newInstance();
        ResourcePropertyValueChangeNotificationType propValueChangeNotifXBean = propValueChangeNotifDocXBean.addNewResourcePropertyValueChangeNotification();
        ResourcePropertyValueChangeNotificationType.OldValue oldValueXBean = propValueChangeNotifXBean.addNewOldValue();
        if ( oldValue != null )
        {
            for ( int i = 0; i < oldValue.length; i++ )
            {
                XmlBeanUtils.addChildElement( oldValueXBean, (XmlObject) oldValue[i] );
            }
        }
        else
        {
            oldValueXBean.setNil();
        }
        ResourcePropertyValueChangeNotificationType.NewValue newValueXBean = propValueChangeNotifXBean.addNewNewValue();
        if ( newValue != null )
        {
            for ( int i = 0; i < newValue.length; i++ )
            {
                XmlBeanUtils.addChildElement( newValueXBean, (XmlObject) newValue[i] );
View Full Code Here

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

     * @throws Exception on error
     */
    public void testAddChildElement()
            throws Exception
    {
        ResourcePropertyValueChangeNotificationType resourcePropertyValueChangeNotificationType = ResourcePropertyValueChangeNotificationType.Factory.newInstance();
        ResourcePropertyValueChangeNotificationType.OldValue oldValue = resourcePropertyValueChangeNotificationType.addNewOldValue();
        XmlBeanUtils.addChildElement( oldValue, XmlObject.Factory.parse( "<foo/>" ) );
        XmlObject[] childElems = XmlBeanUtils.getChildElements( oldValue, new QName( "foo" ) );
        assertEquals( 1, childElems.length );
        XmlObject fooElem = childElems[0];
        childElems = XmlBeanUtils.getChildElements( fooElem, new QName( "foo" ) );
        //assertEquals( 0, childElems.length );  // a bug in XmlBeans causes this assertion to fail

        resourcePropertyValueChangeNotificationType = ResourcePropertyValueChangeNotificationType.Factory.newInstance();
        oldValue = resourcePropertyValueChangeNotificationType.addNewOldValue();
        CurrentTimeDocument currentTimeDocument = CurrentTimeDocument.Factory.newInstance();
        currentTimeDocument.setCurrentTime( Calendar.getInstance( ) );
        XmlObject newXBean = XmlBeanUtils.copyXmlBean( currentTimeDocument.xgetCurrentTime() );
        XmlBeanUtils.addChildElement( oldValue, newXBean );
        childElems = XmlBeanUtils.getChildElements( oldValue, new QName( "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd", "CurrentTime" ) );
View Full Code Here

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

        XmlObject object = xmlCursor.getObject();
        xString1 = (XmlString) object.set( xString2 );
        System.out.println( xString1 );

        ResourcePropertyValueChangeNotificationDocument resourcePropertyValueChangeNotificationDocument = ResourcePropertyValueChangeNotificationDocument.Factory.newInstance();
        ResourcePropertyValueChangeNotificationType resourcePropertyValueChangeNotificationType = resourcePropertyValueChangeNotificationDocument.addNewResourcePropertyValueChangeNotification();
        ResourcePropertyValueChangeNotificationType.OldValue oldValue = resourcePropertyValueChangeNotificationType.addNewOldValue();
        XmlCursor parentCursor = oldValue.newCursor();
        if ( parentCursor.toLastChild() )
        {
            parentCursor.toEndToken();
            parentCursor.toNextToken();
        }
        parentCursor.toEndToken();
        parentCursor.insertElement( new QName( "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd", "BaseFault" ));
        System.out.println( "BEFORE:\n" + oldValue.xmlText( new XmlOptions().setSaveOuter() ) );
        parentCursor.toPrevSibling();
        XmlObject childXBean = parentCursor.getObject();
        parentCursor.dispose();
        //BaseFaultDocument baseFaultDocument = BaseFaultDocument.Factory.newInstance( );
        //BaseFaultType baseFaultType = baseFaultDocument.addNewBaseFault();
        BaseFaultType baseFaultType = BaseFaultType.Factory.newInstance( );
        baseFaultType.setTimestamp( Calendar.getInstance( ) );
        childXBean.set( baseFaultType );
        System.out.println( "AFTER:\n" + oldValue.xmlText( new XmlOptions().setSaveOuter() ) );

        ResourcePropertyValueChangeNotificationDocument resourcePropertyValueChangeNotificationDocument1 = ResourcePropertyValueChangeNotificationDocument.Factory.newInstance();
        ResourcePropertyValueChangeNotificationType resourcePropertyValueChangeNotificationType1 = resourcePropertyValueChangeNotificationDocument.addNewResourcePropertyValueChangeNotification();
        ResourcePropertyValueChangeNotificationType.OldValue oldValue1 = resourcePropertyValueChangeNotificationType1.addNewOldValue();
        oldValue1.newCursor().setTextValue( "one" );
        System.out.println( resourcePropertyValueChangeNotificationDocument );

        ResourcePropertyValueChangeNotificationType resourcePropertyValueChangeNotificationType2 = ResourcePropertyValueChangeNotificationType.Factory.newInstance();
        ResourcePropertyValueChangeNotificationType.OldValue oldValue2 = resourcePropertyValueChangeNotificationType2.addNewOldValue();
        oldValue2.newCursor().setTextValue( "two" );
        oldValue1 = (ResourcePropertyValueChangeNotificationType.OldValue) oldValue1.set( oldValue2 );
        System.out.println( resourcePropertyValueChangeNotificationDocument1 );

        GetResourcePropertyDocument getResourcePropertyDoc1 = GetResourcePropertyDocument.Factory.newInstance();
View Full Code Here

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

    }

    private ResourcePropertyValueChangeNotificationDocument buildPropValueChangeNotifDocXmlBean( Object[] oldValue, Object[] newValue )
    {
        ResourcePropertyValueChangeNotificationDocument propValueChangeNotifDocXBean = ResourcePropertyValueChangeNotificationDocument.Factory.newInstance();
        ResourcePropertyValueChangeNotificationType propValueChangeNotifXBean = propValueChangeNotifDocXBean.addNewResourcePropertyValueChangeNotification();
        ResourcePropertyValueChangeNotificationType.OldValue oldValueXBean = propValueChangeNotifXBean.addNewOldValue();
        if ( oldValue != null )
        {
            for ( int i = 0; i < oldValue.length; i++ )
            {
                XmlBeanUtils.addChildElement( oldValueXBean, (XmlObject) oldValue[i] );
            }
        }
        else
        {
            oldValueXBean.setNil();
        }
        ResourcePropertyValueChangeNotificationType.NewValue newValueXBean = propValueChangeNotifXBean.addNewNewValue();
        if ( newValue != null )
        {
            for ( int i = 0; i < oldValue.length; i++ )
            {
                XmlBeanUtils.addChildElement( newValueXBean, (XmlObject) newValue[i] );
View Full Code Here

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

    }

    protected XmlObject buildPropValueChangeNotifDocXmlBean( Object[] oldValue, Object[] newValue )
    {
        ResourcePropertyValueChangeNotificationDocument propValueChangeNotifDocXBean = ResourcePropertyValueChangeNotificationDocument.Factory.newInstance();
        ResourcePropertyValueChangeNotificationType propValueChangeNotifXBean = propValueChangeNotifDocXBean.addNewResourcePropertyValueChangeNotification();
        ResourcePropertyValueChangeNotificationType.OldValue oldValueXBean = propValueChangeNotifXBean.addNewOldValue();
        if ( oldValue != null )
        {
            for ( int i = 0; i < oldValue.length; i++ )
            {
                XmlBeanUtils.addChildElement( oldValueXBean, (XmlObject) oldValue[i] );
            }
        }
        else
        {
            oldValueXBean.setNil();
        }
        ResourcePropertyValueChangeNotificationType.NewValue newValueXBean = propValueChangeNotifXBean.addNewNewValue();
        if ( newValue != null )
        {
            for ( int i = 0; i < oldValue.length; i++ )
            {
                XmlBeanUtils.addChildElement( newValueXBean, (XmlObject) newValue[i] );
View Full Code Here

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

     * @return OperationalStatus (i.e. Available)
     */
    private String parseCurrentOperationalStatus(ManagementEventTypeImpl manEvt)
    {
        XmlObject[] childElements = XmlBeanUtils.getChildElements(manEvt);
        ResourcePropertyValueChangeNotificationType propChange = null;
   
        for (int i = 0; i < childElements.length; i++) {
      if(childElements[i] instanceof ResourcePropertyValueChangeNotificationType)
      {
        propChange =
                (ResourcePropertyValueChangeNotificationType) childElements[i];
        break;
      }
    }
       
       
        if(propChange == null) return "Unavailable";
        ResourcePropertyValueChangeNotificationType.NewValue newValue = propChange.getNewValue();
        XmlObject operationalStatus =
                XmlBeanUtils.getChildElements(newValue)[0];
        XmlCursor xmlCursor = operationalStatus.newCursor();
        return xmlCursor.getTextValue();
    }
View Full Code Here

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

     * @return OperationalStatus (i.e. Available)
     */
    private String parseCurrentOperationalStatus(ManagementEventTypeImpl manEvt)
    {
        XmlObject[] childElements = XmlBeanUtils.getChildElements(manEvt);
        ResourcePropertyValueChangeNotificationType propChange =
                (ResourcePropertyValueChangeNotificationType) childElements[3];
        ResourcePropertyValueChangeNotificationType.NewValue newValue = propChange.getNewValue();
        XmlObject operationalStatus =
                XmlBeanUtils.getChildElements(newValue)[0];
        XmlCursor xmlCursor = operationalStatus.newCursor();
        return xmlCursor.getTextValue();
    }
View Full Code Here

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

        // make sure we receive a propChanged mgmtEvent
        ManagementEventType mgmtEvent = waitForManagementEvent( notifListener );
        XmlObject[] propChangedEvents = XmlBeanUtils.getChildElements(mgmtEvent, new QName(ResourcePropertiesConstants.NSURI_WSRP_SCHEMA, "ResourcePropertyValueChangeNotification"));
        assertEquals( "ManagementEvent does not contain a single ResourcePropertyValueChangeNotification", 1, propChangedEvents.length );
        assertTrue( propChangedEvents[0] instanceof ResourcePropertyValueChangeNotificationType );
        ResourcePropertyValueChangeNotificationType propChangedEvent = (ResourcePropertyValueChangeNotificationType)propChangedEvents[0];
        assertFalse( propChangedEvent.getNewValue().toString().equals( propChangedEvent.getOldValue().toString() ) );
    }
View Full Code Here

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

   protected XmlObject buildPropValueChangeNotifDocXmlBean( Object[] oldValue,
                                                            Object[] newValue )
   {
      ResourcePropertyValueChangeNotificationDocument      propValueChangeNotifDocXBean =
         ResourcePropertyValueChangeNotificationDocument.Factory.newInstance(  );
      ResourcePropertyValueChangeNotificationType          propValueChangeNotifXBean =
         propValueChangeNotifDocXBean.addNewResourcePropertyValueChangeNotification(  );
      ResourcePropertyValueChangeNotificationType.OldValue oldValueXBean =
         propValueChangeNotifXBean.addNewOldValue(  );
      if ( oldValue != null )
      {
         for ( int i = 0; i < oldValue.length; i++ )
         {
            XmlBeanUtils.addChildElement( oldValueXBean, (XmlObject) oldValue[i] );
         }
      }
      else
      {
         oldValueXBean.setNil(  );
      }

      ResourcePropertyValueChangeNotificationType.NewValue newValueXBean =
         propValueChangeNotifXBean.addNewNewValue(  );
      if ( newValue != null )
      {
         for ( int i = 0; i < newValue.length; i++ )
         {
            XmlBeanUtils.addChildElement( newValueXBean, (XmlObject) newValue[i] );
View Full Code Here

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.ResourcePropertyValueChangeNotificationType

    * @throws Exception on error
    */
   public void testAddChildElement(  )
   throws Exception
   {
      ResourcePropertyValueChangeNotificationType          resourcePropertyValueChangeNotificationType =
         ResourcePropertyValueChangeNotificationType.Factory.newInstance(  );
      ResourcePropertyValueChangeNotificationType.OldValue oldValue =
         resourcePropertyValueChangeNotificationType.addNewOldValue(  );
      XmlBeanUtils.addChildElement( oldValue,
                                    XmlObject.Factory.parse( "<fo>fum</fo>" ) );

      // add a second one, so we can make sure they get added in the right order...
      XmlBeanUtils.addChildElement( oldValue,
                                    XmlObject.Factory.parse( "<fo>nub</fo>" ) );
      XmlObject[] childElems = XmlBeanUtils.getChildElements( oldValue,
                                                              new QName( "fo" ) );
      assertEquals( 2, childElems.length );
      XmlObject[] grandchildElems = XmlBeanUtils.getChildElements( childElems[0],
                                                                   new QName( "fo" ) );
      assertEquals( 0, grandchildElems.length ); // this tests the nefarious "redundant grandchild" cursor bug
      assertEquals( "fum",
                    XmlBeanUtils.getValue( childElems[0] ) );
      assertEquals( "nub",
                    XmlBeanUtils.getValue( childElems[1] ) );

      resourcePropertyValueChangeNotificationType =
         ResourcePropertyValueChangeNotificationType.Factory.newInstance(  );
      oldValue = resourcePropertyValueChangeNotificationType.addNewOldValue(  );
      CurrentTimeDocument currentTimeDocument = CurrentTimeDocument.Factory.newInstance(  );
      currentTimeDocument.setCurrentTime( Calendar.getInstance(  ) );
      XmlObject newXBean = XmlBeanUtils.copyXmlBean( currentTimeDocument.xgetCurrentTime(  ) );
      XmlBeanUtils.addChildElement( oldValue, newXBean );
      childElems =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.