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 intDEFAULT_MAX_NUMBER_OBJECT_TYPESstatic intDEFAULT_MAX_OBJECT_TYPE_COOKIE_LENGTHstatic intDEFAULT_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 BooleangetBooleanContainerProperty(String key)Gets the property value for the given key as a Boolean.booleangetBooleanContainerProperty(String key, boolean defaultValue)Gets the property value for the given key as a boolean, returning the defaultValue if the located property valuenull.StringgetContainerProperty(String key)Gets the property value for the given key as a String.StringgetContainerProperty(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 (nullor all characters are whitespace).LevelgetLogLevel()Returns the logging level for the connector.LonggetLongContainerProperty(String key)Gets the property value for the given key as a Long.longgetLongContainerProperty(String key, long defaultValue)Gets the property value for the given key as a Long, returning the defaultValue if the located property valuenull.intgetMaxNumberObjectTypes()Returns the maximum number of object types allowed to be returned from a browse request.intgetMaxObjectTypeCookieLength()Returns the maximum number of characters allowed in an ObjectType cookie.intgetMaxPageSize()Returns the maximum page size recommended by the Atom.AtomProxyConfiggetProxyConfig()Returns ProxyConfig object with access to Atom proxy properties such as proxyHost, proxyPort etc.voidsetProxyConfig(AtomProxyConfig proxyConfig)Setter method for AtomProxyConfig to overwrite the default implementation of SimpleAtomProxyConfig instance if needed.SimpleAtomConfigwithContainerProperty(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 aHashMapwith 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:AtomConfigGets the property value for the given key as a String.- Specified by:
getContainerPropertyin interfaceAtomConfig- Parameters:
key- key of the desired property- Returns:
- String property value or
nullif not found.
-
getContainerProperty
public String getContainerProperty(String key, String defaultValue)
Description copied from interface:AtomConfigGets the property value for the given key as a String., returning the defaultValue if the located property value is blank (nullor all characters are whitespace).- Specified by:
getContainerPropertyin 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:AtomConfigGets the property value for the given key as a Boolean.- Specified by:
getBooleanContainerPropertyin interfaceAtomConfig- Parameters:
key- key of the desired property- Returns:
- Boolean property value or
nullif not found or isn't "true" or "false".
-
getBooleanContainerProperty
public boolean getBooleanContainerProperty(String key, boolean defaultValue)
Description copied from interface:AtomConfigGets the property value for the given key as a boolean, returning the defaultValue if the located property valuenull.- Specified by:
getBooleanContainerPropertyin 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:AtomConfigGets the property value for the given key as a Long.- Specified by:
getLongContainerPropertyin interfaceAtomConfig- Parameters:
key- key of the desired property- Returns:
- Long property value or
nullif not found.
-
getLongContainerProperty
public long getLongContainerProperty(String key, long defaultValue)
Description copied from interface:AtomConfigGets the property value for the given key as a Long, returning the defaultValue if the located property valuenull.- Specified by:
getLongContainerPropertyin 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:AtomConfigReturns ProxyConfig object with access to Atom proxy properties such as proxyHost, proxyPort etc.- Specified by:
getProxyConfigin interfaceAtomConfig- Returns:
- Proxy configuration properties set on an Atom.
-
getMaxPageSize
public int getMaxPageSize()
Description copied from interface:AtomConfigReturns 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:
getMaxPageSizein interfaceAtomConfig- Returns:
- the maximum page size that the atom recommends
-
getMaxNumberObjectTypes
public int getMaxNumberObjectTypes()
Description copied from interface:AtomConfigReturns 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:
getMaxNumberObjectTypesin interfaceAtomConfig- Returns:
- the maximum number of object types allowed
-
getMaxObjectTypeCookieLength
public int getMaxObjectTypeCookieLength()
Description copied from interface:AtomConfigReturns 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:
getMaxObjectTypeCookieLengthin interfaceAtomConfig- Returns:
- the maximum number of characters allowed in an ObjectDefinition cookie.
-
getLogLevel
public Level getLogLevel()
Description copied from interface:AtomConfigReturns the logging level for the connector.- Specified by:
getLogLevelin interfaceAtomConfig- Returns:
- the logging level for the connector
-
-