com.cybersource.ws.client
Class MerchantConfig

java.lang.Object
  extended by com.cybersource.ws.client.MerchantConfig

public class MerchantConfig
extends java.lang.Object

An internal class used by the clients to hold and derive the properties applicable to the current transaction.


Constructor Summary
MerchantConfig(java.util.Properties _props, java.lang.String _merchantID)
          Constructor.
 
Method Summary
 java.lang.String getCacertPassword()
           
 java.lang.String getcustomHttpClass()
           
 java.lang.String getEffectiveNamespaceURI()
          Returns the effective namespace URI to be used to parse the request and reply documents.
 java.lang.String getEffectivePassword()
          Returns the effective key password.
 java.lang.String getEffectiveServerURL()
          Returns the effective server URL to which the request will be sent.
 boolean getEnableLog()
           
 java.lang.String getKeyAlias()
           
 java.io.File getKeyFile()
          Returns a File object representing the key file.
 java.lang.String getKeyFilename()
           
 java.lang.String getKeyPassword()
           
 java.lang.String getKeysDirectory()
           
 java.lang.String getLogDirectory()
           
 java.io.File getLogFile()
          Returns a File object representing the log file.
 java.lang.String getLogFilename()
           
 int getLogMaximumSize()
           
 boolean getLogSignedData()
           
 java.lang.String getLogString()
          Returns a string representation of the properties for logging purposes.
 java.lang.String getMerchantID()
           
 java.lang.String getNamespaceURI()
           
 int getNumberOfRetries()
           
 java.lang.String getPassword()
           
 java.lang.String getProperty(java.lang.String merchantID, java.lang.String prop)
          Returns the value of the specified property.
 java.lang.String getProperty(java.lang.String merchantID, java.lang.String prop, java.lang.String defaultVal)
          Returns the value of the specified property.
 java.lang.String getProxyHost()
           
 java.lang.String getProxyPassword()
           
 int getProxyPort()
           
 java.lang.String getProxyUser()
           
 long getRetryInterval()
           
 boolean getSendToAkamai()
           
 boolean getSendToProduction()
           
 java.lang.String getServerURL()
           
 java.lang.String getTargetAPIVersion()
           
 int getTimeout()
           
 java.util.UUID getUniqueKey()
           
 boolean getUseHttpClient()
           
 boolean getUseSignAndEncrypted()
           
 boolean isAllowRetry()
           
 boolean isCacertEnabled()
           
 boolean isCustomHttpClassEnabled()
           
 boolean isJdkCertEnabled()
           
 void setAllowRetry(boolean allowRetry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MerchantConfig

public MerchantConfig(java.util.Properties _props,
                      java.lang.String _merchantID)
               throws com.cybersource.ws.client.ConfigException
Constructor.

Parameters:
_props - Properties object to get properties from. May be null, in which case, all properties will be read from the System properties.
_merchantID - merchantID. May be null. If specified, merchant- specific properties will take precedence over the generic ones (i.e. those that do not start with a merchant id prefix).
Throws:
ConfigException - if something is missing of invalid in the configuration.
Method Detail

getcustomHttpClass

public java.lang.String getcustomHttpClass()

isCustomHttpClassEnabled

public boolean isCustomHttpClassEnabled()

getUseSignAndEncrypted

public boolean getUseSignAndEncrypted()

getMerchantID

public java.lang.String getMerchantID()

getKeysDirectory

public java.lang.String getKeysDirectory()

getKeyAlias

public java.lang.String getKeyAlias()

getKeyPassword

public java.lang.String getKeyPassword()

getSendToProduction

public boolean getSendToProduction()

getSendToAkamai

public boolean getSendToAkamai()

getTargetAPIVersion

public java.lang.String getTargetAPIVersion()

getKeyFilename

public java.lang.String getKeyFilename()

getServerURL

public java.lang.String getServerURL()

getNamespaceURI

public java.lang.String getNamespaceURI()

getPassword

public java.lang.String getPassword()

getEnableLog

public boolean getEnableLog()

getLogSignedData

public boolean getLogSignedData()

getLogDirectory

public java.lang.String getLogDirectory()

getLogFilename

public java.lang.String getLogFilename()

getLogMaximumSize

public int getLogMaximumSize()

getUseHttpClient

public boolean getUseHttpClient()

getTimeout

public int getTimeout()

getProxyHost

public java.lang.String getProxyHost()

getProxyPort

public int getProxyPort()

getProxyUser

public java.lang.String getProxyUser()

getProxyPassword

public java.lang.String getProxyPassword()

getEffectiveServerURL

public java.lang.String getEffectiveServerURL()
Returns the effective server URL to which the request will be sent. If a serverURL is specified, then that is what is returned. Otherwise, the effective server URL is derived from the values of sendToAkamai, sendToProduction and targetAPIVersion.

Returns:
the effective server URL.

getEffectiveNamespaceURI

public java.lang.String getEffectiveNamespaceURI()
Returns the effective namespace URI to be used to parse the request and reply documents. If a namespaceURI is specified, then that is what is returned. Otherwise, the effective namespace URI is derived from the value of targetAPIVersion.

Returns:
the effective namespace URI.

getEffectivePassword

public java.lang.String getEffectivePassword()
Returns the effective key password. If a password is specified, then that is what is returned. Otherwise, the effective password is the same as the merchantID.

Returns:
the effective key password.

getKeyFile

public java.io.File getKeyFile()
                        throws com.cybersource.ws.client.ConfigException
Returns a File object representing the key file. If a keyFilename is specified, that will be the one used. Otherwise, the filename will be derived from the merchantID.

Throws:
ConfigException - if the file is missing, is not a file, or is not readable.

getLogFile

public java.io.File getLogFile()
                        throws com.cybersource.ws.client.ConfigException
Returns a File object representing the log file.

Throws:
ConfigException - if the directory specified for the log file is missing or is not a directory.

getProperty

public java.lang.String getProperty(java.lang.String merchantID,
                                    java.lang.String prop)
Returns the value of the specified property. See the other version of this method for the complete behavior.

Parameters:
merchantID - merchant id.
prop - property to search for.
Returns:
the value of the specified property or null if none is found.

getProperty

public java.lang.String getProperty(java.lang.String merchantID,
                                    java.lang.String prop,
                                    java.lang.String defaultVal)
Returns the value of the specified property. The search behavior is as follows:
  1. In the Properties object supplied in the constructor, it looks for the property whose format is "merchantID.prop", e.g. "myMerchant.keysDirectory", unless the merchantID parameter is null, in which case, this step is skipped. If the Properties object is null, this and the second step are skipped.
  2. If it doesn't find one, it looks in the same Properties object for the property without the merchantID prefix, e.g. "keysDirectory".
  3. If it doesn't find one, it repeats steps 1 and 2, but looking in the System properties this time.
  4. If none is found, it returns the default value specified.

Parameters:
merchantID - merchant id.
prop - property to search for.
defaultVal - default value to return if property is not found (may be null).
Returns:
the value of the specified property or the default value specified if none is found.

getLogString

public java.lang.String getLogString()
Returns a string representation of the properties for logging purposes.


getUniqueKey

public java.util.UUID getUniqueKey()

getNumberOfRetries

public int getNumberOfRetries()

getRetryInterval

public long getRetryInterval()

isAllowRetry

public boolean isAllowRetry()

setAllowRetry

public void setAllowRetry(boolean allowRetry)

isCacertEnabled

public boolean isCacertEnabled()

isJdkCertEnabled

public boolean isJdkCertEnabled()

getCacertPassword

public java.lang.String getCacertPassword()


Copyright © 2017. All Rights Reserved.