Package com.boomi.connector.testutil
Class SimpleAtomConfig
- java.lang.Object
-
- com.boomi.connector.testutil.SimpleAtomConfig
-
- All Implemented Interfaces:
AtomConfig
public class SimpleAtomConfig extends Object implements AtomConfig
Simple implementation of AtomConfig.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_NUMBER_OBJECT_TYPES
static int
DEFAULT_MAX_OBJECT_TYPE_COOKIE_LENGTH
static int
DEFAULT_MAX_PAGE_SIZE
-
Constructor Summary
Constructors Constructor Description SimpleAtomConfig()
SimpleAtomConfig(int maxPageSize, int maxNumObjects, int maxCookieLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
getBooleanContainerProperty(String key)
Gets the property value for the given key as a Boolean.boolean
getBooleanContainerProperty(String key, boolean defaultValue)
Gets the property value for the given key as a boolean, returning the defaultValue if the located property valuenull
.String
getContainerProperty(String key)
Gets the property value for the given key as a String.String
getContainerProperty(String key, String defaultValue)
Gets the property value for the given key as a String., returning the defaultValue if the located property value is blank (null
or all characters are whitespace).Level
getLogLevel()
Returns the logging level for the connector.Long
getLongContainerProperty(String key)
Gets the property value for the given key as a Long.long
getLongContainerProperty(String key, long defaultValue)
Gets the property value for the given key as a Long, returning the defaultValue if the located property valuenull
.int
getMaxNumberObjectTypes()
Returns the maximum number of object types allowed to be returned from a browse request.int
getMaxObjectTypeCookieLength()
Returns the maximum number of characters allowed in an ObjectType cookie.int
getMaxPageSize()
Returns the maximum page size recommended by the Atom.AtomProxyConfig
getProxyConfig()
Returns ProxyConfig object with access to Atom proxy properties such as proxyHost, proxyPort etc.void
setProxyConfig(AtomProxyConfig proxyConfig)
Setter method for AtomProxyConfig to overwrite the default implementation of SimpleAtomProxyConfig instance if needed.SimpleAtomConfig
withContainerProperty(String propertyKey, String propertyValue)
Builder method to set any container properties.
-
-
-
Field Detail
-
DEFAULT_MAX_PAGE_SIZE
public static final int DEFAULT_MAX_PAGE_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_MAX_NUMBER_OBJECT_TYPES
public static final int DEFAULT_MAX_NUMBER_OBJECT_TYPES
- See Also:
- Constant Field Values
-
DEFAULT_MAX_OBJECT_TYPE_COOKIE_LENGTH
public static final int DEFAULT_MAX_OBJECT_TYPE_COOKIE_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
withContainerProperty
public SimpleAtomConfig withContainerProperty(String propertyKey, String propertyValue)
Builder method to set any container properties. Creates and populates aHashMap
with key value pairs- Parameters:
propertyKey
- the key of property to be storedpropertyValue
- the associated value of the key to be stored- Returns:
- this
-
setProxyConfig
public void setProxyConfig(AtomProxyConfig proxyConfig)
Setter method for AtomProxyConfig to overwrite the default implementation of SimpleAtomProxyConfig instance if needed.- Parameters:
proxyConfig
- Atom proxy configuration information which may be of use to a developer. Connector devs can use the SimpleAtomProxyConfig builder to create a new instance and pass it in as an argument here.
-
getContainerProperty
public String getContainerProperty(String key)
Description copied from interface:AtomConfig
Gets the property value for the given key as a String.- Specified by:
getContainerProperty
in interfaceAtomConfig
- Parameters:
key
- key of the desired property- Returns:
- String property value or
null
if not found.
-
getContainerProperty
public String getContainerProperty(String key, String defaultValue)
Description copied from interface:AtomConfig
Gets the property value for the given key as a String., returning the defaultValue if the located property value is blank (null
or all characters are whitespace).- Specified by:
getContainerProperty
in interfaceAtomConfig
- Parameters:
key
- key of the desired propertydefaultValue
- value to return if property value is blank- Returns:
- String property value or defaultValue if not found.
-
getBooleanContainerProperty
public Boolean getBooleanContainerProperty(String key)
Description copied from interface:AtomConfig
Gets the property value for the given key as a Boolean.- Specified by:
getBooleanContainerProperty
in interfaceAtomConfig
- Parameters:
key
- key of the desired property- Returns:
- Boolean property value or
null
if not found or isn't "true" or "false".
-
getBooleanContainerProperty
public boolean getBooleanContainerProperty(String key, boolean defaultValue)
Description copied from interface:AtomConfig
Gets the property value for the given key as a boolean, returning the defaultValue if the located property valuenull
.- Specified by:
getBooleanContainerProperty
in interfaceAtomConfig
- Parameters:
key
- key of the desired propertydefaultValue
- value to return if property value isnull
- Returns:
- boolean property value or defaultValue if not found.
-
getLongContainerProperty
public Long getLongContainerProperty(String key)
Description copied from interface:AtomConfig
Gets the property value for the given key as a Long.- Specified by:
getLongContainerProperty
in interfaceAtomConfig
- Parameters:
key
- key of the desired property- Returns:
- Long property value or
null
if not found.
-
getLongContainerProperty
public long getLongContainerProperty(String key, long defaultValue)
Description copied from interface:AtomConfig
Gets the property value for the given key as a Long, returning the defaultValue if the located property valuenull
.- Specified by:
getLongContainerProperty
in interfaceAtomConfig
- Parameters:
key
- key of the desired propertydefaultValue
- value to return if property value isnull
- Returns:
- Long property value or defaultValue if not found.
-
getProxyConfig
public AtomProxyConfig getProxyConfig()
Description copied from interface:AtomConfig
Returns ProxyConfig object with access to Atom proxy properties such as proxyHost, proxyPort etc.- Specified by:
getProxyConfig
in interfaceAtomConfig
- Returns:
- Proxy configuration properties set on an Atom.
-
getMaxPageSize
public int getMaxPageSize()
Description copied from interface:AtomConfig
Returns the maximum page size recommended by the Atom. Connector implementations should use this value along with any internal limits to determine a reasonable page size when working with pageable results.- Specified by:
getMaxPageSize
in interfaceAtomConfig
- Returns:
- the maximum page size that the atom recommends
-
getMaxNumberObjectTypes
public int getMaxNumberObjectTypes()
Description copied from interface:AtomConfig
Returns the maximum number of object types allowed to be returned from a browse request. More than this number of object types will be considered an error by the Atom and will fail the browsing process.- Specified by:
getMaxNumberObjectTypes
in interfaceAtomConfig
- Returns:
- the maximum number of object types allowed
-
getMaxObjectTypeCookieLength
public int getMaxObjectTypeCookieLength()
Description copied from interface:AtomConfig
Returns the maximum number of characters allowed in an ObjectType cookie. Cookies which are longer than this value will be considered an error by the Atom and will fail the browsing process.- Specified by:
getMaxObjectTypeCookieLength
in interfaceAtomConfig
- Returns:
- the maximum number of characters allowed in an ObjectDefinition cookie.
-
getLogLevel
public Level getLogLevel()
Description copied from interface:AtomConfig
Returns the logging level for the connector.- Specified by:
getLogLevel
in interfaceAtomConfig
- Returns:
- the logging level for the connector
-
-