DRCL JavaSim API

drcl.inet.core
Class Identity

java.lang.Object
  |
  +--drcl.DrclObj
        |
        +--drcl.comp.Component
              |
              +--drcl.inet.core.Identity
All Implemented Interfaces:
java.lang.Cloneable, InetConstants, InetCoreConstants, ObjectDuplicable, java.io.Serializable

public class Identity
extends Component
implements InetCoreConstants

The component that manages the identities of the network node.

Contracts:

Events:

Properties:

Version:
1.0, 10/17/2000
Author:
Hung-ying Tyan
See Also:
IDLookup, IDConfig, Serialized Form

Inner classes inherited from class drcl.comp.Component
Component.LockPack
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, id, infoPort, lockHead, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Fields inherited from interface drcl.inet.core.InetCoreConstants
CONFIG_PORT_ID, PULL_PORT_ID
 
Fields inherited from interface drcl.inet.InetConstants
BYTE_MODE, DEFAULT_BANDWIDTH, DEFAULT_BUFFER_SIZE, DEFAULT_MTU, EVENT_ID_CHANGED_PORT_ID, EVENT_IDENTITY_ADDED, EVENT_IDENTITY_REMOVED, EVENT_IF_NEIGHBOR_DOWN, EVENT_IF_NEIGHBOR_UP, EVENT_IF_PORT_ID, EVENT_MCAST_HOST_PORT_ID, EVENT_PKT_ARRIVAL, EVENT_PKT_ARRIVAL_PORT_ID, EVENT_RT_ENTRY_ADDED, EVENT_RT_ENTRY_MODIFIED, EVENT_RT_ENTRY_REMOVED, EVENT_RT_MCAST_CHANGED_PORT_ID, EVENT_RT_UCAST_CHANGED_PORT_ID, EVENT_VIF_NEIGHBOR_DOWN, EVENT_VIF_NEIGHBOR_UP, EVENT_VIF_PORT_ID, HOST_ENTRY_EXT, ID_CSL, MCAST_QUERY_PORT_ID, PACKET_MODE, PID_DV, PID_DVMRP, PID_HELLO, PID_IGMP, PID_OSPF, PID_RSVP, PID_TCP, PID_UDP, SERVICE_CONFIGSW_PORT_ID, SERVICE_ID_PORT_ID, SERVICE_IF_PORT_ID, SERVICE_MCAST_PORT_ID, SERVICE_RT_PORT_ID, UCAST_QUERY_PORT_ID
 
Constructor Summary
Identity()
           
Identity(java.lang.String id_)
           
 
Method Summary
 long[] _getAll()
          Returns all the identities stored in this database.
 void add(long newID_)
          Adds a new identity without timeout.
 void add(long[] ids_, double[] timeouts_)
          Adds a list of identities with timeouts.
 void add(long newID_, double timeoutDuration_)
          Adds a new identity with timeout.
 void duplicate(java.lang.Object source_)
          Duplicates the content of source_, including ID, name, child components and connections among them, to this component.
 long getDefaultID()
          Returns the default identity.
 long[] getIDs()
          Returns all the static identities stored in this component.
 java.lang.String info()
          Outputs the identities stored in this database and their timeout instances.
protected  void process(java.lang.Object data_, Port inPort_)
          The main callback method of a component.
 boolean query(long id_)
          Queries the existence of an identity in this database.
 boolean[] query(long[] ids_)
          Queries the existence of multiple identities in this database.
 double queryTimeout(long id_)
          Queries the time instance when the identity will be timed out.
 double[] queryTimeout(long[] ids_)
          Queries the time instances when the identities will be timed out.
 void remove(long id_)
          Removes an identity from the identity database.
 void remove(long[] ids_)
          Removes multiple identities.
 void reset()
          Resets the component for being used anew.
 void setDefaultID(long defaultIdentity_)
          Sets the default identity.
 void setIDs(long[] ids_)
          Adds the identities to the database.
 
Methods inherited from class drcl.comp.Component
_resume, _start, _stop, addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, componentAdded, componentRemoved, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, finishing, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getForkManager, getID, getName, getParent, getPort, getPort, getRoot, getRuntime, getTime, iduplicate, isAncestorOf, isComponentNotificationEnabled, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortNotificationEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, portAdded, portRemoved, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setComponentNotificationEnabled, setContract, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setPortNotificationEnabled, setPortRemovable, setRuntime, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Identity

public Identity()

Identity

public Identity(java.lang.String id_)
Method Detail

reset

public void reset()
Description copied from class: Component
Resets the component for being used anew. All the internal variables must be set to the initial state. All the ports and child components are reset as well.
Overrides:
reset in class Component

duplicate

public void duplicate(java.lang.Object source_)
Description copied from class: Component
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. Subclasses need to override this method to copy its own variables.
Overrides:
duplicate in class Component

process

protected void process(java.lang.Object data_,
                       Port inPort_)
Description copied from class: Component
The main callback method of a component. Being invoked when data arrives at a port of its.
Overrides:
process in class Component
Following copied from class: drcl.comp.Component
Parameters:
data_ - the arrival data.
inPort_ - the port where the data arrives.

setDefaultID

public void setDefaultID(long defaultIdentity_)
Sets the default identity. This method is also the setter method of the "defaultID" property.
Parameters:
defaultIdentity_ - the default identity.

getDefaultID

public long getDefaultID()
Returns the default identity.

setIDs

public void setIDs(long[] ids_)
Adds the identities to the database.

getIDs

public long[] getIDs()
Returns all the static identities stored in this component.

add

public void add(long newID_)
Adds a new identity without timeout.

add

public void add(long newID_,
                double timeoutDuration_)
Adds a new identity with timeout.
Parameters:
newID_ - new identiy to be added.
timeouDuration_ - timeout duration

add

public void add(long[] ids_,
                double[] timeouts_)
Adds a list of identities with timeouts.
Parameters:
newID_ - an array of identities to add.
timeouDuration_ - an array of timeout durations.

remove

public void remove(long id_)
Removes an identity from the identity database.

remove

public void remove(long[] ids_)
Removes multiple identities.

query

public boolean query(long id_)
Queries the existence of an identity in this database.

query

public boolean[] query(long[] ids_)
Queries the existence of multiple identities in this database.
Parameters:
ids_ - the identities in question.
Returns:
array of results. The result is true if the corresponding identity exists.

queryTimeout

public double queryTimeout(long id_)
Queries the time instance when the identity will be timed out. Returns the time instance; Double.NaN if the identity does not exist.

queryTimeout

public double[] queryTimeout(long[] ids_)
Queries the time instances when the identities will be timed out. Returns array of the time instances. A time instance may be Double.NaN if the corresponding identity does not exist.

_getAll

public long[] _getAll()
Returns all the identities stored in this database.

info

public java.lang.String info()
Outputs the identities stored in this database and their timeout instances.
Overrides:
info in class Component

DRCL JavaSim API

Copyright © 2001 - DRCL, OSU     ~ Back to JavaSim Home ~