Previous section.

Inter-domain Management: Specification Translation

Inter-domain Management: Specification Translation
Copyright © 1997 The Open Group

Mapping GDMO Templates to IDL Interfaces

For every GDMO managed object class template, an IDL interface is defined which supports the operations exported by members of the corresponding managed object type. In addition, a module is defined which contain interfaces supporting notifications. Inheritance Hierarchy of Interfaces of Managed Object Classes describes the inheritance hierarchy of management IDL interfaces derived from MANAGED OBJECT CLASS template definitions. The base interface for all IDL management interfaces is ManagedObject (which implicitly inherits from CORBA::Object as do all IDL interfaces). No attribute or operation is defined for ManagedObject yet. It is provided as a place holder for attributes and operations needed to implement managed object interfaces in a generic way.

Figure: Inheritance Hierarchy of Interfaces of Managed Object Classes
,iX "managed object class"

Since all generated IDL interfaces inherit from ManagedObject, the necessary functionality to support CMIS request and responses can be provided through the implementation of the OSIMgmt::ManagedObject interface. It is envisaged that the ManagedObject interface will provide support for such things as scoping, filtering, and attribute groups, by declaring operations on a per object basis for use by the gateway to fulfill scoped and filtered requests. This issue is deferred to the definition of Interaction Translation and of the ManagedObject interface in a separate document.

GDMO identifiers are subject to the same lexical translation and disambiguation rules defined for ASN.1 identifiers in Lexical Translation . As "/" is a legal character in GDMO identifiers (but not in ASN.1), it will be translated as the literal string "_SLASH_".

GDMO template order is determined by its use inside Managed Object classes. Templates not used (for example, Name Bindings, Parameters, Attributes, Packages, etc, that are declared but are not used or not accessible from Managed Object classes in the document) are not mapped. Imported templates are considered as if they were local to the current document for lexical purposes.

With the exception of managed object classes, each template REGISTERED AS clause is not mapped into the IDL files generated by the specification translation.

Error Handling

Both CMIP and CORBA provide mechanisms to handle errors. CMIP provides a basic set of errors (augmented by ROSE errors) one of which, processingFailure, may carry additional data defined in PARAMETER templates with context SPECIFIC-ERROR. This polymorphism is handled via the ANY DEFINED BY clause, which in turn is mapped to the IDL ASN1_DefinedAny type (which is derived from the IDL any type). CORBA provides a two-tiered exception handling mechanism consisting of standard exceptions (which carry very little data) and user exceptions which may carry arbitrary data types as defined in the IDL. In order to preserve the data capability, user defined exceptions are provided for each of the CMIP errors with data types as translated from the CMIP module (see reference CMIP). This is included by all translated objects via the file OSIMgmt.idl. An initial version of the OSIMgmt.idl file is contained in . It will further defined in the Interaction Translation document.

This solution will allow any invokers of an IDL operation to handle CMIP errors through exceptions. To enhance IDL readability, macros are provided defining the set of exceptions which each operation type might raise. A convenient side-effect of this is that PARAMETERs in general and SPECIFIC-ERRORs in particular need only be mapped to a type-declaration, so that a suitable TypeCode would be generated for use with IDL any.

Mapping Managed Object Templates to IDL

During translation from a managed object class template to an IDL interface, mandatory and conditional packages of the managed object class are distinguished only through the use of comments. The attributes, actions and notifications of conditional packages are translated in the same way as those of mandatory packages. Whether a conditional package is present or not is an implementation issue. When an attempt is made to access a conditional package that is not present, the implementation should raise the CORBA standard system exception NO_IMPLEMENT.

For each template in a GDMO specification, the method for translating from that template to the appropriate IDL definitions is described. This is done recursively starting from the MANAGED OBJECT CLASS template shown in Managed Object Class Template Structure .


<class-label> MANAGED OBJECT CLASS
[DERIVED FROM <class-label> [, <class-label>]* ; ]
[CHARACTERIZED BY <package-label> [, <package-label>]* ; ]
[CONDITIONAL PACKAGES <package-label> PRESENT IF
<condition-definition>
[, <package-label> PRESENT IF <condition-definition> ]* ; ]
REGISTERED AS object-identifier ;


