com.remedy.cmdb.api
Class CMDBAttribute

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

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

The CMDBAttribute class defines the attributes of CMDBClass.

See Also:
Serialized Form

Field Summary
static int CMDB_ATTR_AUDITTYPE_AUDIT
          Attribute audit type audit.
static int CMDB_ATTR_AUDITTYPE_AUDIT_AND_COPY
          Attribute audit type audit and copy.
static int CMDB_ATTR_AUDITTYPE_COPY
          Attribute audit type copy.
static int CMDB_ATTR_AUDITTYPE_NONE
          Attribute audit type none.
static int CMDB_ATTR_CHARAC_AUDIT_OPTION
          Defines the attribute audit option characteristic.
static int CMDB_ATTR_CHARAC_CHANGE_PERMS
          Defines the change permission CMDBAttribute characteristic.
static int CMDB_ATTR_CHARAC_CREATE_MODE
          Defines the create mode CMDBAttribute characteristic.
static int CMDB_ATTR_CHARAC_DESCRIPTION
          Defines the enumerated value for the CMDBAttribute description characteristic.
static int CMDB_ATTR_CHARAC_HIDDEN
          Defines the hidden CMDBAttribute characteristic.
static int CMDB_ATTR_CHARAC_NAMESPACE
          Defines the attribute namespace encoded in CMDBAttribute characteristic.
static int CMDB_ATTR_CHARAC_PRIMARY_KEY
          Defines the primary key CMDBAttribute characteristic.
static int CMDB_ATTR_CHARAC_PROPAGATED_OWNER
          Defines the propagated owner CMDBAttribute characteristic.
static int CMDB_ATTR_CHARAC_VIEW_PERMS
          Defines the view permission CMDBAttribute characteristic.
static int CMDB_ATTR_CREATE_MODE_OPEN
          Allows any user to create an instance on this attribute.
static int CMDB_ATTR_CREATE_MODE_PROTECTED
          only allow the user who has attribute change permission to create instance on this attribute.
static int CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY
          A display only attribute, which is usually a core attribute.
static int CMDB_ATTR_ENTRYMODE_NONE
          No entry mode.
static int CMDB_ATTR_ENTRYMODE_OPTIONAL
          An optional attribute.
static int CMDB_ATTR_ENTRYMODE_REQUIRED
          A required attribute.
static int CMDB_ATTR_TYPE_CORE
          The attribute is a core attribute, which is created and maintained by the Class Manager API.
static int CMDB_ATTR_TYPE_CORE_INTERNAL
          The attribute is a core internal attribute, which is created and maintained by the Class Manager API, and it is hidden from the end-user.
static int CMDB_ATTR_TYPE_NONE
          No attribute type.
static int CMDB_ATTR_TYPE_REGULAR
          The attribute is the regular type.
 
Constructor Summary
CMDBAttribute(java.lang.String aName)
          Constructor that creates an attribute with the given name.
CMDBAttribute(java.lang.String aName, int aEntryMode, CMDBAttributeLimit aLimit, Value aDefaultValue)
          Constructor that creates an attribute with the provided information.
CMDBAttribute(java.lang.String aName, long arFieldId)
          Constructor that creates an attribute with the given name and field ID.
CMDBAttribute(java.lang.String aName, long arFieldId, int aEntryMode, CMDBAttributeLimit aLimit, Value aDefaultValue)
          Constructor that creates an attribute with the provided information.
CMDBAttribute(java.lang.String aName, java.lang.String attributeId)
          Constructor that creates an attribute with the given name and attribute GUID.
CMDBAttribute(java.lang.String aName, java.lang.String attributeId, int aEntryMode, CMDBAttributeLimit aLimit, Value aDefaultValue)
          Constructor that creates an attribute with the provided information.
CMDBAttribute(java.lang.String aName, java.lang.String attributeId, long arFieldId)
          Constructor that creates an attribute with the given name, field ID and attribute GUID.
CMDBAttribute(java.lang.String aName, java.lang.String attributeId, long arFieldId, int aEntryMode, CMDBAttributeLimit aLimit, Value aDefaultValue)
          Constructor that creates an attribute with the provided information.
 
