## org.cometd.oort
Class Seti

    java.lang.Object
      org.mortbay.component.AbstractLifeCycle
          org.cometd.oort.Seti

All Implemented Interfaces:
  LifeCycle

    public class Seti

extends AbstractLifeCycle

The Search for Extra Terrestial Intelligence. Well in this case, just the search for a user logged onto an Cometd node in an Oort cluster.

Seti allows an application to maintain a mapping from userId to comet client ID using the `associate(String, Client)` and `disassociate(String)` methods. Each cometd node keeps its own associate mapping for clients connected to it.

The `sendMessage(Collection, String, Object)` and `sendMessage(String, String, Object)` methods may be used to send a message to user(s) anywhere in the Oort cluster and Seti organizes the search of the distributed associate maps in order to locate the user(s)

If users can be directed to shards of cometd servers, then each Seti instance must be told it's shard ID and the `userId2Shard(String)` method must be extended to map users to shards.

Nested Class Summary

Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle
`LifeCycle.Listener`

Field Summary
`static String` `SETI_ATTRIBUTE`
`static String` `SETI_SHARD`

Fields inherited from class org.mortbay.component.AbstractLifeCycle
`_listeners`

Constructor Summary
`Seti(Oort oort, String shardId)`

Method Summary
`void` `associate(String userId, org.cometd.Client client)`
`void` `disassociate(String userId)`
`protected void` `doStart()`
`protected void` `doStop()`
`protected void` `receive(org.cometd.Client from, org.cometd.Client to, org.cometd.Message msg)`
`void` `sendMessage(Collection<String> toUsers, String toChannel, Object message)`
`void` `sendMessage(String toUser, String toChannel, Object message)`
`protected org.cometd.oort.Seti.ShardLocation` `userId2Shard(String userId)`

Methods inherited from class org.mortbay.component.AbstractLifeCycle
`addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

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

Field Detail

### SETI_ATTRIBUTE

    public static final String SETI_ATTRIBUTE

See Also:
  Constant Field Values

### SETI_SHARD

    public static final String SETI_SHARD

See Also:
  Constant Field Values

Constructor Detail

### Seti

    public Seti(Oort oort,
                String shardId)

Method Detail

### doStart

    protected void doStart()
                    throws Exception

  Overrides:
    `doStart` in class `AbstractLifeCycle`
  Throws:
    `Exception`

### doStop

    protected void doStop()
                   throws Exception

  Overrides:
    `doStop` in class `AbstractLifeCycle`
  Throws:
    `Exception`

### associate

    public void associate(String userId,
                          org.cometd.Client client)

### disassociate

    public void disassociate(String userId)

### sendMessage

    public void sendMessage(String toUser,
                            String toChannel,
                            Object message)

### sendMessage

    public void sendMessage(Collection<String> toUsers,
                            String toChannel,
                            Object message)

### userId2Shard

    protected org.cometd.oort.Seti.ShardLocation userId2Shard(String userId)

### receive

    protected void receive(org.cometd.Client from,
                           org.cometd.Client to,
                           org.cometd.Message msg)

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.