Table: Managed Object Class Template Structure

A managed object class, maps to a management IDL interface with the same name plus additional interfaces which support notifications. Interface top inherits from ManagedObject and #includes OSIMgmt.idl. All other management interfaces multiply inherit from the interfaces corresponding to the managed object classes in the DERIVED FROM clause and must #include the files where IDL interface definitions corresponding to those managed object class templates have been generated. Then for each package, CONDITIONAL or otherwise, do the following steps (output to management IDL interface unless otherwise stated):

The REGISTERED AS clauses are translated as:

// <class-label> ... REGISTERED AS { a b c d e f }

#pragma ID <mapped-class-label> "OSIOID:a.b.c.d.e.f"
This allows the object identifier to be re-used as an Interface Repository ID.

This is only done for Managed Object Class templates.

Mapping an Attribute as a Set of IDL Operations

Associated with each Attribute in a GDMO package is a property-list which identifies the access mechanisms to the attribute. These may be GET, REPLACE, GET-REPLACE, ADD, REMOVE, ADD-REMOVE or REPLACE-WITH-DEFAULT. In addition CMIP may raise a number of different errors (possibly with parameters given in SPECIFIC-ERROR parameters) such as processingError or illegalValue. These are mapped to IDL as User Exceptions so that the additional data may be carried and this is the main reason why GDMO attributes are not mapped directly to IDL attributes; access operations on IDL attributes cannot raise user exceptions. All attribute operations may raise the same set of errors defined by the macro ATTRIBUTE_ERRORS from OSIMgmt.idl defined in Error Handling . Each attribute maps to one or more of five possible IDL operations:

<type>	<attribute-label>Get() raises (ATTRIBUTE_ERRORS);
void	<attribute-label>Set(in <type> value)
        raises (ATTRIBUTE_ERRORS);
void	<attribute-label>Add(in <type> value)
        raises (ATTRIBUTE_ERRORS);
void	<attribute-label>Remove(in <type> value)
        raises (ATTRIBUTE_ERRORS);
<type>	<attribute-label>SetDefault()
        raises (ATTRIBUTE_ERRORS);

where <type> is the ASN.1 for the Attribute type translated to IDL via the mechanisms defined in ASN.1 Type to CORBA-IDL Translation . Note that <attribute-label> is the attribute identifier after disambiguation (that is, it may have a suffix of the form <__n>). Note that Add and Remove operations manipulate sets and hence take values of the same type as the attribute itself.

For each attribute property in the list, IDL operations are generated according to Mapping Attribute Properties to IDL Operations . Each operation is generated at most once for each attribute in an interface.


Property IDL Operations Required
GET <attribute-label>Get
REPLACE <attribute-label>Set
GET-REPLACE <attribute-label>Get and <attribute-label>Set
ADD <attribute-label>Add
REMOVE <attribute-label>Remove
ADD-REMOVE <attribute-label>Add and <attribute-label>Remove
REPLACE-WITH-DEFAULT <attribute-label>SetDefault


Table: Mapping Attribute Properties to IDL Operations

Mapping Parameters to IDL Types

In GDMO, a PARAMETER is provided in order to resolve ANY DEFINED BY clauses in ACTIONS, NOTIFICATIONS and the CMIP Error processingFailure. The ASN.1 ANY DEFINED BY construct maps to an IDL any and to use this requires a suitable TypeCode to be available. Since a TypeCode is automatically generated when a type is defined in IDL, the corresponding typedef in IDL is simply generated. Applications that wish to use the PARAMETER clauses can then use the TypeCode to insert their data into the relevant IDL any field. As an additional programming aid, a comment is also generated for each parameter template.

<parameter-template> ::=
<parameter-label> PARAMETER
CONTEXT <context-type> ;
<syntax-or-attribute-choice> ;
[ BEHAVIOUR <behaviour-definition-label>
[ , <behaviour-definition-label>]* ; ]
[ REGISTERED AS object-identifier ] ;
 
<context-type> ::= <context-keyword> | ACTION-INFO |
ACTION-REPLY | EVENT-INFO |
EVENT-REPLY | SPECIFIC-ERROR
<context-keyword> ::= <type-reference>.<identifier>
<syntax-or-attribute-choice> ::= WITH SYNTAX <type-reference> |
ATTRIBUTE <attribute-label>


Table: Parameter Template Production

The mapping proceeds by translating the syntax of the attribute to an IDL type. If the ATTRIBUTE construct is used, the IDL type is the type of the reference attribute. Behaviour definitions are transcribed as comments, as is the CONTEXT type information. The mapping generates a new IDL type declaration, where the new type is named after parameter label and the type is the translation of the WITH SYNTAX or ATTRIBUTE constructs.

Examples

Example: Mapping Parameters to IDL Types

GDMO IDL
not-running PARAMETERS typedef ActionModule::ServerState
CONTEXT SPECIFIC-ERROR; not_runningType;
WITH SYNTAX // SPECIFIC-ERROR
ActionModule.ServerState;  


Mapping Actions to IDL Operations

In GDMO objects, action templates may have parameters and replies. Where actions have a reply syntax, objects have the option of using multiple replies (that is, returning a sequence of PDUs, each of the type given in the reply syntax, containing part of the reply). The behaviour clause of an action template indicates whether multiple replies may be used. Multiple replies allow data to be returned as it becomes available and have been used for monitoring progress. Whilst these are not widely used and could easily be replaced by notifications, it was regarded as necessary to provide for this capability. To do this, an additional interface which operates in the reverse direction is necessary (that is, the object instance would be the client of the interface and the manager would be the server). To achieve this, the managed object raises an exception to indicate that it will generate multiple replies.

As an additional complexity, actions may be either confirmed or unconfirmed, and this may be selected at run-time.


<action-template> ::=
<action-label> ACTION
<behaviour-clause>
<action-mode>
[PARAMETERS <param1>[, <param>]* ; ]
<action-info-syntax>
<action-reply-syntax>
REGISTERED AS object-identifier ;
 
<action-mode> ::= MODE CONFIRMED ; | empty
<action-info-syntax> ::= WITH INFORMATION SYNTAX <type-reference> ; | empty
<action-reply-syntax> ::= WITH REPLY SYNTAX <type-reference> ; | empty


Table: Action Template Production

Mapping of Action Parameters

Any parameters contained in the PARAMETERS clause of the action template are mapped as comments.

Mapping to an Operation on the Primary Interface

Each ACTION template is mapped to at least one operation in the management IDL interface. The name of the mandatory operation is the <action-label> of the ACTION template which may need disambiguating via the usual rules. It is possible for the name of an action to clash with an operation generated for an attribute. In this case, the attribute operation takes precedence and the name of the action is changed according to the usual rules (that is, add a suffix of the form <__n>). The operation may raise any of the CMIP errors associated with ACTION invocation (defined by the macro ACTION_ERRORS from OSIMgmt.idl in Error Handling ). If the action template has a WITH INFORMATION SYNTAX clause, the operation has an in parameter with type translated from the WITH INFORMATION SYNTAX clause named actionInfo. If the action template has a WITH REPLY SYNTAX clause, then the action may result in multiple replies (this is determined by the text in the behaviour clause but this information is not available to the compiler). In this case, the operation has a return type which is the translation of the WITH REPLY SYNTAX clause and may raise an additional user exception named UsingMR to indicate if it is using multiple replies.

Handling Multiple Replies

The handling of multiple replies is a matter for the Interaction Translation specification. The general mechanism to handle multiple replies does not need any special treatment from the GDMO to IDL translation process except for the UsingMR exception raised by the operations derived from the ACTION translation (see Mapping to an Operation on the Primary Interface ). If the manager is to handle multiple replies, it must detect the UsingMR exception and take the appropiate steps.

Examples

Example 1
Consider a simple case of ACTION template:
suspend ACTION
    MODE CONFIRMED
    PARAMETERS not-supported, not-running;
    WITH INFORMATION SYNTAX ActionModule.Suspend;
    WITH REPLY SYNTAX ActionModule.ServerState;
REGISTERED AS { 1 2 3 4 9 };
not-supported PARAMETER
    CONTEXT SPECIFIC-ERROR;
    WITH SYNTAX ActionModule.ReasonCode;
