org.jacorb.imr.util

Class ImRModel


public class ImRModel
extends java.lang.Object

This class provides the GUIs functionality communicating with the repository.

Author:
Nicolas Noffke $Id: ImRModel.java,v 1.10 2004/05/06 12:39:59 nicolas Exp $

Field Summary

protected int
m_current_refresh_interval
protected boolean
m_refresh_disabled

Constructor Summary

ImRModel()
The constructor.

Method Summary

void
addServer(String name, String command, String host)
Add a server to the repository.
void
connectTo(String ior_url)
Connect the manager to a remote repository.
void
disableRefresh()
Disable the automatic refresh.
void
fetchServers()
Fetch all servers from the repository.
JComboBox
getHostSelector()
Get a JComboBox containing all known hostnames.
TableModel
getPOATableModel()
Get the table model for the POA table.
int
getRow(ServerInfo server, POAInfo poa)
Get the row number of a POA in the POA table.
TableModel
getServerTableModel()
Get the table model for the server table.
JTree
getTree()
Get the tree representation of the server structure.
void
holdServer(String name)
Hold a server.
void
holdServer(int server_row)
Hold a server.
void
imrShutdown(boolean wait)
Shut the repository down.
void
poaTableForServer(ServerInfo server)
Set the POA table model to the specific server, i.e.
void
refreshServer(String name)
Refresh a server.
void
refreshServer(int index)
Refresh a server.
void
releaseServer(String name)
Release a server.
void
releaseServer(int server_row)
Release a server.
void
removeServer(String name)
Remove a server from the repository.
void
removeServer(int server_row)
Remove a server from the repository.
void
saveTable()
Make a backup of the server table.
void
setRefreshInterval(int interval)
Set the interval by which the internal data is refreshed.
void
setServerDown(String name)
Set a server down.
void
setServerDown(int server_row)
Set a server down.
protected void
updateServer(int server_row, String field_name, Object new_value)
Update a server in the repository by changes the user made in the server table of the GUI.

Field Details

m_current_refresh_interval

protected int m_current_refresh_interval


m_refresh_disabled

protected boolean m_refresh_disabled

Constructor Details

ImRModel

public ImRModel()
The constructor. Connects to default repository and fetches the servers.

Method Details

addServer

public void addServer(String name,
                      String command,
                      String host)
Add a server to the repository.

Parameters:
name - the servers name.
command - the servers startup command. Leave empty (not null) if automatic startup is not desired.
host - the host the server is running on.


connectTo

public void connectTo(String ior_url)
Connect the manager to a remote repository.

Parameters:
ior_url - an url pointing to the IOR file of a remote repository.


disableRefresh

public void disableRefresh()
Disable the automatic refresh.


fetchServers

public void fetchServers()
Fetch all servers from the repository. Rebuild Tree and HostSelector.


getHostSelector

public JComboBox getHostSelector()
Get a JComboBox containing all known hostnames.

Returns:
a JComboBox.


getPOATableModel

public TableModel getPOATableModel()
Get the table model for the POA table.

Parameters:


getRow

public int getRow(ServerInfo server,
                  POAInfo poa)
Get the row number of a POA in the POA table.

Parameters:
server - the server node the POA belongs to.
poa - the poas poa node.


getServerTableModel

public TableModel getServerTableModel()
Get the table model for the server table.

Parameters:


getTree

public JTree getTree()
Get the tree representation of the server structure.

Returns:
a JTree.


holdServer

public void holdServer(String name)
Hold a server.

Parameters:
name - the servers name.


holdServer

public void holdServer(int server_row)
Hold a server.

Parameters:
server_row - the servers row in the table.


imrShutdown

public void imrShutdown(boolean wait)
Shut the repository down.

Parameters:
wait - true, if ORB should wait for still open connections to be closed by clients.


poaTableForServer

public void poaTableForServer(ServerInfo server)
Set the POA table model to the specific server, i.e. the POA table displays this servers poas.

Parameters:


refreshServer

public void refreshServer(String name)
Refresh a server.

Parameters:
name - the servers name.


refreshServer

public void refreshServer(int index)
Refresh a server.

Parameters:


releaseServer

public void releaseServer(String name)
Release a server.

Parameters:
name - the servers name.


releaseServer

public void releaseServer(int server_row)
Release a server.

Parameters:
server_row - the servers row in the table.


removeServer

public void removeServer(String name)
Remove a server from the repository.

Parameters:
name - the servers name.


removeServer

public void removeServer(int server_row)
Remove a server from the repository.

Parameters:
server_row - the servers row in the table.


saveTable

public void saveTable()
Make a backup of the server table.


setRefreshInterval

public void setRefreshInterval(int interval)
Set the interval by which the internal data is refreshed.

Parameters:


setServerDown

public void setServerDown(String name)
Set a server down.

Parameters:
name - the servers name.


setServerDown

public void setServerDown(int server_row)
Set a server down.

Parameters:
server_row - the servers row in the table.


updateServer

protected void updateServer(int server_row,
                            String field_name,
                            Object new_value)
Update a server in the repository by changes the user made in the server table of the GUI.

Parameters:
server_row - the row of the server in the table.
field_name - the columns name.
new_value - the cells new value.