Skip navigation links

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

E12907-03


oracle.irm.engine.core.feature
Class FeatureOperationsInstance

java.lang.Object
  extended by oracle.irm.engine.core.feature.FeatureOperationsInstance


public final class FeatureOperationsInstance
extends Object

Operations for obtaining and manipulating desktop features.

This class provides static methods for a set of procedural style methods. The methods can be made to appear as global methods by using import static. e.g.

import static oracle.irm.engine.core.feature.FeatureOperationsInstance.*;

Method Summary
static Collection<Feature> addFeatures(Collection<Feature> features, String[] ids)
          Add features to a collection by feature identity.
static Feature getFeature(String id)
          Get a feature.
static Label getFeatureLabel(Locale locale, String id)
          Get a feature label.
static Collection<Feature> getFeatures(String[] ids)
          Get a set of features from an array of feature identities.
static boolean hasPrimaryFeature(Collection<Feature> features)
          Check a collection of features has at least one primary feature.
static boolean hasRecordedFeature(Collection<Feature> features)
          Check whether a collection of features includes recorded feature.
static boolean isPrimaryFeature(Feature feature)
          Check whether a feature is a primary feature.
static Collection<Label> listFeatureLabels(Locale locale, String[] ids)
          List feature labels.
static Collection<Feature> listFeatures()
          List features.
static Collection<Feature> listPrimaryFeatures()
          List primary features.
static Collection<Feature> listRecordableFeatures()
          List the features that can be recorded by the desktop application.
static Collection<Feature> stripFeatures(Collection<Feature> features, String[] ids)
          Remove features from a collection by feature identity.
static Collection<Feature> stripPrimaryFeatures(Collection<Feature> features)
          Remove primary features from a collection of features.
static Collection<Feature> stripRecordedFeatures(Collection<Feature> features)
          Remove recorded features from a collection of features.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

listFeatures

public static Collection<Feature> listFeatures()
List features. Lists all known features.

Listing supported features

The following code demonstrates how to list the supported features that can be used when defining a LicenseCriteria. The code uses a utility method to show the object properties together with captions in the default locale.
 import static oracle.irm.engine.core.feature.FeatureOperationsInstance.listFeatures;
 import static oracle.irm.engine.system.i18n.VisualizationInstance.displaySummary;
 
 import java.util.Collection;
 import java.util.Locale;
 
 import oracle.irm.engine.core.feature.Feature;
 import oracle.irm.engine.core.feature.UnknownFeatureException;
 
 public class ListFeatures
 {
        public static void main(String[] args) throws UnknownFeatureException {
 
            Locale locale = Locale.getDefault();
 
         Collection<Feature> features = listFeatures();
 
         for (Feature feature : features)
         {
                String summary = displaySummary(feature, locale);
 
                System.out.println(summary);
                System.out.println("");
         }
        }
 }
Returns:
the list of features. If applicable, this method will return an empty collection rather than null to indicate no results.

listRecordableFeatures

public static Collection<Feature> listRecordableFeatures()
List the features that can be recorded by the desktop application. Not all application features can have their usage recorded. For example, the edit operations is not recorded.
Returns:
the list of features that can be recorded by the desktop. If applicable, this method will return an empty collection rather than null to indicate no results.
See Also:
Record

listPrimaryFeatures

public static Collection<Feature> listPrimaryFeatures()
List primary features.
Returns:
the list of primary features. If applicable, this method will return an empty collection rather than null to indicate no results.
See Also:
isPrimaryFeature

getFeature

public static Feature getFeature(String id)
                          throws UnknownFeatureException
Get a feature. Get a feature from the feature Id.
Parameters:
id - the feature identity.
Returns:
the feature for the requested feature identity. This method will never return null.
Throws:
UnknownFeatureException - if the feature identity is unknown.

getFeatures

public static Collection<Feature> getFeatures(String[] ids)
                                       throws UnknownFeatureException