REGISTERED AS { 1 2 3 4 10 };
not-running PARAMETER
    CONTEXT SPECIFIC-ERROR;
    WITH SYNTAX ActionModule.ServerState;
REGISTERED AS { 1 2 3 4 11 };

This would translate in the primary interface as follows:

typedef ActionModule::ReasonCodeType not_supportedType; // SPECIFIC-ERROR
typedef ActionModule::ServerStateType not_runningType; // SPECIFIC-ERROR

ActionModule::ServerStateType suspend(in ActionModule::SuspendType actionInfo)
    raises (ACTION_ERRORS, UsingMR);

// PARAMETERS not-supported, not-running;

Example 2
If the ACTION template definition for suspend was:
suspend ACTION
    PARAMETERS not-supported, not-running, time-delay;
    WITH INFORMATION SYNTAX ActionModule.Suspend;
REGISTERED AS { 1 2 3 4 9 };

The operation definitions in the primary interface would look like this:

void suspend (in ActionModule::SuspendType actionInfo)
    raises (ACTION_ERRORS);

// PARAMETERS not-supported, not-running, time-delay;

oneway void suspendUnconfirmed (in ActionModule::SuspendType actionInfo);

Mapping Notifications to IDL Operations

The interfaces described below are contained in several separate files. This allows applications that do not wish to make use of some or all of these features to simply discard the files. It is, however, required that the files are generated.

Mapping of notifications must enable the use of typed or untyped events via the push or pull models. The mapping generates two sets of operations in the interfaces of the <nickname>_N and <nickname>_NP modules. However, due to issues surrounding the GDMO/CMIP notification mechanisms, the issue of how notification handling is setup is deferred to the Interaction Translation document. It is recommended that a comment be generated, listing the notifications on the primary interface.

CORBA event channels do not allow for operations which have a return type. In GDMO it is allowable for notifications to have reply syntaxes; however this is not believed to be used. In view of this it was decided not to map reply syntaxes for notifications. For similar reasons, no user exceptions are raised by notification operations.


<notification-template> ::=
<notification-label> NOTIFICATION
<behaviour-clause>
[PARAMETERS <param1>[, <param>]* ; ]
<notification-info-syntax>
<notification-reply-syntax>
REGISTERED AS object-identifier
 
<notification-info-syntax> ::= WITH INFORMATION SYNTAX
<type-reference>
<notification-attribute-ids> ; |
empty
 
<notification-attribute-ids> ::= AND ATTRIBUTE IDS
<attribute-id> [, <attribute-id>]* |
empty
 
<notification-reply-syntax> ::= WITH REPLY SYNTAX <type-reference> ; |
empty


Table: Notification Template Production

To maximise the flexibility of events, two alternatives are supported. Pure untyped events are supported by the CMIP header data as well as an any to carry the data. This results in the necessary type code being generated. Alternatively, interfaces supporting fully typed events are also generated in both push and pull flavours. Note that operations supporting typed delivery of notifications are produced in two interfaces per document (one for push and one for pull). These interfaces are called Notifications and PullNotifications and are scoped within a module with the same name as the file to ensure uniqueness.

Mapping of Event Parameters

Any parameters contained in the PARAMETERS clause of the notification template which have a context type of EVENT-REPLY or SPECIFIC-ERROR are ignored because reply syntaxes are not supported. Any parameter having a context type of EVENT-INFO are mapped as comments.

Mapping to Operations in Notification Modules

To support typed events under the push model, operations are generated in the _N module. Since notification can be confirmed or unconfirmed as selected at run-time, two operations are generated, one for confirmed events and one for unconfirmed. The unconfirmed event is defined as oneway in IDL. These operations have the following in parameters for the CMIP header components:

in ASN1_ObjectIdentifier sourceObjectClass, 
in X711CMI::ObjectInstanceType sourceObjectInstance, 
in ASN1_ObjectIdentifier eventType, 
in X711CMI::ASN1_GeneralizedTimeOpt eventTime,

followed by an in parameter of type translated from the WITH INFORMATION SYNTAX clause named notifInfo. The operations are named as <notificaton-label> and <notification-label>Unconfirmed respectively. Both operations have the return type void.

