org.jmythapi.protocol.utils
Class RequestUtils

java.lang.Object
  extended by org.jmythapi.protocol.utils.RequestUtils

public class RequestUtils
extends Object


Constructor Summary
RequestUtils()
           
 
Method Summary
static int addressToInt(InetAddress address)
           
static Map<InetAddress,String> getArpCache()
           
static String getChainID()
           
static String getChainID(String chainPrefix)
           
static String getHostname()
           
static String getMacAddress(String ipAddress)
          TODO: this seems only to work for a local machine
static InetAddress getNetworkAddress(InterfaceAddress interfaceAddress)
           
static InetAddress intToAddress(int addressInt)
           
static int networkPrefixToNetmask(int prefixLength)
           
static Map<InetAddress,String> parseArpCache(String arpCacheData, Pattern pattern)
           
static Map<InetAddress,String> parseArpCacheLinux(String arpCacheData)
           
static Map<InetAddress,String> parseArpCacheWindows(String arpCacheData)
           
static void wakeOnLan(InetAddress networkAddress, String macAddress)
           
static void wakeOnLan(String networkAddress, String macAddress)
          Parts of this function was copied from: http://coding.derkeiler.com/Archive/Java/comp.lang.java.help/2008-01/msg00013.html
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestUtils

public RequestUtils()
Method Detail

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 address
macAddress - 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.