Method Summary
 void addCustomCharacteristic(int charactId, Value charactVal)
          Add the specified custom characteristic to the attribute
 int getAttributeType()
          Gets the type of the attribute.
 int getAuditType()
          Returns the audit type characteristic.
 CMDBClassNameKey getBaseClassName()
          Gets the name of the base class the attribute is associated with.
 java.lang.String getChangePermission()
          Gets the change permission of the attribute.
 int getCreateMode()
          Returns the create mode characteristic.
 Value getCustomCharacteristic(int charactId)
          Gets the specified custom characteristic.
 java.util.Map getCustomCharacteristicMap()
          Retrieves all custom characteristics as a map.
 int getDataType()
          Gets the dataType of the attribute.
 Value getDefaultValue()
          Gets the default value of the attribute.
 java.lang.String getDescription()
          Returns the attribute description.
 int getEntryMode()
          Gets the entry mode of the attribute.
 long getFieldId()
          Gets the ID of the AR System field that stores the attribute.
 boolean getHidden()
          Returns Hidden characteristic.
 java.lang.String getId()
          Gets the ID of the attribute.
 CMDBAttributeLimit getLimitInfo()
          Gets the limit of the attribute.
 java.lang.String getName()
          Gets the name of the attribute.
 java.lang.String getNamespace()
          Returns the attribute namespace.
 java.lang.String getNewName()
          Gets the new attribute name to be set into AR System.
 boolean getPrimaryKey()
          Returns PrimaryKey characteristic.
 java.lang.String getPropagatedOwner()
          Returns the propagated owner characteristic.
 java.lang.String getViewPermission()
          Gets the view permission of the attribute.
 void removeAllCustomCharacteristic()
          Removes all custom characteristics from the attribute.
 void removeCustomCharacteristic(int charactId)
          Removes the specified custom characteristic from the attribute.
 void setAuditType(int auditType)
          Sets the audit type characteristic.
 void setChangePermission(java.lang.String changePerm)
          Sets Change Permission characteristic.
 void setCreateMode(int createMode)
          Sets the create mode characteristic.
 void setDefaultValue(Value aDefaultVal)
          Sets the default value of the attribute.
 void setDescription(java.lang.String description)
          Sets the description.
 void setEntryMode(int anEntryMode)
          Sets the entry mode of the attribute.
 void setHidden(boolean isHidden)
          Sets Hidden characteristic.
 void setLimit(CMDBAttributeLimit aLimit)
          Sets the limit of the attribute.
 void setName(java.lang.String aName)
          Sets the name of the attribute.
 void setNamespace(java.lang.String namespace)
          Sets the namespace.
 void setNewName(java.lang.String aNewName)
          Updates the name of CMDBClass attribute.
 void setViewPermission(java.lang.String viewPerm)
          Sets View Permission characteristic.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMDB_ATTR_ENTRYMODE_NONE

public static final int CMDB_ATTR_ENTRYMODE_NONE
No entry mode.

See Also:
Constant Field Values

CMDB_ATTR_ENTRYMODE_REQUIRED

public static final int CMDB_ATTR_ENTRYMODE_REQUIRED
A required attribute.

See Also:
Constant Field Values

CMDB_ATTR_ENTRYMODE_OPTIONAL

public static final int CMDB_ATTR_ENTRYMODE_OPTIONAL
An optional attribute.

See Also:
Constant Field Values

CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY

public static final int CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY
A display only attribute, which is usually a core attribute.

See Also:
Constant Field Values

CMDB_ATTR_TYPE_NONE

public static final int CMDB_ATTR_TYPE_NONE
No attribute type.

See Also:
Constant Field Values

CMDB_ATTR_TYPE_CORE_INTERNAL

public static final int CMDB_ATTR_TYPE_CORE_INTERNAL
The attribute is a core internal attribute, which is created and maintained by the Class Manager API, and it is hidden from the end-user.

See Also:
Constant Field Values

CMDB_ATTR_TYPE_CORE

