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

microsoft.exchange.webservices.data.ProtocolConnectionCollection Maven / Gradle / Ivy

Go to download

The source came from http://archive.msdn.microsoft.com/ewsjavaapi Support for Maven has been added.

The newest version!
/**************************************************************************
 * copyright file="ProtocolConnectionCollection.java" company="Microsoft"
 *     Copyright (c) Microsoft Corporation.  All rights reserved.
 * 
 * Defines the ProtocolConnectionCollection.java.
 **************************************************************************/
package microsoft.exchange.webservices.data;

import java.util.ArrayList;

/**
 * Represents a user setting that is a collection of protocol connection.
 * 
 */
public final class ProtocolConnectionCollection {

	/** The connections. */
	private ArrayList connections;

	/**
	 * Initializes a new instance of the  class.
	 */
	ProtocolConnectionCollection() {
		this.connections = new ArrayList();
	}

	/**
	 * Read user setting with ProtocolConnectionCollection value.
	 * 
	 * @param reader
	 *            EwsServiceXmlReader
	 * @return the protocol connection collection
	 * @throws Exception
	 *             the exception
	 */
	static ProtocolConnectionCollection LoadFromXml(EwsXmlReader reader)
			throws Exception {
		ProtocolConnectionCollection value = new ProtocolConnectionCollection();
		ProtocolConnection connection = null;

		do {
			reader.read();

			if (reader.getNodeType().getNodeType() == XMLNodeType.START_ELEMENT) {
				if (reader.getLocalName().equals(
						XmlElementNames.ProtocolConnection)) {
					connection = ProtocolConnection.loadFromXml(reader);
					if (connection != null) {
						value.getConnections().add(connection);
					}
				}
			}
		} while (!reader.isEndElement(XmlNamespace.Autodiscover,
				XmlElementNames.ProtocolConnections));

		return value;
	}

	/**
	 * Gets the Connections.
	 * 
	 * @return the connections
	 */
	public ArrayList getConnections() {
		return this.connections;
	}

	/**
	 * Sets the connections.
	 * 
	 * @param value
	 *            the new connections
	 */
	void setConnections(ArrayList value) {
		this.connections = value;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy