def add(uuid, validto, data = {})
      @log.debug "attempting to add UUID: '#{uuid.to_s}' which is valid to '#{Time.at(validto.to_i)}' with data #{data.to_s}"
      return false unless validate_uuid(uuid)

      store = setup
      # wrap the change in a transaction because multiple autosign instances
      # may try to run simultaneously. This will block until another process
      # releases the transaction lock.
      result = store.transaction do
        # check whether the UUID is already in the store
        if store.root?(uuid)
          @log.warn "Token with UUID '#{uuid}' is already saved in the journal, will not add'"
          store.abort
        else
          # save the token identified by UUID
          store[uuid.to_s] = {:validto => validto.to_s, :data => data}
        end
      end

      # return true if the transaction went through
      return !!result
    end
def add(uuid, validto, data = {})
      @log.debug "attempting to add UUID: '#{uuid.to_s}' which is valid to '#{Time.at(validto.to_i)}' with data #{data.to_s}"
      return false unless validate_uuid(uuid)

      store = setup
      # wrap the change in a transaction because multiple autosign instances
      # may try to run simultaneously. This will block until another process
      # releases the transaction lock.
      result = store.transaction do
        # check whether the UUID is already in the store
        if store.root?(uuid)
          @log.warn "Token with UUID '#{uuid}' is already saved in the journal, will not add'"
          store.abort
        else
          # save the token identified by UUID
          store[uuid.to_s] = {:validto => validto.to_s, :data => data}
        end
      end

      # return true if the transaction went through
      return !!result
    end
@param settings [Hash] config settings for the new journal instance
 @return [Autosign::Journal] instance of the Autosign::Journal class
 Add a new token to the journal. Only succeeds if the token is not in the journal already.

 @param uuid [String] RFC4122 v4 UUID functioning as unique journal entry identifier
 @param validto [Integer] POSIX timestamp in seconds since epoch that the token will be valid until
 @param data [Hash] Arbitrary hash that will be serialized and stored in the journal for auditing purposes

 @example attempt adding a token to the journal
   journal = Autosign::Journal.new({journalfile = '/etc/autosign/journal')
   fail unless journal.add('d2e601c8-93df-4459-be18-1877eaf00920')

 This will only succeed if the token has not previously been added
 This is the primary way this class is expected to be used