public static final int CMDB_ATTR_TYPE_CORE
The attribute is a core attribute, which is created and maintained by the Class Manager API.

See Also:
Constant Field Values

CMDB_ATTR_TYPE_REGULAR

public static final int CMDB_ATTR_TYPE_REGULAR
The attribute is the regular type.

See Also:
Constant Field Values

CMDB_ATTR_CHARAC_VIEW_PERMS

public static final int CMDB_ATTR_CHARAC_VIEW_PERMS
Defines the view permission CMDBAttribute characteristic.

See Also:
Constant Field Values

CMDB_ATTR_CHARAC_CHANGE_PERMS

public static final int CMDB_ATTR_CHARAC_CHANGE_PERMS
Defines the change permission CMDBAttribute characteristic.

See Also:
Constant Field Values

CMDB_ATTR_CHARAC_HIDDEN

public static final int CMDB_ATTR_CHARAC_HIDDEN
Defines the hidden CMDBAttribute characteristic.

See Also:
Constant Field Values

CMDB_ATTR_CHARAC_PRIMARY_KEY

public static final int CMDB_ATTR_CHARAC_PRIMARY_KEY
Defines the primary key CMDBAttribute characteristic.

See Also:
Constant Field Values

CMDB_ATTR_CHARAC_PROPAGATED_OWNER

public static final int CMDB_ATTR_CHARAC_PROPAGATED_OWNER
Defines the propagated owner CMDBAttribute characteristic. This is a read only characteristic.

See Also:
Constant Field Values

CMDB_ATTR_CHARAC_CREATE_MODE

public static final int CMDB_ATTR_CHARAC_CREATE_MODE
Defines the create mode CMDBAttribute characteristic.

See Also:
Constant Field Values

CMDB_ATTR_CHARAC_AUDIT_OPTION

public static final int CMDB_ATTR_CHARAC_AUDIT_OPTION
Defines the attribute audit option characteristic.

See Also:
Constant Field Values

CMDB_ATTR_CHARAC_NAMESPACE

public static final int CMDB_ATTR_CHARAC_NAMESPACE
Defines the attribute namespace encoded in CMDBAttribute characteristic.

See Also:
Constant Field Values

CMDB_ATTR_CHARAC_DESCRIPTION

public static final int CMDB_ATTR_CHARAC_DESCRIPTION
Defines the enumerated value for the CMDBAttribute description characteristic.

See Also:
Constant Field Values

CMDB_ATTR_CREATE_MODE_OPEN

public static final int CMDB_ATTR_CREATE_MODE_OPEN
Allows any user to create an instance on this attribute.

See Also:
Constant Field Values

CMDB_ATTR_CREATE_MODE_PROTECTED

public static final int CMDB_ATTR_CREATE_MODE_PROTECTED
only allow the user who has attribute change permission to create instance on this attribute.

See Also:
Constant Field Values

CMDB_ATTR_AUDITTYPE_NONE

public static final int CMDB_ATTR_AUDITTYPE_NONE
Attribute audit type none.

See Also:
Constant Field Values

CMDB_ATTR_AUDITTYPE_AUDIT

public static final int CMDB_ATTR_AUDITTYPE_AUDIT
Attribute audit type audit.

See Also:
Constant Field Values

CMDB_ATTR_AUDITTYPE_COPY

public static final int CMDB_ATTR_AUDITTYPE_COPY
Attribute audit type copy.

See Also:
Constant Field Values

CMDB_ATTR_AUDITTYPE_AUDIT_AND_COPY

public static final int CMDB_ATTR_AUDITTYPE_AUDIT_AND_COPY
Attribute audit type audit and copy.

See Also:
Constant Field Values
Constructor Detail

CMDBAttribute

public CMDBAttribute(java.lang.String aName)
Constructor that creates an attribute with the given name. The attribute that is created does not have a dataType. Call setLimit(CMDBAttributeLimit aLimit) to set the data type. Without it, the attribute is not valid.

Parameters:
aName - the name of the attribute
Throws:
java.lang.IllegalArgumentException - if aName length is longer than Constants.AR_MAX_NAME_SIZE

CMDBAttribute

