|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.taverna.raven.spi.AbstractArtifactFilter
net.sf.taverna.raven.spi.Profile
public class Profile
A Profile in this context is a set of Artifacts that are known to work in conjunction with one another. With Raven's ability to deploy components at runtime and update in a very fine grained manner the issue of support can become tangled, the potential variety of coexisting (and therefore possibly interacting) software components may cause incompatibilities that are only apparent at runtime. For this reason some organisations such as OMII-UK may with to provide a 'blessed' combination of component versions which have had some level of integration testing within their host environment.
The profile is held and distributed in the form of an XML file with the following structure:
<profile>
<artifact groupId="..." artifactId="..." version="..."/>
...
</profile>
Note that as this is only used by the SPI mechanism there is no need to
include dependencies of these artifacts, the only entries required are those
which directly contain SPI implementations
| Constructor Summary | |
|---|---|
Profile(boolean strict)
|
|
Profile(java.io.InputStream is,
boolean strict)
Create a Profile and initialize it from the specified InputStream of XML (see class description) |
|
| Method Summary | |
|---|---|
void |
addArtifact(Artifact artifact)
Allow an artifact to be added to the profile at runtime |
void |
addArtifactsForPlugins(java.io.InputStream pluginsDefinitionStream)
Adds artifacts contains in the profile definition for a Plugin. |
void |
addSystemArtifact(Artifact artifact)
|
Artifact |
discoverArtifact(java.lang.String groupId,
java.lang.String artifactId)
Select the highest version Artifact defined in the registry that
fits the artifactId and groupId. |
Artifact |
discoverArtifact(java.lang.String groupId,
java.lang.String artifactId,
Repository repository)
Select the highest version Artifact defined in the registry that
fits the artifactId and groupId. |
java.util.Set<Artifact> |
filter(java.util.Set<Artifact> intersecting)
Return the intersection of the set of Artifacts in this Profile and that presented to this method if strict is true, otherwise return the intersection plus all artifacts in the set which have no match within the profile when only groupId and artifactId are taken into account. |
java.util.Set<Artifact> |
getArtifacts()
Get the artifacts that forms part of this profile. |
java.lang.String |
getName()
Return the name of the profile, or null if no name is defined |
java.util.Set<Artifact> |
getSystemArtifacts()
Get the subset of getArtifacts() that is marked as being system
artifacts by this profile. |
java.lang.String |
getVersion()
Return the version string of the Profile, or 'NO VERSION' if a version is not defined |
void |
removeArtifact(Artifact artifact)
Allow an artifact to be removed from the profile at runtime |
void |
removeSystemArtifact(Artifact artifact)
|
void |
write(java.io.OutputStream outputStream)
Generate the XML representation of this profile, write to given output stream. |
| Methods inherited from class net.sf.taverna.raven.spi.AbstractArtifactFilter |
|---|
addArtifactFilterListener, removeArtifactFilterListener |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Profile(boolean strict)
public Profile(java.io.InputStream is,
boolean strict)
throws InvalidProfileException
If the strict setting is set to true then the filter operation is a straight set intersection of the set to be filtered and the set of artifacts within this profile. If false then the behaviour is slightly more complex - an artifact is allowed through the filter if either all three fields (groupId, artifactId and version) match or there are no matches on the groupId and artifactId pair. This effectively allows through components which are unknown to the profile and can be used to compose the union of multiple profiles by adding each one to the filter chain in turn.
is - InputStream to read XML fromstrict - only allows exact matches to the profile through if true, if
false then artifacts which don't exist in the profile in any
version will be allowed through.
InvalidProfileException - if there is any problem reading or parsing the profile XML.| Method Detail |
|---|
public void addArtifact(Artifact artifact)
artifact - public void addArtifactsForPlugins(java.io.InputStream pluginsDefinitionStream)
pluginsDefinitionStream - public void addSystemArtifact(Artifact artifact)
public Artifact discoverArtifact(java.lang.String groupId,
java.lang.String artifactId)
Artifact defined in the registry that
fits the artifactId and groupId. Useful for allowing artifacts to be
defined without version with the profile dictating the version to be
used.
Versions are compared as described in VersionComparator.
groupId - artifactId -
VersionComparator
public Artifact discoverArtifact(java.lang.String groupId,
java.lang.String artifactId,
Repository repository)
Artifact defined in the registry that
fits the artifactId and groupId. Useful for allowing artifacts to be
defined without version with the profile dictating the version to be
used.
Versions are compared as described in VersionComparator.
groupId - artifactId - repository - Repository to use for finding nested dependencies
VersionComparatorpublic java.util.Set<Artifact> filter(java.util.Set<Artifact> intersecting)
intersecting - List of Artifacts to filter
public java.util.Set<Artifact> getArtifacts()
Set of Artifact.public java.lang.String getName()
public java.util.Set<Artifact> getSystemArtifacts()
getArtifacts() that is marked as being system
artifacts by this profile. A system artifact is supposed to be added by
PreLauncher.addURLToClassPath(java.net.URL)
and thereby available even to artifacts that don't declare it as a
dependency. This is mainly useful for global XML parsers and similar
implementations that are discovered by non-Raven SPIs.
public java.lang.String getVersion()
public void removeArtifact(Artifact artifact)
artifact - public void removeSystemArtifact(Artifact artifact)
public void write(java.io.OutputStream outputStream)
throws javax.xml.parsers.ParserConfigurationException,
javax.xml.transform.TransformerFactoryConfigurationError,
javax.xml.transform.TransformerException
outputStream - Stream to output profile as XML.
javax.xml.parsers.ParserConfigurationException - If a DocumentBuilder could not be created
javax.xml.transform.TransformerFactoryConfigurationError - If a Transformer could not be created
javax.xml.transform.TransformerException - If the XML document could not be transformed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||