Skip to content

Commit

Permalink
Simplify imports of main class
Browse files Browse the repository at this point in the history
  • Loading branch information
shymega committed Feb 8, 2023
1 parent 44a974e commit 322ecaf
Showing 1 changed file with 25 additions and 33 deletions.
58 changes: 25 additions & 33 deletions src/openldbws_example_clojure/core.clj
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
(ns openldbws-example-clojure.core
(:require [taoensso.timbre :as timbre
:refer [log trace debug info warn error
fatal report logf tracef debugf infof
warnf errorf fatalf reportf spy
get-env]])
(:import (com.thalesgroup.rtti._2013_11_28.token.types AccessToken)
(com.thalesgroup.rtti._2021_11_01.ldb GetBoardRequestParams)
(com.thalesgroup.rtti._2021_11_01.ldb LDBServiceSoap)
(com.thalesgroup.rtti._2021_11_01.ldb Ldb)
(com.thalesgroup.rtti._2021_11_01.ldb StationBoardResponseType)
(com.thalesgroup.rtti._2021_11_01.ldb.types ServiceItem)

(org.apache.cxf.endpoint Client))
(:require [taoensso.timbre :refer [info infof]])
(:import
(com.thalesgroup.rtti._2013_11_28.token.types AccessToken)
(com.thalesgroup.rtti._2021_11_01.ldb GetBoardRequestParams Ldb LDBServiceSoap GetBoardRequestParams)
(com.thalesgroup.rtti._2021_11_01.ldb.types ServiceItem))
(:gen-class))

(defn -main
Expand Down Expand Up @@ -46,37 +38,37 @@
;; print informational banner for trains at 'X'
(infof "Trains at: %s"
(->
departureBoard
(.getGetStationBoardResult ,,,)
(.getLocationName ,,,)
))
departureBoard
(.getGetStationBoardResult,,,)
(.getLocationName,,,)
))
(info "===============================================================================")

;; create list of services from 'X'
(def services
(->
departureBoard
(.getGetStationBoardResult ,,,)
(.getTrainServices ,,,)
(.getService ,,,)))
departureBoard
(.getGetStationBoardResult,,,)
(.getTrainServices,,,)
(.getService,,,)))

;; iterate over list of services
(doseq [si services]
(infof "%s to %s from %s - %s"
(.getStd si)

(->
si
(.getDestination ,,,)
(.getLocation ,,,)
(.get ,,, 0)
(.getLocationName ,,,))
si
(.getDestination,,,)
(.getLocation,,,)
(.get,,, 0)
(.getLocationName,,,))

(->
si
(.getOrigin ,,,)
(.getLocation ,,,)
(.get ,,, 0)
(.getLocationName ,,,))
(->
si
(.getOrigin,,,)
(.getLocation,,,)
(.get,,, 0)
(.getLocationName,,,))

(.getEtd si))))
(.getEtd si))))

0 comments on commit 322ecaf

Please sign in to comment.