Package org.apache.ws.resource.properties

Examples of org.apache.ws.resource.properties.ResourceProperty


        org.wsdmdemo.service.weatherStationDir.RemoveWeatherStationResponseDocument responseDocument = org.wsdmdemo.service.weatherStationDir.RemoveWeatherStationResponseDocument.Factory.newInstance();
        org.wsdmdemo.service.weatherStationDir.RemoveWeatherStationResponseDocument.RemoveWeatherStationResponse response = responseDocument.addNewRemoveWeatherStationResponse();

        //remove a relationship
        ResourcePropertySet resourcePropertySet = ((PropertiesResource) getResource()).getResourcePropertySet();
        ResourceProperty resourceProperty = resourcePropertySet.get(WeatherStationDirPropertyQNames.RELATIONSHIP);

        org.wsdmdemo.service.weatherStationDir.RemoveWeatherStationDocument.RemoveWeatherStation removeWeatherStation = requestDoc.getRemoveWeatherStation();
        String resourceId = removeWeatherStation.getResourceId();

        //iterate the relationships
        Iterator iterator = resourceProperty.iterator();
        List removeList = new ArrayList();
        while (iterator.hasNext())
        {
            RelationshipDocument relationshipDocument = (RelationshipDocument) iterator.next();
            RelationshipParticipantType[] participantArray = relationshipDocument.getRelationship().getParticipantArray();

            for (int i = 0; i < participantArray.length; i++)
            {
                RelationshipParticipantType relationshipParticipantType = participantArray[i];
                if (resourceId != null && resourceId.equals(relationshipParticipantType.getResourceId()))
                {
                    removeList.add(relationshipDocument); //add to list to be removed
                }
            }
        }

        for (int i = 0; i < removeList.size(); i++)
        {
            resourceProperty.remove((RelationshipDocument) removeList.get(i));//remove it from the document
        }
        return responseDocument;
    }
View Full Code Here


    {
        org.wsdmdemo.service.weatherStationDir.AddWeatherStationResponseDocument responseDocument = org.wsdmdemo.service.weatherStationDir.AddWeatherStationResponseDocument.Factory.newInstance();
        org.wsdmdemo.service.weatherStationDir.AddWeatherStationResponseDocument.AddWeatherStationResponse response = responseDocument.addNewAddWeatherStationResponse();

        ResourcePropertySet resourcePropertySet = ((PropertiesResource) getResource()).getResourcePropertySet();
        ResourceProperty resourceProperty = resourcePropertySet.get(WeatherStationDirPropertyQNames.RELATIONSHIP);

        //get the request epr
        org.wsdmdemo.service.weatherStationDir.AddWeatherStationDocument.AddWeatherStation addWeatherStation = requestDoc.getAddWeatherStation();
        org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType addedEpr = addWeatherStation.getEndpointReference();

        //define a relationship
        RelationshipDocument relationshipDocument = RelationshipDocument.Factory.newInstance();


        //define the relationship type
        RelationshipType relationshipType = InteropRequestUtils.createRelationshipType(relationshipDocument.addNewRelationship());


        //add self as a participant
        RelationshipParticipantType parentRelationshipParticipantType = relationshipType.addNewParticipant();
        WeatherStationDirResource resource = (WeatherStationDirResource) getResource();
        XmlBeansEndpointReference xmlEpr = (XmlBeansEndpointReference) resource.getEndpointReference();
        EndpointReferenceType dirEndpointReferenceType = (EndpointReferenceType) xmlEpr.getXmlObject(AddressingConstants.NSURI_ADDRESSING_SCHEMA);
        parentRelationshipParticipantType.setResourceId(InteropConstants.DIR_RESOURCEID);
        parentRelationshipParticipantType.setRole(InteropConstants.PARENT_RELATION);//uri
        parentRelationshipParticipantType.setManageabilityEndpointReferenceArray(new EndpointReferenceType[]{dirEndpointReferenceType});


        //add the new ws as the other participant
        RelationshipParticipantType childRelationshipParticipantType = relationshipType.addNewParticipant();
        childRelationshipParticipantType.setResourceId(InteropRequestUtils.getResourceId(addedEpr));
        childRelationshipParticipantType.setRole(InteropConstants.CHILD_RELATION);//uri
        childRelationshipParticipantType.setManageabilityEndpointReferenceArray(new EndpointReferenceType[]{addedEpr});

        resourceProperty.add(relationshipDocument);

        return responseDocument;
    }
