hudson.scm
Class IntegritySCM

java.lang.Object
  extended by hudson.scm.SCM
      extended by hudson.scm.IntegritySCM
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.scm.SCM>, java.io.Serializable

public class IntegritySCM
extends hudson.scm.SCM
implements java.io.Serializable

This class provides an integration between Hudson for Continuous Builds and MKS Integrity for Configuration Management

See Also:
Serialized Form

Nested Class Summary
static class IntegritySCM.DescriptorImpl
          The relationship of Descriptor and SCM (the describable) is akin to class and object.
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
static java.lang.String FS
           
static java.lang.String NL
           
static java.text.SimpleDateFormat SDF
           
 
Fields inherited from class hudson.scm.SCM
PERMISSIONS, TAG
 
Constructor Summary
IntegritySCM(IntegrityRepositoryBrowser browser, java.lang.String hostName, int port, boolean secure, java.lang.String configPath, java.lang.String userName, java.lang.String password, java.lang.String ipHostName, int ipPort, boolean cleanCopy, java.lang.String lineTerminator, boolean restoreTimestamp, boolean skipAuthorInfo, boolean checkpointBeforeBuild, java.lang.String alternateWorkspace)
          Create a constructor that takes non-transient fields, and add the annotation @DataBoundConstructor to it.
 
Method Summary
 void buildEnvVars(hudson.model.AbstractBuild<?,?> build, java.util.Map<java.lang.String,java.lang.String> env)
          Adds MKS Integrity CM Project info to the build variables
 hudson.scm.SCMRevisionState calcRevisionsFromBuild(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.TaskListener listener)
          Overridden calcRevisionsFromBuild function Returns the current project configuration which can be used to difference any future configurations
 boolean checkout(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.FilePath workspace, hudson.model.BuildListener listener, java.io.File changeLogFile)
          Overridden checkout function This is the real invocation of this plugin.
protected  hudson.scm.PollingResult compareRemoteRevisionWith(hudson.model.AbstractProject<?,?> project, hudson.Launcher launcher, hudson.FilePath workspace, hudson.model.TaskListener listener, hudson.scm.SCMRevisionState _baseline)
          Overridden compareRemoteRevisionWith function Loads up the previous project configuration and compares that against the current to determine if the project has changed
 APISession createAPISession()
          Creates an authenticated API Session against the MKS Integrity Server
 hudson.scm.ChangeLogParser createChangeLogParser()
          Overridden createChangeLogParser function Creates a custom Integrity Change Log Parser, which compares two view project outputs
 java.lang.String getAlternateWorkspace()
          Returns the alternate workspace directory
 IntegrityRepositoryBrowser getBrowser()
           
 boolean getCheckpointBeforeBuild()
          Returns true/false depending on whether or not perform a checkpoint before the build
 boolean getCleanCopy()
          Returns true/false depending on whether or not the workspace is required to be cleaned
 java.lang.String getConfigPath()
          Returns the Project or Configuration Path for a MKS Integrity Source Project
 hudson.scm.SCMDescriptor<IntegritySCM> getDescriptor()
          Returns the SCMDescriptor for the SCM object.
 java.lang.String getHostName()
          Returns the host name of the MKS Integrity Server
 IntegrityCMProject getIntegrityProject()
          Returns the MKS Integrity Configuration Management Project
 java.lang.String getipHostName()
          Returns the Integration Point host name of the MKS API Session
 int getipPort()
          Returns the Integration Point port of the MKS API Session
 java.lang.String getLineTerminator()
          Returns the line terminator to apply when obtaining files from the MKS Integrity Server
 java.lang.String getPassword()
          Returns the clear password of the user connecting to the MKS Integrity Server
 int getPort()
          Returns the port of the MKS Integrity Server
 boolean getRestoreTimestamp()
          Returns true/false depending on whether or not the restore timestamp option is in effect
 boolean getSecure()
          Returns true/false depending on secure sockets are enabled
 boolean getSkipAuthorInfo()
          Returns true/false depending on whether or not to use 'si revisioninfo' to determine author information
 java.lang.String getUserName()
          Returns the User connecting to the MKS Integrity Server
static java.io.File getViewProjectResponseFile(hudson.model.AbstractBuild<?,?> build)
          Returns the MKS API Response xml file for the specified build
 boolean requiresWorkspaceForPolling()
          Toggles whether or not a workspace is required for polling Since, we're using a Server Integration Point in the MKS API, we do not require a workspace.
 void setAlternateWorkspace(java.lang.String alternateWorkspace)
          Sets an alternate workspace for the checkout directory
 void setCheckpointBeforeBuild(boolean checkpointBeforeBuild)
          Toggles whether or not a checkpoint should be performed before the build
 void setCleanCopy(boolean cleanCopy)
          Toggles whether or not the workspace is required to be cleaned
 void setConfigPath(java.lang.String configPath)
          Sets the Project or Configuration Path for a MKS Integrity Source Project
 void setHostName(java.lang.String hostName)
          Sets the host name of the MKS Integrity Server
 void setipHostName(java.lang.String ipHostName)
          Sets the Integration Point host name of the MKS API Session
 void setipPort(int ipPort)
          Sets the Integration Point port of the MKS API Session
 void setLineTerminator(java.lang.String lineTerminator)
          Sets the line terminator to apply when obtaining files from the MKS Integrity Server
 void setPassword(java.lang.String password)
          Sets the encrypted Password of the user connecting to the MKS Integrity Server
 void setPort(int port)
          Sets the port of the MKS Integrity Server
 void setRestoreTimestamp(boolean restoreTimestamp)
          Toggles whether or not to restore the timestamp for individual files
 void setSecure(boolean secure)
          Toggles whether or not secure sockets are enabled
 void setSkipAuthorInfo(boolean skipAuthorInfo)
          Toggles whether or not to use 'si revisioninfo' to determine author information
 void setUserName(java.lang.String userName)
          Sets the User connecting to the MKS Integrity Server
 
