#region Disclaimer / License // Copyright (C) 2011, Jackie Ng // http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@gmail.com // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // #endregion using System; using System.Collections.Generic; using System.Text; using System.Xml.Serialization; using System.ComponentModel; namespace OSGeo.MapGuide.MaestroAPI.Commands { /// /// Defines the command for querying the cache status of FDO connections /// /// /// This example shows how invoke the /// command. Note that you should check if the connection supports this command through its capabilities /// /// /// /// public interface IGetFdoCacheInfo : ICommand { /// /// Executes this command and returns a that /// represents this cache status information /// /// FdoCacheInfo Execute(); } /// /// Represents the cache status of FDO connections currently managed by the MapGuide Server /// [XmlRoot(ElementName = "FdoCacheInformation")] //NOXLATE public class FdoCacheInfo { private static XmlSerializer smSerializer; /// /// Gets the serializer. /// public static XmlSerializer Serializer { get { if (null == smSerializer) smSerializer = new XmlSerializer(typeof(FdoCacheInfo)); return smSerializer; } } /// /// Gets the timestamp /// /// /// The time stamp. /// [XmlElement] public DateTime TimeStamp { get; set; } /// /// Gets the configuration settings /// /// /// The configuration. /// [XmlElement(ElementName = "ConfigurationSettings")] //NOXLATE [DisplayName("Configuration Settings")] //NOXLATE public ConfigurationSettings Configuration { get; set; } /// /// Gets an array of cache status of connections for each provider /// [XmlElement(ElementName = "Provider")] //NOXLATE [DisplayName("Cached FDO Providers")] //NOXLATE public CachedProviderInfo[] Providers { get; set; } } /// /// Represents information about a cached FDO connection /// [Serializable] public class CachedFdoConnection { /// /// Gets the feature source /// [XmlElement] [DisplayName("Feature Source")] //NOXLATE public string Name { get; set; } /// /// Gets the state of this connection /// [XmlElement] public string ConnectionState { get; set; } /// /// Gets whether this connection is currently in use /// [XmlElement] public string InUse { get; set; } /// /// Gets the number of objects currently using this connection /// [XmlElement] public int UseCount { get; set; } /// /// Gets the long transaction /// [XmlElement] public string LongTransaction { get; set; } /// /// Gets the date this connection was last used /// [XmlElement] public DateTime LastUsed { get; set; } /// /// Gets whether this connection is valid /// [XmlElement] public string Valid { get; set; } } /// /// Represents the cache status of connections for a particular provider /// [Serializable] public class CachedProviderInfo { /// /// Gets the feature source /// [XmlElement(ElementName = "Name")] //NOXLATE public string FeatureSourceId { get; set; } /// /// Gets the maximum connection pool size /// [XmlElement] public int MaximumDataConnectionPoolSize { get; set; } /// /// Gets the current connection pool size /// [XmlElement] public int CurrentDataConnectionPoolSize { get; set; } /// /// Gets the number of current connections /// [XmlElement] public int CurrentDataConnections { get; set; } /// /// Gets the thread model /// [XmlElement] public string ThreadModel { get; set; } /// /// Gets whether connections are cached /// [XmlElement] public string KeepDataConnectionsCached { get; set; } /// /// Gets an array of cached connections using this provider /// [XmlElement(ElementName = "CachedFdoConnection")] //NOXLATE [DisplayName("Cached Feature Sources")] //NOXLATE public CachedFdoConnection[] CachedFdoConnections { get; set; } } /// /// Represents the FDO cache configuration /// [Serializable] public class ConfigurationSettings { /// /// Gets whether connection pooling is enabled /// [XmlElement] public string DataConnectionPoolEnabled { get; set; } /// /// Gets the FDO providers which are excluded from connection pooling /// [XmlElement] public string DataConnectionPoolExcludedProviders { get; set; } /// /// Gets the size of the connection pool /// [XmlElement] public int DataConnectionPoolSize { get; set; } /// /// Gets a delimited list of custom connection pool sizes by provider /// [XmlElement] public string DataConnectionPoolSizeCustom { get; set; } /// /// Gets the connection timeout /// [XmlElement] public int DataConnectionTimeout { get; set; } } }