259 lines
11 KiB
C#

//----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
//
// File: CIM_ConcreteJob.cs
//
// Contents: A concrete version of Job. This class represents a generic and instantiable unit of work, such as a batch or a print job.
// This file was automatically generated from CIM_ConcreteJob.mof
//
//----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Globalization;
using System.Xml.Serialization;
using System.IO;
using Intel.Manageability.WSManagement;
using Intel.Manageability.Cim.Untyped;
namespace Intel.Manageability.Cim.Typed
{
/// <summary>
///A concrete version of Job. This class represents a generic and instantiable unit of work, such as a batch or a print job.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ConcreteJob")]
[System.Xml.Serialization.XmlRootAttribute("CIM_ConcreteJob", Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ConcreteJob", IsNullable=false)]
public class CIM_ConcreteJob : CIM_Job
{
/// <summary>
/// Default constructor.
/// </summary>
public CIM_ConcreteJob() :base()
{
}
/// <summary>
/// Constructor that recieves an xml string for deserialization.
/// </summary>
/// <param name="xml">xml string to deserialize</param>
public CIM_ConcreteJob(string xml): base((IWSManClient)null)
{
this.Deserialize(xml);
}
/// <summary>
/// Constructor which recieves a Ws-Management client object.
/// </summary>
/// <param name="client">Ws-Management client</param>
public CIM_ConcreteJob(IWSManClient client): base(client)
{
}
/// <summary>
/// Key, Required, Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies an instance of this class. In order to ensure uniqueness within the NameSpace, the value of InstanceID SHOULD be constructed using the following 'preferred' algorithm:
/// &lt;OrgID&gt;:&lt;LocalID&gt;
/// Where &lt;OrgID&gt; and &lt;LocalID&gt; are separated by a colon ':', and where &lt;OrgID&gt; must include a copyrighted, trademarked or otherwise unique name that is owned by the business entity that is creating or defining the InstanceID, or that is a registered ID that is assigned to the business entity by a recognized global authority. (This requirement is similar to the &lt;Schema Name&gt;_&lt;Class Name&gt; structure of Schema class names.) In addition, to ensure uniqueness &lt;OrgID&gt; must not contain a colon (':'). When using this algorithm, the first colon to appear in InstanceID must appear between &lt;OrgID&gt; and &lt;LocalID&gt;.
/// &lt;LocalID&gt; is chosen by the business entity and should not be re-used to identify different underlying (real-world) elements. If the above 'preferred' algorithm is not used, the defining entity must assure that the resulting InstanceID is not re-used across any InstanceIDs produced by this or other providers for the NameSpace of this instance.
/// For DMTF defined instances, the 'preferred' algorithm must be used with the &lt;OrgID&gt; set to 'CIM'.
/// </summary>
[CimField(true, true)]
public override string InstanceID
{
get
{
return this.GetField("InstanceID")[0];
}
set
{
this.SetOrAddField("InstanceID",value);
}
}
/// <summary>
/// Remove JobState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveJobState()
{
RemoveField("JobState");
}
/// <summary>
/// Is true if the field JobState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool JobStateExist
{
get
{
return ContainsField("JobState");
}
}
/// <summary>
/// Optional, JobState is an integer enumeration that indicates the operational state of a Job. It can also indicate transitions between these states, for example, 'Shutting Down' and 'Starting'. Following is a brief description of the states:
/// New (2) indicates that the job has never been started.
/// Starting (3) indicates that the job is moving from the 'New', 'Suspended', or 'Service' states into the 'Running' state.
/// Running (4) indicates that the Job is running.
/// Suspended (5) indicates that the Job is stopped, but can be restarted in a seamless manner.
/// Shutting Down (6) indicates that the job is moving to a 'Completed', 'Terminated', or 'Killed' state.
/// Completed (7) indicates that the job has completed normally.
/// Terminated (8) indicates that the job has been stopped by a 'Terminate' state change request. The job and all its underlying processes are ended and can be restarted (this is job-specific) only as a new job.
/// Killed (9) indicates that the job has been stopped by a 'Kill' state change request. Underlying processes might have been left running, and cleanup might be required to free up resources.
/// Exception (10) indicates that the Job is in an abnormal state that might be indicative of an error condition. Actual status might be displayed though job-specific objects.
/// Service (11) indicates that the Job is in a vendor-specific state that supports problem discovery, or resolution, or both.
/// Query pending (12) waiting for a client to resolve a query
/// </summary>
[CimField(false, false)]
public virtual ushort JobState
{
get
{
return ushort.Parse(this["JobState"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("JobState",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Required, The user-friendly name for this instance of a Job. In addition, the user-friendly name can be used as a property for a search or query. (Note: Name does not have to be unique within a namespace.)
/// </summary>
[CimField(false, true)]
public override string Name
{
get
{
return this.GetField("Name")[0];
}
set
{
this.SetOrAddField("Name",value);
}
}
/// <summary>
/// Required, The amount of time that the Job is retained after it has finished executing, either succeeding or failing in that execution. The job must remain in existence for some period of time regardless of the value of the DeleteOnCompletion property.
/// The default is five minutes.
/// </summary>
[CimField(false, true)]
public virtual CimDateTime TimeBeforeRemoval
{
get
{
return CimDateTime.Parse(this["TimeBeforeRemoval"][0]);
}
set
{
this.SetOrAddField("TimeBeforeRemoval",value.ToString());
}
}
/// <summary>
/// Remove TimeOfLastStateChange field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveTimeOfLastStateChange()
{
RemoveField("TimeOfLastStateChange");
}
/// <summary>
/// Is true if the field TimeOfLastStateChange exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool TimeOfLastStateChangeExist
{
get
{
return ContainsField("TimeOfLastStateChange");
}
}
/// <summary>
/// Optional, The date or time when the state of the Job last changed. If the state of the Job has not changed and this property is populated, then it must be set to a 0 interval value. If a state change was requested, but rejected or not yet processed, the property must not be updated.
/// </summary>
[CimField(false, false)]
public virtual CimDateTime TimeOfLastStateChange
{
get
{
return CimDateTime.Parse(this["TimeOfLastStateChange"][0]);
}
set
{
this.SetOrAddField("TimeOfLastStateChange",value.ToString());
}
}
/// <summary>
/// Enumerate instances of CIM_ConcreteJob class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <param name="cimKeys">Keys for selecting the instances</param>
/// <returns>Collection of CIM_ConcreteJob objects</returns>
public static new Collection<CIM_ConcreteJob> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
{
List<CIM_ConcreteJob> ret = CimBase.Enumerate<CIM_ConcreteJob>(client, cimKeys);
return new Collection<CIM_ConcreteJob>(ret);
}
/// <summary>
/// Enumerate instances of CIM_ConcreteJob class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <returns>Collection of CIM_ConcreteJob objects</returns>
public static new Collection<CIM_ConcreteJob> Enumerate(IWSManClient client)
{
List<CIM_ConcreteJob> ret = CimBase.Enumerate<CIM_ConcreteJob>(client);
return new Collection<CIM_ConcreteJob>(ret);
}
/// <summary>
/// Delete the instance of CIM_ConcreteJob if it is singular.
/// Note: This method will succeed only if a single instance of the class exists.
/// </summary>
/// <param name="client">WS-Management client</param>
public static new void Delete(IWSManClient client)
{
CimBase.Delete<CIM_ConcreteJob>(client);
}
/// <summary>
/// Represents the keys of the CIM_ConcreteJob class.
/// </summary>
public new class CimKeys : CIM_Job.CimKeys
{
/// <summary>
/// Key, Required, Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies an instance of this class. In order to ensure uniqueness within the NameSpace, the value of InstanceID SHOULD be constructed using the following 'preferred' algorithm:
/// &lt;OrgID&gt;:&lt;LocalID&gt;
/// Where &lt;OrgID&gt; and &lt;LocalID&gt; are separated by a colon ':', and where &lt;OrgID&gt; must include a copyrighted, trademarked or otherwise unique name that is owned by the business entity that is creating or defining the InstanceID, or that is a registered ID that is assigned to the business entity by a recognized global authority. (This requirement is similar to the &lt;Schema Name&gt;_&lt;Class Name&gt; structure of Schema class names.) In addition, to ensure uniqueness &lt;OrgID&gt; must not contain a colon (':'). When using this algorithm, the first colon to appear in InstanceID must appear between &lt;OrgID&gt; and &lt;LocalID&gt;.
/// &lt;LocalID&gt; is chosen by the business entity and should not be re-used to identify different underlying (real-world) elements. If the above 'preferred' algorithm is not used, the defining entity must assure that the resulting InstanceID is not re-used across any InstanceIDs produced by this or other providers for the NameSpace of this instance.
/// For DMTF defined instances, the 'preferred' algorithm must be used with the &lt;OrgID&gt; set to 'CIM'.
/// </summary>
public virtual string InstanceID
{
get
{
return GetKey("InstanceID");
}
set
{
SetOrAddKey("InstanceID", value);
}
}
}
}
}