View Full Code Here

    {
        m_resourceContext = new SushiResourceContext();
        SushiPlate plate = new SushiPlate();
        SushiCallback callback = new SushiCallback( plate );
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( callback );
        final QName[] propNames = new QName[]{SushiPropertyQNames.EBI, SushiPropertyQNames.IKA};
        GetMultipleResourcePropertiesResponseDocument.GetMultipleResourcePropertiesResponse response = getMultipleResourceProperties( propNames );
        XmlObject[] propElems = XmlBeanUtils.getChildElements( response );
        assertNotNull( propElems );
        assertEquals( propNames[0], XmlBeanUtils.getName( propElems[0] ) );
View Full Code Here

        String value = XmlBeanUtils.getValue( ebiPropElems[0] );
        assertEquals( "9", value );

        //setup callback to modify resource prop
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( callback );

        queryResourcePropertiesResponse = queryResourceProperties( "*" );

        ebiPropElems = XmlBeanUtils.getChildElements( queryResourcePropertiesResponse, SushiPropertyQNames.EBI );
        assertNotNull( ebiPropElems );
View Full Code Here

        m_resourceContext = new SushiResourceContext();
        // create and register callback object
        SushiPlate plate = new SushiPlate();
        SushiCallback callback = new SushiCallback( plate );
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( callback );
        // send GetRP request and make sure prop got updated by callback.refreshProperty()
        GetResourcePropertyResponseDocument.GetResourcePropertyResponse response = getResourceProperty( SushiPropertyQNames.EBI );
        XmlObject[] ebiPropElems = XmlBeanUtils.getChildElements( response, SushiPropertyQNames.EBI );
        assertNotNull( ebiPropElems );
        assertEquals( 1, ebiPropElems.length );
View Full Code Here

    public void testInsertResourcePropertiesCallback() throws XmlException, ResourceException,
            ResourceContextException
    {
        m_resourceContext = new SushiResourceContext();
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( m_callback );

        XmlObject xBean =
                XmlObject.Factory.parse( "<foo:Ebi xmlns:foo=\"http://ws.apache.org/resource/properties/test/sushi\">"
                + "0" + "</foo:Ebi>" );
        insertResourceProperty( new XmlObject[]{xBean} );
View Full Code Here

        XmlObject xBean =
                XmlObject.Factory.parse( "<foo:Ika xmlns:foo=\"http://ws.apache.org/resource/properties/test/sushi\">"
                + "my favorite!" + "</foo:Ika>" );
        insertResourceProperty( new XmlObject[]{xBean} );
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.IKA );
        resourceProp.setCallback( m_callback );
        deleteResourceProperty( SushiPropertyQNames.IKA );
        GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourcePropertyResponse = getResourceProperty(
                SushiPropertyQNames.OHTORO );
        assertNotNull( getResourcePropertyResponse );
        assertTrue( m_callback.deleteWasInvoked() );
View Full Code Here

        SushiPlate plate = new SushiPlate();
        SushiCallback callback = new SushiCallback( plate );

        //setup callback on resource prop
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( callback );
        XmlObject xBean =
                XmlObject.Factory.parse( "<foo:Ebi xmlns:foo=\"http://ws.apache.org/resource/properties/test/sushi\">"
                + newValue + "</foo:Ebi>" );
        updateResourceProperty( new XmlObject[]{xBean} );
        assertPropHasOneElemWithGivenValue( SushiPropertyQNames.EBI, newValue );
View Full Code Here

        org.apache.ws.notification.topics.util.TopicUtils.initNotificationProducerProperties(getTopicSpaceSet(), getResourcePropertySet());
    }

    public void setFCCID(FCCIDDocument fccidDocument)
    {
        ResourceProperty resourceProperty = getResourcePropertySet().get(WeatherstationPropertyQNames.FCCID);
        resourceProperty.add(fccidDocument);
    }
View Full Code Here

            aSituation.setMessage( lstring );
            XmlBeansManagementEvent event = new XmlBeansManagementEvent( aSituation );

            // set resource Reporter and source  ResourceId
            ResourcePropertySet propSet      = m_notificationProducerResource.getResourcePropertySet(  );
            ResourceProperty    resourceId   = propSet.get( ApplicationPropertyQNames.RESOURCEID );
            String              Id           = null;
            Iterator            propElemIter = resourceId.iterator(  );
            while ( propElemIter.hasNext(  ) )
            {
               XmlObject propElem = (XmlObject) propElemIter.next(  );
               if ( propElem instanceof XmlAnyUriImpl )
               {
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.properties.ResourceProperty

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.