All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.mb.MBManifest

java.lang.Object
   |
   +----com.ibm.beans.mb.MBManifest

public final class MBManifest
extends Object
implements Serializable
A class that reads and writes manifest files. Don't even think about subclassing it. MBManifest is for use only by persons who intend to subclass RepositoryModel to handle a custom repository type. If you are not writing a new RepositoryModel, please hit the Back button on your browser now and kindly attempt to forget that this class even exists. Thank you.


Constructor Index

 o MBManifest()
Constructs a new MBManifest.

Method Index

 o add(int)
Creates a new empty MBManifestSection with the specifed ID and adds it to the manifest.
 o add(int, String, String)
Adds the given <key, value> pair to the MBManifestSection indicated by id.
 o add(String)
Adds an MBManifestSection for the given nameValue.
 o add(String, byte[])
Adds an ObjectByteArray to the MBManifestSection that contains the <"Name", nameValue> pair.
 o add(String, String, String)
Adds the given <key, value> pair to the MBManifestSection that has a "Name" of nameValue.
 o checkSigningInformation()
Determine whether this MBManifest contains a moniker of the form "META-INF/XXXXX.SF", in which case this is a Signed Repository.
 o elements()
Gets an Enumeration of the sections Vector.
 o findSectionByKey(String)
Finds the first MBManifestSection that contains the key.
 o findSectionByValue(String)
Finds the first MBManifestSection that contains nameValue as the value for the key "Name".
 o findSectionsByKey(String)
Gets a Vector of all MBManifestSections that contain key.
 o getBeanElement(String)
Gets MBManifestSection that has moniker that matches beanName according to the JavaBean coding and naming specs.
 o getBeanElements(String)
Gets a Vector of all MBManifestSections that have monikers that match beanName according to the JavaBean coding and naming specs.
 o getCommonMBElements()
Gets a Vector of all MBManifestSections that contain Name keys but do not contain MBInstN keys.
 o getDependsOnElements(String)
Gets a Vector of all MBManifestSections that have monikers listed in the Depends-On tag in the section specified by beanMoniker.
 o getJavaBeans()
Gets a Vector of Strings of the nameValues from the <"Name", nameValue> pairs of all MBManifestSections that are contain the <"Java-Bean", "True"> pair.
 o getNextID()
Gets the next ID number.
 o getNextMBInst()
Gets the next MBInstN key.
 o getObjectByteArray(String)
Gets the ObjectByteArray reference from the MBManifestSection that contains the <"Name", nameValue> pair.
 o initializeManifest()
Initializes the manifest.
 o isDependsOnManifest()
Determine whether this MBManifest contains any Depends-On: tags.
 o isIBMBeanExtenderManifest()
Determine whether this MBManifest has IBM Bean Extender manifest extensions.
 o outputManifest(OutputStream)
Writes the manifest to the given OutputStream.
 o parseManifest(InputStream)
 o query(int, String)
Gets the value from the <key, value> pair in the MBManifestSection identified by id.
 o updateDigests()
Adds new SHA-1 and MD5 MessageDigest information to the manifest for this MBElement.

Constructors

 o MBManifest
 protected MBManifest()
Constructs a new MBManifest.

Methods

 o parseManifest
 protected boolean parseManifest(InputStream is) throws IOException
 o outputManifest
 protected boolean outputManifest(OutputStream os)
Writes the manifest to the given OutputStream. The caller must close the OutputStream.

Parameters:
os - The OutputStream that receives the manifest.
Returns:
true if successful, false otherwise.
 o add
 protected void add(int id)
Creates a new empty MBManifestSection with the specifed ID and adds it to the manifest.

Parameters:
id - The ID of the new Section.
See Also:
MBManifestSection
 o add
 protected MBManifestSection add(int id,
                                 String key,
                                 String value)
Adds the given <key, value> pair to the MBManifestSection indicated by id. If a section with that ID doesn't exist, this method creates a new MBManifestSection and adds the specified pair.

Parameters:
ID - The id of the MBManifestSection.
key - The key to be added.
value - The value to be added.
Returns:
The MBManifestSection that has been created and/or modified.
See Also:
MBManifestSection
 o add
 protected MBManifestSection add(String nameValue,
                                 String key,
                                 String value)
Adds the given <key, value> pair to the MBManifestSection that has a "Name" of nameValue. If the nameValue is not found, an MBManifestSection will be created with a <"Name", nameValue> pair, and the <key, value> pair will be added to that MBManifestSection.

Parameters:
nameValue - The value of the "Name" key in the desired MBManifestSection.
key - The key to be added.
value - The value to be added.
Returns:
The MBManifestSection that has been created and/or modified.
 o add
 protected MBManifestSection add(String nameValue)
Adds an MBManifestSection for the given nameValue. The section will be created with a <"Name", nameValue> pair. If a section with this <"Name", nameValue> pair already exists, do nothing.

Parameters:
nameValue - The value to be used with the "Name" key in the created MBManifestSection.
Returns:
The MBManifestSection that has been added.
 o add
 protected void add(String nameValue,
                    byte b[])
Adds an ObjectByteArray to the MBManifestSection that contains the <"Name", nameValue> pair. If a section with the <"Name", nameValue> pair does not exist, do nothing.

Parameters:
nameValue - The value of the "Name" key in the target MBManifestSection.
b - The ObjectByteArray to be set.
 o getObjectByteArray
 protected byte[] getObjectByteArray(String nameValue)
Gets the ObjectByteArray reference from the MBManifestSection that contains the <"Name", nameValue> pair. If a section with the <"Name", nameValue> pair does not exist, do nothing.

Parameters:
nameValue - The value of the "Name" key in the target MBManifestSection.
Returns:
The ObjectByteArray.
 o getJavaBeans
 protected Vector getJavaBeans()
Gets a Vector of Strings of the nameValues from the <"Name", nameValue> pairs of all MBManifestSections that are contain the <"Java-Bean", "True"> pair.

Returns:
Vector of Strings containing the names of the Java Beans.
 o query
 protected String query(int id,
                        String key)
Gets the value from the <key, value> pair in the MBManifestSection identified by id.

Parameters:
id - The ID of the MBManifestSection.
key - The key whose value is being obtained.
Returns:
The desired value or null if the value could not be found.
 o elements
 protected Enumeration elements()
Gets an Enumeration of the sections Vector. The Enumeration can be used to step through the MBManifestSections of this MBManifest.

Returns:
An Enumeration of the MBManifest sections Vector.
 o findSectionByValue
 protected MBManifestSection findSectionByValue(String nameValue)
Finds the first MBManifestSection that contains nameValue as the value for the key "Name".

Parameters:
nameValue - The value to be matched.
Returns:
The first MBManifestSection that contains the nameValue argument.
 o findSectionByKey
 protected MBManifestSection findSectionByKey(String key)
Finds the first MBManifestSection that contains the key.

Parameters:
key - The key to be matched.
Returns:
The first MBManifestSection that contains key.
 o findSectionsByKey
 protected Vector findSectionsByKey(String key)
Gets a Vector of all MBManifestSections that contain key.

Parameters:
key - The key to be matched.
Returns:
A Vector of all MBManifestSections that contain key.
 o getBeanElements
 protected Vector getBeanElements(String beanName)
Gets a Vector of all MBManifestSections that have monikers that match beanName according to the JavaBean coding and naming specs.

Parameters:
beanName - The bean name to be matched.
Returns:
A Vector of all matching MBManifestSections.
See Also:
MBManifestSection
 o getBeanElement
 protected MBManifestSection getBeanElement(String beanName)
Gets MBManifestSection that has moniker that matches beanName according to the JavaBean coding and naming specs.

Parameters:
beanName - The bean name to be matched.
Returns:
A matching MBManifestSection.
See Also:
MBManifestSection
 o getDependsOnElements
 protected Vector getDependsOnElements(String beanMoniker)
Gets a Vector of all MBManifestSections that have monikers listed in the Depends-On tag in the section specified by beanMoniker. Also includes the section that has the Depends-On tag.

Parameters:
beanMoniker - The bean moniker whose Depends-On tag we're using.
Returns:
A Vector of all matching MBManifestSections.
See Also:
MBManifestSection
 o getCommonMBElements
 protected Vector getCommonMBElements()
Gets a Vector of all MBManifestSections that contain Name keys but do not contain MBInstN keys.

Returns:
A Vector of all matching MBManifestSections.
See Also:
MBManifestSection
 o isIBMBeanExtenderManifest
 protected boolean isIBMBeanExtenderManifest()
Determine whether this MBManifest has IBM Bean Extender manifest extensions.

Returns:
true if this MBManifest has IBM Bean Extender manifest extensions; false otherwise.
 o isDependsOnManifest
 protected boolean isDependsOnManifest()
Determine whether this MBManifest contains any Depends-On: tags.

Returns:
true if this MBManifest contains any Depends-On: tags; false otherwise.
 o checkSigningInformation
 protected boolean checkSigningInformation()
Determine whether this MBManifest contains a moniker of the form "META-INF/XXXXX.SF", in which case this is a Signed Repository. This method also cleans up any META-INF files that might have slipped into the Manifest (ie, when opening a DirectoryModelRepository).

Returns:
true if this Repository is Signed, false otherwise.
 o getNextID
 protected int getNextID()
Gets the next ID number.

Returns:
The next ID number.
 o getNextMBInst
 protected String getNextMBInst()
Gets the next MBInstN key.

Returns:
The next MBInstN key.
 o initializeManifest
 protected void initializeManifest()
Initializes the manifest. This method assumes that the manifest is indeed empty.

 o updateDigests
 protected synchronized void updateDigests()
Adds new SHA-1 and MD5 MessageDigest information to the manifest for this MBElement. This method is called immediately before writing a manifest.

See Also:
MessageDigest

All Packages  Class Hierarchy  This Package  Previous  Next  Index