com.amazon.carbonado.raw
Interface StorableCodecFactory

All Known Implementing Classes:
CompressedStorableCodecFactory, CustomStorableCodecFactory, GenericStorableCodecFactory

public interface StorableCodecFactory

Factory for creating instances of StorableCodec.

Author:
Brian S O'Neill

Method Summary
<S extends Storable>
StorableCodec<S>
createCodec(Class<S> type, StorableIndex pkIndex, boolean isMaster, Layout layout)
           
<S extends Storable>
StorableCodec<S>
createCodec(Class<S> type, StorableIndex pkIndex, boolean isMaster, Layout layout, RawSupport support)
           
 LayoutOptions getLayoutOptions(Class<? extends Storable> type)
          Optionally return additional information regarding storable encoding.
 String getStorageName(Class<? extends Storable> type)
          Returns the preferred storage/database name for the given type.
 

Method Detail

getStorageName

String getStorageName(Class<? extends Storable> type)
                      throws SupportException
Returns the preferred storage/database name for the given type. Return null to let repository decide.

Throws:
SupportException - if type is not supported

getLayoutOptions

LayoutOptions getLayoutOptions(Class<? extends Storable> type)
Optionally return additional information regarding storable encoding.

Since:
1.2.1

createCodec

<S extends Storable> StorableCodec<S> createCodec(Class<S> type,
                                                  StorableIndex pkIndex,
                                                  boolean isMaster,
                                                  Layout layout)
                                              throws SupportException
Parameters:
type - type of storable to create codec for
pkIndex - suggested index for primary key (optional)
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

<S extends Storable> StorableCodec<S> createCodec(Class<S> type,
                                                  StorableIndex pkIndex,
                                                  boolean isMaster,
                                                  Layout layout,
                                                  RawSupport support)
                                              throws SupportException
Parameters:
type - type of storable to create codec for
pkIndex - suggested index for primary key (optional)
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.