/** * Creates a default TCP transport mapping with the server for incoming * messages disabled. * @throws IOException * on failure of binding a local port. */ public DefaultTcpTransportMapping() throws IOException { super(new TcpAddress(InetAddress.getLocalHost(), 0)); }
/** * Creates a default TCP transport mapping with the server for incoming * messages disabled. * * @throws IOException * on failure of binding a local port. */ public DefaultTcpTransportMapping() throws IOException { super(new TcpAddress(InetAddress.getLocalHost(), 0)); }
/** * Creates a default TCP transport mapping with the server for incoming * messages disabled. * @throws UnknownHostException * @throws IOException * on failure of binding a local port. */ public DefaultTcpTransportMapping() throws UnknownHostException, IOException { super(new TcpAddress(InetAddress.getLocalHost(), 0)); }
/** * <p>Constructor for SnmpTcpV1Manager.</p> * * @param loader a {@link net.percederberg.mibble.MibLoader} object. * @param ipAddress a {@link java.lang.String} object. * @param snmpCommunity a {@link java.lang.String} object. * @param retries a int. * @param timeout a int. * @param maxSizeRequestPDU a int. * @param maxRepetitions a int. * @param destinationPort a int. * @throws java.io.IOException if any. */ public SnmpTcpV1Manager(MibLoader loader, String ipAddress, String snmpCommunity, int retries, int timeout, int maxSizeRequestPDU, int maxRepetitions,int destinationPort) throws IOException { super(loader, retries, timeout, maxSizeRequestPDU,maxRepetitions,new TcpTransportMappingFactory(),new TcpAddress("0.0.0.0/0")); this.snmpCommunity = snmpCommunity; this.tcpAddress = new TcpAddress(ipAddress+"/"+destinationPort); } /**
/** * <p>Constructor for SnmpTcpV2Manager.</p> * * @param loader a {@link net.percederberg.mibble.MibLoader} object. * @param ipAddress a {@link java.lang.String} object. * @param snmpCommunity a {@link java.lang.String} object. * @param retries a int. * @param timeout a int. * @param maxSizeRequestPDU a int. * @param maxRepetitions a int. * @param destinationPort a int. * @throws java.io.IOException if any. */ public SnmpTcpV2Manager(MibLoader loader, String ipAddress, String snmpCommunity,int retries, int timeout, int maxSizeRequestPDU,int maxRepetitions, int destinationPort) throws IOException { super(loader, retries, timeout, maxSizeRequestPDU,maxRepetitions, new TcpTransportMappingFactory(),new TcpAddress("0.0.0.0/0")); this.snmpCommunity = snmpCommunity; this.tcpAddress = new TcpAddress(ipAddress+"/"+destinationPort); } /**
/** {@inheritDoc} */ @Override public void doSetParameters(Map<String, String> conParams) { int destinationPort = super.convertStringToIntParam("destinationPort",conParams.get("destinationPort"),161); this.tcpAddress = new TcpAddress(conParams.get("ipAddress")+"/"+destinationPort); this.snmpCommunity=conParams.get("snmpCommunity"); }
/** {@inheritDoc} */ @Override protected void doSetParameters(Map<String, String> conParams) { int destinationPort = super.convertStringToIntParam("destinationPort",conParams.get("destinationPort"),161); this.tcpAddress = new TcpAddress(conParams.get("ipAddress")+"/"+destinationPort); this.snmpCommunity=conParams.get("snmpCommunity"); }
/** {@inheritDoc} */ @Override public void doSetParameters(Map<String, String> conParams) { int destinationPort = super.convertStringToIntParam("destinationPort",conParams.get("destinationPort"),161); this.tcpAddress = new TcpAddress(conParams.get("ipAddress")+"/"+destinationPort); this.ver3Username = conParams.get("ver3Username"); this.ver3AuthPasscode = conParams.get("ver3Username"); this.authenticationProtocol = conParams.get("authenticationProtocol"); this.privacyProtocol = conParams.get("privacyProtocol"); this.privacyProtocolPassShare = conParams.get("privacyProtocolPassShare"); }
private static Address getAddress(String transportAddress) { String transport = "udp"; int colon = transportAddress.indexOf(':'); if (colon > 0) { transport = transportAddress.substring(0, colon); transportAddress = transportAddress.substring(colon + 1); } // set default port if (transportAddress.indexOf('/') < 0) { transportAddress += "/161"; } if (transport.equalsIgnoreCase("udp")) { return new UdpAddress(transportAddress); } else if (transport.equalsIgnoreCase("tcp")) { return new TcpAddress(transportAddress); } throw new IllegalArgumentException("Unknown transport " + transport); }
private static Address getAddress(String transportAddress) { String transport = "udp"; int colon = transportAddress.indexOf(':'); if (colon > 0) { transport = transportAddress.substring(0, colon); transportAddress = transportAddress.substring(colon+1); } // set default port if (transportAddress.indexOf('/') < 0) { transportAddress += "/161"; } if (transport.equalsIgnoreCase("udp")) { return new UdpAddress(transportAddress); } else if (transport.equalsIgnoreCase("tcp")) { return new TcpAddress(transportAddress); } throw new IllegalArgumentException("Unknown transport "+transport); }
@Override public TcpAddress getListenAddress() { int port = tcpAddress.getPort(); ServerThread serverThreadCopy = serverThread; try { port = serverThreadCopy.ssc.socket().getLocalPort(); } catch (NullPointerException npe) { // ignore } return new TcpAddress(tcpAddress.getInetAddress(), port); }
/** * <p>Constructor for SnmpTcpV2Manager.</p> * * @param loader a {@link net.percederberg.mibble.MibLoader} object. */ public SnmpTcpV2Manager(MibLoader loader) { super(loader,new TcpTransportMappingFactory(),new DefaultMessageDispatcherFactory(),new TcpAddress("0.0.0.0/0")); }
public static Address parse(String address) { try { TcpAddress a = new TcpAddress(); if (a.parseAddress(address)) { return a; } } catch (Exception ex) { logger.error(ex); } return null; }
public static Address parse(String address) { try { TcpAddress a = new TcpAddress(); if (a.parseAddress(address)) { return a; } } catch (Exception ex) { logger.error(ex); } return null; }
/** * <p>Constructor for SnmpTcpV1Manager.</p> * * @param loader a {@link net.percederberg.mibble.MibLoader} object. */ public SnmpTcpV1Manager(MibLoader loader) { super(loader,new TcpTransportMappingFactory(),new DefaultMessageDispatcherFactory(),new TcpAddress("0.0.0.0/0")); }
public static Address parse(String address) { try { TcpAddress a = new TcpAddress(); if (a.parseAddress(address)) { return a; } } catch (Exception ex) { logger.error(ex); } return null; }
/** * <p>Constructor for SnmpTcpV3Manager.</p> * * @param loader a {@link net.percederberg.mibble.MibLoader} object. */ public SnmpTcpV3Manager(MibLoader loader) { super(loader,new TcpTransportMappingFactory(),new DefaultMessageDispatcherFactory(),new TcpAddress("0.0.0.0/0")); }
@Override public TcpAddress getListenAddress() { int port = tcpAddress.getPort(); ServerThread serverThreadCopy = serverThread; try { port = ((InetSocketAddress) serverThreadCopy.ssc.getLocalAddress()).getPort(); } catch (NullPointerException npe) { // ignore } catch (IOException e) { e.printStackTrace(); } return new TcpAddress(tcpAddress.getInetAddress(), port); }
@Override public TcpAddress getListenAddress() { int port = tcpAddress.getPort(); ServerThread serverThreadCopy = serverThread; try { port = ((InetSocketAddress)serverThreadCopy.ssc.getLocalAddress()).getPort(); } catch (NullPointerException npe) { // ignore } catch (IOException e) { e.printStackTrace(); } return new TcpAddress(tcpAddress.getInetAddress(), port); }
@Override public TcpAddress getListenAddress() { int port = tcpAddress.getPort(); ServerThread serverThreadCopy = serverThread; try { port = serverThreadCopy.ssc.socket().getLocalPort(); } catch (NullPointerException npe) { if (logger.isDebugEnabled()) { logger.debug("TLSTM.getListenAddress called but TLSTM is not listening yet"); } } return new TcpAddress(tcpAddress.getInetAddress(), port); }