False WSRP Change Notifications
-------------------------------

                 Key: MUSE-170
                 URL: https://issues.apache.org/jira/browse/MUSE-170
             Project: Muse
          Issue Type: Bug
          Components: WSN NotificationProducer, WSN SubscriptionManager, WSN 
Topics, WSRF & WSN - Property Change Notifications
    Affects Versions: 2.1.0
            Reporter: Dan Jemiolo
         Assigned To: Dan Jemiolo
             Fix For: 2.2.0


I want to reduce message exchanges when getting the
ServiceGroupEntry-Properties by buffering the content elements instead of
getting it directly from the member-resource at every call.
Fro doing so, I tried to extend the SimpleEntry class by buffering the
content element and get notified by updates via WSRP change notifications.
That for the ServiceGroupEntry subscribes itself to the content-properties
(in my simple case the OperationalStatus) of the member-resource at the end
of its initializeCompleted-method:

public void initializeCompleted() throws SoapFault {
      super.initializeCompleted();
      subscribeToMemberProperties();
}

private void subscribeToMemberProperties(){
    try {
       ServiceGroup sg =
(ServiceGroup)getServiceGroup().getCapability(WssgConstants.SERVICE_GROUP_URI);

       NotificationConsumer consumerCap =
(NotificationConsumer)getResource().getCapability(WsnConstants.CONSUMER_URI);

        EndpointReference producerEPR = getMemberEPR();
        EndpointReference myEPR = getResource().getEndpointReference();

        NotificationProducerClient producer = new
NotificationProducerClient(producerEPR);
        if(logger.isDebugEnabled()){
            producer.setTrace(true);
        }
             //get the Property-QNames for the properties to subscribe for
            QName[] contentNames = sg.getContentElements();
        for (QName topic : contentNames) {
              //
              // Step 1: subscribe myself to the producer resource
              //
              TopicFilter filter = new TopicFilter(topic);
              this.subscriptionClient = producer.subscribe(myEPR, filter,
null);

              // Add MessageListener for the topic (a simple private
innerClass that accepts all messages when the subscriptionReferenceEPR
equals the saved subscriptionClient.getEPR())
              EntryMessageListener listener = new
EntryMessageListener(topic);
              consumerCap.addMessageListener(listener);
         }
      } catch (BaseFault e) {
            logger.error("subscribeToMemberProperties()", e);
      } catch (SoapFault e) {
            logger.error("subscribeToMemberProperties()", e);
      }
}

Can I create a single Filter for all contentElements? Could I do that with
the new FilterSet (JIRA - MUSE-122) ?

With having two Resources I have the following subscriptions when
registering the resources to the ServiceGroup:

ServiceGroupEntry - MuseResource-2 subscribes to WsResource -
MuseResource-1

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";>
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://134.100.14.93:8080/DefaultService/services/WsResource</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing";>uuid:9c01d504-eebd-5801-154e-22a17bc3a008</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing";>

<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
        </wsa:From>
        <muse-wsa:ResourceId
            xmlns:wsa="http://www.w3.org/2005/08/addressing";
            wsa:IsReferenceParameter="true"
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-1</muse-wsa:ResourceId>
    </soap:Header>
    <soap:Body>
        <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2";>
            <wsnt:ConsumerReference>
                <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://192.168.28.1:8080/RegistryService/services/ServiceGroupEntry</wsa:Address>
                <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
                    <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-2</muse-wsa:ResourceId>
                </wsa:ReferenceParameters>
            </wsnt:ConsumerReference>
            <wsnt:Filter>
                <wsnt:TopicExpression

Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete";
xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>muws2:OperationalStatus</wsnt:TopicExpression>
            </wsnt:Filter>
        </wsnt:Subscribe>
    </soap:Body>
</soap:Envelope>

ServiceGroupEntry - MuseResource-3 subscribes to WsResource -
MuseResource-2

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";>
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://134.100.14.93:8080/DefaultService/services/WsResource</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing";>uuid:993f6ca5-ea17-ce36-c9c3-ac45351da5ad</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing";>

<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
        </wsa:From>
        <muse-wsa:ResourceId
            xmlns:wsa="http://www.w3.org/2005/08/addressing";
            wsa:IsReferenceParameter="true"
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-2</muse-wsa:ResourceId>
    </soap:Header>
    <soap:Body>
        <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2";>
            <wsnt:ConsumerReference>
                <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://192.168.28.1:8080/RegistryService/services/ServiceGroupEntry</wsa:Address>
                <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
                    <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-3</muse-wsa:ResourceId>
                </wsa:ReferenceParameters>
            </wsnt:ConsumerReference>
            <wsnt:Filter>
                <wsnt:TopicExpression

Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete";
xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>muws2:OperationalStatus</wsnt:TopicExpression>
            </wsnt:Filter>
        </wsnt:Subscribe>
    </soap:Body>
</soap:Envelope>

When changing the OperationalStatus of WsResource - MuseResource-1 to
Unavailable by:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";>
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://134.100.14.93:8080/DefaultService/services/WsResource</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://docs.oasis-open.org/wsrf/rpw-2/SetResourceProperties/SetResourcePropertiesRequest</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing";>uuid:be807ac5-5dbb-96ed-6d1d-61c7629b0694</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing";>

<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
        </wsa:From>
        <muse-wsa:ResourceId
            xmlns:wsa="http://www.w3.org/2005/08/addressing";
            wsa:IsReferenceParameter="true"
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-1</muse-wsa:ResourceId>
    </soap:Header>
    <soap:Body>
        <wsrf-rp:SetResourceProperties
xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2";>
            <wsrf-rp:Update>
                <muws2:OperationalStatus
xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>Unavailable</muws2:OperationalStatus>
            </wsrf-rp:Update>
        </wsrf-rp:SetResourceProperties>
    </soap:Body>
</soap:Envelope>

I get the following Notifications from both WsResources:

WsResource - MuseResource-1 notifies its entry (as it should be)

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";>
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://192.168.28.1:8080/RegistryService/services/ServiceGroupEntry</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/NotifyRequest</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing";>uuid:10e4f1ff-0b96-fe39-3766-81a50ea820db</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing";>

<wsa:Address>http://134.100.14.93:8080/DefaultService/services/WsResource</wsa:Address>
            <wsa:ReferenceParameters>
                <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-1</muse-wsa:ResourceId>
            </wsa:ReferenceParameters>
        </wsa:From>
        <muse-wsa:ResourceId
            xmlns:wsa="http://www.w3.org/2005/08/addressing";
            wsa:IsReferenceParameter="true"
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-2</muse-wsa:ResourceId>
    </soap:Header>
    <soap:Body>
        <wsnt:Notify xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2";>
            <wsnt:NotificationMessage
                xmlns:muse-wsa="http://ws.apache.org/muse/addressing";
                xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";
                xmlns:wsa="http://www.w3.org/2005/08/addressing";
                xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2";
xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2";>
                <wsnt:SubscriptionReference>
                    <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://134.100.14.93:8080/DefaultService/services/SubscriptionManager</wsa:Address>
                    <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
                        <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-2</muse-wsa:ResourceId>
                    </wsa:ReferenceParameters>
                </wsnt:SubscriptionReference>
                <wsnt:Topic

Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete";
xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>muws2:OperationalStatus</wsnt:Topic>
                <wsnt:ProducerReference>
                    <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://134.100.14.93:8080/DefaultService/services/WsResource</wsa:Address>
                    <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
                        <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-1</muse-wsa:ResourceId>
                    </wsa:ReferenceParameters>
                </wsnt:ProducerReference>
                <wsnt:Message>
                    <wsrf-rp:ResourcePropertyValueChangeNotification
xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2";>
                        <wsrf-rp:OldValues>
                            <muws2:OperationalStatus
xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>Available</muws2:OperationalStatus>
                        </wsrf-rp:OldValues>
                        <wsrf-rp:NewValues>
                            <muws2:OperationalStatus
xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>Unavailable</muws2:OperationalStatus>
                        </wsrf-rp:NewValues>
                    </wsrf-rp:ResourcePropertyValueChangeNotification>
                </wsnt:Message>
            </wsnt:NotificationMessage>
        </wsnt:Notify>
    </soap:Body>
</soap:Envelope>

And WsResource - MuseResource-2 notifies its Entry of an
PropertyValueChange (that is my problem)

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";>
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://192.168.28.1:8080/RegistryService/services/ServiceGroupEntry</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/NotifyRequest</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing";>uuid:29bdb8a0-6936-1185-9b7f-d31ddc978590</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing";>

<wsa:Address>http://134.100.14.93:8080/DefaultService/services/WsResource</wsa:Address>
            <wsa:ReferenceParameters>
                <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-2</muse-wsa:ResourceId>
            </wsa:ReferenceParameters>
        </wsa:From>
        <muse-wsa:ResourceId
            xmlns:wsa="http://www.w3.org/2005/08/addressing";
            wsa:IsReferenceParameter="true"
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-3</muse-wsa:ResourceId>
    </soap:Header>
    <soap:Body>
        <wsnt:Notify xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2";>
            <wsnt:NotificationMessage
                xmlns:muse-wsa="http://ws.apache.org/muse/addressing";
                xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";
                xmlns:wsa="http://www.w3.org/2005/08/addressing";
                xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2";
xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2";>
                <wsnt:SubscriptionReference>
                    <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://134.100.14.93:8080/DefaultService/services/SubscriptionManager</wsa:Address>
                    <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
                        <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-3</muse-wsa:ResourceId>
                    </wsa:ReferenceParameters>
                </wsnt:SubscriptionReference>
                <wsnt:Topic

Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete";
xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>muws2:OperationalStatus</wsnt:Topic>
                <wsnt:ProducerReference>
                    <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing";>http://134.100.14.93:8080/DefaultService/services/WsResource</wsa:Address>
                    <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
                        <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing";>MuseResource-2</muse-wsa:ResourceId>
                    </wsa:ReferenceParameters>
                </wsnt:ProducerReference>
                <wsnt:Message>
                    <wsrf-rp:ResourcePropertyValueChangeNotification
xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2";>
                        <wsrf-rp:OldValues>
                            <muws2:OperationalStatus
xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>Available</muws2:OperationalStatus>
                        </wsrf-rp:OldValues>
                        <wsrf-rp:NewValues>
                            <muws2:OperationalStatus
xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd";>Unavailable</muws2:OperationalStatus>
                        </wsrf-rp:NewValues>
                    </wsrf-rp:ResourcePropertyValueChangeNotification>
                </wsnt:Message>
            </wsnt:NotificationMessage>
        </wsnt:Notify>
    </soap:Body>
</soap:Envelope>

When getting the ResourcePropertiesDocument of WsResource - MuseResource-2
the OperationalStatus is still "Available" as it should be. Although the
notification of a change was sent.
I don't know what I am doing wrong, am I handling the subscription process
right?
Sorry for this long email, I hope the xml-output will be readable.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to