org.optimizationservices.oscommon.representationparser
Class OSRegistryWriter

java.lang.Object
  extended by org.optimizationservices.oscommon.representationparser.OSgLWriter
      extended by org.optimizationservices.oscommon.representationparser.OSRegistryWriter

public class OSRegistryWriter
extends OSgLWriter

The OSRegistryWriter class is used to construct an instance that follows the OSRegistry format.

Since:
OS 1.0
Version:
1.0, 03/14/2004
Author:
Robert Fourer, Jun Ma, Kipp Martin

Field Summary
 
Fields inherited from class org.optimizationservices.oscommon.representationparser.OSgLWriter
m_document
 
Constructor Summary
OSRegistryWriter()
          Constructor.
 
Method Summary
 boolean addNewsElement(java.util.GregorianCalendar time, java.lang.String value)
          Add a news element.
 boolean addService(ServiceEntry service)
          Add an OSRegistry service.
 boolean deleteService(java.lang.String serviceURI)
          Delete an OSRegistry service.
static void main(java.lang.String[] argv)
          main for test purposes.
 boolean setDescription(java.lang.String description)
          Set the description element.
 boolean setNews(NewsElement[] newsElements)
          Set the OSRegistry news.
 boolean setOSRegistry(OSRegistry osRegistry)
          set the OSRegistry, a standard os registry data structure.
 boolean setServices(ServiceEntry[] services)
          Set the OSRegistry services.
 
Methods inherited from class org.optimizationservices.oscommon.representationparser.OSgLWriter
getDocument, setDocument, writeToFile, writeToSring, writeToStandardOutput
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSRegistryWriter

public OSRegistryWriter()
Constructor.

Method Detail

setOSRegistry

public boolean setOSRegistry(OSRegistry osRegistry)
                      throws java.lang.Exception
set the OSRegistry, a standard os registry data structure.

Parameters:
osRegistry - holds the standard os registry data structure.
Returns:
whether the OSRegistry is set successfully.
Throws:
java.lang.Exception

setDescription

public boolean setDescription(java.lang.String description)
Set the description element. If the element is already there, it will reset it. If the element is not there (e.g. optional element), it will add it.

Parameters:
description - holds the description of the os registry.
Returns:
whether the description is set successfully.

addNewsElement

public boolean addNewsElement(java.util.GregorianCalendar time,
                              java.lang.String value)
Add a news element.

Parameters:
time - holds the time.
value - holds the news element value.
Returns:
whether the news is added successfully.

setNews

public boolean setNews(NewsElement[] newsElements)
Set the OSRegistry news.

Returns:
whether the news is set successfully or not.
See Also:
NewsElement

setServices

public boolean setServices(ServiceEntry[] services)
Set the OSRegistry services.

Returns:
whether the services are set successfully or not.
See Also:
ServiceEntry

addService

public boolean addService(ServiceEntry service)
Add an OSRegistry service.

Returns:
whether the service is added successfully or not.
See Also:
ServiceEntry

deleteService

public boolean deleteService(java.lang.String serviceURI)
Delete an OSRegistry service.

Returns:
whether the service is deleted successfully or not.
See Also:
ServiceEntry

main

public static void main(java.lang.String[] argv)
main for test purposes.

Parameters:
argv - command line arguments.