Package com.boomi.connector.testutil
Class SimpleAtomContext
- java.lang.Object
-
- com.boomi.connector.testutil.SimpleAtomContext
-
- All Implemented Interfaces:
AtomContext
- Direct Known Subclasses:
ConnectorTestContext
,SimpleBrowseContext
public class SimpleAtomContext extends Object implements AtomContext
-
-
Constructor Summary
Constructors Constructor Description SimpleAtomContext(AtomConfig config)
Constructs a new SimpleAtomContext
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static SSLContext
createSSLContext(PublicKeyStore publicKeyStore, PrivateKeyStore privateKeyStore)
OutputStream
createTempOutputStream()
Returns an OutputStream which can be used for writing intermediate data in a "safe" manner (i.e.AtomConfig
getConfig()
Returns the current Atom's configuration.InputStream
tempOutputStreamToInputStream(OutputStream tempOutputStream)
Converts the OutputStream to an InputStream for reading any temporary data written.Payload
tempOutputStreamToPayload(OutputStream tempOutputStream)
Converts the OutputStream to an Payload for passing any temporary data written to anOperationResponse
method.
-
-
-
Constructor Detail
-
SimpleAtomContext
public SimpleAtomContext(AtomConfig config)
Constructs a new SimpleAtomContext- Parameters:
config
- the basic config for browsing
-
-
Method Detail
-
createSSLContext
protected static SSLContext createSSLContext(PublicKeyStore publicKeyStore, PrivateKeyStore privateKeyStore) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
getConfig
public AtomConfig getConfig()
Description copied from interface:AtomContext
Returns the current Atom's configuration.- Specified by:
getConfig
in interfaceAtomContext
-
createTempOutputStream
public OutputStream createTempOutputStream() throws IOException
Description copied from interface:AtomContext
Returns an OutputStream which can be used for writing intermediate data in a "safe" manner (i.e. the intermediate storage will not use an unbounded amount of memory). The temporary data may be read by calling either theAtomContext.tempOutputStreamToInputStream(java.io.OutputStream)
orAtomContext.tempOutputStreamToPayload(java.io.OutputStream)
methods on the returned OutputStream before closing. The returned OutputStream must be closed after use.- Specified by:
createTempOutputStream
in interfaceAtomContext
- Throws:
IOException
-
tempOutputStreamToInputStream
public InputStream tempOutputStreamToInputStream(OutputStream tempOutputStream) throws IOException
Description copied from interface:AtomContext
Converts the OutputStream to an InputStream for reading any temporary data written. This method must be called before the temporary OutputStream is closed. The returned InputStream must be closed after use. Prefer theAtomContext.tempOutputStreamToPayload(java.io.OutputStream)
method for passing the data to anOperationResponse
method.- Specified by:
tempOutputStreamToInputStream
in interfaceAtomContext
- Parameters:
tempOutputStream
- OutputStream created from a call toAtomContext.createTempOutputStream()
- Throws:
IOException
-
tempOutputStreamToPayload
public Payload tempOutputStreamToPayload(OutputStream tempOutputStream) throws IOException
Description copied from interface:AtomContext
Converts the OutputStream to an Payload for passing any temporary data written to anOperationResponse
method. This method must be called before the temporary OutputStream is closed.- Specified by:
tempOutputStreamToPayload
in interfaceAtomContext
- Parameters:
tempOutputStream
- OutputStream created from a call toAtomContext.createTempOutputStream()
- Throws:
IOException
-
-