3 (:import com.interrupt.bookkeeping.cc.analysis.DepthFirstAdapter)
7 (defn get-depth-adapter []
9 (proxy [DepthFirstAdapter] []
12 (caseAExitCommand4 [node]
14 (println (str "caseAExitCommand4: " node))
16 (proxy-super inAExitCommand4 node)
17 (proxy-super outAExitCommand4 node)
24 (caseALoginCommand3 [node]
25 (println (str "caseALoginCommand3: " node))
29 (caseAPrintCommand6 [node]
30 (println (str "caseAPrintCommand6: " node))
35 (caseALoadCommand3 [node]
36 (println (str "caseALoadCommand3: " node))
38 (comment "replicating java calls in the 'DepthFirstAdapter'")
45 (proxy-super inALoadCommand3 node) ;; inALoadCommand3(node);
47 (if (not= (. node getLoad ) nil) ;; if(node.getLoad() != null) { node.getLoad().apply(this); }
48 (.. node getLoad (apply this) )
51 (if (not= (. node getLbracket ) nil) ;; if(node.getLbracket() != null) { node.getLbracket().apply(this); }
52 (.. node getLbracket (apply this) )
55 (if (not= (. node getCommandInput ) nil) ;; if(node.getCommandInput() != null) { node.getCommandInput().apply(this); }
57 (do ;; execute 'if' block
58 (.. node getCommandInput (apply this) )
60 ;; TODO - AOptsCommandInput ...
61 (if (instance? com.interrupt.bookkeeping.cc.node.AOptsCommandInput (. node getCommandInput) )
62 (do (println "OPTIONS input"))
65 ;; AXpathCommandInput ...
66 (if (instance? com.interrupt.bookkeeping.cc.node.AXpathCommandInput (. node getCommandInput) )
68 (println "XPATH input")
76 ;; execute ADD for 'User'
83 (if (not= (. node getRbracket ) nil) ;; if(node.getRbracket() != null) { node.getRbracket().apply(this); }
84 (.. node getRbracket (apply this) )
88 (proxy-super outALoadCommand3 node) ;; outALoadCommand3(node);
92 ;; ADD command (for registering users too)
93 ;; 1. check that there's not an existing user
94 ;; 2. add corresponding default group to the new user
95 ;; 3. add to aauth.groups
96 ;; 4. add to aauth.users
97 ;; 5. add Associated Bookkeeping to Group