org.jacorb.imr.util

Class ImRModel

public class ImRModel extends Object

This class provides the GUIs functionality communicating with the repository.

Author: Nicolas Noffke $Id: ImRModel.java,v 1.12 2006/06/14 11:54:40 alphonse.bendt Exp $

Field Summary
protected intm_current_refresh_interval
protected booleanm_refresh_disabled
Constructor Summary
ImRModel()
The constructor.
Method Summary
voidaddServer(String name, String command, String host)
Add a server to the repository.
voidconnectTo(String ior_url)
Connect the manager to a remote repository.
voiddisableRefresh()
Disable the automatic refresh.
voidfetchServers()
Fetch all servers from the repository.
JComboBoxgetHostSelector()
Get a JComboBox containing all known hostnames.
TableModelgetPOATableModel()
Get the table model for the POA table.
intgetRow(ServerInfo server, POAInfo poa)
Get the row number of a POA in the POA table.
TableModelgetServerTableModel()
Get the table model for the server table.
JTreegetTree()
Get the tree representation of the server structure.
voidholdServer(String name)
Hold a server.
voidholdServer(int server_row)
Hold a server.
voidimrShutdown(boolean wait)
Shut the repository down.
voidpoaTableForServer(ServerInfo server)
Set the POA table model to the specific server, i.e. the POA table displays this servers poas.
voidrefreshServer(String name)
Refresh a server.
voidrefreshServer(int index)
Refresh a server.
voidreleaseServer(String name)
Release a server.
voidreleaseServer(int server_row)
Release a server.
voidremoveServer(String name)
Remove a server from the repository.
voidremoveServer(int server_row)
Remove a server from the repository.
voidsaveTable()
Make a backup of the server table.
voidsetRefreshInterval(int interval)
Set the interval by which the internal data is refreshed.
voidsetServerDown(String name)
Set a server down.
voidsetServerDown(int server_row)
Set a server down.
protected voidupdateServer(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 Detail

m_current_refresh_interval

protected int m_current_refresh_interval

m_refresh_disabled

protected boolean m_refresh_disabled

Constructor Detail

ImRModel

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

Method Detail

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.

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.

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: server the servers name to build the table for.

refreshServer

public void refreshServer(String name)
Refresh a server.

Parameters: name the servers name.

refreshServer

public void refreshServer(int index)
Refresh a server.

Parameters: index the servers row in the table.

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: interval refresh interval in ms.

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.