/** * Establishes a connection to a Splunk service using a map of arguments. * This member creates a new {@code Service} instance and authenticates * the session using credentials passed in from the {@code args} map. * * @param args The {@code args} map. * @return A new {@code Service} instance. */ public static Service connect(Map<String, Object> args) { Service service = new Service(args); if (args.containsKey("username")) { service.login(); } return service; }