Class IONodeStore<USERKEY>

  • Type Parameters:
    USERKEY - The user key.
    All Implemented Interfaces:
    NodeStore<USERKEY,​byte[],​java.io.InputStream>

    public class IONodeStore<USERKEY>
    extends java.lang.Object
    implements NodeStore<USERKEY,​byte[],​java.io.InputStream>
    An implementation of NodeStore that stores and returns streams of data.
    • Method Detail

      • loadData

        public java.io.InputStream loadData​(byte[] key)
        Description copied from interface: NodeStore
        Load the user's data.
        Specified by:
        loadData in interface NodeStore<USERKEY,​byte[],​java.io.InputStream>
        Returns:
        the user's data or null if it is not found.
      • store

        public void store​(byte[] key,
                          java.io.InputStream data)
        Description copied from interface: NodeStore
        Store user data. If an object already exists at the key, it should be replaced.
        Specified by:
        store in interface NodeStore<USERKEY,​byte[],​java.io.InputStream>
      • store

        public void store​(byte[] key,
                          Node<USERKEY,​byte[]> node)
        Description copied from interface: NodeStore
        Store the given node. If an object already exists at the key, it should be replaced.
        Specified by:
        store in interface NodeStore<USERKEY,​byte[],​java.io.InputStream>
      • removeNode

        public void removeNode​(byte[] key)
        Description copied from interface: NodeStore
        Remove the given node key. If the key does not exist, this should return without error.
        Specified by:
        removeNode in interface NodeStore<USERKEY,​byte[],​java.io.InputStream>
      • removeData

        public void removeData​(byte[] key)
        Description copied from interface: NodeStore
        Remove the given data key. If the key does not exist, this should return without error.
        Specified by:
        removeData in interface NodeStore<USERKEY,​byte[],​java.io.InputStream>
      • generateKey

        public byte[] generateKey​(Node<USERKEY,​byte[]> node,
                                  java.io.InputStream inputStream)
        Description copied from interface: NodeStore
        Generate a key to store a node or data element. This key must be unique.
        Specified by:
        generateKey in interface NodeStore<USERKEY,​byte[],​java.io.InputStream>
        Parameters:
        node - This is provided to implementations for some context. If generateKey is being called for the purposes of storing a user key, this will be null.
        inputStream - If a key is being generated for a user key value, it will be passed along. This is most useful when things like a PagedList are adding a value, but the List API does not provide a way to specify a key.
      • convert

        public byte[] convert​(USERKEY key)
        By default this returns the key parameter.
        Specified by:
        convert in interface NodeStore<USERKEY,​byte[],​java.io.InputStream>
        Parameters:
        key - The user key. This is returned as the storage key.
        Returns:
        Return a key for use in storing data.