catch ( Exception e )
{
throw new RuntimeException( e );
}
TopicType topicType = null;
if ( containsTopicSpaceForPropertyNamespace( topicSpaceArray,
propQName.getNamespaceURI( ) ) )
{
// first determine if there is a TopicSpace with the same namespace as the Resource Property
for ( int i = 0; i < topicSpaceArray.length; i++ )
{
TopicSpaceType topicSpaceType = topicSpaceArray[i];
if ( topicSpaceType.getTargetNamespace( ).equals( propQName.getNamespaceURI( ) ) )
{
//todo what other fields can be set??
topicType = topicSpaceType.addNewTopic( );
topicType.setName( propQName.getLocalPart( ) );
}
}
}
else
{
TopicSpaceType topicSpace = getNewTopicSpace( );
if ( topicSpace != null )
{
topicSpace.setName( "ResourcePropertiesTopicSpace" );
topicSpace.setTargetNamespace( propQName.getNamespaceURI( ) );
topicType = topicSpace.addNewTopic( );
}
}
if ( topicType != null )
{
topicType.setName( propQName.getLocalPart( ) );
List messageTypeList = new ArrayList( );
messageTypeList.add( ResourceProperties11Constants.RESOURCE_PROPERTIES_PROPERTY_VALUE_CHANGE_NOTIFICATION_QNAME );
topicType.setMessageTypes( messageTypeList );
}
}