/** * @return the timeout */ public int getTimeout() { return getLevel().getTimeout(); }
public Resolver getResolver() { String hostName = getHostName(); Resolver r = getLevel().find(Resolver.class); if(r == null) { r = new Resolver(hostName); getLevel().registerStarter(r); } return r; }
@Override public boolean start() { if(!getResolver().isStarted()) return false; boolean started = startConnection(); if(started) { uptime = setUptime(); log(Level.DEBUG, "Uptime for %s = %ds", this, uptime); } return started; }
@Override public void configure(PropertiesManager pm) { super.configure(pm); starterKey = getLevel().getParent().registerStarter(new Resolver(bmcname)).getKey(); }
public Socket connect(String host, int port) throws NoSuchAlgorithmException, KeyManagementException, IOException { SocketFactory ss = getLevel().find(SocketFactory.class); Socket s = ss.createSocket(host, port); SSLSocketFactory ssf = getContext().getSocketFactory(); s = ssf.createSocket(s, host, port, true); log(Level.DEBUG, "done SSL handshake for %s", host); return s; }
Socket makeSocket(String host, int port) throws IOException { SocketFactory sf = getLevel().find(SocketFactory.class); return sf.createSocket(host, port); }
@Override public Object call() throws Exception { log(Level.DEBUG, "Collect all stats for host %s", host.getName()); String collectName = Timer.this.name + "/" + "JrdsCollect-" + host.getName(); host.setRunningname(collectName); host.collectAll(); host.setRunningname(collectName + ":notrunning"); return null; }
public Socket createSocket(String host, int port) throws IOException { log(Level.DEBUG, "creating a RMI socket to %s:%d", host, port); return getLevel().find(SocketFactory.class).createSocket(host, port); } }
public HostsList getHostList() { if(root == null && getParent() != null) root = getParent().getHostList(); return root; }
/** * To get the default time out * * @return the connection timeout in second */ public int getTimeout() { return getLevel().getTimeout(); }
public Timer(String name, PropertiesManager.TimerInfo ti) { super(); this.name = name; setTimeout(ti.timeout); setStep(ti.step); setSlowCollectTime(ti.slowCollectTime); this.numCollectors = ti.numCollectors; }
/** * It's called after the starter registration but in host list configuration * A starter can uses it to tweaks it's configuration It can be overriden to * contains delayed initialization but it must begin with a call to * super.configuration(pm) * * @param pm */ public void configure(PropertiesManager pm) { log(Level.DEBUG, "registred to %s", getLevel()); }
@Override public void configure(PropertiesManager pm) { super.configure(pm); maxConnect = pm.numCollectors; timeout = pm.timeout; }
private Socket connect() throws NoSuchAlgorithmException, KeyManagementException, IOException { if(port == 23) { SocketFactory ss = find(SocketFactory.class); return ss.createSocket(iloHost, port); } else { return find(SSLStarter.class).connect(iloHost, port); } }
public JrdsSocketConnection(String host, int port, SocketFactory sf) throws IOException { super(sf.createSocket(host, port)); this.host = host; this.port = port; }
public Resolver(String hostname) { this.hostname = hostname; log(Level.DEBUG, "New dns resolver"); }
@Override public Socket createSocket(HttpContext context) throws IOException { return ss.createSocket(); } };