com.remedy.cmdb.api
Class CMDBInstance

java.lang.Object
  extended bycom.remedy.cmdb.api.CMDBInstance
All Implemented Interfaces:
java.io.Serializable

public class CMDBInstance
extends java.lang.Object
implements java.io.Serializable

The CMDBInstance class is used to work with CMDB Instances. New set of API with CMDB 2.0 is a common class to deal with both CI and Relationship instances.

See Also:
Serialized Form

Field Summary
static int CMDB_ATTACHMENT_LOCATION_BUFFER
          The attachment is store in a data buffer
static int CMDB_ATTACHMENT_LOCATION_FILE
          The attachment is stored in a file
static int CMDB_ATTACHMENT_LOCATION_NONE
          No attachment is stored
static int CMDB_DATASET_ACCESSIBILITY_READ_ONLY
          A dataset that is read only
static int CMDB_DATASET_ACCESSIBILITY_WRITABLE
          A dataset that is writable
static int CMDB_DATASET_ACCESSIBLITY_WRITABLE_BY_CLIENT_TYPE
          A dataset that is writable certain client types
static int CMDB_DATASET_TYPE_OVERLAY
          Overlay dataset type
static int CMDB_DATASET_TYPE_REGULAR
          Regular dataset type
static int CMDB_GET_DATASET_MODE_CURRENT
          Find in the curerent Dataset only
static int CMDB_GET_MASK_NONE
          Take no action
static int CMDB_NO_MAX_LIST_RETRIEVE
          No maximum limit for the number of entries retrieved in the list.
static int CMDB_START_WITH_FIRST_INSTANCE
          Retrieves from result set starting with the first instance.
 
Constructor Summary
CMDBInstance(CMDBClassNameKey aClassKey)
          Creates an CMDBInstance object with minimum information.
CMDBInstance(CMDBClassNameKey aClassKey, java.util.Map anAttrValuesMap)
          Constructor that creates an CMDBInstance object with the information provided.
 
Method Summary
 void create(ARServerUser context)
          Creates the current CMDBClass instance in AR System.
 void create(ARServerUser context, java.lang.String aDatasetId)
          Creates the current CMDBClass instance in AR System.
static void delete(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String instanceId, int deleteOption)
          Deletes the current CMDBClass instance from AR System.
static void delete(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String aDatasetId, java.lang.String instanceId, int deleteOption)
          Deletes the current CMDBClass instance from AR System.
static java.lang.String[] find(ARServerUser context, CMDBClassNameKey aClassKey, QualifierInfo query, CMDBSort[] sortArray, int firstRetrieve, int maxRetrieve, java.lang.Integer numMatches)
          Finds all qualified CMDBClass instances in AR System
static java.lang.String[] find(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String query, CMDBSort[] sortArray, int firstRetrieve, int maxRetrieve, java.lang.Integer numMatches)
          Finds the IDs of all CMDBClass instances in AR System
static java.lang.String[] find(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String aDatasetId, int aGetMask, QualifierInfo query, CMDBSort[] sortArray, int firstRetrieve, int maxRetrieve, java.lang.Integer numMatches)
          Finds all qualified CMDBClass instances in AR System
static java.lang.String[] find(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String aDatasetId, int aGetMask, java.lang.String query, CMDBSort[] sortArray, int firstRetrieve, int maxRetrieve, java.lang.Integer numMatches)
          Finds the IDs of all CMDBClass instances in AR System
static void findBlobByKey(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String aDatasetId, int aGetMask, java.lang.String instanceId, java.lang.String attributeName, AttachmentInfo attachment)
          Finds the specified attachment attribute from AR System.
static void findBlobByKey(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String instanceId, java.lang.String attributeName, AttachmentInfo attachment)
          Finds the specified attachment attribute from AR System.
static CMDBInstance findByKey(ARServerUser context, CMDBClassNameKey aClassKey, int aGetMask, java.lang.String aDatasetId, java.lang.String instanceId, java.lang.String[] attributeNames)
          Finds the specified CMDBClass instance in AR System
