Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-02


oracle.irm.engine.core.general
Interface LabelOperations


public interface LabelOperations

Operations on labels. Provides utilities for working with labels and collections of labels.

Instance

The methods on LabelOperations can be invoked using LabelOperationsInstance.


Method Summary
 Collection<Label> copyLabels(Collection<Label> labels, int length)
          Copy a set of labels.
 Label getLabel(Collection<Label> labels, Locale[] locales)
          Get a label from a collection.
 Label getUnknownLabel(Locale locale)
          Get the unknown label.
 Collection<Label> sortLabels(Collection<Label> labels, Locale[] locales)
          Sort labels into a locale preference order.
 void validateLabel(Label label, int name, int description)
          Validate the name and description lengths of a label.
 void validateLabels(Collection<Label> labels, int name, int description)
          Validate the name and description lengths of a set of label values.

 

Method Detail

getLabel

Label getLabel(Collection<Label> labels,
               Locale[] locales)
Get a label from a collection. Give a set of locales, find the most appropriate label.
Parameters:
labels - the set of labels. This parameter is optional, it is valid to pass null or an empty collection.
locales - locales. The labels are searched in the same order as the provided array.
Returns:
the matched label. If no label is available the 'unknown' label is returned. This method will never return null.

getUnknownLabel

Label getUnknownLabel(Locale locale)
Get the unknown label. The unknown label is a default label with the words no label available. The unknown label can be used if a label is not available for an object.
Parameters:
locale - locale. The locale required.
Returns:
the unknown label. This method will never return null.

copyLabels

Collection<Label> copyLabels(Collection<Label> labels,
                             int length)
Copy a set of labels. Performs a deep copy of the label attributes. The Name property is also changed to reflect the label has been copied. For example, in English, the label Top Secret would turn into Copy Of Top Secret. If the new label name exceeds the maximum length provided the copied name is truncated.
Parameters:
labels - the set of labels to copy. This parameter is optional, it is valid to pass null or an empty collection.
length - maximum label name size. Set the size to 0 if there is no limit of the length of the name.
Returns:
the copied labels. If applicable, this method will return an empty collection rather than null to indicate no results.

sortLabels

Collection<Label> sortLabels(Collection<Label> labels,
                             Locale[] locales)
Sort labels into a locale preference order. This method allows a set of labels to be sorted based on a locale preference order. The desktop uses the label order as a fall back mechanism when displaying classification details. If there is no appropriate label to display to the user the first label is displayed.
Parameters:
labels - the set of labels to sort. This parameter is optional, it is valid to pass null or an empty collection.
locales - the locale(s) sort order. If no locales are specified, the default locale is used as the only sort criteria. This parameter is optional, it is valid to pass null.
Returns:
the sorted labels. If applicable, this method will return an empty collection rather than null to indicate no results.

validateLabels

void validateLabels(Collection<Label> labels,
                    int name,
                    int description)
                    throws IllegalArgumentException
Validate the name and description lengths of a set of label values.
Parameters:
labels - labels to validate. This parameter is optional, it is valid to pass null or an empty collection.
name - maximum name size.
description - maximum description size. Ignored if a label does not have a maximum size.
Throws:
IllegalArgumentException - if either the name or description have invalid lengths.

validateLabel

void validateLabel(Label label,
                   int name,
                   int description)
                   throws IllegalArgumentException
Validate the name and description lengths of a label.
Parameters:
label - label to validate.
name - maximum name size.
description - maximum description size. Ignored if a label does not have a description.
Throws:
IllegalArgumentException - if either the name or description have invalid lengths.

Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-02


Copyright © 2010, Oracle. All rights reserved.