Copyright @ 2002 SAP. All Rights Reserved.

com.sap.tc.complib
Interface SourceState


public interface SourceState

A SourceState instance describes a source state of a software component contained in compartment of a configration. A source state definition always contains a repository definition. A source state can hav etow types, depending on whether activation is allowed in the current configuration or not.

If activation is allowed for a source state (type WITH_ACTIVATION), an inactive and an active location (workspace) must be specified

If a source state is only built but no chnages can be activated in the configuration (type NO_ACTIVATE), only one location (workspace) must be specified.

Since:
1.0
Version:
1.0 August 2002

Field Summary
static int ACTIVATION
          source state type: activation: changes are allowed and activation is required.
static int CHANGE
          source state type: changeable but no activation in place In this case you have one location which must be a changeable workspace
static int LOCAL
          source state type: only locally, no repository, no remote locations
static int READONLY
          source state type: readonly: changes and also activation are not allowed In this case you have one location (workspace or snapshot).
 
Method Summary
 java.lang.String getInactiveLocation()
          gets the String with the inactive location.
 java.lang.String getLocation()
          gets the String with the location.
 Repository getRepository()
          gets the Repository object with the server parameters
 int getType()
          gets the typ of the source state location.
 boolean isChangeable()
          Returns whether changes are allowed in ths source state.
 boolean isExportAllowed()
          returns whether source code export from this software state is allowed.
 boolean isLocal()
          returns whether the sources exist only locally and is not connected to a repository
 boolean isLocationChangeable()
          Returns whether changes are allowed in the source code location returned by getLocation().
 void serialize(XMLWriter writer)
          Serializes the source state info to the given XMLWriter.
 void serialize(XMLWriter writer, java.lang.String schemaVersion)
           
 void setExportAllowed(boolean value)
          sets whether source code export from this software state is allowed.
 void setInactiveLocation(java.lang.String value)
          sets the String with the inactive location.
 void setLocation(java.lang.String value)
          sets the String with the location Depending on the type, this is if OPEN_WITH_ACTIVATE_ALLOWED: the name of the active workspace if OPEN_NO_ACTIVATION: a workspace path if CLOSED a snapshot path
 void setRepository(Repository value)
          sets the Repository object wit the server parameters
 void setType(int value)
          sets the type of the source state location This can be one of the following constants ACTIVATION READONLY CHANGE LOCAL
 java.lang.String typeAsString()
          Returns the source state in a readable form.
 void validate()
          Verifies that the SourceState is valid.
 

Field Detail

ACTIVATION

public static final int ACTIVATION
source state type: activation: changes are allowed and activation is required. In this case you have two locations: the location and the inactive location. Changes are allowed only in the inactive location but not in the (active) location.

READONLY

public static final int READONLY
source state type: readonly: changes and also activation are not allowed In this case you have one location (workspace or snapshot). But even if the location is an open workspace, changes are not allowed in this configuration.

CHANGE

public static final int CHANGE
source state type: changeable but no activation in place In this case you have one location which must be a changeable workspace

LOCAL

public static final int LOCAL
source state type: only locally, no repository, no remote locations
Method Detail

getType

public int getType()
gets the typ of the source state location. This can be one of the following constants

setType

public void setType(int value)
sets the type of the source state location This can be one of the following constants

getRepository

public Repository getRepository()
gets the Repository object with the server parameters

setRepository

public void setRepository(Repository value)
sets the Repository object wit the server parameters

getLocation

public java.lang.String getLocation()
gets the String with the location. Depending on the type, this is if OPEN_WITH_ACTIVATE_ALLOWED: the name of the active workspace if OPEN_NO_ACTIVATION: a workspace path if CLOSED a snapshot path

setLocation

public void setLocation(java.lang.String value)
sets the String with the location Depending on the type, this is if OPEN_WITH_ACTIVATE_ALLOWED: the name of the active workspace if OPEN_NO_ACTIVATION: a workspace path if CLOSED a snapshot path

getInactiveLocation

public java.lang.String getInactiveLocation()
gets the String with the inactive location. This only makes sense if the type is OPEN_WITH_ACTIVATE_ALLOWED otherwise the result is undefined and irrelevant

setInactiveLocation

public void setInactiveLocation(java.lang.String value)
sets the String with the inactive location. This only makes sense if the type is OPEN_WITH_ACTIVATE_ALLOWED otherwise the value of this property is irrelevant

isExportAllowed

public boolean isExportAllowed()
returns whether source code export from this software state is allowed. This is only about source code exports from the associated source code repository. This setting does not affect the export of build results from the build server.
Returns:
true if source code export is allowed

setExportAllowed

public void setExportAllowed(boolean value)
sets whether source code export from this software state is allowed. This is only about source code exports from the associated source code repository. This setting does not affect the export of build results from the build server.
Parameters:
value - treu if export should be allowed

isLocal

public boolean isLocal()
returns whether the sources exist only locally and is not connected to a repository
Returns:
true if the source state exists only locally

isLocationChangeable

public boolean isLocationChangeable()
Returns whether changes are allowed in the source code location returned by getLocation(). The result is true as far as the configuration is concerned. Settings on the respoistory may still prevent changes.
Returns:
true if changes are allowed in "the location" (as returned by getLocation())

isChangeable

public boolean isChangeable()
Returns whether changes are allowed in ths source state.
Returns:
true if changes are allowed in any of the locations of this source state

serialize

public void serialize(XMLWriter writer)
               throws ValidationException
Serializes the source state info 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 SourceState is valid. Checks mandatory children and attributes based on the type of the source state
Throws:
ValidationException - if the object is not valid.

typeAsString

public java.lang.String typeAsString()
Returns the source state in a readable form.

Copyright @ 2002 SAP. All Rights Reserved.