Class DataContext
- Namespace
- ArcanaDevelopment.adTempus.Client
- Assembly
- ArcanaDevelopment.adTempus.Client.dll
Defines an isolation context within which most data fetch/update operations occur.
public sealed class DataContext
- Inheritance
-
objectDataContext
Remarks
The DataContext provides the primary interface for fetching data and managing from an adTempus server.
While the Scheduler represents a connection to an adTempus server, Scheduler the DataContext allows a client to work with separate, isolated copies of objects from that server.
Each DataContext maintains a cache of all the objects that have been fetched through it, and guarantees that any operations you perform on an object with a given identity will operate on the same copy of the object.
For example, suppose you fetch a CredentialProfile for user "bob" through the DataContext. Subsequently you fetch a job that uses CredentialProfile "bob." When you ask the job for its CredentialProfile, the object you get back will be the same copy of the object that you previously fetched from the DataContext.
Conversely, DataContexts and the objects that belong to them are isolated from each other. If you fetch the CredentialProfile for "bob" through a second DataContext, you will get a separate copy of that CredentialProfile. If you make changes to that CredentialProfile, those changes will not be reflected in the copies that belong to other DataContexts.
To enforce this isolation, objects are not permitted to be used across DataContext boundaries. For example, if you fetch a CredentialProfile in DataContext A, you cannot assign that CredentialProfile to a Job that you fetched through DataContext B. If you try to do this, the assignment operation will throw a BoundaryViolationException.
The one exception to this rule is the %Scheduler.ReadOnlyDataContext% exposed by the Scheduler. This special context is intended to be used for fetching lists of reference data for use when editing other objects. Objects fetched through this DataContext can be used in other DataContexts. However, objects fetched through the ReadOnlyDataContext cannot be modified.
Generally a DataContext should be short-lived, discarded after updates made within the context have been saved. For example, in the adTempus Console, the list of job groups, jobs, etc., is fetched through a DataContext that is kept alive for the entire time the Console is running, but the data fetched through that DataContext is not updated in the Console. Instead, when a user wants to edit a Job or other object, the Console creates a new DataContext and fetches a copy of the desired job into that new DataContext. All edit operations now operate on objects in this separate context, keeping them isolated from the rest of the Console, and vice-versa. For example,
- The job list in the Console is refreshed from the server periodically. Since this operation uses a different context, the copy of the Job that is being edited is not overwritten by the refresh operation.
- Similarly, in-progress changes to the Job being edited are not reflected elsewhere in the Console until the job has been saved.
Once the user has finished editing the job (saving or discarding the changes), the DataContext is disposed.
To create a new DataContext, use NewDataContext().
Properties
IsReadOnly
Indicates whether this context is read-only.
public bool IsReadOnly { get; }
Property Value
- bool
Remarks
If the IsReadOnly is True, then all objects in the context are read-only, and attempts to modify them will result in an exception.
Scheduler
Gets the Scheduler session that this DataContext belongs to.
public Scheduler Scheduler { get; }
Property Value
Methods
CanCreateObject(ClassID)
Indicates whether the caller has permission to create objects of the specified class.
public bool CanCreateObject(ClassID cid)
Parameters
| Name | Type | Description |
|---|---|---|
cid |
ClassID | The Class ID. |
Returns
- bool
True if the caller has permission to create objects of the class, or False otherwise.
Remarks
For a Job or JobGroup use CanCreateObject(ClassID, OID).
CanCreateObject(ClassID, OID)
Indicates whether the caller has permission to create objects of the specified class.
public bool CanCreateObject(ClassID cid, OID parentOID)
Parameters
| Name | Type | Description |
|---|---|---|
cid |
ClassID | The Class ID. |
parentOID |
OID | The OID of the parent object, if any. See Remarks. |
Returns
- bool
True if the caller has permission to create objects of the class, or False otherwise.
Remarks
parentOID, because
permission to create depends on permission to create within the parent Group.
CanDuplicateObject(ADTObject)
Indicates whether the caller has permission to duplicate the specified object.
public bool CanDuplicateObject(ADTObject source)
Parameters
| Name | Type | Description |
|---|---|---|
source |
ADTObject |
Returns
- bool
CanPerformOnObject(OID, SecurityPermission)
Determines whether the caller can perform the specified action on the specified object.
public bool CanPerformOnObject(OID oid, SecurityPermission action)
Parameters
| Name | Type | Description |
|---|---|---|
oid |
OID | The OID of the object to check permission for. |
action |
SecurityPermission | The security action requested. |
Returns
- bool
True if the user can perform the requested action or False otherwise.
CountJobHistory(InstanceQueryParameters)
public int CountJobHistory(InstanceQueryParameters parameters)
Parameters
| Name | Type | Description |
|---|---|---|
parameters |
InstanceQueryParameters |
Returns
- int
CountLogMessages(LogQueryParameters)
public int CountLogMessages(LogQueryParameters parameters)
Parameters
| Name | Type | Description |
|---|---|---|
parameters |
LogQueryParameters |
Returns
- int
CreateObject(ClassID)
Creates an object of the specified class.
public ADTObject CreateObject(ClassID cid)
Parameters
| Name | Type | Description |
|---|---|---|
cid |
ClassID | The ID of the class to create. |
Returns
- ADTObject
A new object of the specified class.
Remarks
When you call this method to create a new Job or JobGroup, the new object will be created in the Root group. If the caller does not have permission to create jobs/groups in the Root group, the call will fail with a PermissionDeniedException. To avoid this, use NewJob() and NewGroup() instead, to create the new job or group directly in the target group.
Exceptions
- PermissionDeniedException
Thrown if the caller does not have permission to create objects of the specified type.
CreateUnitOfWork()
Creates a new UnitOfWork.
public UnitOfWork CreateUnitOfWork()
Returns
Exceptions
- InvalidOperationException
Thrown if IsReadOnly is True.
Dispose()
Releases all resources held by the DataContext.
public void Dispose()
DoFastJobLookup(string)
public ReadOnlyCollection<JobLookupInfo> DoFastJobLookup(string name)
Parameters
| Name | Type | Description |
|---|---|---|
name |
string |
Returns
- ReadOnlyCollection<JobLookupInfo>
DuplicateObject(OID)
Returns a duplicate copy of an object.
public ADTObject DuplicateObject(OID oid)
Parameters
| Name | Type | Description |
|---|---|---|
oid |
OID | The OID of the object to duplicate. |
Returns
- ADTObject
A new copy of the object.
Remarks
This method should only be called for independent objects.
Calling DuplicateObject is equivalent to calling Duplicate() but eliminates the need to fetch the job from the server first.
This method is intended for use in scenarios where you want to duplicate a top-level object and edit the new object in a different DataContext than the original (without this method you would need to fetch the object in the new context, then call Duplicate on the object to create the new copy).
~DataContext()
protected ~DataContext()
GetAlertNotificationRules(ObjectFetchOptions)
public AlertNotificationRuleCollection GetAlertNotificationRules(ObjectFetchOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
options |
ObjectFetchOptions |
Returns
GetCredentialProfile(string)
Gets the Windows Credential Profile with the specified name.
public CredentialProfile GetCredentialProfile(string userName)
Parameters
| Name | Type | Description |
|---|---|---|
userName |
string | The user ID of the profile to fetch. |
Returns
- CredentialProfile
The profile, or null (Nothing) if the profile does not exist.
GetCredentialProfile(string, string, string)
Gets the Credential Profile with the specified name and type.
public CredentialProfile GetCredentialProfile(string userName, string profileType, string credentialSelector)
Parameters
| Name | Type | Description |
|---|---|---|
userName |
string | The user ID of the profile to fetch. |
profileType |
string | The type of profile to fetch. Specify null (Nothing) for a default Windows credential profile. |
credentialSelector |
string | The profile selector/discriminator to use. Specify null or empty string when searching for Windows credentials. |
Returns
- CredentialProfile
The profile, or null (Nothing) if the profile does not exist.
GetCredentialProfiles(string, string)
Fetches all Credential Profiles of the specified type.
public CredentialProfileCollection GetCredentialProfiles(string profileType, string credentialSelector)
Parameters
| Name | Type | Description |
|---|---|---|
profileType |
string | The profile type to fetch. Specify "*" for all types, an empty string ("") for Windows credentials, or the name of a credential type. |
credentialSelector |
string | The profile selector/discriminator to use. Specify null or empty string when searching for Windows credentials. |
Returns
- CredentialProfileCollection
All Credential Profiles of the requested type for which the caller has at least List permission.
GetCredentialProfiles(string, string, ObjectFetchOptions, int, ref bool)
Fetches all Credential Profiles of the specified type.
public CredentialProfileCollection GetCredentialProfiles(string profileType, string credentialSelector, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
profileType |
string | The profile type to fetch. Specify "*" for all types, an empty string ("") for Windows credentials, or the name of a credential type. |
credentialSelector |
string | The profile selector/discriminator to use. Specify null or empty string when searching for Windows credentials. |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
- CredentialProfileCollection
All Credential Profiles of the requested type for which the caller has at least List permission.
GetDescriptionForObject(OID, string)
public string GetDescriptionForObject(OID oid, string targetComputerName = null)
Parameters
| Name | Type | Description |
|---|---|---|
oid |
OID | |
targetComputerName |
string |
Returns
- string
GetEffectivePermissions(params OID[])
Gets the effective permission sets for one or more objects.
public Dictionary<OID, int[]> GetEffectivePermissions(params OID[] requestedOIDs)
Parameters
| Name | Type | Description |
|---|---|---|
requestedOIDs |
OID[] | The OIDs of the object(s) to check permissions for. |
Returns
- Dictionary<OID, int[]>
A dictionary of permission sets for the objects.
Remarks
Each item is an array of uints representing all the permissions that the caller has for the object. The values may be any of the values from SecurityPermission, or extended values.
Important: When checking to see if a specific permission is present, you must test separately for the presence of SecurityPermission.FullControl. If SecurityPermission.FullControl is present then the caller is authorized to perform any action, but other actions will not be explicitly included in the list. Use ArcanaDevelopment.adTempus.Internal.Utility.CanPerform(uint[],SecurityPermission) to properly check for a permission.
If the array of permissions is empty, the object could not be found or the caller does not have any permissions.
GetFileServiceProvider(string)
public FileServiceProvider GetFileServiceProvider(string name)
Parameters
| Name | Type | Description |
|---|---|---|
name |
string |
Returns
GetFileServiceProviders(params string[])
public FileServiceProviderCollection GetFileServiceProviders(params string[] providerTypes)
Parameters
| Name | Type | Description |
|---|---|---|
providerTypes |
string[] |
Returns
GetFileServiceProviders(string[], ObjectFetchOptions, int, ref bool)
Gets File Service Providers from the server.
public FileServiceProviderCollection GetFileServiceProviders(string[] providerTypes, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
providerTypes |
string[] | |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetHistoryAndMessages(InstanceQueryParameters, out ExecutionHistoryItemCollection, LogQueryParameters, out LogMessageCollection)
public void GetHistoryAndMessages(InstanceQueryParameters historyParameters, out ExecutionHistoryItemCollection history, LogQueryParameters logParameters, out LogMessageCollection messages)
Parameters
| Name | Type | Description |
|---|---|---|
historyParameters |
InstanceQueryParameters | |
history |
ExecutionHistoryItemCollection | |
logParameters |
LogQueryParameters | |
messages |
LogMessageCollection |
GetHolidaySet(string)
Gets the Holiday Set with the specified name.
public SharedSchedule GetHolidaySet(string setName)
Parameters
| Name | Type | Description |
|---|---|---|
setName |
string | The name of the Holiday Set to fetch. |
Returns
- SharedSchedule
The requested holiday set, or null (Nothing) if the schedule does not exist.
GetHolidaySets()
Gets all Holiday Sets.
public SharedScheduleCollection GetHolidaySets()
Returns
- SharedScheduleCollection
All Holiday Sets for which the caller has at least List permission.
GetHolidaySets(ObjectFetchOptions, int, ref bool)
Gets all Holiday Sets.
public SharedScheduleCollection GetHolidaySets(ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
- SharedScheduleCollection
All Holiday Sets for which the caller has at least List permission.
GetJob(string)
Gets the Job with the specified name.
public Job GetJob(string jobName)
Parameters
| Name | Type | Description |
|---|---|---|
jobName |
string | The fully-qualified name of the job to fetch (see Remarks). |
Returns
- Job
The Job, or null (Nothing) if no matching object is found.
Remarks
If the job is contained in a group, the full path to the job must be included
in the form "Group Level 1\Group Level 2\Job Name". For a job in the root group, specify
"\Job Name". To search all groups, specify only the name (e.g., "Job Name").
Exceptions
- MultipleMatchException
Thrown if more than one job matches the criteria. Use GetJobs instead to get multiple matches.
GetJobChain(IEnumerable<OID>, Guid?)
Gets the requested jobs and all jobs linked to them through Conditions, Responses, and Triggers.
public JobLinkResults GetJobChain(IEnumerable<OID> oids, Guid? chainID)
Parameters
| Name | Type | Description |
|---|---|---|
oids |
IEnumerable<OID> | The OIDs to fetch. See Remarks. |
chainID |
Guid? | If specified, only jobs participating in the specified chain are returned. |
Returns
Remarks
GetJobChain returns all jobs that are linked to the requested jobs, directly or indirectly, through JobConditions, JobControlActions, and JobTriggers.
For example, if this job is called by a Response in JobA, and JobA has a condition on JobB, GetJobChain returns this job, JobA, and JobB.
The oids collection can also include JobGroup or JobQueue oids. In this case GetJobChain processes all jobs in the specified groups and queues.
GetJobExecutionTimes(JobQueryParameters, DateTime, DateTime)
Gets scheduled job executions that meet the specified criteria.
public ReadOnlyCollection<JobExecutionTimes> GetJobExecutionTimes(JobQueryParameters queryParameters, DateTime startTime, DateTime endTime)
Parameters
| Name | Type | Description |
|---|---|---|
queryParameters |
JobQueryParameters | Query parameters to filter the jobs considered. |
startTime |
DateTime | The earliest time (inclusive) to consider. Specify the date/time in the timezone of the target server (available from ServerTimeZone). |
endTime |
DateTime | The latest time (inclusive) to consider.Specify the date/time in the timezone of the target server (available from ServerTimeZone). |
Returns
- ReadOnlyCollection<JobExecutionTimes>
A collection of JobExecutionTimes with one item for each job that is scheduled for execution during the specified date/time range. The ExecutionTimes collection will contain a value for each scheduled execution date/time for the job.
GetJobGroup(string)
Gets the JobGroup with the specified name.
public JobGroup GetJobGroup(string groupName)
Parameters
| Name | Type | Description |
|---|---|---|
groupName |
string | The fully-qualified name of the group to fetch (see Remarks). Specify null (nothing) or an empty string to get the root group. |
Returns
- JobGroup
The Job Group, or null (Nothing) if no matching object is found.
Remarks
If the group is contained in a parent group, the full path to the group must be included in the form "Group Level 1\Group Level 2\Group Level 3".
Exceptions
- MultipleMatchException
Thrown if more than one job matches the criteria. Use GetJobs instead to get multiple matches.
GetJobGroups(string)
Gets the Job Groups with the specified name.
public JobGroupCollection GetJobGroups(string groupName)
Parameters
| Name | Type | Description |
|---|---|---|
groupName |
string | The fully-qualified name of the group to fetch (see Remarks). Specify null (nothing) or an empty string to get the root group. |
Returns
- JobGroupCollection
The Job Group, or null (Nothing) if no matching object is found.
Remarks
If the group is contained in a parent group, the full path to the group must be included in the form "Group Level 1\Group Level 2\Group Level 3" (to fetch the group "Group Level 3".
GetJobGroups(string, ObjectFetchOptions, int, ref bool)
Gets job groups from the server.
public JobGroupCollection GetJobGroups(string groupName, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
groupName |
string | |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetJobHistory(InstanceQueryParameters)
public ExecutionHistoryItemCollection GetJobHistory(InstanceQueryParameters parameters)
Parameters
| Name | Type | Description |
|---|---|---|
parameters |
InstanceQueryParameters |
Returns
GetJobHistoryWithRecordCount(InstanceQueryParameters, out int)
public ExecutionHistoryItemCollection GetJobHistoryWithRecordCount(InstanceQueryParameters parameters, out int recordCount)
Parameters
| Name | Type | Description |
|---|---|---|
parameters |
InstanceQueryParameters | |
recordCount |
int |
Returns
GetJobMonitorData(JobMonitorViewFetchOptions, InstanceQueryParameters, DateTime, DateTime, out DateTime, ref DateTime?, out ReadOnlyCollection<JobExecutionTimes>, out ExecutionHistoryItemCollection)
public void GetJobMonitorData(JobMonitorViewFetchOptions fetchOptions, InstanceQueryParameters queryParameters, DateTime startDate, DateTime endDate, out DateTime calculatedRangeEnd, ref DateTime? lastFetchTimeUTC, out ReadOnlyCollection<JobExecutionTimes> scheduledExecutions, out ExecutionHistoryItemCollection instances)
Parameters
| Name | Type | Description |
|---|---|---|
fetchOptions |
JobMonitorViewFetchOptions | |
queryParameters |
InstanceQueryParameters | |
startDate |
DateTime | |
endDate |
DateTime | |
calculatedRangeEnd |
DateTime | |
lastFetchTimeUTC |
DateTime? | |
scheduledExecutions |
ReadOnlyCollection<JobExecutionTimes> | |
instances |
ExecutionHistoryItemCollection |
GetJobQueue(string)
Gets the Job Queue with the specified name.
public JobQueue GetJobQueue(string queueName)
Parameters
| Name | Type | Description |
|---|---|---|
queueName |
string | The name of the Queue to fetch. Specify null (Nothing) or an empty string to get the default queue. |
Returns
- JobQueue
The Job Queue, or null (Nothing) if no matching object is found.
GetJobQueueStubs()
public JobQueueCollection GetJobQueueStubs()
Returns
GetJobQueues()
public JobQueueCollection GetJobQueues()
Returns
GetJobQueues(ObjectFetchOptions, int, ref bool)
public JobQueueCollection GetJobQueues(ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetJobTree(OID, bool, bool, bool)
public JobGroup GetJobTree(OID baseGroupOID, bool recursive, bool includeGroups, bool includeJobs)
Parameters
| Name | Type | Description |
|---|---|---|
baseGroupOID |
OID | |
recursive |
bool | |
includeGroups |
bool | |
includeJobs |
bool |
Returns
GetJobs(OID[], ObjectFetchOptions, int, ref bool)
Gets jobs from the server.
public JobCollection GetJobs(OID[] oids, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
oids |
OID[] | |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetJobs(string)
Gets the Jobs that match the specified name.
public JobCollection GetJobs(string jobName)
Parameters
| Name | Type | Description |
|---|---|---|
jobName |
string | The fully-qualified name of the job to fetch (see Remarks). |
Returns
- JobCollection
The Job, or null (Nothing) if no matching object is found.
Remarks
If the job is contained in a group, the full path to the job must be included
in the form "Group Level 1\Group Level 2\Job Name". For a job in the root group, specify
"\Job Name". To search all groups, specify only the name (e.g., "Job Name").
GetJobs(string, JobFetchFilter, ObjectFetchOptions, int, ref bool)
Gets jobs from the server.
public JobCollection GetJobs(string jobName, JobFetchFilter fetchCriteria, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
jobName |
string | |
fetchCriteria |
JobFetchFilter | |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetJobs(string, ObjectFetchOptions, int, ref bool)
Gets jobs from the server.
public JobCollection GetJobs(string jobName, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
jobName |
string | |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetLogMessages(LogQueryParameters)
public LogMessageCollection GetLogMessages(LogQueryParameters parameters)
Parameters
| Name | Type | Description |
|---|---|---|
parameters |
LogQueryParameters |
Returns
GetLogMessagesWithRecordCount(LogQueryParameters, out int)
public LogMessageCollection GetLogMessagesWithRecordCount(LogQueryParameters parameters, out int recordCount)
Parameters
| Name | Type | Description |
|---|---|---|
parameters |
LogQueryParameters | |
recordCount |
int |
Returns
GetMessagingServiceProvider(string)
public MessagingServiceProvider GetMessagingServiceProvider(string name)
Parameters
| Name | Type | Description |
|---|---|---|
name |
string |
Returns
GetMessagingServiceProviders(params MessagingServiceType[])
Gets MessagingServiceProviders of the specified type(s).
public MessagingServiceProviderCollection GetMessagingServiceProviders(params MessagingServiceType[] providerTypes)
Parameters
| Name | Type | Description |
|---|---|---|
providerTypes |
MessagingServiceType[] | The types of providers to fetch. If no types are specified, all types are returned. |
Returns
GetMessagingServiceProviders(MessagingServiceType[], ObjectFetchOptions, int, ref bool)
Gets Messaging Service Providers from the server.
public MessagingServiceProviderCollection GetMessagingServiceProviders(MessagingServiceType[] providerTypes, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
providerTypes |
MessagingServiceType[] | |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetNotificationGroup(string)
Gets the Notification Group with the specified name.
public NotificationGroup GetNotificationGroup(string groupName)
Parameters
| Name | Type | Description |
|---|---|---|
groupName |
string | The name of the group to fetch. |
Returns
- NotificationGroup
The Notification Group, or null (Nothing) if no matching object is found.
GetNotificationIndividual(string)
Gets the Notification Individual with the specified name.
public NotificationIndividual GetNotificationIndividual(string name)
Parameters
| Name | Type | Description |
|---|---|---|
name |
string | The name of the Individual to fetch. |
Returns
- NotificationIndividual
The Notification Individual, or null (Nothing) if no matching object is found.
GetNotificationRecipients(params NotificationRecipientType[])
public NotificationRecipientCollection GetNotificationRecipients(params NotificationRecipientType[] selectionTypes)
Parameters
| Name | Type | Description |
|---|---|---|
selectionTypes |
NotificationRecipientType[] |
Returns
GetNotificationRecipients(NotificationRecipientType[], ObjectFetchOptions, int, ref bool)
Gets Notification Recipients from the server.
public NotificationRecipientCollection GetNotificationRecipients(NotificationRecipientType[] selectionTypes, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
selectionTypes |
NotificationRecipientType[] | |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetNotificationRecipientsForAddress(NotificationAddressType, string)
Gets the NotificationIndividuals that have the specified address.
public NotificationIndividualCollection GetNotificationRecipientsForAddress(NotificationAddressType addressType, string address)
Parameters
| Name | Type | Description |
|---|---|---|
addressType |
NotificationAddressType | |
address |
string |
Returns
GetObject(OID)
Gets the object with the specified OID.
public ADTObject GetObject(OID oid)
Parameters
| Name | Type | Description |
|---|---|---|
oid |
OID |
Returns
- ADTObject
The requested object.
Remarks
All fetches of an object through this DataContext (or through objects that belong to it) are guaranteed to return the same copy of the object for as long as the DataContext exists.
This method fetches the requested object and all dependent objects. For example, fetching a Job fetches back to the client all steps, conditions, triggers, etc. In scenarios where the dependent objects are not required (for example, you only are going to be listing the job names), use GetObject(OID, ObjectFetchOptions) to fetch only a "stub" of the object on the initial fetch. This is more efficient as less data needs to be retrieved from the database and returned to the client.
Exceptions
- PermissionDeniedException
Thrown if the caller does not have permission for the requested object.
- ObjectNotFoundException
Thrown if the object does not exist
GetObject(OID, ObjectFetchOptions)
Gets the object with the specified OID, using options to control the way data is returned.
public ADTObject GetObject(OID oid, ObjectFetchOptions fetchOptions)
Parameters
| Name | Type | Description |
|---|---|---|
oid |
OID | |
fetchOptions |
ObjectFetchOptions |
Returns
- ADTObject
The requested object.
Remarks
This method allows you to select how the requested object is returned. See the remarks for ObjectFetchOptions for more information.
All fetches of an object through this DataContext (or through objects that belong to it) are guaranteed to return the same copy of the object for as long as the DataContext exists.
Exceptions
- PermissionDeniedException
Thrown if the caller does not have permission for the requested object.
- ObjectNotFoundException
Thrown if the object does not exist
GetObjectDiagnostics(OID[], int)
public string GetObjectDiagnostics(OID[] objectOIDs, int options)
Parameters
| Name | Type | Description |
|---|---|---|
objectOIDs |
OID[] | |
options |
int |
Returns
- string
GetObjects(params OID[])
Gets the objects with the specified OIDs.
public ADTObjectCollection GetObjects(params OID[] OIDs)
Parameters
| Name | Type | Description |
|---|---|---|
OIDs |
OID[] |
Returns
- ADTObjectCollection
The requested object.
Remarks
Any invalid OIDs or objects for which the caller does not have permission are silently ignored.
GetObjects(OID[], ObjectFetchOptions)
Gets the objects with the specified OIDs.
public ADTObjectCollection GetObjects(OID[] OIDs, ObjectFetchOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
OIDs |
OID[] | |
options |
ObjectFetchOptions |
Returns
- ADTObjectCollection
The requested object.
Remarks
Any invalid OIDs or objects for which the caller does not have permission are silently ignored.
This method allows you to select how the requested object is returned. See the remarks for ObjectFetchOptions for more information.
GetRemoteAgent(string)
Gets the Remote Agent with the specified name or address.
public RemoteAgent GetRemoteAgent(string agentName)
Parameters
| Name | Type | Description |
|---|---|---|
agentName |
string | The name or address of the Agent to fetch. |
Returns
- RemoteAgent
The Remote Agent, or null (Nothing) if no matching object is found.
GetRemoteAgents()
public RemoteAgentCollection GetRemoteAgents()
Returns
GetRemoteAgents(ObjectFetchOptions, int, ref bool)
Gets Remote Agents from the server.
public RemoteAgentCollection GetRemoteAgents(ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetScriptLibraries(params string[])
public ScriptLibraryCollection GetScriptLibraries(params string[] languages)
Parameters
| Name | Type | Description |
|---|---|---|
languages |
string[] |
Returns
GetScriptLibraries(string[], ObjectFetchOptions, int, ref bool)
Gets Script Libraries from the server.
public ScriptLibraryCollection GetScriptLibraries(string[] languages, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
languages |
string[] | |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetScriptLibrary(string)
Gets the Script Library with the specified name.
public ScriptLibrary GetScriptLibrary(string libraryName)
Parameters
| Name | Type | Description |
|---|---|---|
libraryName |
string | The name of the Script Library to fetch. |
Returns
- ScriptLibrary
The script library, or null (Nothing) if the script library does not exist.
GetSecurityEntities(ObjectFetchOptions, bool, int, ref bool)
Gets Security Entities from the server.
public SecurityEntityCollection GetSecurityEntities(ObjectFetchOptions options, bool includeACEs, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
options |
ObjectFetchOptions | |
includeACEs |
bool | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetSecurityEntities(bool)
public SecurityEntityCollection GetSecurityEntities(bool includeACEs = false)
Parameters
| Name | Type | Description |
|---|---|---|
includeACEs |
bool |
Returns
GetSecurityLogin(string)
Gets the Security Login with the specified name or SID.
public SecurityLogin GetSecurityLogin(string name)
Parameters
| Name | Type | Description |
|---|---|---|
name |
string | The name or SID of the login to fetch. |
Returns
- SecurityLogin
The Security Login, or null (Nothing) if no matching object is found.
GetSecurityLogins(LoginType[], ObjectFetchOptions, bool, int, ref bool)
public SecurityLoginCollection GetSecurityLogins(LoginType[] types, ObjectFetchOptions options, bool includeACEs, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
types |
LoginType[] | |
options |
ObjectFetchOptions | |
includeACEs |
bool | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetSecurityLogins(LoginType[], bool)
public SecurityLoginCollection GetSecurityLogins(LoginType[] types, bool includeACEs = false)
Parameters
| Name | Type | Description |
|---|---|---|
types |
LoginType[] | |
includeACEs |
bool |
Returns
GetSecurityLogins(ObjectFetchOptions, bool, int, ref bool)
Gets Security Logins from the server.
public SecurityLoginCollection GetSecurityLogins(ObjectFetchOptions options, bool includeACEs, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
options |
ObjectFetchOptions | |
includeACEs |
bool | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetSecurityLogins(bool)
public SecurityLoginCollection GetSecurityLogins(bool includeACEs = false)
Parameters
| Name | Type | Description |
|---|---|---|
includeACEs |
bool |
Returns
GetSecurityRole(string)
Gets the Security Role with the specified name.
public SecurityRole GetSecurityRole(string name)
Parameters
| Name | Type | Description |
|---|---|---|
name |
string | The name of the Role to fetch. |
Returns
- SecurityRole
The Security Role, or null (Nothing) if no matching object is found.
GetSecurityRoles(ObjectFetchOptions, bool, int, ref bool)
Gets Security Roles from the server.
public SecurityRoleCollection GetSecurityRoles(ObjectFetchOptions options, bool includeACEs, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
options |
ObjectFetchOptions | |
includeACEs |
bool | |
pageSize |
int | |
restartPaging |
bool |
Returns
GetSecurityRoles(bool)
public SecurityRoleCollection GetSecurityRoles(bool includeACEs = false)
Parameters
| Name | Type | Description |
|---|---|---|
includeACEs |
bool |
Returns
GetServerSettings()
public ServerSettings GetServerSettings()
Returns
GetSharedSchedule(string)
Gets the Shared Schedule with the specified name.
public SharedSchedule GetSharedSchedule(string scheduleName)
Parameters
| Name | Type | Description |
|---|---|---|
scheduleName |
string | The name of the Shared Schedule to fetch. |
Returns
- SharedSchedule
The requested schedule, or null (Nothing) if the schedule does not exist.
GetSharedSchedules()
Gets all Shared Schedules.
public SharedScheduleCollection GetSharedSchedules()
Returns
- SharedScheduleCollection
All Shared Schedules for which the caller has at least List permission.
GetSharedScript(string)
Gets the Shared Script with the specified name.
public Script GetSharedScript(string scriptName)
Parameters
| Name | Type | Description |
|---|---|---|
scriptName |
string | The name of the Shared Script to fetch. |
Returns
- Script
The shared script, or null (Nothing) if the shared script does not exist.
GetSharedScripts(params string[])
public ScriptCollection GetSharedScripts(params string[] languages)
Parameters
| Name | Type | Description |
|---|---|---|
languages |
string[] |
Returns
GetSharedScripts(string[], ObjectFetchOptions, int, ref bool)
Gets Shared Scripts from the server.
public ScriptCollection GetSharedScripts(string[] languages, ObjectFetchOptions options, int pageSize, ref bool restartPaging)
Parameters
| Name | Type | Description |
|---|---|---|
languages |
string[] | |
options |
ObjectFetchOptions | |
pageSize |
int | |
restartPaging |
bool |
Returns
ResyncJobs(OID[], int)
Resynchronizes status data for jobs.
public void ResyncJobs(OID[] jobOIDs, int options)
Parameters
| Name | Type | Description |
|---|---|---|
jobOIDs |
OID[] | |
options |
int | Reserved for future use. |
Remarks
Use this method to initiate a resync if the instance counts for the job are incorrect.
SearchAndReplace(ObjectSearchOptions, out ReadOnlyCollection<SearchReplaceResult>, out MessageCollection)
public void SearchAndReplace(ObjectSearchOptions options, out ReadOnlyCollection<SearchReplaceResult> results, out MessageCollection messages)
Parameters
| Name | Type | Description |
|---|---|---|
options |
ObjectSearchOptions | |
results |
ReadOnlyCollection<SearchReplaceResult> | |
messages |
MessageCollection |
UpdateQueueOrder(IEnumerable<ExecutionHistoryItem>)
Updates the ordering of pending jobs in their queues.
public void UpdateQueueOrder(IEnumerable<ExecutionHistoryItem> instancesToUpdate)
Parameters
| Name | Type | Description |
|---|---|---|
instancesToUpdate |
IEnumerable<ExecutionHistoryItem> | Collection of ExecutionHistoryItem objects with the PriorityOverride or QueueOrderOverride set. |
ViewObjectFromSnapshot(OID, Guid, out MessageCollection)
public ADTObject ViewObjectFromSnapshot(OID objectToView, Guid snapshotID, out MessageCollection messages)
Parameters
| Name | Type | Description |
|---|---|---|
objectToView |
OID | |
snapshotID |
Guid | |
messages |
MessageCollection |