public CMDBAttribute(java.lang.String aName,
                     long arFieldId)
Constructor that creates an attribute with the given name and field ID. The attribute that is created does not have a dataType. Call setLimit(CMDBAttributeLimit aLimit) to set the data type. Without it, the attribute is not valid.

Parameters:
aName - the name of the attribute
arFieldId - the ID of AR System field that stores the attribute
Throws:
java.lang.IllegalArgumentException - if aName length is longer than Constants.AR_MAX_NAME_SIZE

CMDBAttribute

public CMDBAttribute(java.lang.String aName,
                     java.lang.String attributeId,
                     long arFieldId)
Constructor that creates an attribute with the given name, field ID and attribute GUID. The attribute that is created does not have a dataType. Call setLimit(CMDBAttributeLimit aLimit) to set the data type. Without it, the attribute is not valid.

Parameters:
aName - the name of the attribute
attributeId - the GUID of the attribute
arFieldId - the ID of AR System field that stores the attribute
Throws:
java.lang.IllegalArgumentException - if aName length is longer than Constants.AR_MAX_NAME_SIZE

CMDBAttribute

public CMDBAttribute(java.lang.String aName,
                     java.lang.String attributeId)
Constructor that creates an attribute with the given name and attribute GUID. The attribute that is created does not have a dataType. Call setLimit(CMDBAttributeLimit aLimit) to set the data type. Without it, the attribute is not valid.

Parameters:
aName - the name of the attribute
attributeId - the GUID of the attribute
Throws:
java.lang.IllegalArgumentException - if aName length is longer than Constants.AR_MAX_NAME_SIZE

CMDBAttribute

public CMDBAttribute(java.lang.String aName,
                     int aEntryMode,
                     CMDBAttributeLimit aLimit,
                     Value aDefaultValue)
Constructor that creates an attribute with the provided information.

Parameters:
aName - the name of the attribute
aEntryMode - the entry mode of the attribute
aLimit - the size limit of the attribute
aDefaultValue - the default value of the attribute
Throws:
java.lang.IllegalArgumentException - if the map value is not PropInfo
java.lang.IllegalArgumentException - if aName length is longer than Constants.AR_MAX_NAME_SIZE

CMDBAttribute

public CMDBAttribute(java.lang.String aName,
                     long arFieldId,
                     int aEntryMode,
                     CMDBAttributeLimit aLimit,
                     Value aDefaultValue)
Constructor that creates an attribute with the provided information.

Parameters:
aName - the name of the attribute
arFieldId - the ID of AR System field that stores the attribute
aEntryMode - the entry mode of the attribute
aLimit - the size limit of the attribute
aDefaultValue - the default value of the attribute
Throws:
java.lang.IllegalArgumentException - if the map value is not PropInfo
java.lang.IllegalArgumentException - if aName length is longer than Constants.AR_MAX_NAME_SIZE

CMDBAttribute

public CMDBAttribute(java.lang.String aName,
                     java.lang.String attributeId,
                     long arFieldId,
                     int aEntryMode,
                     CMDBAttributeLimit aLimit,
                     Value aDefaultValue)
Constructor that creates an attribute with the provided information.

Parameters:
aName - the name of the attribute
attributeId - the GUID of the attribute
arFieldId - the ID of AR System field that stores the attribute
aEntryMode - the entry mode of the attribute
aLimit - the size limit of the attribute
aDefaultValue - the default value of the attribute
Throws:
java.lang.IllegalArgumentException - if the map value is not PropInfo
java.lang.IllegalArgumentException - if aName length is longer than Constants.AR_MAX_NAME_SIZE

CMDBAttribute

public CMDBAttribute(java.lang.String aName,
                     java.lang.String attributeId,
                     int aEntryMode,
                     CMDBAttributeLimit aLimit,
                     Value aDefaultValue)
Constructor that creates an attribute with the provided information.

Parameters:
aName - the name of the attribute
attributeId - the GUID of the attribute
aEntryMode - the entry mode of the attribute
aLimit - the size limit of the attribute
aDefaultValue - the default value of the attribute
Throws:
java.lang.IllegalArgumentException - if the map value is not PropInfo
java.lang.IllegalArgumentException - if aName length is longer than Constants.AR_MAX_NAME_SIZE
Method Detail