Similarly, the pull model is supported by two operations generated in the _NP module. These have the following out parameters for the CMIP header components:

out ASN1_ObjectIdentifier sourceObjectClass, 
out X711CMI::ObjectInstanceType sourceObjectInstance, 
out ASN1_ObjectIdentifier eventType, 
out X711CMI::ASN1_GeneralizedTimeOpt eventTime,

followed by an out parameter of type translated from the WITH INFORMATION SYNTAX clause named notifInfo. The operations are named as pull_<notification-label> and try_<notification-label> and have void and boolean return types respectively. Note that with the pull model, event delivery is inherently confirmed.

To support the untyped event mechanism, a suitable IDL type will be defined in the OSIMgmt.idl file. However, definition of such a type is postponed to Interaction Translation.

Example

The following NOTIFICATION template:
objectCreation NOTIFICATION
    BEHAVIOUR objectCreationBehaviour;
    WITH INFORMATION SYNTAX Notification-ASN1Module.ObjectInfo
        AND ATTRIBUTE IDS
        sourceIndicator SourceIndicator,
        attributeList AttributeList,
        notificationIdentifier NotificationIdentifier,
        correlatedNotifications CorrelatedNotifications,
        additionalText AdditionalText,
        additionalInformation AdditionalInformation;
REGISTERED AS { joint-iso-ccitt ms(9) smi(3) part2(2) notification(10) 6}

would be translated as follows:

// in X721_N module 
  void objectCreation (
    in ASN1_ObjectIdentifier sourceObjectClass, 
    in X711CMI::ObjectInstanceType sourceObjectInstance, 
    in ASN1_ObjectIdentifier eventType, 
    in X711CMI::ASN1_GeneralizedTimeOpt eventTime,
    in X711Not::ObjectInfoType notifInfo);

  oneway void objectCreationUnconfirmed (
    in ASN1_ObjectIdentifier sourceObjectClass, 
    in X711CMI::ObjectInstanceType sourceObjectInstance, 
    in ASN1_ObjectIdentifier eventType, 
    in X711CMI::ASN1_GeneralizedTimeOpt eventTime,
    in X711Not::ObjectInfoType notifInfo);

// in X721_NP module
  void pull_objectCreation (
    out ASN1_ObjectIdentifier sourceObjectClass, 
    out X711CMI::ObjectInstanceType sourceObjectInstance, 
    out ASN1_ObjectIdentifier eventType, 
    out X711CMI::ASN1_GeneralizedTimeOpt eventTime,
    out X711Not::ObjectInfoType notifInfo); 

  boolean try_objectCreation (
    out ASN1_ObjectIdentifier sourceObjectClass, 
    out X711CMI::ObjectInstanceType sourceObjectInstance, 
    out ASN1_ObjectIdentifier eventType, 
    out X711CMI::ASN1_GeneralizedTimeOpt eventTime,
    out X711Not::ObjectInfoType notifInfo);

Resolving Inheritance Collisions

In CORBA IDL, an attribute or operation cannot be inherited from more than one interface, whereas in GDMO such multiple declaration is allowed. This can arise from both single and multiple inheritance. In order to solve issues of inheritance collision, the algorithm described here will produce the correct output.

The following steps should be applied in order to each managed object class of the input GDMO document. Before processing a class, all its ancestors in the inheritance tree must be processed, and the results of that processing taken into account:

  1. Check for repetition of attribute/operation names across all ancestors in inheritance tree.

  2. Revise ancestor name collisions by revising the inheritance hierarchy, if required.

  3. Add only non-redundant attribute/operation methods from the current object.

  4. Map the revised derived managed object class to IDL interface.

Implementation of this (or an equivalent) algorithm is optional. If a translator does not implement such an algorithm, it will not be able to successfully translate GDMO documents that cause inheritance collisions.

This algorithm was chosen because it maintains the inheritance tree as large as possible, and it also results in the generation of cleaner IDL code.

Examples

Figure: Inheritance Hierarchy Showing Name Collision

