Skip navigation links

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

E12907-03


oracle.irm.engine.core.feature
Interface FeatureOperations


public interface FeatureOperations

Operations for obtaining and manipulating desktop features.

Instance

The methods on FeatureOperations can be invoked using FeatureOperationsInstance.


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

 

Method Detail

listFeatures

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

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

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

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

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

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

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

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

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

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

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

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

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

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.