             [puppetlabs.puppetdb.scf.migrate :refer [migrate! indexes!]]
             [puppetlabs.puppetdb.scf.storage :as scf-store]
             [puppetlabs.puppetdb.scf.storage-utils :as sutils]
+            [puppetlabs.puppetdb.schema :as pls :refer [defn-validated]]
             [puppetlabs.puppetdb.time :refer [to-seconds to-millis parse-period
                                               format-period period?]]
             [puppetlabs.puppetdb.utils :as utils]
             [puppetlabs.trapperkeeper.core :refer [defservice] :as tk]
             [puppetlabs.trapperkeeper.services :refer [service-id service-context]]
             [robert.hooke :as rh]
+            [schema.core :as s]
             [slingshot.slingshot :refer [throw+ try+]])
-  (:import [javax.jms ExceptionListener]))
+  (:import [javax.jms ExceptionListener]
+           [org.joda.time Period]))
 
 (def cli-description "Main PuppetDB daemon")
 (def database-metrics-registry (get-in metrics/metrics-registries [:database :registry]))

      (log/error e "Error while deactivating stale nodes"))))

(defn purge-nodes!
  "Delete nodes which have been *deactivated or expired* longer than `node-purge-ttl`."
  [node-purge-ttl db]
  {:pre [(map? db)
         (period? node-purge-ttl)]}

                database read-database
                puppetdb command-processing]} config
        {:keys [pretty-print]} developer
        {:keys [gc-interval dlo-compression-interval]} database
        {:keys [dlo-compression-threshold]} command-processing
        {:keys [disable-update-checking]} puppetdb

