Lines 32 - 35 store the variables passed into the properties of this object. This means that they can be used in the
Lines 37 onwards are the
call method. A class that implements Callable will need to have this method, it's the one that is triggered when Xots runs the tasklet. Because this is a Callable - a background task that is kicked off and monitored for a response - it needs to return something, in this case a String.
Lines 39 - 48 create a StringBuilder, get the view and iterate the documents for the relevant state. The view is retrieved using
SessionType.CURRENT, but because the tasklet is running as the server, that is in reality the same as
SessionType.NATIVE. The names of all contacts for the state are output to the StringBuilder.
Line 49 returns the names.
Lines 50 - 53 do the error handling, writing to OpenLog (like the Runnable) and returning the error message.