org.jmythapi.protocol.utils
Class RequestUtils
java.lang.Object
  
org.jmythapi.protocol.utils.RequestUtils
public class RequestUtils
- extends Object
 
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
RequestUtils
public RequestUtils()
getHostname
public static String getHostname()
 
addressToInt
public static int addressToInt(InetAddress address)
 
intToAddress
public static InetAddress intToAddress(int addressInt)
                                throws UnknownHostException
- Throws:
 UnknownHostException
 
networkPrefixToNetmask
public static int networkPrefixToNetmask(int prefixLength)
 
getNetworkAddress
public static InetAddress getNetworkAddress(InterfaceAddress interfaceAddress)
                                     throws UnknownHostException
- Throws:
 UnknownHostException
 
getMacAddress
public static String getMacAddress(String ipAddress)
                            throws IOException
- TODO: this seems only to work for a local machine
- Throws:
 IOException
 
 
wakeOnLan
public static void wakeOnLan(String networkAddress,
                             String macAddress)
                      throws UnknownHostException
- Parts of this function was copied from:
 http://coding.derkeiler.com/Archive/Java/comp.lang.java.help/2008-01/msg00013.html
- Parameters:
 networkAddress - the network addressmacAddress - the mac address
- Throws:
 UnknownHostException - if the network address can not be resolved
 
 
wakeOnLan
public static void wakeOnLan(InetAddress networkAddress,
                             String macAddress)
 
getArpCache
public static Map<InetAddress,String> getArpCache()
                                           throws IOException,
                                                  InterruptedException
- Throws:
 IOException
InterruptedException
 
parseArpCacheWindows
public static Map<InetAddress,String> parseArpCacheWindows(String arpCacheData)
 
parseArpCacheLinux
public static Map<InetAddress,String> parseArpCacheLinux(String arpCacheData)
 
parseArpCache
public static Map<InetAddress,String> parseArpCache(String arpCacheData,
                                                    Pattern pattern)
 
getChainID
public static String getChainID()
 
getChainID
public static String getChainID(String chainPrefix)
 
Copyright © 2008-2013. All Rights Reserved.