Holger's Java API

## com.antelmann.db.remote
Class RemoteDatabaseChangeHandler

    java.lang.Object
      com.antelmann.db.remote.RemoteDatabaseChangeHandler

All Implemented Interfaces:
  NetConnectionHandler

    public class RemoteDatabaseChangeHandler

extends Object
implements NetConnectionHandler

delivers changes delivered from a change notification server to its listeners. As with a `DatabaseChangeMonitor`, you can add `DatabaseChangeListener` objects to this instance. You can use a `MessageDelegator` to listen to a connection to a `ChangeNotificationServer` instance.

Since:
  16.11.2008, 02:59:43
Author:
  Holger Antelmann
See Also:
  `MessageDelegator`, `RemoteDBChangeNotifier`, `ChangeNotificationServer`, `DatabaseChangeListener`, `DatabaseChangeMonitor`

Constructor Summary
`RemoteDatabaseChangeHandler(Database<?> db)`

Method Summary
`void` `addListener(DatabaseChangeListener l)`
`void` `connectionLost(NetConnection connection)` called when a connection caused an IOException during reading or writing; the connection may not have been closed at this point.
`protected void` `deliverChanges(RemoteDBUpdateEvent[] msg)`
`DatabaseChangeListener[]` `getListeners()`
`void` `handleMessage(Object message, NetConnection connection)` called when a message is received by the given NetConnection object
`boolean` `removeListener(DatabaseChangeListener l)`
`void` `setRemoteFilter(NetConnection con, RemoteDBChangeFilter filter)` allows to set a remote filter on the given connection, so that not every change is delivered by the server to this connection

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

Constructor Detail

### RemoteDatabaseChangeHandler

    public RemoteDatabaseChangeHandler(Database<?> db)

Method Detail

### handleMessage

    public void handleMessage(Object message,
                              NetConnection connection)

  Description copied from interface: `NetConnectionHandler`
  called when a message is received by the given NetConnection object

  Specified by:
    `handleMessage` in interface `NetConnectionHandler`

### connectionLost

    public void connectionLost(NetConnection connection)

  Description copied from interface: `NetConnectionHandler`
  called when a connection caused an IOException during reading or writing; the connection may not have been closed at this point.
  Usually, it is a good idea to close the connection here explicitly.

  Specified by:
    `connectionLost` in interface `NetConnectionHandler`

### setRemoteFilter

    public void setRemoteFilter(NetConnection con,
                                RemoteDBChangeFilter filter)
                         throws IOException

  allows to set a remote filter on the given connection, so that not every change is delivered by the server to this connection

  Throws:
    `IOException`

### addListener

    public void addListener(DatabaseChangeListener l)

### removeListener

    public boolean removeListener(DatabaseChangeListener l)

### getListeners

    public DatabaseChangeListener[] getListeners()

### deliverChanges

    protected void deliverChanges(RemoteDBUpdateEvent[] msg)
                           throws ClassNotFoundException

  Throws:
    `ClassNotFoundException`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads