jpl.mipl.mdms.web.domain
Class DomainModel

java.lang.Object
  extended by jpl.mipl.mdms.web.domain.DomainModel

public class DomainModel
extends Object

Purpose: Domain model for the domain registry service. Initialized from a Domain object, this model tracks updates to metrics and is responsible for the formation of dynamically-generated domain file content.

   Copyright 2006, California Institute of Technology.
   ALL RIGHTS RESERVED.
   U.S. Government Sponsorship acknowledge. 2006.
   
 ============================================================================
 Modification History :
 ----------------------

 Date              Who              What
 ----------------------------------------------------------------------------
 08/10/2006        Nick             Initial Release
 ============================================================================
 

Version:
$Id: DomainModel.java,v 1.1 2006/09/29 18:51:18 ntt Exp $
Author:
Nicholas Toole (Nicholas.T.Toole@jpl.nasa.gov)

Field Summary
protected  List _listeners
          Collection of listeners
protected  ServerOrderer _order
          Server orderer, sorts servers by some priority
protected  Map _serverGroups
          Server group name -> server group node
protected  Domain _sourceDomain
          Reference domain file
 
Constructor Summary
DomainModel(Domain domain)
          Constructor
 
Method Summary
 void addListener(Object l)
          Not yet implemented
protected  void fireServerMetricChange(String group, String server)
          Not yet implemented
 String getDomainContents()
           
 ServerMetrics[] getMetricsForGroup(String groupName, boolean filterVft)
           
 String[] getServerGroupNames()
           
protected  jpl.mipl.mdms.web.domain.DomainModel.ServerGroupNode getServerGroupNode(String groupName)
          Handles server group node retrieval.
static void main(String[] args)
           
protected static int parseInt(String valueString)
           
protected static long parseLong(String valueString)
           
protected  void populateModel()
          Initializes this model
 void removeListener(Object l)
          Not yet implemented
 void updateServerMetric(Properties metricEntry)
          Look up metrics for a given server and update with field.
 void updateServerMetric(String serverGroup, String server, Properties metricEntry)
          Look up metrics for a given server and update with field
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_serverGroups

protected final Map _serverGroups
Server group name -> server group node


_sourceDomain

protected final Domain _sourceDomain
Reference domain file


_order

protected final ServerOrderer _order
Server orderer, sorts servers by some priority


_listeners

protected final List _listeners
Collection of listeners

Constructor Detail

DomainModel

public DomainModel(Domain domain)
            throws SessionException
Constructor

Parameters:
domain - Instance of domain that represents the initial state of this model
Throws:
SessionException
Method Detail

populateModel

protected void populateModel()
                      throws SessionException
Initializes this model

Throws:
SessionException

getServerGroupNode

protected jpl.mipl.mdms.web.domain.DomainModel.ServerGroupNode getServerGroupNode(String groupName)
Handles server group node retrieval. If an existing node is found, it is retrieved. Otherwise a new node is created, added to the collection, and then returned

Parameters:
groupName - Server group name
Returns:
ServerGroupNode assocaited with groupName

updateServerMetric

public void updateServerMetric(Properties metricEntry)
Look up metrics for a given server and update with field. It is assumed that metric contains server_group and name values.

Parameters:
metricEntry - New metric properties entry

updateServerMetric

public void updateServerMetric(String serverGroup,
                               String server,
                               Properties metricEntry)
Look up metrics for a given server and update with field

Parameters:
serverGroup - Server group name
server - Server name
metricEntry - New metric properties entry

parseInt

protected static int parseInt(String valueString)

parseLong

protected static long parseLong(String valueString)

addListener

public void addListener(Object l)
Not yet implemented


removeListener

public void removeListener(Object l)
Not yet implemented


fireServerMetricChange

protected void fireServerMetricChange(String group,
                                      String server)
Not yet implemented


getMetricsForGroup

public ServerMetrics[] getMetricsForGroup(String groupName,
                                          boolean filterVft)

getServerGroupNames

public String[] getServerGroupNames()

getDomainContents

public String getDomainContents()

main

public static void main(String[] args)