Copyright @ 2002 SAP. All Rights Reserved.

com.sap.tc.complib
Interface Compartment


public interface Compartment

Compartment models one compartmnet of a development configuration. The compartmnet contains a softwware state of one software component. The software state can consist of an archive state and or a source state. The compartment also lists the build variants existin gfor this software state. Aliases for software components which are used in definitions of developement components are resolved by the alias mapping of the compartment.

Since:
1.0
Version:
1.0 August 2002

Method Summary
 void addBuildVariant(BuildVariant variant)
          add a new buile variant or overwrite existing one with same name.
 Property addProperty(java.lang.String name, java.lang.String namespaceURI)
          Adds a property to the list of properties.
 Property addProperty(java.lang.String name, java.lang.String namespaceURI, java.lang.String value)
          Adds a property to the list of properties.
 void addUsedCompartment(java.lang.String usedCompartmentName)
          add a new used compartment
 java.util.Map emptyBuildVariants()
          remove all entries from the alias map or return anew empty map
 java.util.List emptyProperties()
          Removes the entries from the list of properties, or creates a new empty property list.
 java.util.Map emptyScAliases()
          remove all entries from the alias map or return anew empty map
 java.util.Set emptyUsedCompartments()
          remove all entries from the used compartments Set or return a new empty set
 java.util.Map getBuildVariants()
          gets a Map with the build variants for this Compartment interface.
 java.lang.String getCaption()
          gets the display name
 java.lang.String getDescription()
          gets the String describing the purpose of the compartment
 boolean getHasArchiveState()
          get the information whether this compartment contains at least partially an archive state.
 java.lang.String getLocalArchiveFolder()
          Returns the name of local archive Folder where pre-installed archives are located.
 java.lang.String getName()
          get the String with the techincal name of the compartment.
 java.util.List getProperties()
          Returns the list of properties.
 Property getProperty(java.lang.String name)
          Returns the property matching the given name.
 Property getProperty(java.lang.String name, java.lang.String namespaceURI)
          Returns the property matching the given name and namespace.
 java.lang.String getSCAlias(java.lang.String targetCompartment)
          get the alias name for compartment with some SC that is used by this one.
 java.util.Map getScAliases()
          get Map with the mapping of alias name to the name of the target compartment.
 java.lang.String getScName()
          get the name of the software component contained in the compartment
 java.lang.String getScVendor()
          get the String with the vendor of the software component contained in the compartment
 SourceState getSourceState()
          gets the SourceState object with the information about the source state contained in this compartment or null if the compartment does not contain a source state
 java.util.Set getUsedCompartments()
          returns a Set with the names of all the compartments to which this compartment has a usage relationship.
 boolean hasInactiveSourceState()
          get the information whether there is an inactive source state for this compartment.
 boolean hasLocalArchivesOnly()
          returns whether this is a localOnly compartment that contains only pre-installed archives in the local archive folder
 boolean hasLocalSourceStateOnly()
          get the information whether there is a local-only source state for this compartment.
 boolean hasSourceState()
          get the information whether there is a source state for this compartment.
 boolean isActivationAllowed()
          get the information whether activation is allowed in this compartment
 boolean IsDefaultCompartment()
          get the setIsDefaultCompartment porperty.
 boolean isLocal()
          returns whether this is a localOnly compartment that has either archives or sources only locally.
 boolean isModificationAllowed()
          get the information whether development or source import is possible and allowed in this compartment
 void removeUsedCompartment(java.lang.String usedCompartmentName)
          removes a compartment from the list of used compartments
 void serialize(XMLWriter writer)
          Serializes the Compartment to the given XMLWriter.
 void serialize(XMLWriter writer, java.lang.String schemaVersion)
           
 void setCaption(java.lang.String value)
          sets the display name
 void setDefaultCompartment(boolean value)
          set the setIsDefaultDepartment property. constraint: there can be only one default compartmnets for each (sc-vandor,sc-name) combination.
 void setDescription(java.lang.String value)
          sets the String describing the purpose of the compartment
 void setHasArchiveState(boolean value)
          set the information whether this compartmnet contains an archive state
 void setLocalArchiveFolder(java.lang.String value)
          Sets the local archive Folder where pre-installed archives are located.
 void setName(java.lang.String value)
          set the String with the name of the compartment.
 void setScName(java.lang.String value)
          set the name of the software component contained in the compartment
 void setScVendor(java.lang.String value)
          set the String with the vendor of the software component contained in the compartment
 void setSourceState(SourceState value)
          sets the SourceState object for the source state contained in this compartment.
 void setUsedCompartments(java.util.Set usedCompartments)
          Deprecated.  
 void validate()
          Verifies that the object is valid.
 

Method Detail

getName

public java.lang.String getName()
get the String with the techincal name of the compartment.

setName

public void setName(java.lang.String value)
set the String with the name of the compartment. The name must be unique in the scope of the configuration

getCaption

public java.lang.String getCaption()
gets the display name

setCaption

public void setCaption(java.lang.String value)
sets the display name

getDescription

public java.lang.String getDescription()
gets the String describing the purpose of the compartment

setDescription

public void setDescription(java.lang.String value)
sets the String describing the purpose of the compartment

getHasArchiveState

public boolean getHasArchiveState()
get the information whether this compartment contains at least partially an archive state. Note that even if this method returns true, it can be a mix of sources and archives.

setHasArchiveState

public void setHasArchiveState(boolean value)
set the information whether this compartmnet contains an archive state

IsDefaultCompartment

public boolean IsDefaultCompartment()
get the setIsDefaultCompartment porperty. This is a boolean which is true if this compartnent should be used as the default for component references. this is irrelvant if this is the only compartment for the contained software component in this configuration

hasSourceState

public boolean hasSourceState()
get the information whether there is a source state for this compartment. Note that even if this method returns true, it can be a mix of sources and archives. If this method returns true, the compart is assigned to at lesat one workspace (active).

hasLocalSourceStateOnly

public boolean hasLocalSourceStateOnly()
get the information whether there is a local-only source state for this compartment.

hasInactiveSourceState

public boolean hasInactiveSourceState()
get the information whether there is an inactive source state for this compartment. If this method returns true, the compart is assigned to 2 workspaces, one inactive and one active.

isModificationAllowed

public boolean isModificationAllowed()
get the information whether development or source import is possible and allowed in this compartment
Returns:
true if allowed, false if no source state or change forbidden

isActivationAllowed

public boolean isActivationAllowed()
get the information whether activation is allowed in this compartment
Returns:
true if allowed, false if not possible

getSCAlias

public java.lang.String getSCAlias(java.lang.String targetCompartment)
get the alias name for compartment with some SC that is used by this one. This is only possible if an alias is defined. (Usually if two states of the same SC are used) The method is a convenience method so you do not hve to loop through the alias map.
Parameters:
targetCompartment - the compartmnet for which the alias should be returned
Returns:
the alias Name if an alias is defined or null if no alias is defined for the the specified target compartment
See Also:
#getSCAliases()

setDefaultCompartment

public void setDefaultCompartment(boolean value)
set the setIsDefaultDepartment property. constraint: there can be only one default compartmnets for each (sc-vandor,sc-name) combination. This is not echecked immediately e.g. by throwing an exception. Instead it will be detected when validation of the Configuration is requested.
See Also:
getIsDefaultDepartment

getScVendor

public java.lang.String getScVendor()
get the String with the vendor of the software component contained in the compartment

setScVendor

public void setScVendor(java.lang.String value)
set the String with the vendor of the software component contained in the compartment

getScName

public java.lang.String getScName()
get the name of the software component contained in the compartment

setScName

public void setScName(java.lang.String value)
set the name of the software component contained in the compartment

emptyProperties

public java.util.List emptyProperties()
Removes the entries from the list of properties, or creates a new empty property list.
Returns:
an empty list of Property instances

addProperty

public Property addProperty(java.lang.String name,
                            java.lang.String namespaceURI)
Adds a property to the list of properties.
Parameters:
name - the name of the property
namespaceURI - an URI or URL identifying the namespace to which the property belongs to.
Returns:
the new property

addProperty

public Property addProperty(java.lang.String name,
                            java.lang.String namespaceURI,
                            java.lang.String value)
