com.atlassian.bamboo.agent.bootstrap
Class AgentContext

java.lang.Object
  extended by com.atlassian.bamboo.agent.bootstrap.AgentContext

public class AgentContext
extends java.lang.Object


Field Summary
static java.lang.String BOOTSTRAP_VERSION
           
static java.lang.String DISABLE_BOOTSTRAP_UPDATE
           
static java.lang.String FINGERPRINT_PARAM
           
static java.lang.String SERVER_AUTH_POLL_INTERVAL
          Server poll interval for authentication, in seconds.
static java.lang.String UUID_PARAM
           
static java.lang.String VERSION_PARAM
           
 
Constructor Summary
AgentContext(AgentContextData original)
          This constructor is used to reconstruct the AgentContext when the runtime classpath becomes available for Remote Upgrade, Remote and Elastic agents.
AgentContext(org.apache.commons.httpclient.HttpClient httpClient, java.lang.String baseUrl, java.lang.String fingerPrintRequestSuffix, AgentBootstrapType agentBootstrapType)
           
 
Method Summary
static java.lang.String addParameter(java.lang.String url, java.lang.String name, java.lang.String value)
           
 java.lang.String getAbsoluteURL(java.lang.String relativeUrl)
           
 AgentBootstrapType getAgentBootstrapType()
           
 java.util.UUID getAgentUuid()
          Unique ID for authenticating the agent.
 java.lang.String getBaseUrl()
           
 java.lang.String getFingerprint()
           
 org.apache.commons.httpclient.HttpClient getHttpClient()
           
 java.util.Map<java.lang.String,java.lang.String> getUserProperties()
           
 java.lang.Error panic(java.lang.String reason)
          Shutdown the AgentContext, as a unrecoverable error has occurred.
 java.lang.Error panic(java.lang.String reason, java.lang.Throwable throwable)
          Shutdown the AgentContext, as a unrecoverable error has occurred.
 java.lang.Error panic(java.lang.Throwable throwable)
          Shutdown the AgentContext, as a unrecoverable error has occurred.
protected  void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVER_AUTH_POLL_INTERVAL

public static final java.lang.String SERVER_AUTH_POLL_INTERVAL
Server poll interval for authentication, in seconds.

See Also:
Constant Field Values

FINGERPRINT_PARAM

public static final java.lang.String FINGERPRINT_PARAM
See Also:
Constant Field Values

VERSION_PARAM

public static final java.lang.String VERSION_PARAM
See Also:
Constant Field Values

UUID_PARAM

public static final java.lang.String UUID_PARAM
See Also:
Constant Field Values

DISABLE_BOOTSTRAP_UPDATE

public static final java.lang.String DISABLE_BOOTSTRAP_UPDATE
See Also:
Constant Field Values

BOOTSTRAP_VERSION

public static final java.lang.String BOOTSTRAP_VERSION
See Also:
Constant Field Values
Constructor Detail

AgentContext

public AgentContext(org.apache.commons.httpclient.HttpClient httpClient,
                    java.lang.String baseUrl,
                    java.lang.String fingerPrintRequestSuffix,
                    AgentBootstrapType agentBootstrapType)

AgentContext

public AgentContext(AgentContextData original)
             throws java.lang.Exception
This constructor is used to reconstruct the AgentContext when the runtime classpath becomes available for Remote Upgrade, Remote and Elastic agents. Please do not change the signature of this constructor as we call it via reflection to avoid class equality issues across classloaders.

Parameters:
original - original agent context data to copy
Throws:
java.lang.Exception - if unable to clone for any reason
Since:
3.3
Method Detail

run

protected void run()
            throws java.lang.ClassNotFoundException,
                   java.io.IOException
Throws:
java.lang.ClassNotFoundException
java.io.IOException

getFingerprint

public java.lang.String getFingerprint()

getBaseUrl

public java.lang.String getBaseUrl()
Returns:
base url for bootstrap
Since:
3.3

getAbsoluteURL

public java.lang.String getAbsoluteURL(java.lang.String relativeUrl)

addParameter

public static java.lang.String addParameter(java.lang.String url,
                                            java.lang.String name,
                                            java.lang.String value)

getHttpClient

public org.apache.commons.httpclient.HttpClient getHttpClient()

getUserProperties

public java.util.Map<java.lang.String,java.lang.String> getUserProperties()

getAgentBootstrapType

public AgentBootstrapType getAgentBootstrapType()
Returns:
type of agent bootstrap
Since:
3.3

getAgentUuid

public java.util.UUID getAgentUuid()
Unique ID for authenticating the agent.

Returns:
unique agent ID

panic

public java.lang.Error panic(java.lang.Throwable throwable)

Shutdown the AgentContext, as a unrecoverable error has occurred.

Parameters:
throwable - The Throwable that caused the panic.
Returns:
Never returns; Declared as returning Error so that callers can throw result to indicate to compiler that subsequent code is unreachable.

panic

public java.lang.Error panic(java.lang.String reason)

Shutdown the AgentContext, as a unrecoverable error has occurred.

Parameters:
reason - for panic
Returns:
Never returns; Declared as returning Error so that callers can throw result to indicate to compiler that subsequent code is unreachable.

panic

public java.lang.Error panic(java.lang.String reason,
                             java.lang.Throwable throwable)

Shutdown the AgentContext, as a unrecoverable error has occurred.

Parameters:
reason - for panic
throwable - The Throwable that caused the panic.
Returns:
Never returns; Declared as returning Error so that callers can throw result to indicate to compiler that subsequent code is unreachable.


Copyright © 2012 Atlassian. All Rights Reserved.