Class TransformGZipBytes

java.lang.Object
org.synchronoss.cpo.jdbc.transform.TransformGZipBytes
All Implemented Interfaces:
CpoTransform<byte[],byte[]>, JdbcCpoTransform<byte[],byte[]>

public class TransformGZipBytes extends Object implements 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 Details

    • TransformGZipBytes

      public TransformGZipBytes()
      Construct the TransformGZipBytes
  • Method Details

    • transformIn

      public byte[] transformIn(byte[] inBytes) throws CpoException
      Transforms the datasource object into an object required by the class
      Specified by:
      transformIn in interface CpoTransform<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:
      transformOut in interface JdbcCpoTransform<byte[],byte[]>
      Parameters:
      jpsf - The JdbcPreparedStatementFactory
      attributeObject - 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: JdbcCpoTransform
      Transforms a java object to a data source object for the preparedstatement
      Specified by:
      transformOut in interface JdbcCpoTransform<byte[],byte[]>
      Parameters:
      jpsf - the callable statement factory that will be receiving the object
      attributeObject - the java object to be transformed
      Returns:
      The datasource object
      Throws:
      CpoException - an error transforming the java object to the data object
      UnsupportedOperationException
    • transformOut

      public byte[] transformOut(byte[] j) throws CpoException, UnsupportedOperationException
      Description copied from interface: CpoTransform
      Converts a bean attribute's value into the raw datastore-side representation.
      Specified by:
      transformOut in interface CpoTransform<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 converted
      UnsupportedOperationException