   "Creates a distributed atom for the client on the given path."
   [client path]
   (-> client
-      (.create path AsyncReference)
+      (.create path DistributedAtomicValue)
       (.get)))
 
 (defn get!
   "Gets a value from an atom."
-  [^AsyncReference atom]
+  [^DistributedAtomicValue atom]
   (-> (.get atom)
       (.get)))
 
 (defn set!
   "Sets a value for an atom."
-  [^AsyncReference atom value]
+  [^DistributedAtomicValue atom value]
   (-> (.set atom value)
       (.get)))
 
 (defn cas!
   "Compares and sets a value for an atom."
-  [^AsyncReference atom expected updated]
+  [^DistributedAtomicValue atom expected updated]
   (-> (.compareAndSet atom expected updated)
       (.get)))
  "Returns a CopycatClient for the given nodes. Nodes should be a seq of maps containing :id, :host and :port values."
  ^CopycatClient
  [nodes]
  (let [cluster-members (map #(-> (NettyMember/builder)
                                  (.withId (:id %))
                                  (.withHost (:host %))
                                  (.withPort (:port %))
                                  .build)
                             nodes)
        cluster (-> (NettyMembers/builder)
                    (.withMembers cluster-members)
                    (.build))
        client (-> (CopycatClient/builder)
                   (.withMembers cluster)
                   (.build)
                   (.open)

(ns figaro.core
    "A sweet Clojure API for Copycat"
  (:import (net.kuujo.copycat Copycat CopycatClient CopycatServer)
           (net.kuujo.copycat.raft Members Member)
           (net.kuujo.copycat.io.transport NettyTransport)
           (net.kuujo.copycat.io.storage Log StorageLevel)
           (net.kuujo.copycat.atomic DistributedAtomicValue)))

(defn mem-log
  "Creates an in memory log."