static CMDBInstance findByKey(ARServerUser context, java.lang.String instanceId, CMDBClassNameKey aClassKey, java.lang.String[] attributeNames)
          Finds the specified CMDBClass instance in AR System
static CMDBInstance[] findObjects(ARServerUser context, CMDBClassNameKey aClassKey, QualifierInfo query, java.lang.String[] attributeGetList, CMDBSort[] sortArray, int firstRetrieve, int maxRetrieve, java.lang.Integer numMatches)
          Finds all qualified CMDBClass instances in AR System
static CMDBInstance[] findObjects(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String[] instanceIds, java.lang.String[] attributeGetList)
          Finds all specified CMDBClass instances in AR System
static CMDBInstance[] findObjects(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String aDatasetId, int aGetMask, QualifierInfo query, java.lang.String[] attributeGetList, CMDBSort[] sortArray, int firstRetrieve, int maxRetrieve, java.lang.Integer numMatches)
          Finds all qualified CMDBClass instances in AR System
static CMDBInstance[] findObjects(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String aDatasetId, int aGetMask, java.lang.String[] instanceIds, java.lang.String[] attributeGetList)
          Finds all specified CMDBClass instances in AR System
static CMDBInstance[] findObjects(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String aDatasetId, int aGetMask, java.lang.String query, java.lang.String[] attributeGetList, CMDBSort[] sortArray, int firstRetrieve, int maxRetrieve, java.lang.Integer numMatches)
          Finds all qualified CMDBClass instances in AR System
static CMDBInstance[] findObjects(ARServerUser context, CMDBClassNameKey aClassKey, java.lang.String query, java.lang.String[] attributeGetList, CMDBSort[] sortArray, int firstRetrieve, int maxRetrieve, java.lang.Integer numMatches)
          Finds all qualified CMDBClass instances in AR System
 CMDBAttributeValue getAttributeValueByName(java.lang.String name)
          Use the attribute name as a map key to find the attribute value.
 java.util.Map getAttributeValues()
          Gets the attribute values.
 CMDBClassNameKey getClassKey()
          Gets the key of the class that the instance belongs to.
 int getGetMask()
          Gets the instance datasetSetMode
 java.lang.String getId()
          Gets the instance ID
 void setAttributeValues(java.util.Map newAttrValueMap)
          Replaces the attribute values of the instance.
 void update(ARServerUser context)
          Saves the change made to the current CMDBClass instance in AR System.
 void update(ARServerUser context, java.lang.String aDatasetId)
          Saves the change made to the current CMDBClass instance in AR System.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMDB_START_WITH_FIRST_INSTANCE

public static final int CMDB_START_WITH_FIRST_INSTANCE
Retrieves from result set starting with the first instance.

See Also:
Constant Field Values

CMDB_NO_MAX_LIST_RETRIEVE

public static final int CMDB_NO_MAX_LIST_RETRIEVE
No maximum limit for the number of entries retrieved in the list.

See Also:
Constant Field Values

CMDB_ATTACHMENT_LOCATION_NONE

public static final int CMDB_ATTACHMENT_LOCATION_NONE
No attachment is stored

See Also:
Constant Field Values

CMDB_ATTACHMENT_LOCATION_FILE

public static final int CMDB_ATTACHMENT_LOCATION_FILE
The attachment is stored in a file

See Also:
Constant Field Values

CMDB_ATTACHMENT_LOCATION_BUFFER

public static final int CMDB_ATTACHMENT_LOCATION_BUFFER
The attachment is store in a data buffer

See Also:
Constant Field Values

CMDB_GET_MASK_NONE

public static final int CMDB_GET_MASK_NONE
Take no action

See Also:
Constant Field Values

CMDB_GET_DATASET_MODE_CURRENT

public static final int CMDB_GET_DATASET_MODE_CURRENT
Find in the curerent Dataset only

See Also:
Constant Field Values

CMDB_DATASET_ACCESSIBILITY_WRITABLE

public static final int CMDB_DATASET_ACCESSIBILITY_WRITABLE
A dataset that is writable

See Also:
Constant Field Values