addCustomCharacteristic

public void addCustomCharacteristic(int charactId,
                                    Value charactVal)
Add the specified custom characteristic to the attribute

Parameters:
charactId - the ID of the characteristic
charactVal - the value of the characteristic
Throws:
java.lang.IllegalArgumentException - if the characteristic is not in the expected range

getId

public java.lang.String getId()
Gets the ID of the attribute.

Returns:
the id of the attribute

getName

public java.lang.String getName()
Gets the name of the attribute.

Returns:
the name of the attribute

getNewName

public java.lang.String getNewName()
Gets the new attribute name to be set into AR System.

Returns:
the new name of the attribute

getFieldId

public long getFieldId()
Gets the ID of the AR System field that stores the attribute.

Returns:
the arsystem field id of the attribute

getEntryMode

public int getEntryMode()
Gets the entry mode of the attribute. The mode can be CMDB_ATTR_ENTRYMODE_OPTIONAL, CMDB_ATTR_ENTRYMODE_REQUIRED, or CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY

Returns:
the entry mode.

getDataType

public int getDataType()
Gets the dataType of the attribute. It can be CMDBAttributeLimit.CMDB_ATTR_DATA_TYPE_INTEGER, CMDBAttributeLimit.CMDB_ATTR_DATA_TYPE_REAL, CMDBAttributeLimit.CMDB_ATTR_DATA_TYPE_CHAR, CMDBAttributeLimit.CMDB_ATTR_DATA_TYPE_DIARY, CMDBAttributeLimit.CMDB_ATTR_DATA_TYPE_ENUM, CMDBAttributeLimit.CMDB_ATTR_DATA_TYPE_TIME, CMDBAttributeLimit.CMDB_ATTR_DATA_TYPE_DECIMAL, CMDBAttributeLimit.CMDB_ATTR_DATA_TYPE_DATE.

Returns:
the dataType of the attribute

getAttributeType

public int getAttributeType()
Gets the type of the attribute. The type can be CMDB_ATTR_TYPE_CORE_INTERNAL, CMDB_ATTR_TYPE_CORE, or CMDB_ATTR_TYPE_REGULAR

Returns:
the type of the attribute

getBaseClassName

public CMDBClassNameKey getBaseClassName()
Gets the name of the base class the attribute is associated with.


getDefaultValue

public Value getDefaultValue()
Gets the default value of the attribute.

Returns:
the default value of the attribute

getLimitInfo

public CMDBAttributeLimit getLimitInfo()
Gets the limit of the attribute.

Returns:
the limit of the attribute

getViewPermission

public java.lang.String getViewPermission()
Gets the view permission of the attribute.

Returns:
the view permission of the attribute

getChangePermission

public java.lang.String getChangePermission()
Gets the change permission of the attribute.

Returns:
the change permission of the attribute

getHidden

public boolean getHidden()
Returns Hidden characteristic. If this characteristic is not set, the return value defaults to false.

Returns:
Hidden characteristic

getPrimaryKey

public boolean getPrimaryKey()
Returns PrimaryKey characteristic. If this characteristic is not set, the return value defaults to false. This is a read-only characteristic, and it is maintained by the Class Manager API.

Returns:
PrimaryKey characteristic

getCreateMode

public int getCreateMode()
Returns the create mode characteristic.

Returns:
create mode characteristic, which can be: CMDB_ATTR_CREATE_MODE_OPEN, CMDB_ATTR_CREATE_MODE_PROTECTED.

getPropagatedOwner

public java.lang.String getPropagatedOwner()
Returns the propagated owner characteristic.

Returns:
the propagated owner

getAuditType

public int getAuditType()
Returns the audit type characteristic.

Returns:
audit type characteristic, which can be: CMDB_ATTR_AUDITTYPE_NONE, CMDB_ATTR_AUDITTYPE_AUDIT, CMDB_ATTR_AUDITTYPE_COPY, CMDB_ATTR_AUDITTYPE_AUDIT_AND_COPY.

