// This file was generated by Mendix Modeler.
//
// WARNING: Code you write here will be lost the next time you deploy the project.

package system.proxies;

public class Statistics
{
	private final com.mendix.systemwideinterfaces.core.IMendixObject statisticsMendixObject;

	private final com.mendix.systemwideinterfaces.core.IContext context;

	/**
	 * Internal name of this entity
	 */
	public static final java.lang.String entityName = "System.Statistics";

	/**
	 * Enum describing members of this entity
	 */
	public enum MemberNames
	{
		MaxNumberOfConcurrentUsers("MaxNumberOfConcurrentUsers"),
		MaxNumberOfAnonymousConcurrentUsers("MaxNumberOfAnonymousConcurrentUsers"),
		MaxNumberOfNamedUsers("MaxNumberOfNamedUsers"),
		LastUpdate("LastUpdate"),
		ClusterManager("System.ClusterManager");

		private java.lang.String metaName;

		MemberNames(java.lang.String s)
		{
			metaName = s;
		}

		@Override
		public java.lang.String toString()
		{
			return metaName;
		}
	}

	public Statistics(com.mendix.systemwideinterfaces.core.IContext context)
	{
		this(context, com.mendix.core.Core.instantiate(context, "System.Statistics"));
	}

	protected Statistics(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject statisticsMendixObject)
	{
		if (statisticsMendixObject == null)
			throw new java.lang.IllegalArgumentException("The given object cannot be null.");
		if (!com.mendix.core.Core.isSubClassOf("System.Statistics", statisticsMendixObject.getType()))
			throw new java.lang.IllegalArgumentException("The given object is not a System.Statistics");

		this.statisticsMendixObject = statisticsMendixObject;
		this.context = context;
	}

	/**
	 * @deprecated Use 'Statistics.load(IContext, IMendixIdentifier)' instead.
	 */
	@Deprecated
	public static system.proxies.Statistics initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException
	{
		return system.proxies.Statistics.load(context, mendixIdentifier);
	}

