//File: DAFUpdate.idl #ifndef _DAF_UPDATE_IDL_ #define _DAF_UPDATE_IDL_ #include #pragma prefix "omg.org" module DAFUpdate { // types imported from the descriptions and identifiers modules typedef DAFDescriptions::ResourceDescription ResourceDescription; typedef DAFIdentifiers::ResourceIDSequence ResourceIDSequence; // An Action is is the "verb" for an UpdateCommand structure. typedef short Action; const Action CREATE_RESOURCE_ACTION = 1; const Action SET_VALUES_ACTION = 2; const Action DELETE_RESOURCE_ACTION = 3; const Action ENFORCE_PRECONDITION_ACTION = 4; // an Update consists of a command and its associated data. struct UpdateCommand { Action action; ResourceDescription resource; }; typedef sequence UpdateCommandSequence; // updates can raise these exeptions exception PreconditionFailed { string reason }; exception UpdateError { string reason; }; exception UnknownResource{ string reason; }; // the update service interface ResourceUpdateService { // generate identifiers for use in create_resource and CREATE_RESOURCE_ACTION ResourceIDSequence create_resource_ids( in ResourceID prototype, in int how_many ) raises ( UnknownResource ); // create a new resource with the given description and identifier ResourceID create_resource( in ResourceDescription new_resource ) raises( PreconditionFailed, UpdateError ); // update the resource that matches precondition according to the resource description void set_values( in ResourceDescription precondition, in ResourceDescription resource ) raises( Preconditionfailed, UpdateError ); // delete the resource that matches the given description void delete_resource( in ResourceDescription resource ) raises( Preconditionfailed, UpdateError ); // perform multiple updates in one operation void apply_updates( UpdateCommandSequence updates ) raises( Preconditionfailed, UpdateError ); }; }; #endif // _DAF_UPDATE_IDL_