       :request (HashPrintRequestAttributeSet. (into-array PrintRequestAttribute s))
       nil)))
 
+(defn- valid-attrs?
+  "Returns true if all of the Attribute objects in
+   attrs are bounded by the type specified by k.
+   Valid keywords for k are:
+     :doc
+     :job
+     :request,
+     :service"
+  {:since "0.0.1"}
+  [attrs k]
+  (if (seq attrs)
+    (let [mappings {:doc DocAttribute
+                    :job PrintJobAttribute
+                    :request PrintRequestAttribute
+                    :service PrintServiceAttribute}]
+      (every? (fn [attr] (instance? (k mappings) attr)) attrs))))
+
+
 (defn- make-doc
   "Returns a javax.print.Doc object for the print data in this
    job map. SimpleDoc will throw an IllegalArgumentException if

          maybe-listen))))

(defmethod make-job :docs [spec]
  (let [{docs :docs} spec
        {:keys [doc ^PrintService printer attrs ^PrintJobtListener listener]
         :or {printer (printer :default)
              attrs #{MediaTray/MAIN}}} spec
              maybe-listen #(if listener (add-listener % listener) %)]
    (if (and (every? #(valid-attrs? (:attrs %) :doc) docs)
             (valid-attrs? attrs :job))
      (map->MultiJobSpec {:docs (map #(assoc % :obj (make-doc %)) docs)
                          :printer printer
                          :attrs attrs
                          :jobs (map maybe-listen
                                     (for [d docs]
                                       (.. printer createPrintJob)))}))))

;; (defn make-job
;;   "Returns a JobSpec map that is the result of

         :or {printer (printer :default)
              attrs #{MediaTray/MAIN}}} spec
              maybe-listen #(if listener (add-listener % listener) %)]
    (if  (and (valid-attrs? doc-attrs :doc)
             (valid-attrs? attrs :job))
      (-> (map->JobSpec {:doc doc
                         :printer printer
