return true;
return false;
}
public void serverChanged(ServerEvent event) {
IConnectionWrapper con = idToConnection.get(event.getServer().getId());
if( con != null ) {
if( serverSwitchesToState(event, IServer.STATE_STARTED)) {
fireAdded(con);
} else if( serverSwitchesToState(event, IServer.STATE_STOPPED)) {
fireRemoved(con);
}
}
}
public void serverAdded(IServer server) {
if( belongsHere(server)) {
getConnections();
if( !idToConnection.containsKey(server.getId())) {
IConnectionWrapper connection = createConnection(server);
idToConnection.put(server.getId(), connection);
if( connection != null && server.getServerState() == IServer.STATE_STARTED )
fireAdded(idToConnection.get(server.getId()));
}
}
}
public void serverChanged(IServer server) {
if( belongsHere(server)) {
getConnections();
Object o = idToConnection.get(server.getId());
if( o == null ) {
IConnectionWrapper connection = createConnection(server);
idToConnection.put(server.getId(), connection);
if( connection != null && server.getServerState() == IServer.STATE_STARTED )
fireAdded(idToConnection.get(server.getId()));
}
}
}
public void serverRemoved(IServer server) {
if( belongsHere(server)) {
IConnectionWrapper connection;
if( idToConnection != null ) {
connection = idToConnection.get(server.getId());
if( connection != null ) {
idToConnection.remove(server.getId());
fireRemoved(connection);
}
} else {
// hasn't been initialized yet
getConnections();
// but now its missing from the collection, so make one up
IConnectionWrapper dummy = createConnection(server);
// Make sure we don't fire a removal for a connection that doesn't exist
if( dummy != null )
fireRemoved(dummy);
}