Methods inherited from class hudson.scm.SCM
_calcRevisionsFromBuild, _for, all, createEmptyChangeLog, getApi, getEffectiveBrowser, getModuleRoot, getModuleRoot, getModuleRoots, getModuleRoots, getType, nullify, poll, pollChanges, processWorkspaceBeforeDeletion, supportsPolling
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NL

public static final java.lang.String NL

FS

public static final java.lang.String FS

SDF

public static final java.text.SimpleDateFormat SDF
Constructor Detail

IntegritySCM

@DataBoundConstructor
public IntegritySCM(IntegrityRepositoryBrowser browser,
                                         java.lang.String hostName,
                                         int port,
                                         boolean secure,
                                         java.lang.String configPath,
                                         java.lang.String userName,
                                         java.lang.String password,
                                         java.lang.String ipHostName,
                                         int ipPort,
                                         boolean cleanCopy,
                                         java.lang.String lineTerminator,
                                         boolean restoreTimestamp,
                                         boolean skipAuthorInfo,
                                         boolean checkpointBeforeBuild,
                                         java.lang.String alternateWorkspace)
Create a constructor that takes non-transient fields, and add the annotation @DataBoundConstructor to it. Using the annotation helps the Stapler class to find which constructor that should be used when automatically copying values from a web form to a class.

Method Detail

getBrowser

@Exported
public IntegrityRepositoryBrowser getBrowser()
Overrides:
getBrowser in class hudson.scm.SCM

getipHostName

public java.lang.String getipHostName()
Returns the Integration Point host name of the MKS API Session

Returns:

getHostName

public java.lang.String getHostName()
Returns the host name of the MKS Integrity Server

Returns:

getipPort

public int getipPort()
Returns the Integration Point port of the MKS API Session

Returns:

getPort

public int getPort()
Returns the port of the MKS Integrity Server

Returns:

getSecure

public boolean getSecure()
Returns true/false depending on secure sockets are enabled

Returns:

getConfigPath

public java.lang.String getConfigPath()
Returns the Project or Configuration Path for a MKS Integrity Source Project

Returns:

getUserName

public java.lang.String getUserName()
Returns the User connecting to the MKS Integrity Server

Returns:

getPassword

public java.lang.String getPassword()
Returns the clear password of the user connecting to the MKS Integrity Server

Returns:

getCleanCopy

public boolean getCleanCopy()
Returns true/false depending on whether or not the workspace is required to be cleaned

Returns:

getLineTerminator

public java.lang.String getLineTerminator()
Returns the line terminator to apply when obtaining files from the MKS Integrity Server

Returns:

getRestoreTimestamp

public boolean getRestoreTimestamp()
Returns true/false depending on whether or not the restore timestamp option is in effect

Returns:

getSkipAuthorInfo

public boolean getSkipAuthorInfo()
Returns true/false depending on whether or not to use 'si revisioninfo' to determine author information

Returns:

getCheckpointBeforeBuild

public boolean getCheckpointBeforeBuild()
Returns true/false depending on whether or not perform a checkpoint before the build

Returns:

getAlternateWorkspace

public java.lang.String getAlternateWorkspace()
Returns the alternate workspace directory

Returns:

setipHostName

public void setipHostName(java.lang.String ipHostName)
Sets the Integration Point host name of the MKS API Session


setHostName

public void setHostName(java.lang.String hostName)
Sets the host name of the MKS Integrity Server


setipPort

public void setipPort(int ipPort)
Sets the Integration Point port of the MKS API Session


setPort

public void setPort(int port)
Sets the port of the MKS Integrity Server


setSecure

public void setSecure(boolean secure)
Toggles whether or not secure sockets are enabled


setConfigPath

public void setConfigPath(java.lang.String configPath)
Sets the Project or Configuration Path for a MKS Integrity Source Project


setUserName

public void setUserName(java.lang.String userName)
Sets the User connecting to the MKS Integrity Server


setPassword

public void setPassword(java.lang.String password)
Sets the encrypted Password of the user connecting to the MKS Integrity Server


setCleanCopy

public void setCleanCopy(boolean cleanCopy)
Toggles whether or not the workspace is required to be cleaned


setLineTerminator

