private String getHostAndPort() { String host = (objectFactory.Options().ServerName.Value().trim().isEmpty()) ? "???" : objectFactory.Options().ServerName.Value(); String port = (objectFactory.Options().PortNumber.Value().equals("0")) ? "???" : objectFactory.Options().PortNumber.Value(); return host + ":" + port; }
private ObjectModelConnector( SOSOptionHostName host, SOSOptionPortNumber port, SOSOptionFolderName folder) { try { objectFactory = new SchedulerObjectFactory(); objectFactory.initMarshaller(Spooler.class); objectFactory.Options().ServerName = host; objectFactory.Options().PortNumber = port; logger.info("Object factory connected with " + getHostAndPort() + "."); } catch (Exception e) { throw new JobNetException( "Unable to connect with SchedulerObjectFactory for server " + getHostAndPort()); } String path = PathResolver.resolvePath(folder.Value()); try { connector = new LiveConnector(LiveConnector.getUrl(path)); logger.info("The configuration directory is " + getRootDirectory() + "."); } catch (Exception e) { throw new JobNetException("Unable to connect with live folder" + path); } }