com.force.sdk.connector
Class ForceConnectorConfig

java.lang.Object
  extended by com.sforce.ws.ConnectorConfig
      extended by com.force.sdk.connector.ForceConnectorConfig
All Implemented Interfaces:
Cloneable

public class ForceConnectorConfig
extends com.sforce.ws.ConnectorConfig
implements Cloneable

A Force.com SDK wrapper for the Force.com API ConnectorConfig.

This wrapper stores the same state as a Force.com API ConnectorConfig and can itself be used for a Force.com SOAP connection. However, it provides extra functionality that is useful for the Force.com SDK. This functionality includes:

Author:
Tim Kral, Fiaz Hossain

Field Summary
 
Fields inherited from class com.sforce.ws.ConnectorConfig
DEFAULT
 
Constructor Summary
ForceConnectorConfig()
          Initializes a ForceConnectorConfig object which contains no connection properties.
 
Method Summary
protected  Object clone()
          Makes a copy of this ForceConnectorConfig.
 boolean equals(Object obj)
          Compares this ForceConnectorConfig to the specified object.
 String getClientId()
          Returns the Force.com connection client id.
 PrintStream getTraceStream()
          Returns the PrintStream to which the Force.com connection will print traced API messages.
 int hashCode()
          Returns a hash code for this ForceConnectorConfig.
 void setAuthEndpoint(String authEndpoint)
          Sets the Force.com authentication endpoint.
 void setClientId(String clientId)
          Sets the Force.com connection client id.
 void setConnectionUrl(String connectionUrl)
          Parses a Force.com connection URL and accordingly sets the connection properties found within.
 void setTraceMessage(boolean traceMessage)
          Turns on the ability for this ForceConnectorConfig to trace messages.
 void setUsername(String username)
          Sets the Force.com connection username.
 
Methods inherited from class com.sforce.ws.ConnectorConfig
addMessageHandler, clearMessageHandlers, getAuthEndpoint, getConnectionTimeout, getHeaders, getMaxRequestSize, getMaxResponseSize, getMessagerHandlers, getPassword, getProxy, getProxyPassword, getProxyUsername, getReadTimeout, getRequestHeader, getRestEndpoint, getServiceEndpoint, getSessionId, getSessionRenewer, getTraceFile, getTransport, getUsername, hasMessageHandlers, isCompression, isManualLogin, isPrettyPrintXml, isTraceMessage, isValidateSchema, setCompression, setConnectionTimeout, setManualLogin, setMaxRequestSize, setMaxResponseSize, setNtlmDomain, setPassword, setPrettyPrintXml, setProxy, setProxy, setProxyPassword, setProxyUsername, setReadTimeout, setRequestHeader, setRestEndpoint, setServiceEndpoint, setSessionId, setSessionRenewer, setTraceFile, setTransport, setUseChunkedPost, setValidateSchema, useChunkedPost, verifyEnterpriseEndpoint, verifyPartnerEndpoint
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForceConnectorConfig

public ForceConnectorConfig()
Initializes a ForceConnectorConfig object which contains no connection properties.

This constructor will set the trace message flag to true which means that messaging tracing is controlled by setting the com.force.sdk.connector log level to TRACE.

See Also:
setTraceMessage(boolean)
Method Detail

setAuthEndpoint

public void setAuthEndpoint(String authEndpoint)
Sets the Force.com authentication endpoint.

The authEndpoint parameter may be a fully qualified, versioned Force.com API endpoint. If it is not, this ForceConnectorConfig will attempt to build a qualified Force.com API endpoint and bind the version to the API version used in the Force.com SDK.

Overrides:
setAuthEndpoint in class com.sforce.ws.ConnectorConfig
Parameters:
authEndpoint - representation of a Force.com authentication endpoint (This endpoint may be a fully qualified Force.com API endpoint, but need not be)

getClientId

public String getClientId()
Returns the Force.com connection client id.

The client id is a String identifier which will be set on the Force.com connection created from this ForceConnectorConfig

Returns:
the Force.com connection client id

setClientId

public void setClientId(String clientId)
Sets the Force.com connection client id.

The client id is a String identifier which will be set on the Force.com connection created from this ForceConnectorConfig

Parameters:
clientId - any non null, non empty String that is to be used as a Force.com connection identifier

setConnectionUrl

public void setConnectionUrl(String connectionUrl)
Parses a Force.com connection URL and accordingly sets the connection properties found within.

Parameters:
connectionUrl - A Force.com connection URL
Throws:
IllegalArgumentException - if the Force.com connection URL does not contain a parseable endpoint, username and password
IllegalArgumentException - if any of the connection property values are not valid
See Also:
ForceConnectionProperty

setTraceMessage

public void setTraceMessage(boolean traceMessage)
Turns on the ability for this ForceConnectorConfig to trace messages.

Ultimately, message tracing is controlled by setting the com.force.sdk.connector log level to TRACE. However, this granular control can be removed by setting the trace message flag to false here.

When a ForceConnectorConfig object is constructed, this flag is set to true

Overrides:
setTraceMessage in class com.sforce.ws.ConnectorConfig
Parameters:
traceMessage - the trace message flag for this ForceConnectorConfig

setUsername

public void setUsername(String username)
Sets the Force.com connection username.

This is overridden here because the Force.com connection username is used in part to generate the unique cache id for this ForceConnectorConfig

Overrides:
setUsername in class com.sforce.ws.ConnectorConfig
Parameters:
username - the username to be used in a Force.com connection

getTraceStream

public PrintStream getTraceStream()
Returns the PrintStream to which the Force.com connection will print traced API messages.

Overrides:
getTraceStream in class com.sforce.ws.ConnectorConfig
Returns:
a PrintStream to a com.force.sdk.connector log if that log is set to the TRACE level; otherwise a PrintStream to a trace file set on this ForceConnectorConfig; otherwise System.out

hashCode

public int hashCode()
Returns a hash code for this ForceConnectorConfig.

The hash code is computed by finding the hash code of this ForceConnectorConfig's unique cacheId.

Overrides:
hashCode in class Object
Returns:
a hash code for this ForceConnectorConfig

equals

public boolean equals(Object obj)
Compares this ForceConnectorConfig to the specified object.

The result is true if and only if the argument is not null and is a ForceConnectorConfig object with the same unique cacheId as this ForceConnectorConfig.

Overrides:
equals in class Object
Parameters:
obj - the object to compare this ForceConnectorConfig against
Returns:
true if the ForceConnectorConfigs are equal; false otherwise

clone

protected Object clone()
Makes a copy of this ForceConnectorConfig.

Overrides:
clone in class Object
Returns:
a non null copy of this ForceConnectorConfig
Throws:
RuntimeException - if a CloneNotSupportedException is caught from java.lang.Object


Copyright © 2011. All Rights Reserved.