com.sun.n1.sps.model.component
Interface Component

All Superinterfaces:
PluginMember, SummaryComponent

public interface Component
extends SummaryComponent

A component object is used to model a software component, including its associated resources, steps required to install and uninstall it, and available controls once installed.


Method Summary
 CategoryIDSet getCategories()
          Returns a set of IDs of the categories that this component is a member of.
 java.lang.String getLimitToHostSet()
          Returns the name of the host set whose members define the allowed targets for this component, or null if there is no limit on the targets for this component.
 VarDecl[] getLocalVarList()
          Returns the variables contained in the locally declared component variable list.
 RsrcInfo getResource()
          Returns the resource associated with this component.
 java.lang.String getSchemaVersion()
          Returns the schema version used by this component.
 TargetRef getTargetRef()
          Returns the component's TargetRef, if the component is targetable.
 boolean isInstanceOf(ComponentID otherCompID)
          Returns true if this component is an instance of the component with the passed ID.
 void readFromXML(java.io.InputStream comp)
          Sets the content of this component based on the component defined in XML format contained in the passed stream.
 void writeToXML(java.io.OutputStream out)
          Writes the component content to the passed stream in canonical XML format.
 
Methods inherited from interface com.sun.n1.sps.model.component.SummaryComponent
getAuthor, getDescription, getExtendsTypeName, getFullName, getID, getLabel, getLocalIgnorePaths, getLocalInstallPath, getLocalLimitToHostSet, getModifier, getName, getPath, getPlatform, getRootID, getSoftwareVendor, getTimeStamp, getUserID, getVersionNumber, getVisibility, isDerivedComponent, isSimpleComponent
 
Methods inherited from interface com.sun.n1.sps.model.PluginMember
getPluginID
 

Method Detail

getSchemaVersion

java.lang.String getSchemaVersion()
Returns the schema version used by this component.

Returns:
the schema version

getLimitToHostSet

java.lang.String getLimitToHostSet()
Returns the name of the host set whose members define the allowed targets for this component, or null if there is no limit on the targets for this component.

The main difference between the platform and the limitToHostSet attributes is that when a component is targeted at a virtual host, the limitToHostSet is tested against the virtual host, whereas the platform is tested against the root physical host of that virtual host. Accordingly, setting a limitToHostSet but no platform allows a component to be installed on a particular set of virtual hosts that might reside on different physical platforms (as is the case with weblogic applications). Setting a platform but no limitToHostSet allows a component to be installed on any host that is rooted by a physical host with the given platform. Setting both allows one to constrain both degrees.

If this component has a non-null local limitToHostSet, then it is returned, otherwise if this component is a derived component, then the limitToHostSet of the base component is returned, otherwise null is returned.

Returns:
the name of the limiting host set.
Throws:
java.lang.NullPointerException - if called with an unsaved change to the extends type name.
See Also:
SummaryComponent.getLocalLimitToHostSet()

getLocalVarList

VarDecl[] getLocalVarList()
Returns the variables contained in the locally declared component variable list. Each element in the returned array represents component variable. Modification of the result will not affect this object.

In a derived component, variables that have the same name as that of a variable in the base component serve to override the base variable. Variables with unique names serve to define new variables.

Returns:
the local component variables

getCategories

CategoryIDSet getCategories()
Returns a set of IDs of the categories that this component is a member of. Modifications to the result will not affect this object.

Returns:
the IDs of the categories that this component is a member of

getResource

RsrcInfo getResource()
Returns the resource associated with this component.

If this component is composite, null is returned. Otherwise, if this component has a non-null local resource, it is returned. Otherwise, if this is a derived component with a null resource modifier, the resource of the base component is returned. Otherwise, null is returned.

Returns:
the resource
See Also:
SummaryComponent.isSimpleComponent()

getTargetRef

TargetRef getTargetRef()
Returns the component's TargetRef, if the component is targetable. Uses the local TargetRef if defined, otherwise if this component is derived, returns the TargetRef of the base component, otherwise returns null.

Returns:
the component's TargetRef, or null if there isn't one.

isInstanceOf

boolean isInstanceOf(ComponentID otherCompID)
Returns true if this component is an instance of the component with the passed ID. A component C1 is an instance of a component C2 if C1 and C2 have the same ID, or the base component type of C1 is an instance of C2.

Returns:
true if this component is an instance of the component with the passed ID.

writeToXML

void writeToXML(java.io.OutputStream out)
Writes the component content to the passed stream in canonical XML format. The canonical XML format of a component is equivalent to the XML originally used to create the component, but need not be textually equal. The canonical XML format may contain different whitespace, may reorder the attributes of various elements, and may omit optional attributes whose value is empty or equal to their default value.

Note that no validation is performed prior to writing output. The output may not conform to a valid XML component if this component does not contain one or more required members.

Output is written using UTF-8 encoding.

Parameters:
out - the stream onto which to write the component in canonical XML format.

readFromXML

void readFromXML(java.io.InputStream comp)
Sets the content of this component based on the component defined in XML format contained in the passed stream.

The passed stream must contain a component conforming to the component XML schema. If it does not, an error is raised. Note that when errors are raised, this component may have have state reflecting a partially read component.

The byte order mark (BOM) of the passed stream is used to detemrine the encoding of the stream. If no BOM is present, UTF-8 is assumed.

Parameters:
comp - the stream containing the XML component to read
Throws:
SystemModelParseException - if the component in the passed string does not conform to the XML component schema.
java.lang.UnsupportedOperationException - if this component is read only.