/*
 * AidaTreeClientTest.java
 *
 * Created on October 15, 2003, 11:46 PM
 */

package hep.aida.ref.remote.testRemote;

import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;

import hep.aida.dev.IDevMutableStore;

import hep.aida.ref.remote.RemoteClient;
import hep.aida.ref.remote.RemoteConnectionException;
import hep.aida.ref.remote.RemoteUpdateEvent;
import hep.aida.ref.remote.interfaces.AidaTreeClient;
import hep.aida.ref.remote.interfaces.AidaTreeServer;
import hep.aida.ref.remote.interfaces.AidaUpdateEvent;

/**
 * This is class extends the RemoteClient to create very 
 * simple AidaTreeServerTest and is used to test the
 * RemoteClient - RemoteMutableStore interaction.
 *
 * @author  serbo
 */
public class RemoteClientTest extends RemoteClient {
    
    private AidaTreeServer testServer;
    
    /** Creates a new instance of AidaTreeClientTest */
    public RemoteClientTest(IDevMutableStore store) {
        this(store, true);
    }
    
    public RemoteClientTest(IDevMutableStore store, boolean duplex) {
        this(store, duplex, null, -1);
    }
    
    public RemoteClientTest(IDevMutableStore store, boolean duplex, AidaTreeServer testServer) {
        this(store, duplex, testServer, -1);
    }
    
    public RemoteClientTest(IDevMutableStore store, boolean duplex, AidaTreeServer testServer, long serverUpdateInterval) {
        super(store, duplex);
        this.updateInterval = serverUpdateInterval;
        this.testServer = testServer;
        initTestClient();
    }
    
    
    // Service methods
    
    public void initTestClient() {
    }
    
    
    
    // RemoteClient methods
    
    protected AidaTreeServer getServer() {
        //AidaTreeServer server = null;
        //String name = "RemoteClientTest";
        //server = new AidaTreeServerTest(name, duplex, updateInterval);
        
        return testServer;
    }
    
    public boolean disconnect() {
        boolean ok = super.disconnect();
        
        return ok;
    }
}
