com.sun.pkg.client
Class Manifest

java.lang.Object
  extended by com.sun.pkg.client.Manifest

public class Manifest
extends java.lang.Object

A Manifest is a list of actions within a package.

Author:
trm

Constructor Summary
Manifest(Image img, Fmri pi)
           
 
Method Summary
 int filterByVariants(java.util.Map<java.lang.String,java.lang.String> imageVariants)
          Remove all actions that are not selected by the image Variants Returns # of actions removed
 Action[] findDuplicates()
          If this package has a duplicate action, return one such pair.
<T extends Action>
java.util.List<T>
getActionsByType(java.lang.Class<T> actionClass)
          Obtain the actions of a given type.
 java.lang.String getAttribute(java.lang.String name)
          Returns a package attribute defined by a set action.
 int getPackageSize()
          Returns the size of the package.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Manifest

public Manifest(Image img,
                Fmri pi)
         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getActionsByType

public <T extends Action> java.util.List<T> getActionsByType(java.lang.Class<T> actionClass)
Obtain the actions of a given type.

Parameters:
actionClass - - the desired type of operation
Returns:
a list of the actions of the given type

findDuplicates

public Action[] findDuplicates()
If this package has a duplicate action, return one such pair.

Actions are considered duplicates if they are equal based on the Action.equal method, but if they are different. The idea here is to catch broken manifests that are inconsistent within itself.


filterByVariants

public int filterByVariants(java.util.Map<java.lang.String,java.lang.String> imageVariants)
Remove all actions that are not selected by the image Variants Returns # of actions removed


getAttribute

public java.lang.String getAttribute(java.lang.String name)
Returns a package attribute defined by a set action.

Returns:
a package attribute for the given name, or null if there is no such attribute

getPackageSize

public int getPackageSize()
Returns the size of the package. The size of the package is defined as the sum of the pkg.size attributes of the actions within the Manifest.

Returns:
the size of the package