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(org.apache.commons.httpclient.HttpClient httpClient, java.net.URL baseUrl, java.lang.String fingerPrintRequestSuffix, AgentType 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)
           
 AgentType getAgentBootstrapType()
           
 java.util.UUID getAgentUuid()
          Unique ID for authenticating the agent.
 java.net.URL 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.net.URL baseUrl,
                    java.lang.String fingerPrintRequestSuffix,
                    AgentType agentBootstrapType)
             throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException
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.net.URL 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 AgentType 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.