com.revusky.oreo
Interface DataRegistry

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
DataRegistryImpl

public interface DataRegistry
extends java.rmi.Remote

The interface implemented by objects that vend "virgin" instances of a Record. A virgin instance is "vended" based on the type passed in as an arguments to the getExemplar() method. This is a creational pattern called the exemplar or canonical object pattern IIRC.

Author:
Jonathan Revusky

Method Summary
 DataSource getDataSource(java.lang.String name)
           
 java.util.List getDataSourceNames()
           
 Record getExemplar(java.lang.String type)
           
 RecordDescriptor getMetadata(java.lang.String type)
          get record Metadata for the type
 java.util.List getRecordNames()
           
 void registerDataSource(DataSource dataSource)
          register a DataSource by its unique name
 void registerDataSource(DataSourceMetadata dsm)
          register the metadata for a DataSource by its unique name.
 void registerDataSourceAlias(java.lang.String alias, DataSourceMetadata dsm)
           
 void registerRecordType(RecordDescriptor descriptor)
          Register the metadata for a record type.
 

Method Detail

registerRecordType

public void registerRecordType(RecordDescriptor descriptor)
                        throws java.io.IOException
Register the metadata for a record type.

getExemplar

public Record getExemplar(java.lang.String type)
                   throws java.io.IOException
Returns:
a "virgin" record of the given type

getDataSource

public DataSource getDataSource(java.lang.String name)
                         throws java.io.IOException
Returns:
a DataSource by its unique name

registerDataSource

public void registerDataSource(DataSource dataSource)
                        throws java.io.IOException
register a DataSource by its unique name

registerDataSource

public void registerDataSource(DataSourceMetadata dsm)
                        throws java.io.IOException
register the metadata for a DataSource by its unique name.

getMetadata

public RecordDescriptor getMetadata(java.lang.String type)
                             throws java.io.IOException
get record Metadata for the type

getRecordNames

public java.util.List getRecordNames()
                              throws java.io.IOException
Returns:
a List of the names of all of the record types that this data registry knows about.

getDataSourceNames

public java.util.List getDataSourceNames()
                                  throws java.io.IOException
Returns:
a List of the names of all of the data sources that this data registry knows about.

registerDataSourceAlias

public void registerDataSourceAlias(java.lang.String alias,
                                    DataSourceMetadata dsm)
                             throws java.io.IOException