Package org.apache.ws.notification.topics

Examples of org.apache.ws.notification.topics.Topic


        XmlBeanUtils.setValueAsQName(topicExpressionType, concreteTopicName);
        resourceProp.add(topicDocument);
        Iterator iterator = subTopic.topicIterator();
        while (iterator.hasNext())
        {
            Topic topic = (Topic) iterator.next();
            addConcreteTopics(concreteTopicName, topic, resourceProp);
        }
    }
View Full Code Here


        if ( topics.length > 1 )
        {
            throw new InvalidTopicExpressionFaultException( NAMESPACE_SET,
                    "Given TopicExpression matched more than one Topic supported by this NotificationProducer - the WS-BaseN spec mandates that it match exactly one." );
        }
        Topic topic = topics[0];
        XmlObject currentMsg = (XmlObject) topic.getCurrentMessage();
        if ( currentMsg == null )
        {
            throw new NoCurrentMessageOnTopicFaultException( NAMESPACE_SET );
        }
        GetCurrentMessageResponseDocument responseDoc = GetCurrentMessageResponseDocument.Factory.newInstance();
View Full Code Here

        m_evaluator = new FullTopicExpressionEvaluator();
        m_topicSpaceSet = new TopicSpaceSetImpl( true );
        TopicSpace topicSpace0 = m_topicSpaceSet.addTopicSpace( new TopicSpaceImpl( "" ) );
        topicSpace0.addTopic( "celebs" );
        TopicSpace topicSpace1 = m_topicSpaceSet.addTopicSpace( new TopicSpaceImpl( NSURI1 ) );
        Topic sportsTopic = topicSpace1.addTopic( "sports" );
        Topic tennisTopic = sportsTopic.addTopic( "tennis" );
        tennisTopic.addTopic( "college" );
        Topic footballTopic = sportsTopic.addTopic( "football" );
        footballTopic.addTopic( "college" );
        Topic gamesTopic = topicSpace1.addTopic( "games" );
        gamesTopic.addTopic( "monopoly" );
        gamesTopic.addTopic( "chess" );
        TopicSpace topicSpace2 = m_topicSpaceSet.addTopicSpace( new TopicSpaceImpl( NSURI2 ) );
        Topic bandsTopic = topicSpace2.addTopic( "bands" );
        bandsTopic.addTopic( "beatles" );
        bandsTopic.addTopic( "kinks" );
    }
View Full Code Here

        m_evaluator = new ConcreteTopicExpressionEvaluator();
        m_topicSpaceSet = new TopicSpaceSetImpl( true );
        TopicSpace topicSpace0 = m_topicSpaceSet.addTopicSpace( new TopicSpaceImpl( "" ) );
        topicSpace0.addTopic( "celebs" );
        TopicSpace topicSpace1 = m_topicSpaceSet.addTopicSpace( new TopicSpaceImpl( NSURI1 ) );
        Topic sportsTopic = topicSpace1.addTopic( "sports" );
        Topic tennisTopic = sportsTopic.addTopic( "tennis" );
        tennisTopic.addTopic( "college" );
        Topic footballTopic = sportsTopic.addTopic( "football" );
        footballTopic.addTopic( "college" );
        Topic gamesTopic = topicSpace1.addTopic( "games" );
        gamesTopic.addTopic( "monopoly" );
        gamesTopic.addTopic( "chess" );
    }
View Full Code Here

        m_evaluator = new SimpleTopicExpressionEvaluator();
        m_topicSpaceSet = new TopicSpaceSetImpl( true );
        TopicSpace topicSpace0 = m_topicSpaceSet.addTopicSpace( new TopicSpaceImpl( "" ) );
        topicSpace0.addTopic( "celebs" );
        TopicSpace topicSpace1 = m_topicSpaceSet.addTopicSpace( new TopicSpaceImpl( NSURI1 ) );
        Topic sportsTopic = topicSpace1.addTopic( "sports" );
        Topic tennisTopic = sportsTopic.addTopic( "tennis" );
        tennisTopic.addTopic( "college" );
        Topic footballTopic = sportsTopic.addTopic( "football" );
        footballTopic.addTopic( "college" );
        Topic gamesTopic = topicSpace1.addTopic( "games" );
        gamesTopic.addTopic( "monopoly" );
        gamesTopic.addTopic( "chess" );
    }