CMDB_DATASET_ACCESSIBILITY_READ_ONLY

public static final int CMDB_DATASET_ACCESSIBILITY_READ_ONLY
A dataset that is read only

See Also:
Constant Field Values

CMDB_DATASET_ACCESSIBLITY_WRITABLE_BY_CLIENT_TYPE

public static final int CMDB_DATASET_ACCESSIBLITY_WRITABLE_BY_CLIENT_TYPE
A dataset that is writable certain client types

See Also:
Constant Field Values

CMDB_DATASET_TYPE_REGULAR

public static final int CMDB_DATASET_TYPE_REGULAR
Regular dataset type

See Also:
Constant Field Values

CMDB_DATASET_TYPE_OVERLAY

public static final int CMDB_DATASET_TYPE_OVERLAY
Overlay dataset type

See Also:
Constant Field Values
Constructor Detail

CMDBInstance

public CMDBInstance(CMDBClassNameKey aClassKey)
Creates an CMDBInstance object with minimum information.

Parameters:
aClassKey - the class key of the CMDBClass that the instance belongs to

CMDBInstance

public CMDBInstance(CMDBClassNameKey aClassKey,
                    java.util.Map anAttrValuesMap)
Constructor that creates an CMDBInstance object with the information provided.

Parameters:
aClassKey - the name key of the class that the instance is associated with
anAttrValuesMap - the attribute values are organized into a map that uses the attribute name as its map key, and CMDBAttributeValue as its mapped value
Throws:
java.lang.IllegalArgumentException - if map value is not CMDBAttributeValue
Method Detail

getClassKey

public CMDBClassNameKey getClassKey()
Gets the key of the class that the instance belongs to.

Returns:
an CMDBClass key

getId

public java.lang.String getId()
Gets the instance ID

Returns:
the ID of the instance

getGetMask

public int getGetMask()
Gets the instance datasetSetMode

Returns:
the Dataset Mode of the instance

getAttributeValues

public java.util.Map getAttributeValues()
Gets the attribute values. The values are organized into a map that uses attribute name as its map key. The type of mapped values is CMDBAttributeValue.

Returns:
the attribute values that are collected into a map.

getAttributeValueByName

public CMDBAttributeValue getAttributeValueByName(java.lang.String name)
Use the attribute name as a map key to find the attribute value.

Parameters:
name - the name of the attribute
Returns:
the attribute value.

setAttributeValues

public void setAttributeValues(java.util.Map newAttrValueMap)
Replaces the attribute values of the instance. The new values are organized into a map that uses the attribute name as its map key. The type of mapped values is CMDBAttributeValue.

Parameters:
newAttrValueMap - the new attribute values to be set
Throws:
java.lang.IllegalArgumentException - if map value is not CMDBAttributeValue

create

public void create(ARServerUser context)
            throws ARException
Creates the current CMDBClass instance in AR System.

Parameters:
context - ARSystemUser structure that contains user and host information
Throws:
ARException - if the instance cannot be created in AR System

create

public void create(ARServerUser context,
                   java.lang.String aDatasetId)
            throws ARException
Creates the current CMDBClass instance in AR System.

Parameters:
context - ARSystemUser structure that contains user and host information
aDatasetId - the DatasetId of the instance
Throws:
ARException - if the instance cannot be created in AR System

delete

public static void delete(ARServerUser context,
                          CMDBClassNameKey aClassKey,
                          java.lang.String instanceId,
                          int deleteOption)
                   throws ARException
Deletes the current CMDBClass instance from AR System.

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the name key of the class that the instance belongs to
instanceId - the id of the instance to be deleted
deleteOption - Delete option. Possible values are:
  • 0: For a derived class, delete only if an instance is found.
  • 1: Delete unconditionally.
Throws:
ARException - if the instance cannot be deleted

delete

public static void delete(ARServerUser context,
                          CMDBClassNameKey aClassKey,
                          java.lang.String aDatasetId,
                          java.lang.String instanceId,
                          int deleteOption)
                   throws ARException