getNamespace

public java.lang.String getNamespace()
Returns the attribute namespace.


getDescription

public java.lang.String getDescription()
Returns the attribute description.


getCustomCharacteristic

public Value getCustomCharacteristic(int charactId)
Gets the specified custom characteristic.

Parameters:
charactId - the id of the characteristic requested
Returns:
the characteristic requested
Throws:
java.lang.IllegalArgumentException - if the characteristic is not in the expected range

getCustomCharacteristicMap

public java.util.Map getCustomCharacteristicMap()
Retrieves all custom characteristics as a map. The map is a collection of combinations of a value and an integer type representation of a property ID.

Returns:
all the custom characteristics of the attribute
Throws:
java.lang.IllegalArgumentException - if the characteristic is not in the expected range

removeCustomCharacteristic

public void removeCustomCharacteristic(int charactId)
Removes the specified custom characteristic from the attribute.

Parameters:
charactId - the ID of the characteristic to be removed
Throws:
java.lang.IllegalArgumentException - if the characteristic is not in the expected range

removeAllCustomCharacteristic

public void removeAllCustomCharacteristic()
Removes all custom characteristics from the attribute.


setName

public void setName(java.lang.String aName)
Sets the name of the attribute.

Parameters:
aName - the name of the attribute
Throws:
java.lang.IllegalArgumentException - if aName is empty or its length is longer than Constants.AR_MAX_NAME_SIZE

setNewName

public void setNewName(java.lang.String aNewName)
Updates the name of CMDBClass attribute. This call should be used with CMDBClass.update(com.remedy.arsys.api.ARServerUser) method to modify the name of CMDBClass attribute in AR System.

Parameters:
aNewName - the new name of the attribute
Throws:
java.lang.IllegalArgumentException - if aNewName is empty or its length is longer than Constants.AR_MAX_NAME_SIZE

setEntryMode

public void setEntryMode(int anEntryMode)
Sets the entry mode of the attribute. The mode can be CMDB_ATTR_ENTRYMODE_OPTIONAL or CMDB_ATTR_ENTRYMODE_REQUIRED

Parameters:
anEntryMode - the new entry mode of the attribute

setDefaultValue

public void setDefaultValue(Value aDefaultVal)
Sets the default value of the attribute.

Parameters:
aDefaultVal - the new default value of the attribute

setLimit

public void setLimit(CMDBAttributeLimit aLimit)
Sets the limit of the attribute. The limit can be one of the following types: CHARACTER, DATE, DECIMAL, DIARY, ENUM, INTEGER, REAL, TIME, TIMEOFDAY.

Parameters:
aLimit - the new limit of the attribute

setViewPermission

public void setViewPermission(java.lang.String viewPerm)
Sets View Permission characteristic.

Parameters:
viewPerm - the view permission characteristic of the attribute.

setChangePermission

public void setChangePermission(java.lang.String changePerm)
Sets Change Permission characteristic.

Parameters:
changePerm - the change permission characteristic of the attribute.

setHidden

public void setHidden(boolean isHidden)
Sets Hidden characteristic.

Parameters:
isHidden - a boolean value for Hidden characteristic.

setCreateMode

public void setCreateMode(int createMode)
Sets the create mode characteristic.

Parameters:
createMode - the create mode of the attribute CMDB_ATTR_CREATE_MODE_OPEN, CMDB_ATTR_CREATE_MODE_PROTECTED.

setAuditType

public void setAuditType(int auditType)
Sets the audit type characteristic.

Parameters:
auditType - characteristic, which can be: CMDB_ATTR_AUDITTYPE_NONE, CMDB_ATTR_AUDITTYPE_AUDIT, CMDB_ATTR_AUDITTYPE_COPY, CMDB_ATTR_AUDITTYPE_AUDIT_AND_COPY.

setNamespace

public void setNamespace(java.lang.String namespace)
Sets the namespace.

Parameters:
namespace - the namespace of the attribute

setDescription

public void setDescription(java.lang.String description)
Sets the description.

Parameters:
description - the description of the attribute