Adds a property to the list of properties.
Parameters:
name - the name of the property
namespaceURI - an URI or URL identifying the namespace to which the property belongs to.
value - the simple value of the property.
Returns:
the new property

getProperty

public Property getProperty(java.lang.String name)
Returns the property matching the given name. Note, this method ignores property namespaces. If properties with the same name but different namespaces are defined, this method will always return only the first in the list of properties.
Parameters:
name - the name of the property
Returns:
a property, or null if no property with the given name exists.

getProperty

public Property getProperty(java.lang.String name,
                            java.lang.String namespaceURI)
Returns the property matching the given name and namespace.
Parameters:
name - the name of the property
namespaceURI - the namespace the property belongs to identified by a URI
Returns:
a property, or null if no property with the given name exists.

getProperties

public java.util.List getProperties()
Returns the list of properties.
Returns:
a list of Property instances, or null if no properties are defined.

getSourceState

public SourceState getSourceState()
gets the SourceState object with the information about the source state contained in this compartment or null if the compartment does not contain a source state

setSourceState

public void setSourceState(SourceState value)
sets the SourceState object for the source state contained in this compartment. You must set this property to null, if the compartment does not contain a source state

getScAliases

public java.util.Map getScAliases()
get Map with the mapping of alias name to the name of the target compartment.

emptyScAliases

public java.util.Map emptyScAliases()
remove all entries from the alias map or return anew empty map

emptyUsedCompartments

public java.util.Set emptyUsedCompartments()
remove all entries from the used compartments Set or return a new empty set

addUsedCompartment

public void addUsedCompartment(java.lang.String usedCompartmentName)
add a new used compartment

removeUsedCompartment

public void removeUsedCompartment(java.lang.String usedCompartmentName)
removes a compartment from the list of used compartments

getBuildVariants

public java.util.Map getBuildVariants()
gets a Map with the build variants for this Compartment interface. The variants are contained in a map that uses the build variants name as the key.

addBuildVariant

public void addBuildVariant(BuildVariant variant)
add a new buile variant or overwrite existing one with same name.

emptyBuildVariants

public java.util.Map emptyBuildVariants()
remove all entries from the alias map or return anew empty map

getUsedCompartments

public java.util.Set getUsedCompartments()
returns a Set with the names of all the compartments to which this compartment has a usage relationship. The compartmnets that are listed need not be actually used in the content of the compartmnet but they are allowed two be used.

setUsedCompartments

public void setUsedCompartments(java.util.Set usedCompartments)
Deprecated.  

sets the Set with the names of all the compartments to which this compartment has a usage relationship. The compartmnets that are listed need not be actually used in the content of the compartmnet but they are allowed two be used.

hasLocalArchivesOnly

public boolean hasLocalArchivesOnly()
returns whether this is a localOnly compartment that contains only pre-installed archives in the local archive folder

isLocal

public boolean isLocal()
returns whether this is a localOnly compartment that has either archives or sources only locally.

getLocalArchiveFolder

public java.lang.String getLocalArchiveFolder()
Returns the name of local archive Folder where pre-installed archives are located. This method only returns the name, not the path. The folder is located in a parent folder that can be retrieved from the DevelopmentConfiguration object.

setLocalArchiveFolder

public void setLocalArchiveFolder(java.lang.String value)
Sets the local archive Folder where pre-installed archives are located. Setting this to a non-null value will lead to a validation error in the validate() method if a non-null source state is also specified. It will also lead to a validation error in the validate() method of the DevelopmentConfiguration if a build server is specified.

serialize

public void serialize(XMLWriter writer)
               throws ValidationException
Serializes the Compartment to the given XMLWriter.
Parameters:
writer - the XMLWriter to use for serialization.

serialize

public void serialize(XMLWriter writer,
                      java.lang.String schemaVersion)
               throws ValidationException

validate

public void validate()
              throws ValidationException
Verifies that the object is valid. Mandatory children and attributes. Consistency of build variant definitions. Consistency of alias mappings. Completeness of alias mappings is not checked (impossible based on configuration data only).
Throws:
ValidationException - if the object is not valid.

Copyright @ 2002 SAP. All Rights Reserved.