public class NetworkIF extends Object
| Constructor and Description |
|---|
NetworkIF() |
| Modifier and Type | Method and Description |
|---|---|
long |
getBytesRecv()
Getter for the field
bytesRecv. |
long |
getBytesSent()
Getter for the field
bytesSent. |
long |
getCollisions()
Getter for the field
collisions. |
String |
getDisplayName()
Interface description.
|
long |
getInDrops()
Getter for the field
inDrops. |
long |
getInErrors()
Getter for the field
inErrors. |
String[] |
getIPv4addr()
The Internet Protocol (IP) v4 address.
|
String[] |
getIPv6addr()
The Internet Protocol (IP) v6 address.
|
String |
getMacaddr()
The Media Access Control (MAC) address.
|
int |
getMTU()
The interface Maximum Transmission Unit (MTU).
|
String |
getName()
Interface name.
|
long |
getOutErrors()
Getter for the field
outErrors. |
long |
getPacketsRecv()
Getter for the field
packetsRecv. |
long |
getPacketsSent()
Getter for the field
packetsSent. |
Short[] |
getPrefixLengths()
The Internet Protocol (IP) v6 address.
|
long |
getSpeed()
Getter for the field
speed. |
Short[] |
getSubnetMasks()
The Internet Protocol (IP) v4 subnet masks.
|
long |
getTimeStamp()
Getter for the field
timeStamp. |
NetworkInterface |
queryNetworkInterface()
The NetworkInterface object.
|
void |
setBytesRecv(long bytesRecv)
Setter for the field
bytesRecv. |
void |
setBytesSent(long bytesSent)
Setter for the field
bytesSent. |
void |
setCollisions(long collisions)
Setter for the field
collisions. |
void |
setInDrops(long inDrops)
Setter for the field
inDrops. |
void |
setInErrors(long inErrors)
Setter for the field
inErrors. |
void |
setNetworkInterface(NetworkInterface networkInterface)
Sets the network interface and calculates other information derived from it
|
void |
setOutErrors(long outErrors)
Setter for the field
outErrors. |
void |
setPacketsRecv(long packetsRecv)
Setter for the field
packetsRecv. |
void |
setPacketsSent(long packetsSent)
Setter for the field
packetsSent. |
void |
setSpeed(long speed)
Setter for the field
speed. |
void |
setTimeStamp(long timeStamp)
Setter for the field
timeStamp. |
String |
toString() |
boolean |
updateAttributes()
Updates interface network statistics on this interface.
|
public NetworkInterface queryNetworkInterface()
The NetworkInterface object.
NetworkInterface.public void setNetworkInterface(NetworkInterface networkInterface)
networkInterface - The network interface to setpublic String getName()
Interface name.
public String getDisplayName()
Interface description.
public int getMTU()
The interface Maximum Transmission Unit (MTU).
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the setNetworkInterface(NetworkInterface) method
public String getMacaddr()
The Media Access Control (MAC) address.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the setNetworkInterface(NetworkInterface) method
public String[] getIPv4addr()
The Internet Protocol (IP) v4 address.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the setNetworkInterface(NetworkInterface) method
public Short[] getSubnetMasks()
The Internet Protocol (IP) v4 subnet masks.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the setNetworkInterface(NetworkInterface) method.
public String[] getIPv6addr()
The Internet Protocol (IP) v6 address.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the setNetworkInterface(NetworkInterface) method
public Short[] getPrefixLengths()
The Internet Protocol (IP) v6 address.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the setNetworkInterface(NetworkInterface) method
public long getBytesRecv()
Getter for the field bytesRecv.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the updateAttributes() method
public void setBytesRecv(long bytesRecv)
Setter for the field bytesRecv.
bytesRecv - Set Bytes Receivedpublic long getBytesSent()
Getter for the field bytesSent.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the updateAttributes() method
public void setBytesSent(long bytesSent)
Setter for the field bytesSent.
bytesSent - Set the Bytes Sentpublic long getPacketsRecv()
Getter for the field packetsRecv.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the updateAttributes() method
public void setPacketsRecv(long packetsRecv)
Setter for the field packetsRecv.
packetsRecv - Set The Packets Receivedpublic long getPacketsSent()
Getter for the field packetsSent.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the updateAttributes() method
public void setPacketsSent(long packetsSent)
Setter for the field packetsSent.
packetsSent - Set The Packets Sentpublic long getInErrors()
Getter for the field inErrors.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the updateAttributes() method
public void setInErrors(long inErrors)
Setter for the field inErrors.
inErrors - The Input Errors to set.public long getOutErrors()
Getter for the field outErrors.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the updateAttributes() method
public void setOutErrors(long outErrors)
Setter for the field outErrors.
outErrors - The Output Errors to set.public long getInDrops()
Getter for the field inDrops.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the updateAttributes() method
public void setInDrops(long inDrops)
Setter for the field inDrops.
inDrops - The incoming (receive) dropped packets to set.public long getCollisions()
Getter for the field collisions.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the updateAttributes() method
public void setCollisions(long collisions)
Setter for the field collisions.
collisions - The collisions to set.public long getSpeed()
Getter for the field speed.
This value is set when the NetworkIF is
instantiated and may not be up to date. To update this value, execute
the updateAttributes() method
public void setSpeed(long speed)
Setter for the field speed.
speed - Set the speed of the network interfacepublic long getTimeStamp()
Getter for the field timeStamp.
public void setTimeStamp(long timeStamp)
Setter for the field timeStamp.
timeStamp - The timeStamp to set.public boolean updateAttributes()
true if the update was successful, false otherwise.Copyright © 2010–2020 oshi. All rights reserved.