Package unlimited.fc.client.engine
Class NetworkDiagnostics
- java.lang.Object
-
- java.util.Observable
-
- unlimited.fc.client.engine.NetworkDiagnostics
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class NetworkDiagnostics extends java.util.Observable implements java.lang.AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringOS_STATUS_BADFCVERSIONstatic java.lang.StringOS_STATUS_THIRDPARTYstatic java.lang.StringOS_STATUS_UNKNOWN
-
Constructor Summary
Constructors Modifier Constructor Description protectedNetworkDiagnostics(boolean isUnitTest, int unitTestMtuSize)NetworkDiagnostics(java.lang.String host, int port, boolean useSSL, boolean enableAuth, java.util.function.Supplier<ClientCredentials> credentials, boolean useServlet, java.lang.String servletLocation)NetworkDiagnostics(NetworkDiagnosticsData diagnosticData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]calculateOptimalDiskParameters(int rtt, int maxBandwidth)voidclose()java.lang.StringgetAgentID()intgetClientIdentifier()intgetClientSubIdentifier()java.lang.StringgetHost()intgetMaxSupportedUnitSize()intgetPathMTU(java.lang.String host)intgetProgress()java.lang.StringgetSiteOS()java.lang.StringgetStatus()protected FCClientEnginegetTestEngine()protected FCClientEnginegetTestEngine(boolean useEnableAuth)booleanisFileCatalystServer()booleanisFirewallBlockingIncomingUDP(int udpPort)booleanisFirewallBlockingOutgoingUDP()booleanisSupportsUDP()protected voidquitTestEngine(FCClientEngine test)voidsetClientConnectKey(java.lang.String clientConnectKey)voidsetClientIdentifier(int clientIdentifier)voidsetClientSubIdentifier(int clientSubIdentifier)protected voidsetUnitTest(boolean ut)protected voidsetUnitTestMTU(int mtu)voidtestControl()booleantestMultiStreamTCPDataConnections()booleantestPacket(java.lang.String host, int packetSize)Test if a packet of the given size can travel to the destination unfragmenteddoubletestPacketLoss()doubletestPacketLoss(int packetSize, int numPackets, int rate)longtestRTT()Calculates time for a round trip to server, returns time in milliseconds.booleantestSingleStreamTCPDataConnections()booleantestSingleStreamTCPDataConnections(boolean portFallback)java.lang.StringtoString()
-
-
-
Field Detail
-
OS_STATUS_UNKNOWN
public static final java.lang.String OS_STATUS_UNKNOWN
- See Also:
- Constant Field Values
-
OS_STATUS_BADFCVERSION
public static final java.lang.String OS_STATUS_BADFCVERSION
- See Also:
- Constant Field Values
-
OS_STATUS_THIRDPARTY
public static final java.lang.String OS_STATUS_THIRDPARTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NetworkDiagnostics
protected NetworkDiagnostics(boolean isUnitTest, int unitTestMtuSize)
-
NetworkDiagnostics
public NetworkDiagnostics(java.lang.String host, int port, boolean useSSL, boolean enableAuth, java.util.function.Supplier<ClientCredentials> credentials, boolean useServlet, java.lang.String servletLocation)
-
NetworkDiagnostics
public NetworkDiagnostics(NetworkDiagnosticsData diagnosticData)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
testControl
public void testControl() throws java.lang.Exception- Throws:
java.lang.Exception
-
testRTT
public long testRTT() throws java.lang.ExceptionCalculates time for a round trip to server, returns time in milliseconds.- Returns:
- rtt round trip time in millis
- Throws:
java.lang.Exception
-
testPacketLoss
public double testPacketLoss() throws java.lang.Exception- Throws:
java.lang.Exception
-
testPacketLoss
public double testPacketLoss(int packetSize, int numPackets, int rate) throws java.lang.Exception- Parameters:
packetSize-numPackets-rate-- Returns:
- loss percentage of packets lost
- Throws:
java.lang.Exception
-
getMaxSupportedUnitSize
public int getMaxSupportedUnitSize() throws java.lang.Exception- Throws:
java.lang.Exception
-
testSingleStreamTCPDataConnections
public boolean testSingleStreamTCPDataConnections()
-
testSingleStreamTCPDataConnections
public boolean testSingleStreamTCPDataConnections(boolean portFallback)
-
testMultiStreamTCPDataConnections
public boolean testMultiStreamTCPDataConnections()
-
isFirewallBlockingOutgoingUDP
public boolean isFirewallBlockingOutgoingUDP()
-
isFileCatalystServer
public boolean isFileCatalystServer() throws java.lang.Exception- Throws:
java.lang.Exception
-
isFirewallBlockingIncomingUDP
public boolean isFirewallBlockingIncomingUDP(int udpPort)
-
quitTestEngine
protected void quitTestEngine(FCClientEngine test) throws java.io.IOException, unlimited.core.util.common.exception.FCException
- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
getTestEngine
protected FCClientEngine getTestEngine() throws java.io.IOException, unlimited.core.util.common.exception.FCException
- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
getTestEngine
protected FCClientEngine getTestEngine(boolean useEnableAuth) throws java.io.IOException, unlimited.core.util.common.exception.FCException
- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
getPathMTU
public int getPathMTU(java.lang.String host) throws java.lang.Exception- Throws:
java.lang.Exception
-
calculateOptimalDiskParameters
public int[] calculateOptimalDiskParameters(int rtt, int maxBandwidth)
-
testPacket
public boolean testPacket(java.lang.String host, int packetSize) throws java.lang.ExceptionTest if a packet of the given size can travel to the destination unfragmented- Parameters:
host- destinationpacketSize- Size of packet in bytes INCLUDING the 8 byte ICMP header and the 20 byte IP header- Returns:
- true if the packetsize can be sent unfragmented, false otherwise
- Throws:
java.lang.Exception
-
getProgress
public int getProgress()
-
getStatus
public java.lang.String getStatus()
-
setClientConnectKey
public void setClientConnectKey(java.lang.String clientConnectKey)
-
getClientIdentifier
public int getClientIdentifier()
- Returns:
- the clientIdentifier
-
setClientIdentifier
public void setClientIdentifier(int clientIdentifier)
- Parameters:
clientIdentifier- the clientIdentifier to set
-
getClientSubIdentifier
public int getClientSubIdentifier()
-
setClientSubIdentifier
public void setClientSubIdentifier(int clientSubIdentifier)
-
getHost
public java.lang.String getHost()
-
isSupportsUDP
public boolean isSupportsUDP()
- Returns:
- the supportsUDP
-
getSiteOS
public java.lang.String getSiteOS()
-
getAgentID
public java.lang.String getAgentID()
-
setUnitTest
protected void setUnitTest(boolean ut)
-
setUnitTestMTU
protected void setUnitTestMTU(int mtu)
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-