All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.servicebus.management.UnknownPropertiesHolder Maven / Gradle / Ivy

There is a newer version: 3.6.7
Show newest version
package com.microsoft.azure.servicebus.management;

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Element;
import org.w3c.dom.Node;

/*
 * In future, servicebus may add new properties to entity description.
 * This class helps to hold such properties and send them back 'as is' in UpdateEntity call.
 * Order of xml elements is important. Maintain properties in the same order they were
 * received and send them back in the same order in UpdateEntity call.
 */
class UnknownPropertiesHolder {
	
	private List unknownProperties;
	
	synchronized void addUnknownProperty(Element property) {
		if (this.unknownProperties == null)
		{
			this.unknownProperties = new ArrayList();
		}
		
		this.unknownProperties.add(property);
	}
	
	List getUnknownProperties() {
		return this.unknownProperties;
	}
	
	synchronized void appendUnknownPropertiesToDescriptionElement(Element descriptionElement) {
		if (this.unknownProperties != null) {
			for (Element unknownElement : this.unknownProperties) {
				Node importedElement = descriptionElement.getOwnerDocument().importNode(unknownElement, true);
				descriptionElement.appendChild(importedElement);
			}
		}
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy