gr.uoa.di.madgik.commons.channel.registry
Class ChannelRegistryEntry

java.lang.Object
  extended by gr.uoa.di.madgik.commons.channel.registry.ChannelRegistryEntry

public class ChannelRegistryEntry
extends java.lang.Object

This class is the one kept by the registry connecting an ChannelState that is registered with a specific ChannelRegistryKey for which this entry is stored, along with the INozzleConfig that the ChannelInlet of the channel connected its channel with. This entry also holds info on all the connected ChannelOutlet

Author:
gpapanikos

Constructor Summary
ChannelRegistryEntry(ChannelRegistryKey Key, ChannelState State, INozzleConfig Config, java.lang.String RegisteringNozzle)
          Instantiates a new channel registry entry.
 
Method Summary
 void Dispose()
          Disposes the entry.
 INozzleConfig GetConfig()
           
 java.lang.String GetInletNozzleID()
          Gets the inlet nozzle identifier
 boolean GetIsBroadcast()
          Gets whether the channel supports multiple outlets
 IChannelProxy GetProxy()
          Gets the proxy that acts on behalf of the channel for the inlet nozzle
 java.util.List<RegisteredNozzle> GetRegisteredNozzles()
          Gets the registered nozzles.
 ChannelRegistryKey GetRegistryKey()
          Gets the registry key.
 int GetRestrictBroadcast()
          Gets the number of outlet nozzles the channel supports
 ChannelState GetState()
          Gets the synchronization point of the channel
 java.lang.Boolean HasConnected()
          Checks the number of outlet nozzles connected to the channel
 boolean RegisterNozzle(RegisteredNozzle entry)
          Registers a new outlet nozzle to the channel.
 java.lang.Boolean StillConnected()
          Checks the outlet nozzles that have at some point connected to the channel and checks if at least one of them is still connected.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelRegistryEntry

public ChannelRegistryEntry(ChannelRegistryKey Key,
                            ChannelState State,
                            INozzleConfig Config,
                            java.lang.String RegisteringNozzle)
Instantiates a new channel registry entry.

Parameters:
Key - the key with which the entry is associated with
State - the synchronization point of the channel
Config - the configuration provided to the ChannelInlet
RegisteringNozzle - the inlet nozzle identifier
Method Detail

GetRegistryKey

public ChannelRegistryKey GetRegistryKey()
Gets the registry key.

Returns:
the channel registry key

GetInletNozzleID

public java.lang.String GetInletNozzleID()
Gets the inlet nozzle identifier

Returns:
the identifier

GetState

public ChannelState GetState()
Gets the synchronization point of the channel

Returns:
the channel state

GetProxy

public IChannelProxy GetProxy()
Gets the proxy that acts on behalf of the channel for the inlet nozzle

Returns:
the channel proxy

GetIsBroadcast

public boolean GetIsBroadcast()
Gets whether the channel supports multiple outlets

Returns:
true, if it is supported

GetConfig

public INozzleConfig GetConfig()

GetRestrictBroadcast

public int GetRestrictBroadcast()
Gets the number of outlet nozzles the channel supports

Returns:
the number of outlet nozzles supported

RegisterNozzle

public boolean RegisterNozzle(RegisteredNozzle entry)
Registers a new outlet nozzle to the channel. The registration may be prohibited depending on the values of GetIsBroadcast() and GetRestrictBroadcast()

Parameters:
entry - the new outlet nozzle information
Returns:
true, if the registration was successful, false if no more nozzles can be registered

HasConnected

public java.lang.Boolean HasConnected()
Checks the number of outlet nozzles connected to the channel

Returns:
true if at least one outlet nozzle has been connected

StillConnected

public java.lang.Boolean StillConnected()
Checks the outlet nozzles that have at some point connected to the channel and checks if at least one of them is still connected.

Returns:
true if at least one nozzle is still connected

GetRegisteredNozzles

public java.util.List<RegisteredNozzle> GetRegisteredNozzles()
Gets the registered nozzles.

Returns:
the registered nozzles

Dispose

public void Dispose()
Disposes the entry. The ChannelState.Dispose() method is called, and then the INozzleConfig.Dispose() and for each connected nozzle, the RegisteredNozzle.Dispose()