RAD Object Naming Conventions

RAD object names follow naming conventions and should be easy for clients to recognize.

  • The domain portion of RAD object names follows a reverse-dotted naming convention that prevents collisions in rad's flat object namespace. This convention typically resembles a Java package naming scheme:

    com.oracle.solaris.rad.zonemgr
    com.oracle.solaris.rad.usermgr
    org.example.os.rad.ips
    ...
  • To distinguish a rad API from a native API designed and implemented for a specific language, include "rad." in the API name.

    name="com.oracle.solaris.rad.zonemgr"
  • With the goal of storing objects with names consumers would expect, APIs, and the domains of the objects defined within them, should share the same name. This practice makes the mapping between the two easily identifiable by both the module consumer and module developer.

  • Identifying an interface object is made simpler by adhering to a "type=interface" convention within the object name.

    property name="name" access="ro" type="integer"

A a typical API might look like the following:

<api  xmlns="https://xmlns.oracle.com/radadr"
       name="com.oracle.solaris.rad.zonemgr">
      <version major="1" minor="0"/>
      <interface name="ZoneInfo"> <!-- Information about the current zone  -->
      <property name="name" access="ro" type="integer"/>

          ...

        </interface>
</api>

Within the module, the API would look like the following:

int
_rad_init(void)

    {
    ...
          adr_name _t *zname = adr_name_vcreate(MOD_DOMAIN, 1, "type", "ZoneInfo");
          conerr_t cerr = rad_cont_insert_singleton(&rad_container, zname, &interface_ZoneInfo_svr);
          adr_name_rele(zname);
 

         if (cerr != CE_OK) {
             rad_log(RL_ERROR, "failed to insert module in container");
             return(-1);
         }
        return (0);
}

On the consumer side (Python), the API would look like the following:

import rad.connect as radcon
import rad.bindings.com.oracle.solaris.rad.zonemgr as zonemgr

# Create a connection and retrieve the ZoneInfo object
with radcon.connect_unix() as rc:
    zinfo = rc.get_object(zonemgr.ZoneInfo())
    print zinfo.name