	/**
	 * Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called.
	 * The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.getSudoContext() can be used to obtain sudo access).
	 */
	public static system.proxies.Statistics initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject)
	{
		return new system.proxies.Statistics(context, mendixObject);
	}

	public static system.proxies.Statistics load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException
	{
		com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier);
		return system.proxies.Statistics.initialize(context, mendixObject);
	}

	public static java.util.List<system.proxies.Statistics> load(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String xpathConstraint) throws com.mendix.core.CoreException
	{
		java.util.List<system.proxies.Statistics> result = new java.util.ArrayList<system.proxies.Statistics>();
		for (com.mendix.systemwideinterfaces.core.IMendixObject obj : com.mendix.core.Core.retrieveXPathQuery(context, "//System.Statistics" + xpathConstraint))
			result.add(system.proxies.Statistics.initialize(context, obj));
		return result;
	}

	/**
	 * Commit the changes made on this proxy object.
	 */
	public final void commit() throws com.mendix.core.CoreException
	{
		com.mendix.core.Core.commit(context, getMendixObject());
	}

	/**
	 * Commit the changes made on this proxy object using the specified context.
	 */
	public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException
	{
		com.mendix.core.Core.commit(context, getMendixObject());
	}

	/**
	 * Delete the object.
	 */
	public final void delete()
	{
		com.mendix.core.Core.delete(context, getMendixObject());
	}

	/**
	 * Delete the object using the specified context.
	 */
	public final void delete(com.mendix.systemwideinterfaces.core.IContext context)
	{
		com.mendix.core.Core.delete(context, getMendixObject());
	}
	/**
	 * @return value of MaxNumberOfConcurrentUsers
	 */
	public final java.lang.Integer getMaxNumberOfConcurrentUsers()
	{
		return getMaxNumberOfConcurrentUsers(getContext());
	}

	/**
	 * @param context
	 * @return value of MaxNumberOfConcurrentUsers
	 */
	public final java.lang.Integer getMaxNumberOfConcurrentUsers(com.mendix.systemwideinterfaces.core.IContext context)
	{
		return (java.lang.Integer) getMendixObject().getValue(context, MemberNames.MaxNumberOfConcurrentUsers.toString());
	}

	/**
	 * Set value of MaxNumberOfConcurrentUsers
	 * @param maxnumberofconcurrentusers
	 */
	public final void setMaxNumberOfConcurrentUsers(java.lang.Integer maxnumberofconcurrentusers)
	{
		setMaxNumberOfConcurrentUsers(getContext(), maxnumberofconcurrentusers);
	}

	/**
	 * Set value of MaxNumberOfConcurrentUsers
	 * @param context
	 * @param maxnumberofconcurrentusers
	 */
	public final void setMaxNumberOfConcurrentUsers(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer maxnumberofconcurrentusers)
	{
		getMendixObject().setValue(context, MemberNames.MaxNumberOfConcurrentUsers.toString(), maxnumberofconcurrentusers);
	}

	/**
	 * @return value of MaxNumberOfAnonymousConcurrentUsers
	 */
	public final java.lang.Integer getMaxNumberOfAnonymousConcurrentUsers()
	{
		return getMaxNumberOfAnonymousConcurrentUsers(getContext());
	}

	/**
	 * @param context
	 * @return value of MaxNumberOfAnonymousConcurrentUsers
	 */
	public final java.lang.Integer getMaxNumberOfAnonymousConcurrentUsers(com.mendix.systemwideinterfaces.core.IContext context)
	{
		return (java.lang.Integer) getMendixObject().getValue(context, MemberNames.MaxNumberOfAnonymousConcurrentUsers.toString());
	}

	/**
	 * Set value of MaxNumberOfAnonymousConcurrentUsers
	 * @param maxnumberofanonymousconcurrentusers
	 */
	public final void setMaxNumberOfAnonymousConcurrentUsers(java.lang.Integer maxnumberofanonymousconcurrentusers)
	{
		setMaxNumberOfAnonymousConcurrentUsers(getContext(), maxnumberofanonymousconcurrentusers);
	}

	/**
	 * Set value of MaxNumberOfAnonymousConcurrentUsers
	 * @param context
	 * @param maxnumberofanonymousconcurrentusers
	 */
	public final void setMaxNumberOfAnonymousConcurrentUsers(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer maxnumberofanonymousconcurrentusers)
	{
		getMendixObject().setValue(context, MemberNames.MaxNumberOfAnonymousConcurrentUsers.toString(), maxnumberofanonymousconcurrentusers);
	}

	/**
	 * @return value of MaxNumberOfNamedUsers
	 */
	public final java.lang.Integer getMaxNumberOfNamedUsers()
	{
		return getMaxNumberOfNamedUsers(getContext());
	}

	/**
	 * @param context
	 * @return value of MaxNumberOfNamedUsers
	 */
	public final java.lang.Integer getMaxNumberOfNamedUsers(com.mendix.systemwideinterfaces.core.IContext context)
	{
		return (java.lang.Integer) getMendixObject().getValue(context, MemberNames.MaxNumberOfNamedUsers.toString());
	}

	/**
	 * Set value of MaxNumberOfNamedUsers
	 * @param maxnumberofnamedusers
	 */
	public final void setMaxNumberOfNamedUsers(java.lang.Integer maxnumberofnamedusers)
	{
		setMaxNumberOfNamedUsers(getContext(), maxnumberofnamedusers);
	}

	/**
	 * Set value of MaxNumberOfNamedUsers
	 * @param context
	 * @param maxnumberofnamedusers
	 */
	public final void setMaxNumberOfNamedUsers(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer maxnumberofnamedusers)
	{
		getMendixObject().setValue(context, MemberNames.MaxNumberOfNamedUsers.toString(), maxnumberofnamedusers);
	}

	/**
	 * @return value of LastUpdate
	 */
	public final java.util.Date getLastUpdate()
	{
		return getLastUpdate(getContext());
	}

	/**
	 * @param context
	 * @return value of LastUpdate
	 */
	public final java.util.Date getLastUpdate(com.mendix.systemwideinterfaces.core.IContext context)
	{
		return (java.util.Date) getMendixObject().getValue(context, MemberNames.LastUpdate.toString());
	}

	/**
	 * Set value of LastUpdate
	 * @param lastupdate
	 */
	public final void setLastUpdate(java.util.Date lastupdate)
	{
		setLastUpdate(getContext(), lastupdate);
	}

	/**
	 * Set value of LastUpdate
	 * @param context
	 * @param lastupdate
	 */
	public final void setLastUpdate(com.mendix.systemwideinterfaces.core.IContext context, java.util.Date lastupdate)
	{
		getMendixObject().setValue(context, MemberNames.LastUpdate.toString(), lastupdate);
	}

	/**
	 * @return value of ClusterManager
	 */
	public final system.proxies.XASInstance getClusterManager() throws com.mendix.core.CoreException
	{
		return getClusterManager(getContext());
	}

	/**
	 * @param context
	 * @return value of ClusterManager
	 */
	public final system.proxies.XASInstance getClusterManager(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException
	{
		system.proxies.XASInstance result = null;
		com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.ClusterManager.toString());
		if (identifier != null)
			result = system.proxies.XASInstance.load(context, identifier);
		return result;
	}

	/**
	 * Set value of ClusterManager
	 * @param clustermanager
	 */
	public final void setClusterManager(system.proxies.XASInstance clustermanager)
	{
		setClusterManager(getContext(), clustermanager);
	}

	/**
	 * Set value of ClusterManager
	 * @param context
	 * @param clustermanager
	 */
	public final void setClusterManager(com.mendix.systemwideinterfaces.core.IContext context, system.proxies.XASInstance clustermanager)
	{
		if (clustermanager == null)
			getMendixObject().setValue(context, MemberNames.ClusterManager.toString(), null);
		else
			getMendixObject().setValue(context, MemberNames.ClusterManager.toString(), clustermanager.getMendixObject().getId());
	}

	/**
	 * @return the IMendixObject instance of this proxy for use in the Core interface.
	 */
	public final com.mendix.systemwideinterfaces.core.IMendixObject getMendixObject()
	{
		return statisticsMendixObject;
	}

	/**
	 * @return the IContext instance of this proxy, or null if no IContext instance was specified at initialization.
	 */
	public final com.mendix.systemwideinterfaces.core.IContext getContext()
	{
		return context;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (obj == this)
			return true;

		if (obj != null && getClass().equals(obj.getClass()))
		{
			final system.proxies.Statistics that = (system.proxies.Statistics) obj;
			return getMendixObject().equals(that.getMendixObject());
		}
		return false;
	}

	@Override
	public int hashCode()
	{
		return getMendixObject().hashCode();
	}

	/**
	 * @return String name of this class
	 */
	public static java.lang.String getType()
	{
		return "System.Statistics";
	}

	/**
	 * @return String GUID from this object, format: ID_0000000000
	 * @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object.
	 */
	@Deprecated
	public java.lang.String getGUID()
	{
		return "ID_" + getMendixObject().getId().toLong();
	}
}
