DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
OSA reference

Example Attribute Definition Tables (ADT)

For each attribute, the table defines an identifier, the operations which may be performed on the attribute, the filters which may evaluate the attribute, and whether the attribute takes a single value or a set of data. See also ``Attribute definition table (ADT)''.

This example defines six attributes (userName, userId, groupId, homeDirectory, loginShell and realLifeName) which completely describe any of the object instances of the class sco user. All of the attributes will allow the get operation. Because the userName attribute is the object instance identifier and should never be changed, it does not allow the replace operation to be run on it. Only the groupId attribute will allow the add and remove operations. groupId is the only attribute that allows a set of values (because a user can belong to more than one group) rather than a single value. Only attributes with the set value type allow the add and remove operations since they are intended to be used only upon set valued attributes. The eq filter may be run on everything but the homeDirectory and the userName. The subset filter is only allowed for the attribute groupId, which uses the set value type.

ADT example (Tcl)

set users(attributes) {
        {userName {
                {validOperations {get}}
                {validFilters    {}}
                {dataType        {single}}}}
        {userId {
                {validOperations {get replace}}
                {validFilters    {eq}}
                {dataType        {single}}}}
        {groupId {
                {validOperations {get replace add remove}}
                {validFilters    {eq subset}}
                {dataType        {set}}}}
        {homeDirectory {
                {validOperations {get replace}}
                {validFilters    {}}
                {dataType        {single}}}}
        {loginShell {
                {validOperations {get replace}}
                {validFilters    {eq}}
                {dataType        {single}}}}
        {realLifeName {
                {validOperations {get replace}}
                {validFilters    {eq}}
                {dataType        {single}}}}
}

ADT example (C/C++)

OSAAttr_t attr[] = {
    {
        "uid",
        ATTR_UID,  
        "get set",
        FILTER_EQ,
        ATTR_SINGLE | ATTR_LONG
    },
    {
        "gid",
        ATTR_GID,  
        "get add remove replaceWithDefault",
        FILTER_EQ | FILTER_PRESENT,
        ATTR_SET | ATTR_LONG
    },
    {
        "home",
        ATTR_HOME, 
        "get set",
        FILTER_NO_FILTER,
        ATTR_SINGLE | ATTR_STRING
    },
    {
        "shell",
        ATTR_SHELL,
        "get set",
        FILTER_EQ,
        ATTR_SINGLE | ATTR_STRING
    },
    {
        "name",
        ATTR_NAME, 
        "get set",
        FILTER_EQ,
        ATTR_SINGLE | ATTR_STRING
    },
    NULL
};

Next topic: Example Operation Definition Tables (ODT)
Previous topic: Example tables and procedures

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005