Get a set of features from an array of feature identities. Converts an array of feature identities into a collection of Feature objects.
Parameters:
ids - an array of feature identities.
Returns:
the collection of features. If applicable, this method will return an empty collection rather than null to indicate no results.
Throws:
UnknownFeatureException - if the feature identity is unknown.
See Also:
Id

isPrimaryFeature

public static boolean isPrimaryFeature(Feature feature)
Check whether a feature is a primary feature. A primary feature is an operation that can be directly requested by the desktop and used immediately. Examples include opening content or sealing content. A non primary feature is something requested on-demand once content is in use. e.g. printing or editing.
Parameters:
feature - the feature.
Returns:
true if the feature is a primary feature.

hasPrimaryFeature

public static boolean hasPrimaryFeature(Collection<Feature> features)
Check a collection of features has at least one primary feature.
Parameters:
features - a collection of features. This parameter is optional, it is valid to pass null or an empty collection.
Returns:
whether there is a primary feature in the collection.

hasRecordedFeature

public static boolean hasRecordedFeature(Collection<Feature> features)
Check whether a collection of features includes recorded feature. This method checks the Record property of a feature.
Parameters:
features - a collection of features. This parameter is optional, it is valid to pass null or an empty collection.
Returns:
whether there is an recorded feature in the collection.

stripFeatures

public static Collection<Feature> stripFeatures(Collection<Feature> features,
                                                String[] ids)
Remove features from a collection by feature identity.
Parameters:
features - a collection of features to examine. This parameter is optional, it is valid to pass null or an empty collection.
ids - an array of feature identities.
Returns:
the collection of features. If applicable, this method will return an empty collection rather than null to indicate no results.
See Also:
Id

addFeatures

public static Collection<Feature> addFeatures(Collection<Feature> features,
                                              String[] ids)
                                       throws UnknownFeatureException
Add features to a collection by feature identity.
Parameters:
features - a collection of features. This parameter is optional, it is valid to pass null or an empty collection.
ids - an array of feature identities.
Returns:
the collection of features with the appropriate features added. If applicable, this method will return an empty collection rather than null to indicate no results.
Throws:
UnknownFeatureException - if the feature identity is unknown.
See Also:
Id

stripRecordedFeatures

public static Collection<Feature> stripRecordedFeatures(Collection<Feature> features)
Remove recorded features from a collection of features.
Parameters:
features - a collection of features. This parameter is optional, it is valid to pass null or an empty collection.
Returns:
the recorded features, or an empty collection if none exist. If applicable, this method will return an empty collection rather than null to indicate no results.

stripPrimaryFeatures

public static Collection<Feature> stripPrimaryFeatures(Collection<Feature> features)
Remove primary features from a collection of features.
Parameters:
features - a collection of features. This parameter is optional, it is valid to pass null or an empty collection.
Returns:
the primary features, or an empty collection if none exist. If applicable, this method will return an empty collection rather than null to indicate no results.

getFeatureLabel

public static Label getFeatureLabel(Locale locale,
                                    String id)
                             throws UnknownFeatureException
Get a feature label. A label consists of a human read-able name and description. This name and description could be used in a user interface when selecting features.
Parameters:
locale - the locale for the label.
id - the feature identity.
Returns:
the feature name and description. This method will never return null.
Throws:
UnknownFeatureException - if the feature identity is unknown.

listFeatureLabels

public static Collection<Label> listFeatureLabels(Locale locale,
                                                  String[] ids)
                                           throws UnknownFeatureException
List feature labels. A label consists of a human read-able name and description. This name and description could be used in a user interface when selecting features.
Parameters:
locale - the locale for the label.
ids - an array of feature identities.
Returns:
the feature names and descriptions. The results are provided in the same order as the ids. If applicable, this method will return an empty collection rather than null to indicate no results.
Throws:
UnknownFeatureException - if any one of the feature identities provided is unknown.

Skip navigation links

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

E12907-03


Copyright © 2011, Oracle. All rights reserved.