Class TransformGZipBytes
java.lang.Object
org.synchronoss.cpo.jdbc.transform.TransformGZipBytes
- All Implemented Interfaces:
CpoTransform<byte[],,byte[]> JdbcCpoTransform<byte[],byte[]>
Converts a compressed byte[] from a jdbc datasource to an uncompressed byte[] and from a byte[]
to a compressed byte[] in a datasource
- Author:
- david berry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]transformIn(byte[] inBytes) Transforms the datasource object into an object required by the classbyte[]transformOut(byte[] j) Converts a bean attribute's value into the raw datastore-side representation.byte[]transformOut(JdbcCallableStatementFactory jpsf, byte[] attributeObject) Transforms a java object to a data source object for the preparedstatementbyte[]transformOut(JdbcPreparedStatementFactory jpsf, byte[] attributeObject) Transforms the data from the class attribute to the object required by the datasource
-
Constructor Details
-
TransformGZipBytes
public TransformGZipBytes()Construct the TransformGZipBytes
-
-
Method Details
-
transformIn
Transforms the datasource object into an object required by the class- Specified by:
transformInin interfaceCpoTransform<byte[],byte[]> - Parameters:
inBytes- The object that represents the datasource object being retrieved- Returns:
- The byte array to be stored in the java attribute
- Throws:
CpoException- - An error occurred
-
transformOut
public byte[] transformOut(JdbcPreparedStatementFactory jpsf, byte[] attributeObject) throws CpoException Transforms the data from the class attribute to the object required by the datasource- Specified by:
transformOutin interfaceJdbcCpoTransform<byte[],byte[]> - Parameters:
jpsf- The JdbcPreparedStatementFactoryattributeObject- The object that represents the attribute being persisted.- Returns:
- a byte array to put into the datastore
- Throws:
CpoException- - An error occurred
-
transformOut
public byte[] transformOut(JdbcCallableStatementFactory jpsf, byte[] attributeObject) throws CpoException, UnsupportedOperationException Description copied from interface:JdbcCpoTransformTransforms a java object to a data source object for the preparedstatement- Specified by:
transformOutin interfaceJdbcCpoTransform<byte[],byte[]> - Parameters:
jpsf- the callable statement factory that will be receiving the objectattributeObject- the java object to be transformed- Returns:
- The datasource object
- Throws:
CpoException- an error transforming the java object to the data objectUnsupportedOperationException
-
transformOut
Description copied from interface:CpoTransformConverts a bean attribute's value into the raw datastore-side representation.- Specified by:
transformOutin interfaceCpoTransform<byte[],byte[]> - Parameters:
j- the value read from the bean attribute- Returns:
- the value to bind to the datastore
- Throws:
CpoException- if the value cannot be convertedUnsupportedOperationException
-