Oracle Solaris Trusted Extensions Developer's Guide

Obtaining Label Range Objects

The getLabelRange static factory creates a label range object. The getUserRange and getDeviceRange static factories obtain label range objects for a user and a device, respectively. The getUpper and getLower methods are used to obtain the upper and lower labels of the range, respectively. In addition, the inRange method determines whether the specified label is in a range. For more information about the inRange method, see Comparing Label Objects.

The getUserRange and getDeviceRange static factories correspond to the getuserrange() and getdevicerange() routines. For more information, see Obtaining Label Ranges and the getdevicerange(3TSOL) man page.

The following constructor and method descriptions include the prototype declaration for each constructor:

public static Range getDeviceRange(java.lang.String device)

The getDeviceRange static factory obtains the label range of a user-allocatable device. If no label range is specified for the device, the default range has an upper bound of ADMIN_HIGH and a lower bound of ADMIN_LOW.

You can use the list_devices command to show the label range for a device. See the list_devices(1) and getdevicerange(3TSOL) man pages.

public static <L extends SolarisLabel,U extends SolarisLabel> Range getLabelRange(L lower, U upper)

The getLabelRange static factory creates a label range. The static factory takes the lower bound value in the range and the upper bound, or clearance, as parameters. An exception is thrown if upper does not dominate lower.

public L getLower()

The getLower method returns the lower portion of the range.

public U getUpper()

The getUpper method returns the upper portion of the range.

public static Range getUserRange(java.lang.String user)

The getUserRange static factory obtains the label range of the specified user. The lower bound in the range is used as the initial workspace label when a user logs in to a multilevel desktop. The upper bound, or clearance, is used as an upper limit to the available labels that a user can assign to labeled workspaces.

The default value for a user's label range is specified in the label_encodings file. The value can be overridden by the user_attr file.

For more information, see the getuserrange(3TSOL) man page.