You use the <ResourceAttribute> element, as shown in the following example, to define resource attributes in the prototypeXML string of the adapter Java file:
<ResourceAttribute name=’"+RA_HOST+"’ type=’string’ multi=’false’\n"+ description=’<b>host</b><br>Enter the resource host name.’>\n"+ |
Where the description field identifies the item-level help for the RA_HOST field and must not contain the < character. In the preceding example, the < characters are replaced by < and '.
The following table describes the keywords you can use in <ResourceAttribute> element.
Table 10–4 <ResourceAttribute> Element Keywords
The ResourceAttribute> element may also contain a ValidationPolicy element. A validation policy ensures the value a user specifies on the Resource Parameters page meets the requirements defined in a separate policy object.
The following sample causes the adapter to use the Port Policy to ensure the specified value is valid. The default Port Policy checks the value is an integer between 1 and 65536.
<ResourceAttribute name='Port' value='123'> <ValidationPolicy> <ObjectRef type='Policy' id='#ID#PortPolicy' name='Port Policy'/> </ValidationPolicy> </ResourceAttribute>