Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jcontrol.comm.eia709
Class Eia709Node

    java.lang.Object
      jcontrol.comm.eia709.Eia709Node

    public class Eia709Node

extends Object

Each instance of this class represents a node in the EIA709 network. Next to its own address information, it stores an address table, containing all communication partners and a network variable table.

In order to perform any useful actions, a node must be married to a Controllet, an application that performs network tasks, i.e. sends messages to other nodes in the network and receives incoming messages.

Usually, an EIA-709 application has to perform three steps to get a working node/controllet combination:

1. Create an `Eia709Node` instance with a unique node ID (neuron ID),
2. supply an instance of an `Eia709Controllet` to the node,
3. start the node.

In JAVA code it looks followingly:

     Eia709Node node = new Eia709Node(
                            new byte[] { 'N', 'O', 'D', 'E', 'I', 'D'});  // create node
     node.setControllet( new LampControllet());                           // set controllet
     node.start();                                                        // start node

See Also:
  `Eia709Controllet`

Constructor Summary
`Eia709Node(byte[] neuronId)` Create a new EIA709 node.

Method Summary
`void` | `addGroupMembership(int groupId, int groupSize, int memberId)` Adds the current node to a group.
`protected void` | `finalize()`
`byte[]` | `getDomain()` Returns the domain this node belongs to.
`byte[]` | `getNeuronId()` Returns this node's neuron ID.
`int` | `getNodeAddress()` Returns this node's address.
`int` | `getSubnet()` Returns this node's subnet.
`void` | `setControllet(Eia709Controllet program)` Attaches a program controllet to the node.
`void` | `setNodeAddress(byte[] domain, int subnet, int node)` Sets the address of this node.
`void` | `start()` Starts this node.
`void` | `stop()` Stops this node.

Methods inherited from class java.lang.Object
`clone, equals, getClass, notifyAll, toString, wait`

Constructor Detail

### Eia709Node

    public Eia709Node(byte[] neuronId)

  Create a new EIA709 node.

  Parameters:
    `neuronId` - 6 byte neuron ID of this node.

Method Detail

### setNodeAddress

    public void setNodeAddress(byte[] domain,
                               int subnet,
                               int node)

  Sets the address of this node. The address consists of a domain, a node address and a subnet address.

  Parameters:
    `domain` - domain (must be 0,1,3 or 6 bytes long)
    `subnet` - subnet address between 0 and 255
    `node` - node address between 0 and 127

### setControllet

    public void setControllet(Eia709Controllet program)

  Attaches a program controllet to the node.

  Parameters:
    `program` - the controllet to run on this node

### start

    public void start()

  Starts this node. If not properly configured, an `IllegalArgumentException` is thrown.

### stop

    public void stop()

  Stops this node.

### addGroupMembership

    public void addGroupMembership(int groupId,
                                   int groupSize,
                                   int memberId)

  Adds the current node to a group.

  Parameters:
    `groupId` - group ID
    `groupSize` - number of members in group
    `memberId` - ID of this node within the group

### getDomain

    public byte[] getDomain()

  Returns the domain this node belongs to.

  Returns:
    array of 1,3 or 6 bytes or null

### getNeuronId

    public byte[] getNeuronId()

  Returns this node's neuron ID.

  Returns:
    array of 6 bytes

### getSubnet

    public int getSubnet()

  Returns this node's subnet.

  Returns:
    subnet

### getNodeAddress

    public int getNodeAddress()

  Returns this node's address.

  Returns:
    node address

### finalize

    protected void finalize()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD