org.openflow.protocol.action
Class OFAction

java.lang.Object
  extended by org.openflow.protocol.action.OFAction
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
OFActionCopyTTLIn, OFActionCopyTTLOut, OFActionDecrementMPLSTTL, OFActionDecrementNwTTL, OFActionGroup, OFActionOutput, OFActionPopMPLS, OFActionPopPBB, OFActionPopVLAN, OFActionPushMPLS, OFActionPushPBB, OFActionPushVLAN, OFActionSetField, OFActionSetMPLSTTL, OFActionSetNwTTL, OFActionSetQueue, OFActionVendor

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

The base class for all OpenFlow Actions.

Author:
David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010

Field Summary
protected  short length
           
static int MINIMUM_LENGTH
          Note the true minimum length for this header is 8 including a pad to 64 bit alignment, however as this base class is used for demuxing an incoming Action, it is only necessary to read the first 4 bytes.
static int OFFSET_LENGTH
           
static int OFFSET_TYPE
           
protected  OFActionType type
           
 
Constructor Summary
OFAction()
           
 
Method Summary
 OFAction clone()
           
 boolean equals(java.lang.Object obj)
           
static OFAction fromString(java.lang.String val)
          Given the output from toString(), create a new OFAction
 short getLength()
          Get the length of this message
 int getLengthU()
          Get the length of this message, unsigned
 OFActionType getType()
          Get the type of this message
 int hashCode()
           
 void readFrom(java.nio.ByteBuffer data)
           
 OFAction setLength(short length)
          Set the length of this message
 OFAction setType(OFActionType 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
Note the true minimum length for this header is 8 including a pad to 64 bit alignment, however as this base class is used for demuxing an incoming Action, it is only necessary to read the first 4 bytes. All Actions extending this class are responsible for reading/writing the first 8 bytes, including the pad if necessary.


OFFSET_LENGTH

public static int OFFSET_LENGTH

OFFSET_TYPE

public static int OFFSET_TYPE

type

protected OFActionType type

length

protected short length
Constructor Detail

OFAction

public OFAction()
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 OFAction setLength(short length)
Set the length of this message

Parameters:
length -

getType

public OFActionType getType()
Get the type of this message

Returns:
OFActionType enum

setType

public OFAction setType(OFActionType 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 OFAction fromString(java.lang.String val)
Given the output from toString(), create a new OFAction

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 OFAction clone()
               throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException