DRCL J-Sim API

drcl.inet.contract
Class IDConfig

java.lang.Object
  extended bydrcl.comp.Contract
      extended bydrcl.inet.contract.IDConfig

public class IDConfig
extends Contract

The IdentityConfiguration contract. This contract defines three services at the reactor:

IdentityAddition
The initiator sends a message that consists of:
  1. an integer of value 0 (the "add" command),
  2. the set of identities (long[]) to be added, and
  3. the set of corresponding life periods (double[]).
In response, the reactor adds the set of identities to its database and each identity will stay for the time specified in the corresponding period and then removed. One may specify a negative value or Double.NaN as the period value to have the corresponding identity not removed.
IdentityRemoval
The initiator sends a message that consists of:
  1. an integer of value 1 (the "remove" command) and
  2. the set of identities (long[]) to be removed.
In response, the reactor removes the set of identities from its database.
IdentityTimeoutQuery
The initiator sends a message that consists of:
  1. an integer of value 2 (the "query" command) and
  2. the set of identities (long[]) in question.
In response, the reactor sends back the set of time values (double[]), each of which corresponds to the time when the corresponding identity will be removed.
This class also provides a set of static methods to faciliate conducting the above services (add(..., Port), remove(..., Port) and query(..., Port)) from the specified port. These methods are particularly useful in implementing a protocol that is in charge of maintaining the identities of the node.

Version:
1.0, 10/17/2000
Author:
Hung-ying Tyan

Nested Class Summary
static class IDConfig.Message
           
 
Field Summary
static int ADD
           
static IDConfig INSTANCE
           
static int QUERY
           
static int REMOVE
           
 
Fields inherited from class drcl.comp.Contract
Role_INITIATOR, Role_PEER, Role_REACTOR
 
Constructor Summary
IDConfig()
           
IDConfig(int role_)
           
 
Method Summary
static void add(long[] id_, double[] timeout_, Port out_)
           
static void add(long id_, double timeout_, Port out_)
           
static java.lang.Object createAddRequest(long id_)
           
static java.lang.Object createAddRequest(long[] id_, double[] timeout_)
           
static java.lang.Object createAddRequest(long id_, double timeout_)
           
static java.lang.Object createQueryRequest()
           
static java.lang.Object createQueryRequest(long id_)
           
static java.lang.Object createQueryRequest(long[] id_)
           
static java.lang.Object createRemoveRequest(long id_)
           
static java.lang.Object createRemoveRequest(long[] id_)
           
 java.lang.Object getContractContent()
          Returns the content of this contract (format?).
 java.lang.String getName()
           
static double[] query(long[] id_, Port out_)
           
static double query(long id_, Port out_)
           
static void remove(long[] id_, Port out_)
           
static void remove(long id_, Port out_)
           
 
Methods inherited from class drcl.comp.Contract
getRole, match, setRole
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final IDConfig INSTANCE

ADD

public static final int ADD
See Also:
Constant Field Values

REMOVE

public static final int REMOVE
See Also:
Constant Field Values

QUERY

public static final int QUERY
See Also:
Constant Field Values
Constructor Detail

IDConfig

public IDConfig()

IDConfig

public IDConfig(int role_)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class Contract

getContractContent

public java.lang.Object getContractContent()
Description copied from class: Contract
Returns the content of this contract (format?).

Specified by:
getContractContent in class Contract

add

public static void add(long id_,
                       double timeout_,
                       Port out_)

add

public static void add(long[] id_,
                       double[] timeout_,
                       Port out_)

remove

public static void remove(long id_,
                          Port out_)

remove

public static void remove(long[] id_,
                          Port out_)

query

public static double query(long id_,
                           Port out_)

query

public static double[] query(long[] id_,
                             Port out_)

createAddRequest

public static java.lang.Object createAddRequest(long id_)

createAddRequest

public static java.lang.Object createAddRequest(long id_,
                                                double timeout_)

createAddRequest

public static java.lang.Object createAddRequest(long[] id_,
                                                double[] timeout_)

createRemoveRequest

public static java.lang.Object createRemoveRequest(long id_)

createRemoveRequest

public static java.lang.Object createRemoveRequest(long[] id_)

createQueryRequest

public static java.lang.Object createQueryRequest()

createQueryRequest

public static java.lang.Object createQueryRequest(long id_)

createQueryRequest

public static java.lang.Object createQueryRequest(long[] id_)

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~