Inheritance Hierarchy Showing Name Collision describes the inheritance hierarchy of managed object classes, where the same attributes are declared in inherited interfaces by the following GDMO:

aObject MANAGED OBJECT CLASS
    DERIVED FROM "dmi":top;
    CHARACTERIZED BY aObjectPkg1 PACKAGE
        ATTRIBUTES aAttr1 GET, aAttr2 GET; ;
REGISTERED AS {xxx ?};

bObject MANAGED OBJECT CLASS
    DERIVED FROM "dmi":top;
    CHARACTERIZED BY bObjectPkg1 PACKAGE
        ATTRIBUTES aAttr2 GET-REPLACE, bAttr1 GET; ;
REGISTERED AS {xxx ?};

cObject MANAGED OBJECT CLASS
    DERIVED FROM "dmi":top;
    CHARACTERIZED BY cObjectPkg1 PACKAGE
        ATTRIBUTES cAttr1 GET;;
REGISTERED AS {xxx ?};

dObject MANAGED OBJECT CLASS
    DERIVED FROM cObject;
    CHARACTERIZED BY dObjectPkg1 PACKAGE
        ATTRIBUTES aAttr1 GET-REPLACE, dAttr1 GET; ;
REGISTERED AS {xxx ?};

abObject MANAGED OBJECT CLASS
    DERIVED FROM aObject, bObject;
    CHARACTERIZED BY abObjectPkg1 PACKAGE
        ATTRIBUTES abAttr1 GET; ;
REGISTERED AS {xxx ?};

adObject MANAGED OBJECT CLASS
    DERIVED FROM aObject, dObject;
    CHARACTERIZED BY acObjectPkg1 PACKAGE
        ATTRIBUTES cAttr1 GET-REPLACE; ;
REGISTERED AS {xxx ?};

-- Assume for simplicity that all attributes have WITH SYNTAX "AttrType"

The IDL interfaces for aObject, bObject, cObject and dObject are:

interface aObject : X721::top
{
    AttrType aAttr1Get() raises (ATTRIBUTE_ERRORS);
    AttrType aAttr2Get() raises (ATTRIBUTE_ERRORS);
};

interface bObject : X721::top
{
    AttrType aAttr2Get() raises (ATTRIBUTE_ERRORS);
    void aAttr2Set(in AttrType value) raises (ATTRIBUTE_ERRORS);
    AttrType bAttr1Get() raises (ATTRIBUTE_ERRORS);};

interface cObject : X721::top
{
    AttrType cAttr1Get() raises (ATTRIBUTE_ERRORS);
};

interface dObject : cObject
{
    AttrType aAttr1Get();
    aAttr1Set(in AttrType value) raises (ATTRIBUTE_ERRORS);
    AttrType dAttr1Get() raises (ATTRIBUTE_ERRORS);
};

If abObject is mapped as inheriting from interfaces aObject and bObject, then there is collision on attribute aAttr2. In this case the inheritance tree is modified such that abObject is inherited only from aObject and include the attribute and operation of bObject that is not present in aObject and as well as its own attributes and operations to get:

interface abObject : aObject
{
    void aAttr2Set(in AttrType value) raises (ATTRIBUTE_ERRORS);
    AttrType bAttr1Get() raises (ATTRIBUTE_ERRORS);
    AttrType abAttr1Get() raises (ATTRIBUTE_ERRORS);
};

If adObject is mapped as inheriting from interfaces aObject and dObject, then there is a collision on attribute aAttr1. In this case the inheritance tree is modified such that adObject is inherited from aObject and cObject. In the revised object include the attribute and operation of dObject that is not present in aObject and cObject and its own attributes and operations to get:

interface adObject : aObject, cObject
{
    void aAttr1Set(in AttrType value) raises (ATTRIBUTE_ERRORS);
    AttrType dAttr1Get() raises (ATTRIBUTE_ERRORS);
    void cAttr1Set(in AttrType value) raises (ATTRIBUTE_ERRORS);
};

Revised Inheritance Hierarchy of Managed Object Classes describes the modified inheritance hierarchy of managed object classes shown in Inheritance Hierarchy Showing Name Collision .

Figure: Revised Inheritance Hierarchy of Managed Object Classes

Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index