net.jolsrv2
Class PacketParser

java.lang.Object
  extended by net.jolsrv2.PacketParser

public final class PacketParser
extends java.lang.Object

The class parses incoming packets.

Author:
Andreas Schjønhaug

Method Summary
 java.lang.Object clone()
          Implementation of the singleton design pattern.
static PacketParser getPacketParser()
          Implementation of the singleton design pattern
 AddressBlock parseAddressBlock()
          The method parses an address block
 ParsedPacket parsePacket(java.net.DatagramPacket datagramPacket, Interface iface)
          The method takes an incoming packet on a given interface and parses it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPacketParser

public static PacketParser getPacketParser()
Implementation of the singleton design pattern

Returns:
the packet parser

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Implementation of the singleton design pattern. This method is used to ensure that the class can not be cloned.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

parsePacket

public ParsedPacket parsePacket(java.net.DatagramPacket datagramPacket,
                                Interface iface)
                         throws java.text.ParseException
The method takes an incoming packet on a given interface and parses it.

Parameters:
datagramPacket - the incoming packet
iface - the interface that received the packet
Throws:
java.text.ParseException

parseAddressBlock

public AddressBlock parseAddressBlock()
                               throws java.text.ParseException
The method parses an address block

Returns:
a parsed address block
Throws:
java.text.ParseException