All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.distelli.persistence.ConvertMarker Maven / Gradle / Ivy

There is a newer version: 3.8.16
Show newest version
package com.distelli.persistence;

import java.util.Map;

public interface ConvertMarker {
    public interface Factory {
        /**
         * Provide an implementation of ConvertMarker implemented as
         * base64(MsgPack) of the keys.
         *
         * Note that the ordering of otherKeyNames must be consistent.
         *
         * @param hashKeyName is the index's hash key name.
         *
         * @param otherKeyNames is the other key names (range key for index,
         *     hash key and range key of primary index).
         *
         * @return a generic convert marker implementation that base64 encodes
         *         a message pack of the selected key attribute names.
         */
        public ConvertMarker create(String hashKeyName, String... otherKeyNames);
    }

    /**
     * @param attributes are the full key/value attributes record fetched
     *        from the DB. The 
Object
is a dynamo db "simple * type". See * http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/document/Item.html#asMap-- * * @param hasHashKey is true if this is a query (and thus we know * the hash key between subsequent paginated queries). For * full table scans this is false. * * @return the serialized marker. */ public String toMarker(Map attributes, boolean hasHashKey); /** * @param hk is the hash key passed into the query(), or null if * this is a scan(). * * @param marker is the marker returned from a previous toMarker() call. * * @return an array of attributes used to identify the location within * pagination. */ public Attribute[] fromMarker(Object hk, String marker); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy