org.optimizationservices.oscommon.localinterface
Class OSRegistry

java.lang.Object
  extended by org.optimizationservices.oscommon.localinterface.OSRegistry

public class OSRegistry
extends java.lang.Object

The OSRegistry class is a local interface for storing Optimization Services registry. Its design follows the Optimization Services Registry Language (OSRegistry). All the data structures in this class are standards specified in the OSRegistry schema.

Since:
OS 1.0
Version:
1.0, 03/14/2005
Author:
Robert Fourer, Jun Ma, Kipp Martin
See Also:
OSEntity, OSProcess, OSBenchmark

Field Summary
 java.lang.String description
          description holds the general description of the os registry.
 News news
          news holds the news for the os registry.
 ServiceEntry[] service
          service holds an array of registered services in the os registry.
 
Constructor Summary
OSRegistry()
          Default constructor.
 
Method Summary
 boolean addNews(NewsElement newsElement)
          Add an OSRegistry news element.
 boolean addService(ServiceEntry service)
          Add an OSRegistry service.
 boolean deleteService(java.lang.String serviceURI)
          Delete an OSRegistry service.
 java.lang.String getDescription()
          Get the OSRegistry description.
 NewsElement[] getNews()
          Get the OSRegistry news.
 ServiceEntry getService(java.lang.String serviceURI)
          Get an OSRegistry service.
 ServiceEntry[] getServices()
          Get the OSRegistry services.
static void main(java.lang.String[] args)
          main for test purposes.
 OSRegistry readOSRegistry(java.lang.String osRegistry, boolean isFile, boolean validate)
          read an OSRegistry instance and return and OSRegistry object.
 boolean setDescription(java.lang.String description)
          Set the OSRegistry description.
 boolean setNews(NewsElement[] newsElements)
          Set the OSRegistry news.
 boolean setServices(ServiceEntry[] services)
          Set the OSRegistry services.
 java.lang.String writeOSRegistry()
          write the OSRegistry to an osRegistry xml string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

public java.lang.String description
description holds the general description of the os registry.


news

public News news
news holds the news for the os registry.


service

public ServiceEntry[] service
service holds an array of registered services in the os registry.

Constructor Detail

OSRegistry

public OSRegistry()
Default constructor.

Method Detail

readOSRegistry

public OSRegistry readOSRegistry(java.lang.String osRegistry,
                                 boolean isFile,
                                 boolean validate)
                          throws java.lang.Exception
read an OSRegistry instance and return and OSRegistry object.

Parameters:
osRegistry - holds the optimization registry in a string which format follows the Optimization Services registry Language (OSRegistry) schema.
isFile - holds whether the osRegistry string is a file name or a string that literally holds the osRegistry contents.
validate - holds whether the reader should be validating against the schema or not.
Returns:
the OSRegistry object constructed from the OSRegistry String.
Throws:
java.lang.Exception - if there are errors in reading the string or setting the OSRegistry.

writeOSRegistry

public java.lang.String writeOSRegistry()
                                 throws java.lang.Exception
write the OSRegistry to an osRegistry xml string.

Returns:
the osRegistry xml string.
Throws:
java.lang.Exception - if there are errors in writing the osRegistry string.

getDescription

public java.lang.String getDescription()
Get the OSRegistry description.

Returns:
the OSRegistry description; null or empty string if none.

setDescription

public boolean setDescription(java.lang.String description)
Set the OSRegistry description.

Parameters:
description - holds the OSRegistry description.
Returns:
whether the description is set successfully or not.

getNews

public NewsElement[] getNews()
Get the OSRegistry news.

Returns:
the news element array. Each element of the array corresponds to a news element; null if none.
See Also:
NewsElement

setNews

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

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

addNews

public boolean addNews(NewsElement newsElement)
Add an OSRegistry news element.

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

getServices

public ServiceEntry[] getServices()
Get the OSRegistry services.

Returns:
the service array. Each element of the array corresponds to a service entry; null if none.
See Also:
ServiceEntry

getService

public ServiceEntry getService(java.lang.String serviceURI)
Get an OSRegistry service.

Returns:
the found service, which is in the ServiceEntry data structure.
See Also:
ServiceEntry

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[] args)
main for test purposes.

Parameters:
argv - command line arguments.