com.amazon.carbonado.raw
Class CustomStorableCodecFactory

java.lang.Object
  extended by com.amazon.carbonado.raw.CustomStorableCodecFactory
All Implemented Interfaces:
StorableCodecFactory

public abstract class CustomStorableCodecFactory
extends Object
implements StorableCodecFactory

Factory for custom storable codecs.

Author:
Brian S O'Neill

Constructor Summary
CustomStorableCodecFactory()
           
 
Method Summary
protected abstract
<S extends Storable>
CustomStorableCodec<S>
createCodec(Class<S> type, boolean isMaster, Layout layout)
           
protected
<S extends Storable>
CustomStorableCodec<S>
createCodec(Class<S> type, boolean isMaster, Layout layout, RawSupport support)
           
<S extends Storable>
CustomStorableCodec<S>
createCodec(Class<S> type, StorableIndex pkIndex, boolean isMaster, Layout layout)
           
<S extends Storable>
CustomStorableCodec<S>
createCodec(Class<S> type, StorableIndex pkIndex, boolean isMaster, Layout layout, RawSupport support)
           
 String getStorageName(Class<? extends Storable> type)
          Returns null to let repository decide what the name should be.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.amazon.carbonado.raw.StorableCodecFactory
getLayoutOptions
 

Constructor Detail

CustomStorableCodecFactory

public CustomStorableCodecFactory()
Method Detail

getStorageName

public String getStorageName(Class<? extends Storable> type)
                      throws SupportException
Returns null to let repository decide what the name should be.

Specified by:
getStorageName in interface StorableCodecFactory
Throws:
SupportException - if type is not supported

createCodec

public <S extends Storable> CustomStorableCodec<S> createCodec(Class<S> type,
                                                               StorableIndex pkIndex,
                                                               boolean isMaster,
                                                               Layout layout)
                                                    throws SupportException
Specified by:
createCodec in interface StorableCodecFactory
Parameters:
type - type of storable to create codec for
pkIndex - ignored
isMaster - when true, version properties and sequences are managed
layout - when non-null, attempt to encode a storable layout generation value in each storable
Throws:
SupportException - if type is not supported

createCodec

public <S extends Storable> CustomStorableCodec<S> createCodec(Class<S> type,
                                                               StorableIndex pkIndex,
                                                               boolean isMaster,
                                                               Layout layout,
                                                               RawSupport support)
                                                    throws SupportException
Specified by:
createCodec in interface StorableCodecFactory
Parameters:
type - type of storable to create codec for
pkIndex - ignored
isMaster - when true, version properties and sequences are managed
layout - when non-null, attempt to encode a storable layout generation value in each storable
support - binds generated storable with a storage layer
Throws:
SupportException - if type is not supported
Since:
1.2

createCodec

protected abstract <S extends Storable> CustomStorableCodec<S> createCodec(Class<S> type,
                                                                           boolean isMaster,
                                                                           Layout layout)
                                                                throws SupportException
Parameters:
type - type of storable to create codec for
isMaster - when true, version properties and sequences are managed
layout - when non-null, attempt to encode a storable layout generation value in each storable
Throws:
SupportException - if type is not supported

createCodec

protected <S extends Storable> CustomStorableCodec<S> createCodec(Class<S> type,
                                                                  boolean isMaster,
                                                                  Layout layout,
                                                                  RawSupport support)
                                                       throws SupportException
Parameters:
type - type of storable to create codec for
isMaster - when true, version properties and sequences are managed
layout - when non-null, attempt to encode a storable layout generation value in each storable
support - binds generated storable with a storage layer
Throws:
SupportException - if type is not supported
Since:
1.2


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.