de.nava.informa.utils.toolkit
Class ChannelRecord

java.lang.Object
  extended by de.nava.informa.utils.toolkit.ChannelRecord

public class ChannelRecord
extends Object

Internal channel record. Used by Scheduler and WorkersManager to hold information about channels.

Author:
Aleksey Gureev (spyromus@noizeramp.com)

Field Summary
static int PRIO_HIGH
          High priority.
static int PRIO_LOW
          Low priority.
static int PRIO_NORMAL
          Normal priority.
 
Constructor Summary
ChannelRecord(ChannelIF channel, long period, int priority)
          Creates channel record.
 
Method Summary
 ChannelIF getChannel()
          Returns channel object.
 long getPeriod()
          Returns current period of updates.
 int getPriority()
          Returns priority of poll.
 boolean isCanceled()
          Returns cancel-status of record.
 boolean isFormatResolved()
          Returns TRUE if format of channel is resolved.
 void setCanceled(boolean aCanceled)
          Sets cancel-status of record.
 void setFormatResolved(boolean formatResolved)
          Sets the state of format resolution flag.
 void setPeriod(long period)
          Sets new period of updates (just value).
 void setPriority(int priority)
          Sets priority of poll.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRIO_LOW

public static final int PRIO_LOW
Low priority.

See Also:
Constant Field Values

PRIO_NORMAL

public static final int PRIO_NORMAL
Normal priority.

See Also:
Constant Field Values

PRIO_HIGH

public static final int PRIO_HIGH
High priority.

See Also:
Constant Field Values
Constructor Detail

ChannelRecord

public ChannelRecord(ChannelIF channel,
                     long period,
                     int priority)
Creates channel record.

Parameters:
channel - channel.
period - period of poll in milliseconds.
priority - priority of poll.
Method Detail

getPriority

public final int getPriority()
Returns priority of poll.

Returns:
priority of poll.
See Also:
PRIO_LOW, PRIO_NORMAL, PRIO_HIGH

setPriority

public final void setPriority(int priority)
Sets priority of poll.

Parameters:
priority - priority of poll.
See Also:
PRIO_LOW, PRIO_NORMAL, PRIO_HIGH

getPeriod

public final long getPeriod()
Returns current period of updates.

Returns:
period in milliseconds.

setPeriod

public final void setPeriod(long period)
Sets new period of updates (just value). Actuall period will not be affected as we only store the setting here.

Parameters:
period - new period setting in milliseconds.

getChannel

public final ChannelIF getChannel()
Returns channel object.

Returns:
channel object.

isFormatResolved

public final boolean isFormatResolved()
Returns TRUE if format of channel is resolved.

Returns:
TRUE if format is resolved.

setFormatResolved

public final void setFormatResolved(boolean formatResolved)
Sets the state of format resolution flag.

Parameters:
formatResolved - TRUE if channel format is already resolved.

setCanceled

public void setCanceled(boolean aCanceled)
Sets cancel-status of record.

Parameters:
aCanceled - true to cancel processing.

isCanceled

public boolean isCanceled()
Returns cancel-status of record.

Returns:
true if processing of this record has been canceled.


Copyright © 2002-2007 Niko Schmuck. All Rights Reserved.