Deletes the current CMDBClass instance from AR System.

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the name key of the class that the instance belongs to
instanceId - the id of the instance to be deleted
deleteOption - Delete option. Possible values are:
  • 0: For a derived class, delete only if an instance is found.
  • 1: Delete unconditionally.
Throws:
ARException - if the instance cannot be deleted

findBlobByKey

public static void findBlobByKey(ARServerUser context,
                                 CMDBClassNameKey aClassKey,
                                 java.lang.String instanceId,
                                 java.lang.String attributeName,
                                 AttachmentInfo attachment)
                          throws ARException
Finds the specified attachment attribute from AR System. The attachment can be placed in a buffer or a file. The system returns information based on the access privileges of the user you specify for the ARServerUser parameter. User permissions are verified for the specified attribute. If the user cannot access the attribute, the system returns an error message.

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
instanceId - the ID of the instance to look for
attributeName - name of the attribute that has the attachment
attachment - the location of the returned attachment. The attachment can be stored in a file CMDB_ATTACHMENT_LOCATION_FILE or in a buffer CMDB_ATTACHMENT_LOCATION_BUFFER. If it is stored in a file, then file name should be specified in this argument. The returned attachment object is also saved in this object.
Throws:
ARException - if the specified attachment can't be located.

findBlobByKey

public static void findBlobByKey(ARServerUser context,
                                 CMDBClassNameKey aClassKey,
                                 java.lang.String aDatasetId,
                                 int aGetMask,
                                 java.lang.String instanceId,
                                 java.lang.String attributeName,
                                 AttachmentInfo attachment)
                          throws ARException
Finds the specified attachment attribute from AR System. The attachment can be placed in a buffer or a file. The system returns information based on the access privileges of the user you specify for the ARServerUser parameter. User permissions are verified for the specified attribute. If the user cannot access the attribute, the system returns an error message.

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
aDatasetId - datasetid
aGetMask - the get mask (current, overlay, etc)
instanceId - the ID of the instance to look for
attributeName - name of the attribute that has the attachment
attachment - the location of the returned attachment. The attachment can be stored in a file CMDB_ATTACHMENT_LOCATION_FILE or in a buffer CMDB_ATTACHMENT_LOCATION_BUFFER. If it is stored in a file, then file name should be specified in this argument. The returned attachment object is also saved in this object.
Throws:
ARException - if the specified attachment can't be located.

find

public static java.lang.String[] find(ARServerUser context,
                                      CMDBClassNameKey aClassKey,
                                      java.lang.String query,
                                      CMDBSort[] sortArray,
                                      int firstRetrieve,
                                      int maxRetrieve,
                                      java.lang.Integer numMatches)
                               throws ARException
Finds the IDs of all CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
query - a string where you specify a qualification for retrieving instances For example, to locate instances of class BMC:AssetBase, where Cost Center is "BMC" and Order ID is 5, the qualification will be: 'Cost Center' = "BMC" AND 'Order ID' = 5 So, the name of the attribute you are querying for is always surrounded in single quotes. For each attribute, if the datatype is string, then enclose the string you are looking for in double quotes (as in the above example, "BMC"). For integers, you do not need to put any quotes around it.
firstRetrieve - First instance retrieved for the query chunk. CMDB_START_WITH_FIRST_INSTANCE means retrieve the first instance from AR System.
maxRetrieve - Maximum instances to retrieve for the query. CMDB_NO_MAX_LIST_RETRIEVE means unlimited instances are retrieved.
numMatches - Will return the total number of (accessible) instances that match the qualification criteria. Specify null for this parameter if you do not want to retrieve this count.
Returns:
the IDs of all matching instances
Throws:
ARException - if failed to return all matched instances

find

public static java.lang.String[] find(ARServerUser context,
                                      CMDBClassNameKey aClassKey,
                                      java.lang.String aDatasetId,
                                      int aGetMask,
                                      java.lang.String query,
                                      CMDBSort[] sortArray,
                                      int firstRetrieve,
                                      int maxRetrieve,
                                      java.lang.Integer numMatches)
                               throws ARException
Finds the IDs of all CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
aDatasetId - DatasetId of which you want to retrieve instances
aGetMask - the get mask (current, overlay, etc)
query - a string where you specify a qualification for retrieving instances For example, to locate instances of class BMC:AssetBase, where Cost Center is "BMC" and Order ID is 5, the qualification will be: 'Cost Center' = "BMC" AND 'Order ID' = 5 So, the name of the attribute you are querying for is always surrounded in single quotes. For each attribute, if the datatype is string, then enclose the string you are looking for in double quotes (as in the above example, "BMC"). For integers, you do not need to put any quotes around it.
firstRetrieve - First instance retrieved for the query chunk. CMDB_START_WITH_FIRST_INSTANCE means retrieve the first instance from AR System.
maxRetrieve - Maximum instances to retrieve for the query. CMDB_NO_MAX_LIST_RETRIEVE means unlimited instances are retrieved.
numMatches - Will return the total number of (accessible) instances that match the qualification criteria. Specify null for this parameter if you do not want to retrieve this count.
Returns:
the IDs of all matching instances
Throws:
ARException - if failed to return all matched instances

find

public static java.lang.String[] find(ARServerUser context,
                                      CMDBClassNameKey aClassKey,
                                      QualifierInfo query,
                                      CMDBSort[] sortArray,
                                      int firstRetrieve,
                                      int maxRetrieve,
                                      java.lang.Integer numMatches)
                               throws ARException
Finds all qualified CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
query - an query object where you specify a qualification for retrieving instances
firstRetrieve - First instance retrieved for the query chunk. CMDB_START_WITH_FIRST_INSTANCE means retrieve the first instance from AR System.
maxRetrieve - Maximum instances to retrieve for the query. CMDB_NO_MAX_LIST_RETRIEVE means unlimited instances are retrieved.
numMatches - Will return the total number of (accessible) instances that match the qualification criteria. Specify null for this parameter if you do not want to retrieve this count.
Returns:
the IDs of all matching instances
Throws:
ARException - if failed to return all matched instances

find

public static java.lang.String[] find(ARServerUser context,
                                      CMDBClassNameKey aClassKey,
                                      java.lang.String aDatasetId,
                                      int aGetMask,
                                      QualifierInfo query,
                                      CMDBSort[] sortArray,
                                      int firstRetrieve,
                                      int maxRetrieve,
                                      java.lang.Integer numMatches)
                               throws ARException
Finds all qualified CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
aDatasetId - DatasetId of which you want to retrieve instances
aGetMask - the get mask (current, overlay, etc)
query - an query object where you specify a qualification for retrieving instances
firstRetrieve - First instance retrieved for the query chunk. CMDB_START_WITH_FIRST_INSTANCE means retrieve the first instance from AR System.
maxRetrieve - Maximum instances to retrieve for the query. CMDB_NO_MAX_LIST_RETRIEVE means unlimited instances are retrieved.
numMatches - Will return the total number of (accessible) instances that match the qualification criteria. Specify null for this parameter if you do not want to retrieve this count.
Returns:
the IDs of all matching instances
Throws:
ARException - if failed to return all matched instances

findObjects

public static CMDBInstance[] findObjects(ARServerUser context,
                                         CMDBClassNameKey aClassKey,
                                         java.lang.String query,
                                         java.lang.String[] attributeGetList,
                                         CMDBSort[] sortArray,
                                         int firstRetrieve,
                                         int maxRetrieve,
                                         java.lang.Integer numMatches)
                                  throws ARException
Finds all qualified CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
query - a string where you specify a qualification for retrieving instances For example, to locate instances of class BMC:AssetBase, where Cost Center is "BMC" and Order ID is 5, the qualification will be: 'Cost Center' = "BMC" AND = 'Order ID' = 5 So, the name of the attribute you are querying for is always surrounded in single quotes. For each attribute, if the datatype is string, then enclose the string you are looking for in double quotes (as in the above example, "BMC"). For integers, you do not need to put any quotes around it.
attributeGetList - the attribute to be retrieved. If attributeGetList is NULL, then all attribute values of the instance will be returned.
firstRetrieve - First instance retrieved for the query chunk. CMDB_START_WITH_FIRST_INSTANCE means retrieve the first instance from AR System.
maxRetrieve - Maximum instances to retrieve for the query. CMDB_NO_MAX_LIST_RETRIEVE means unlimited instances are retrieved.
numMatches - Will return the total number of (accessible) instances that match the qualification criteria. Specify null for this parameter if you do not want to retrieve this count.
Returns:
all matching instances. If attributeGetList is null, then all attributeValue in each instance will be retrieved.
Throws:
ARException - if failed to return all matched instances

findObjects

public static CMDBInstance[] findObjects(ARServerUser context,
                                         CMDBClassNameKey aClassKey,
                                         java.lang.String aDatasetId,
                                         int aGetMask,
                                         java.lang.String query,
                                         java.lang.String[] attributeGetList,
                                         CMDBSort[] sortArray,
                                         int firstRetrieve,
                                         int maxRetrieve,
                                         java.lang.Integer numMatches)
                                  throws ARException
Finds all qualified CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
aDatasetId - DatasetId of which you want to retrieve instances
aGetMask - the get mask (current, overlay, etc)
query - a string where you specify a qualification for retrieving instances For example, to locate instances of class BMC:AssetBase, where Cost Center is "BMC" and Order ID is 5, the qualification will be: 'Cost Center' = "BMC" AND = 'Order ID' = 5 So, the name of the attribute you are querying for is always surrounded in single quotes. For each attribute, if the datatype is string, then enclose the string you are looking for in double quotes (as in the above example, "BMC"). For integers, you do not need to put any quotes around it.
attributeGetList - the attribute to be retrieved. If attributeGetList is NULL, then all attribute values of the instance will be returned.
firstRetrieve - First instance retrieved for the query chunk. CMDB_START_WITH_FIRST_INSTANCE means retrieve the first instance from AR System.
maxRetrieve - Maximum instances to retrieve for the query. CMDB_NO_MAX_LIST_RETRIEVE means unlimited instances are retrieved.
numMatches - Will return the total number of (accessible) instances that match the qualification criteria. Specify null for this parameter if you do not want to retrieve this count.
Returns:
all matching instances. If attributeGetList is null, then all attributeValue in each instance will be retrieved.
Throws:
ARException - if failed to return all matched instances

findObjects

public static CMDBInstance[] findObjects(ARServerUser context,
                                         CMDBClassNameKey aClassKey,
                                         QualifierInfo query,
                                         java.lang.String[] attributeGetList,
                                         CMDBSort[] sortArray,
                                         int firstRetrieve,
                                         int maxRetrieve,
                                         java.lang.Integer numMatches)
                                  throws ARException
Finds all qualified CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
query - an query object where you specify a qualification for retrieving instances
attributeGetList - the attribute to be retrieved. If attributeGetList is NULL, then all attribute values of the instance will be returned.
firstRetrieve - First instance retrieved for the query chunk. CMDB_START_WITH_FIRST_INSTANCE means retrieve the first instance from AR System.
maxRetrieve - Maximum instances to retrieve for the query. CMDB_NO_MAX_LIST_RETRIEVE means unlimited instances are retrieved.
numMatches - Will return the total number of (accessible) instances that match the qualification criteria. Specify null for this parameter if you do not want to retrieve this count.
Returns:
all matching instances. If attributeGetList is null, then all attributeValue in each instance will be retrieved.
Throws:
ARException - if failed to return all matched instances

findObjects

public static CMDBInstance[] findObjects(ARServerUser context,
                                         CMDBClassNameKey aClassKey,
                                         java.lang.String aDatasetId,
                                         int aGetMask,
                                         QualifierInfo query,
                                         java.lang.String[] attributeGetList,
                                         CMDBSort[] sortArray,
                                         int firstRetrieve,
                                         int maxRetrieve,
                                         java.lang.Integer numMatches)
                                  throws ARException
Finds all qualified CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
aDatasetId - DatasetId of which you want to retrieve instances
aGetMask - the get mask (current, overlay, etc)
query - an query object where you specify a qualification for retrieving instances
attributeGetList - the attribute to be retrieved. If attributeGetList is NULL, then all attribute values of the instance will be returned.
firstRetrieve - First instance retrieved for the query chunk. CMDB_START_WITH_FIRST_INSTANCE means retrieve the first instance from AR System.
maxRetrieve - Maximum instances to retrieve for the query. CMDB_NO_MAX_LIST_RETRIEVE means unlimited instances are retrieved.
numMatches - Will return the total number of (accessible) instances that match the qualification criteria. Specify null for this parameter if you do not want to retrieve this count.
Returns:
all matching instances. If attributeGetList is null, then all attributeValue in each instance will be retrieved.
Throws:
ARException - if failed to return all matched instances

findObjects

public static CMDBInstance[] findObjects(ARServerUser context,
                                         CMDBClassNameKey aClassKey,
                                         java.lang.String[] instanceIds,
                                         java.lang.String[] attributeGetList)
                                  throws ARException
Finds all specified CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
instanceIds - an array of instance ids
attributeGetList - the attribute to be retrieved. If attributeGetList is NULL, then all attribute values of the instance will be returned.
Returns:
all specified instances. If attributeGetList is null, then all attributeValue in each instance will be retrieved.
Throws:
ARException - if failed to return all matched instances

findObjects

public static CMDBInstance[] findObjects(ARServerUser context,
                                         CMDBClassNameKey aClassKey,
                                         java.lang.String aDatasetId,
                                         int aGetMask,
                                         java.lang.String[] instanceIds,
                                         java.lang.String[] attributeGetList)
                                  throws ARException
Finds all specified CMDBClass instances in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
aDatasetId - DatasetId of which you want to retrieve instances
aGetMask - the get mask (current, overlay, etc)
instanceIds - an array of instance ids
attributeGetList - the attribute to be retrieved. If attributeGetList is NULL, then all attribute values of the instance will be returned.
Returns:
all specified instances. If attributeGetList is null, then all attributeValue in each instance will be retrieved.
Throws:
ARException - if failed to return all matched instances

findByKey

public static CMDBInstance findByKey(ARServerUser context,
                                     java.lang.String instanceId,
                                     CMDBClassNameKey aClassKey,
                                     java.lang.String[] attributeNames)
                              throws ARException
Finds the specified CMDBClass instance in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
instanceId - the ID of the instance to look for
attributeNames - the list of attributes to retrieve.
Returns:
the CMDBinstance instance with the specified attribute value. If attributeNames is null, then all attributeValue in the instance will be retrieved.
Throws:
ARException - if the specified instance can't be located

findByKey

public static CMDBInstance findByKey(ARServerUser context,
                                     CMDBClassNameKey aClassKey,
                                     int aGetMask,
                                     java.lang.String aDatasetId,
                                     java.lang.String instanceId,
                                     java.lang.String[] attributeNames)
                              throws ARException
Finds the specified CMDBClass instance in AR System

Parameters:
context - ARSystemUser structure that contains user and host information
aClassKey - the key of the class that the instance belongs to
instanceId - the ID of the instance to look for
aDatasetId - the DatasetId of the instance
aGetMask - the get mask (current or overlay)
attributeNames - the list of attributes to retrieve.
Returns:
the CMDBinstance instance with the specified attribute value. If attributeNames is null, then all attributeValue in the instance will be retrieved.
Throws:
ARException - if the specified instance can't be located

update

public void update(ARServerUser context)
            throws ARException
Saves the change made to the current CMDBClass instance in AR System.

Parameters:
context - ARSystemUser structure that contains user and host information
Throws:
ARException - if the instance cannot be updated in AR System

update

public void update(ARServerUser context,
                   java.lang.String aDatasetId)
            throws ARException
Saves the change made to the current CMDBClass instance in AR System.

Parameters:
context - ARSystemUser structure that contains user and host information
aDatasetId - the DatasetId of the instance
Throws:
ARException - if the instance cannot be updated in AR System