org.jacorb.imr.util
Class ImRModel

java.lang.Object
  extended byorg.jacorb.imr.util.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.8 2003/12/16 08:41:27 gerald Exp $

Field Summary
protected  int m_current_refresh_interval
           
protected  boolean m_refresh_disabled
           
 
Constructor Summary
ImRModel()
          The constructor.
 
Method Summary
 void addServer(java.lang.String name, java.lang.String command, java.lang.String host)
          Add a server to the repository.
 void connectTo(java.lang.String ior_url)
          Connect the manager to a remote repository.
 void disableRefresh()
          Disable the automatic refresh.
 void fetchServers()
          Fetch all servers from the repository.
 javax.swing.JComboBox getHostSelector()
          Get a JComboBox containing all known hostnames.
 javax.swing.table.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.
 javax.swing.table.TableModel getServerTableModel()
          Get the table model for the server table.
 javax.swing.JTree getTree()
          Get the tree representation of the server structure.
 void holdServer(int server_row)
          Hold a server.
 void holdServer(java.lang.String name)
          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(int index)
          Refresh a server.
 void refreshServer(java.lang.String name)
          Refresh a server.
 void releaseServer(int server_row)
          Release a server.
 void releaseServer(java.lang.String name)
          Release a server.
 void removeServer(int server_row)
          Remove a server from the repository.
 void removeServer(java.lang.String name)
          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(int server_row)
          Set a server down.
 void setServerDown(java.lang.String name)
          Set a server down.
protected  void updateServer(int server_row, java.lang.String field_name, java.lang.Object new_value)
          Update a server in the repository by changes the user made in the server table of the GUI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

connectTo

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

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

getHostSelector

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

Returns:
a JComboBox.

getPOATableModel

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


getServerTableModel

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


poaTableForServer

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


fetchServers

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


removeServer

public void removeServer(java.lang.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.

holdServer

public void holdServer(java.lang.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.

releaseServer

public void releaseServer(java.lang.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.

refreshServer

public void refreshServer(java.lang.String name)
Refresh a server.

Parameters:
name - the servers name.

refreshServer

public void refreshServer(int index)
Refresh a server.


setServerDown

public void setServerDown(java.lang.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.

addServer

public void addServer(java.lang.String name,
                      java.lang.String command,
                      java.lang.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.

getTree

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

Returns:
a JTree.

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.

saveTable

public void saveTable()
Make a backup of the server 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.

setRefreshInterval

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


disableRefresh

public void disableRefresh()
Disable the automatic refresh.


updateServer

protected void updateServer(int server_row,
                            java.lang.String field_name,
                            java.lang.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.