org.openflow.protocol.instruction
Class OFInstruction

java.lang.Object
  extended by org.openflow.protocol.instruction.OFInstruction
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
OFInstructionActions, OFInstructionGotoTable, OFInstructionMeter, OFInstructionWriteMetaData

public class OFInstruction
extends java.lang.Object
implements java.lang.Cloneable

The base class for all OpenFlow Instructions.

Author:
Srini Seetharaman (srini.seetharaman@gmail.com)

Field Summary
protected  short length
           
static int MINIMUM_LENGTH
           
static int OFFSET_LENGTH
           
static int OFFSET_TYPE
           
protected  OFInstructionType type
           
 
Constructor Summary
OFInstruction()
           
 
Method Summary
 OFInstruction clone()
           
 boolean equals(java.lang.Object obj)
           
static OFInstruction fromString(java.lang.String val)
          Given the output from toString(), create a new OFInstruction
 short getLength()
          Get the length of this message
 int getLengthU()
          Get the length of this message, unsigned
 OFInstructionType getType()
          Get the type of this message
 int hashCode()
           
 void readFrom(java.nio.ByteBuffer data)
           
 OFInstruction setLength(short length)
          Set the length of this message
 OFInstruction setType(OFInstructionType type)
          Set the type of this message
 java.lang.String toString()
          Returns a summary of the message
 void writeTo(java.nio.ByteBuffer data)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MINIMUM_LENGTH

public static int MINIMUM_LENGTH

OFFSET_LENGTH

public static int OFFSET_LENGTH

OFFSET_TYPE

public static int OFFSET_TYPE

type

protected OFInstructionType type

length

protected short length
Constructor Detail

OFInstruction

public OFInstruction()
Method Detail

getLength

public short getLength()
Get the length of this message

Returns:

getLengthU

public int getLengthU()
Get the length of this message, unsigned

Returns:

setLength

public OFInstruction setLength(short length)
Set the length of this message

Parameters:
length -

getType

public OFInstructionType getType()
Get the type of this message

Returns:
OFInstructionType enum

setType

public OFInstruction setType(OFInstructionType type)
Set the type of this message

Parameters:
type -

toString

public java.lang.String toString()
Returns a summary of the message

Overrides:
toString in class java.lang.Object
Returns:
"ofmsg=v=$version;t=$type:l=$len:xid=$xid"

fromString

public static OFInstruction fromString(java.lang.String val)
Given the output from toString(), create a new OFInstruction

Parameters:
val -
Returns:

readFrom

public void readFrom(java.nio.ByteBuffer data)

writeTo

public void writeTo(java.nio.ByteBuffer data)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

clone

public OFInstruction clone()
                    throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException