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, ObjectCloneable, ObjectDuplicable, java.io.Serializable
- public class Identity
- extends Component
- implements InetCoreConstants
The component that manages the identities of the network node.
Contracts:
Events:
-
.id@: Type "Identity Added", Object is the identities
being added in
drcl.data.LongObj or long[].
-
.id@: Type "Identity Removed", Object is the identity
being removed in
drcl.data.LongObj or long[].
Properties:
-
defaultID: the default identity of the node.
-
IDs: array of the static identities (won't be timed out)
of the node.
- Version:
- 1.0, 10/17/2000
- Author:
- Hung-ying Tyan
- See Also:
IDLookup,
IDConfig,
Serialized Form
| 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, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND |
| 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_LINK_BROKEN, EVENT_LINK_BROKEN_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, ID_TRACE_RT, MCAST_QUERY_PORT_ID, PACKET_MODE, PID_AODV, PID_DV, PID_DVMRP, PID_HELLO, PID_IGMP, PID_OSPF, PID_RSVP, PID_TCP, PID_TRACE_RT, 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 |
|
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. |
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 |
addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getID, getName, getParent, getPort, getPort, getRoot, getTime, iduplicate, isAncestorOf, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Identity
public Identity()
Identity
public Identity(java.lang.String id_)
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.
- Specified by:
duplicate in interface ObjectDuplicable- Overrides:
duplicate in class Component
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.
add
public void add(long[] ids_,
double[] timeouts_)
- Adds a list of identities with timeouts.
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
Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved. ~ To J-Sim Home ~