Class PortScannerImpl
- java.lang.Object
-
- com.github.toolarium.network.scanner.impl.PortScannerImpl
-
- All Implemented Interfaces:
IPortScanner
public class PortScannerImpl extends java.lang.Object implements IPortScanner
Implements theIPortScanner.
-
-
Field Summary
-
Fields inherited from interface com.github.toolarium.network.scanner.IPortScanner
MAX_PORT, MIN_PORT
-
-
Constructor Summary
Constructors Constructor Description PortScannerImpl()ConstructorPortScannerImpl(int numberOfThreads, int timeout)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intprepareIntegerValue(int inputValue, int minValue, int maxValue)Prepare input int valueprotected java.util.concurrent.Future<IPortScanResult>prepareNetworkAddressScanThread(java.util.concurrent.ExecutorService es, java.lang.String scanAddress, int port, int t, java.util.List<IPortScanListener> portScannerListenerList)Prepare the network address scan threadprotected java.util.List<IPortScanListener>preparePortScanListenerList(IPortScanListener... portScannerListeners)Prepare the port scan listener listprotected voidprepareResultSet(java.lang.Boolean filterIsAvailable, java.util.List<IPortScanResult> result, java.util.concurrent.Future<IPortScanResult> futurePortScanResult)Prepare the result setprotected java.util.List<java.lang.String>prepareScanAddressList(java.lang.String scanAddress)Prepare the scan addressesjava.util.List<IPortScanResult>scan(java.lang.String scanAddress, int inputStartPort, int inputEndPort, java.lang.Boolean filterIsAvailable, IPortScanListener... portScannerListeners)Scan a port range
-
-
-
Method Detail
-
scan
public java.util.List<IPortScanResult> scan(java.lang.String scanAddress, int inputStartPort, int inputEndPort, java.lang.Boolean filterIsAvailable, IPortScanListener... portScannerListeners)
Description copied from interface:IPortScannerScan a port range- Specified by:
scanin interfaceIPortScanner- Parameters:
scanAddress- the scan addressinputStartPort- the start portinputEndPort- the end portfilterIsAvailable- filter the output: true only available ports, false only not available ports, both: nullportScannerListeners- a list of port scan listener- Returns:
- the port scan result list
- See Also:
IPortScanner.scan(java.lang.String, int, int, java.lang.Boolean, com.github.toolarium.network.scanner.listener.IPortScanListener[])
-
prepareNetworkAddressScanThread
protected java.util.concurrent.Future<IPortScanResult> prepareNetworkAddressScanThread(java.util.concurrent.ExecutorService es, java.lang.String scanAddress, int port, int t, java.util.List<IPortScanListener> portScannerListenerList)
Prepare the network address scan thread- Parameters:
es- the executer servicescanAddress- the scan addressport- the portt- the timeoutportScannerListenerList- the port scanner listener list- Returns:
- the result
-
prepareResultSet
protected void prepareResultSet(java.lang.Boolean filterIsAvailable, java.util.List<IPortScanResult> result, java.util.concurrent.Future<IPortScanResult> futurePortScanResult)Prepare the result set- Parameters:
filterIsAvailable- true if the filter is availableresult- the result setfuturePortScanResult- the input port scan result
-
prepareIntegerValue
protected int prepareIntegerValue(int inputValue, int minValue, int maxValue)Prepare input int value- Parameters:
inputValue- the input valueminValue- the min valuemaxValue- the max value- Returns:
- the value
-
prepareScanAddressList
protected java.util.List<java.lang.String> prepareScanAddressList(java.lang.String scanAddress)
Prepare the scan addresses- Parameters:
scanAddress- the scan addresse(s)- Returns:
- the scan host address list
-
preparePortScanListenerList
protected java.util.List<IPortScanListener> preparePortScanListenerList(IPortScanListener... portScannerListeners)
Prepare the port scan listener list- Parameters:
portScannerListeners- the port scan listener list- Returns:
- the port scan listener list
-
-