public void setLineTerminator(java.lang.String lineTerminator)
Sets the line terminator to apply when obtaining files from the MKS Integrity Server


setRestoreTimestamp

public void setRestoreTimestamp(boolean restoreTimestamp)
Toggles whether or not to restore the timestamp for individual files


setSkipAuthorInfo

public void setSkipAuthorInfo(boolean skipAuthorInfo)
Toggles whether or not to use 'si revisioninfo' to determine author information


setCheckpointBeforeBuild

public void setCheckpointBeforeBuild(boolean checkpointBeforeBuild)
Toggles whether or not a checkpoint should be performed before the build

Parameters:
checkpointBeforeBuild -

setAlternateWorkspace

public void setAlternateWorkspace(java.lang.String alternateWorkspace)
Sets an alternate workspace for the checkout directory

Parameters:
alternateWorkspace -

createAPISession

public APISession createAPISession()
Creates an authenticated API Session against the MKS Integrity Server

Returns:
An authenticated API Session

getIntegrityProject

public IntegrityCMProject getIntegrityProject()
Returns the MKS Integrity Configuration Management Project

Returns:

buildEnvVars

public void buildEnvVars(hudson.model.AbstractBuild<?,?> build,
                         java.util.Map<java.lang.String,java.lang.String> env)
Adds MKS Integrity CM Project info to the build variables

Overrides:
buildEnvVars in class hudson.scm.SCM

calcRevisionsFromBuild

public hudson.scm.SCMRevisionState calcRevisionsFromBuild(hudson.model.AbstractBuild<?,?> build,
                                                          hudson.Launcher launcher,
                                                          hudson.model.TaskListener listener)
                                                   throws java.io.IOException,
                                                          java.lang.InterruptedException
Overridden calcRevisionsFromBuild function Returns the current project configuration which can be used to difference any future configurations

Specified by:
calcRevisionsFromBuild in class hudson.scm.SCM
Throws:
java.io.IOException
java.lang.InterruptedException
See Also:
SCM.calcRevisionsFromBuild(hudson.model.AbstractBuild, hudson.Launcher, hudson.model.TaskListener)

requiresWorkspaceForPolling

public boolean requiresWorkspaceForPolling()
Toggles whether or not a workspace is required for polling Since, we're using a Server Integration Point in the MKS API, we do not require a workspace.

Overrides:
requiresWorkspaceForPolling in class hudson.scm.SCM

checkout

public boolean checkout(hudson.model.AbstractBuild<?,?> build,
                        hudson.Launcher launcher,
                        hudson.FilePath workspace,
                        hudson.model.BuildListener listener,
                        java.io.File changeLogFile)
                 throws java.io.IOException,
                        java.lang.InterruptedException
Overridden checkout function This is the real invocation of this plugin. Currently, we will do a project info and determine the true nature of the project Subsequent to that we will run a view project command and cache the information on each member, so that we can execute project checkout commands. This obviously eliminates the need for a sandbox and can wily nilly delete the workspace directory as needed

Specified by:
checkout in class hudson.scm.SCM
Throws:
java.io.IOException
java.lang.InterruptedException
See Also:
SCM.checkout(hudson.model.AbstractBuild, hudson.Launcher, hudson.FilePath, hudson.model.BuildListener, java.io.File)

getViewProjectResponseFile

public static java.io.File getViewProjectResponseFile(hudson.model.AbstractBuild<?,?> build)
Returns the MKS API Response xml file for the specified build

Parameters:
build - Hudson AbstractBuild Object
Returns:

compareRemoteRevisionWith

protected hudson.scm.PollingResult compareRemoteRevisionWith(hudson.model.AbstractProject<?,?> project,
                                                             hudson.Launcher launcher,
                                                             hudson.FilePath workspace,
                                                             hudson.model.TaskListener listener,
                                                             hudson.scm.SCMRevisionState _baseline)
                                                      throws java.io.IOException,
                                                             java.lang.InterruptedException
Overridden compareRemoteRevisionWith function Loads up the previous project configuration and compares that against the current to determine if the project has changed

Specified by:
compareRemoteRevisionWith in class hudson.scm.SCM
Throws:
java.io.IOException
java.lang.InterruptedException
See Also:
SCM.compareRemoteRevisionWith(hudson.model.AbstractProject, hudson.Launcher, hudson.FilePath, hudson.model.TaskListener, hudson.scm.SCMRevisionState)

createChangeLogParser

public hudson.scm.ChangeLogParser createChangeLogParser()
Overridden createChangeLogParser function Creates a custom Integrity Change Log Parser, which compares two view project outputs

Specified by:
createChangeLogParser in class hudson.scm.SCM
See Also:
SCM.createChangeLogParser()

getDescriptor

public hudson.scm.SCMDescriptor<IntegritySCM> getDescriptor()
Returns the SCMDescriptor for the SCM object. The SCMDescriptor is used to create new instances of the SCM.

Specified by:
getDescriptor in interface hudson.model.Describable<hudson.scm.SCM>
Overrides:
getDescriptor in class hudson.scm.SCM


Copyright © 2004-2011 Hudson. All Rights Reserved.