View Full Code Here

         // Topics
         org.apache.ws.notification.topics.TopicSpaceSet topicSpaceSet  = getTopicSpaceSet(  );
         TopicSpace                                      muwsTopicSpace =
            new TopicSpaceImpl( MuwsConstants.NSURI_MUWS_PART2_TOPICS );

         Topic                                           manageabilityEndpointCreation    =
            new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_CREATION_NAME,
                                                false );
         Topic                                           manageabilityEndpointDestruction =
            new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_DESTRUCTION_NAME,
                                                false );

         XmlBeansAdvertisementTopicImpl                  manageableResourceCreation    =
            new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_CREATION_NAME );
         XmlBeansAdvertisementTopicImpl                  manageableResourceDestruction =
            new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_DESTRUCTION_NAME );

         //register listeners for those topics with all known to resourceadmin  homes....
         addListenersToHomes( manageableResourceCreation, manageableResourceDestruction );

         manageabilityEndpointCreation.addTopic( manageableResourceCreation );
         manageabilityEndpointDestruction.addTopic( manageableResourceDestruction );
         muwsTopicSpace.addTopic( manageabilityEndpointCreation );
         muwsTopicSpace.addTopic( manageabilityEndpointDestruction );
         topicSpaceSet.addTopicSpace( muwsTopicSpace );

         ManagementEventTopic identityCapability =
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();

            //request message
            MessageInformationType requestInformationType = notif.addNewRequest();
            MessageContentType requestMessage = requestInformationType.addNewMessage();
            AnyXmlContentsType requestAnyXmlContentsType = requestMessage.addNewXml();
            XmlBeanUtils.addChildElement(requestAnyXmlContentsType, getCurrentTemperatureRequestDoc);

            //reply message
            MessageInformationType replyInformationType = notif.addNewReply();
            MessageContentType replyMessage = replyInformationType.addNewMessage();
            AnyXmlContentsType replyAnyXmlContentsType = replyMessage.addNewXml();
            XmlBeanUtils.addChildElement(replyAnyXmlContentsType, getCurrentTemperatureResponseDocument);

            //todo flesh out
            //StateInformation
            RequestProcessingStateInformationType requestProcessingStateInformationType = notif.addNewStateInformation();
            StateTransitionType stateTransitionType = requestProcessingStateInformationType.addNewStateTransition();

            XmlObject currentState = XmlObject.Factory.parse("<tns:temp xmlns:tns=\"http://tempcentral.com/temps\">Cool</tns:temp>");

            StateType enteredState = stateTransitionType.addNewEnteredState();
            XmlBeanUtils.addChildElement(enteredState, currentState);

            StateType prevState = stateTransitionType.addNewPreviousState();
            XmlBeanUtils.addChildElement(prevState, currentState);

            stateTransitionType.setTransitionIdentifier("urn:NONE");
            stateTransitionType.setTime(currentTime);
            notif.setCurrentTime(currentTime);

            Situation situation = new SituationImpl(new CategoryImpl(MuwsConstants.SITUATION_OTHER));
            XmlBeansManagementEvent xme = new XmlBeansManagementEvent(situation);
            ManagementEventDocument mgmtEvent = (ManagementEventDocument) ((XmlObjectWrapper) xme).getXmlObject();
            org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManagementEventType managementEvent = mgmtEvent.getManagementEvent();
            XmlBeanUtils.addChildElement(managementEvent, notifDocument);

            topic.publish(mgmtEvent);
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
View Full Code Here

     * @throws Exception
     */
    public static void addRelationshipTopics(TopicSpaceSet set) throws Exception
    {
        TopicSpace topicSpace = new TopicSpaceImpl(MuwsConstants.NSURI_MUWS_PART2_TOPICS);
        Topic topic = topicSpace.addTopic(RelationshipsCapability.TOPIC_NAME);
        topic.addTopic(RelationshipsCapability.SUBTOPIC_NAME_RELATIONSHIP_CREATED);
        topic.addTopic(RelationshipsCapability.SUBTOPIC_NAME_RELATIONSHIP_DELETED);
        set.addTopicSpace(topicSpace);
    }
View Full Code Here

    resourceProperty.add(prop_resourceid);

        org.apache.ws.notification.topics.TopicSpaceSet topicSpaceSet = getTopicSpaceSet();
        TopicSpace topicSpace = new TopicSpaceImpl(MuwsConstants.NSURI_MUWS_PART2_TOPICS);

        Topic manageabilityEndpointCreation = new XmlBeansAdvertisementTopicImpl(AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_CREATION_NAME);
        Topic manageabilityEndpointDestruction = new XmlBeansAdvertisementTopicImpl(AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_DESTRUCTION_NAME);

        XmlBeansAdvertisementTopicImpl manageableResourceCreation = new XmlBeansAdvertisementTopicImpl(AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_CREATION_NAME);
        XmlBeansAdvertisementTopicImpl manageableResourceDestruction = new XmlBeansAdvertisementTopicImpl(AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_DESTRUCTION_NAME);

        //todo associate these with all the homes....
        InitialContext ctx = new InitialContext();
        List homes = findHomes(ctx, new ArrayList(),"");
        for (int i = 0; i < homes.size(); i++)
        {
            String home = (String) homes.get(i);
            //do not register its own home
            if( ! home.equals(ResourceAdvertiserHome.HOME_LOCATION))
            {
                AbstractResourceHome absHome = (AbstractResourceHome) ctx.lookup(home);
                absHome.addResourceCreationListener(manageableResourceCreation);
                absHome.addResourceDestructionListener(manageableResourceDestruction);
            }
        }

        manageabilityEndpointCreation.addTopic(manageableResourceCreation);
        manageabilityEndpointDestruction.addTopic(manageableResourceDestruction);
        topicSpace.addTopic(manageabilityEndpointCreation);
        topicSpace.addTopic(manageabilityEndpointDestruction);
        topicSpaceSet.addTopicSpace(topicSpace);

    }
View Full Code Here

     * @param subtopicName
     * @return The sub topic or null if undefined
     */
    private Topic getRelationshipsCapabilitySubTopic(String subtopicName)
    {
        Topic subTopic=null;
        TopicSpace topicSpace = m_resource.getTopicSpaceSet().getTopicSpace(MuwsConstants.NSURI_MUWS_PART2_TOPICS);
        if (topicSpace != null)
        {
            Topic relationshipCapTopic = topicSpace.getTopic(RelationshipsCapability.TOPIC_NAME);
            if(relationshipCapTopic != null)
            {
               subTopic = relationshipCapTopic.getTopic(subtopicName);
            }
        }
        return subTopic;
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.notification.topics.Topic

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.