VLab Common 1.2

pl.psnc.vlab.remote.util
Class DatagramHelper

java.lang.Object
  extended by pl.psnc.vlab.remote.util.DatagramHelper

public class DatagramHelper
extends java.lang.Object

The helper class used to fill out the fields in the Datagram which is used to communicate with the VLab system

Author:
Dominik Stoklosa (~osa~)
Email address
osa@man.poznan.pl

Constructor Summary
DatagramHelper()
           
 
Method Summary
static java.nio.ByteOrder getByteOrder(int byteOrder)
          Decodes the byte order by the given integer value.
static pl.psnc.vlab.remote.Dgram setCommonFields(pl.psnc.vlab.remote.Dgram datagramIn)
          Fills all the fileds in the Datagram object which can be set.
static pl.psnc.vlab.remote.Dgram setCommonFieldsWithoutSession(pl.psnc.vlab.remote.Dgram datagramIn)
          Fills all the fileds in the Datagram object which can be set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatagramHelper

public DatagramHelper()
Method Detail

setCommonFields

public static pl.psnc.vlab.remote.Dgram setCommonFields(pl.psnc.vlab.remote.Dgram datagramIn)
                                                 throws VlabException
Fills all the fileds in the Datagram object which can be set. The one which are not used are set to default values. Some of the fields which are alterd: new datagram identyfier is generated, user id is set, the group (lab) id, task id (which is unknown) and content id ( unused )

Parameters:
datagramIn - datagram (Dgram class)
Returns:
datagram with the common fields set
Throws:
VlabException - an exception which may be thrown

setCommonFieldsWithoutSession

public static pl.psnc.vlab.remote.Dgram setCommonFieldsWithoutSession(pl.psnc.vlab.remote.Dgram datagramIn)
                                                               throws VlabException
Fills all the fileds in the Datagram object which can be set. The one which are not used are set to default values. Some of the fields which are alterd: new datagram identifier is generated, user id is set to -1, the group (lab) id is set to -1, task id (which is unknown) and content id ( unused )

Parameters:
datagramIn - datagram (Dgram class)
Returns:
datagram with the common fields set (except the session info). This is DEBUG method
Throws:
VlabException - an exception which may be thrown

getByteOrder

public static java.nio.ByteOrder getByteOrder(int byteOrder)
                                       throws VlabException
Decodes the byte order by the given integer value. There are two values supported: - 0 little endian - 1 big endian

Parameters:
byteOrder -
Returns:
byte order
Throws:
VlabException - throws an exception if invalid byte order is set

VLab Common 1.2

Copyright 2004 by VLAB Dominik Stoklosa.