uk.org.ogsadai.client.toolkit.activity.delivery
Class DataTransportMode

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.delivery.DataTransportMode

public final class DataTransportMode
extends java.lang.Object

An enumerated type denoting available modes for data push and pull to and from a data service.

Author:
The OGSA-DAI Project Team

Field Summary
static DataTransportMode BLOCK
          Transfer data block by block.
private static java.lang.String BLOCK_STRING
          The string used to represent BLOCK mode.
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
static DataTransportMode FULL
          Transfer data in full within a single block.
private static java.lang.String FULL_STRING
          The string used to represent FULL mode.
private  java.lang.String mMode
          The current mode.
 
Constructor Summary
private DataTransportMode(java.lang.String mode)
          Create a DataTransportMode of the specified type.
 
Method Summary
 java.lang.String getAsString()
          Return the transfer mode as a string - either block or full.
 boolean isBlock()
          Is the current transfer mode a block by block transfer?
 boolean isFull()
          Is the current transfer mode a full transfer?
 void setBlock()
          Set the transfer mode to be a block by block transfer
 void setFull()
          Set the transfer mode to be a full transfer
 void setMode(java.lang.String mode)
          Set the transfer mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

BLOCK_STRING

private static final java.lang.String BLOCK_STRING
The string used to represent BLOCK mode.

See Also:
Constant Field Values

FULL_STRING

private static final java.lang.String FULL_STRING
The string used to represent FULL mode.

See Also:
Constant Field Values

BLOCK

public static final DataTransportMode BLOCK
Transfer data block by block.


FULL

public static final DataTransportMode FULL
Transfer data in full within a single block.


mMode

private java.lang.String mMode
The current mode.

Constructor Detail

DataTransportMode

private DataTransportMode(java.lang.String mode)
Create a DataTransportMode of the specified type.

Parameters:
mode - Either DataTransportMode.BLOCK_STRING for a block by block transfer or DataTransport.FULL_STRING for a full transfer.
Throws:
java.lang.IllegalArgumentException - If mode is neither of the above.
Method Detail

setMode

public void setMode(java.lang.String mode)
Set the transfer mode.

Parameters:
mode - Either DataTransportMode.BLOCK_STRING for a block by block transfer or DataTransport.FULL_STRING for a full transfer.
Throws:
java.lang.IllegalArgumentException - If mode is neither of the above.

setFull

public void setFull()
Set the transfer mode to be a full transfer


setBlock

public void setBlock()
Set the transfer mode to be a block by block transfer


isBlock

public boolean isBlock()
Is the current transfer mode a block by block transfer?

Returns:
true if mode is BLOCK_STRING.

isFull

public boolean isFull()
Is the current transfer mode a full transfer?

Returns:
true if mode is FULL_STRING.

getAsString

public java.lang.String getAsString()
Return the transfer mode as a string - either block or full.

Returns:
mode