Package org.apache.ws.muws

Source Code of org.apache.ws.muws.MuwsUtils

package org.apache.ws.muws;

import org.apache.ws.muws.v1_0.MuwsConstants;
import org.apache.ws.muws.v1_0.capability.RelationshipsCapability;
import org.apache.ws.notification.topics.Topic;
import org.apache.ws.notification.topics.TopicSpace;
import org.apache.ws.notification.topics.TopicSpaceSet;
import org.apache.ws.notification.topics.impl.TopicSpaceImpl;
import org.apache.ws.resource.properties.ResourcePropertySet;

/**
* @author Sal Campana
*/
public class MuwsUtils
{

    /**
     * Replaces the Relationship resource property in the specified property set with a
     * special {@link org.apache.ws.muws.v1_0.impl.XmlBeansRelationshipResourceProperty}.
     *
     * @param propSet
     */
    public static void updateRelationshipResourceProperty( ResourcePropertySet propSet, org.apache.ws.notification.base.NotificationProducerResource notifResource )
    {
        if ( propSet.get( org.apache.ws.muws.v1_0.capability.RelationshipsCapability.PROP_NAME_RELATIONSHIP ) != null )
        {
            org.apache.ws.muws.v1_0.impl.XmlBeansRelationshipResourceProperty relationshipResourceProperty = new org.apache.ws.muws.v1_0.impl.XmlBeansRelationshipResourceProperty( propSet.getMetaData().getPropertyMetaData( org.apache.ws.muws.v1_0.capability.RelationshipsCapability.PROP_NAME_RELATIONSHIP ),
                    (org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet) propSet, notifResource );
            ( (org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet) propSet ).set( relationshipResourceProperty );
        }
    }

    /**
     * Adds the MUWS RelationshipCreated/Deleted topics to the specified topic set.
     *
     * @param topicSet
     *
     * @throws Exception
     */
    public static TopicSpace addRelationshipTopics( TopicSpaceSet topicSet ) 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 );
        return topicSet.addTopicSpace( topicSpace );
    }
   
}
TOP

Related Classes of org.apache.ws.muws.MuwsUtils

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.