uk.ac.ic.doc.automed.p2p
Class SchemaGetter

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.SchemaGetter

public class SchemaGetter
extends java.lang.Object


Constructor Summary
SchemaGetter(AutoMedPeer peer)
           
 
Method Summary
 java.lang.String checkModelsExist(java.lang.String modelsToCheck)
          For each model name in a name-delimited string, check if it exists in the local database.
 java.util.Map getModels(java.lang.String modelsStr)
          For each model name that does not exist in the local database, get it from the directory
 Schema getSchema(Schema schema)
          An overloading method for creating a new Schema object
This method differs from the overloaded one getSchema(String schema)
in that it takes a pre-created Schema object and use it to create
the associated objects.
 Schema getSchema(java.lang.String schemaName)
          Edited by MDLE on 19/10/2005 to adapt to a new method signature in getting the schema's root object
This method creates a new Schema together with its associated objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaGetter

public SchemaGetter(AutoMedPeer peer)
Method Detail

getSchema

public Schema getSchema(java.lang.String schemaName)
                 throws IllegalOperationException,
                        java.io.IOException,
                        UnsuccessfulReplyException,
                        FailedOperationException,
                        AutoMedException
Edited by MDLE on 19/10/2005 to adapt to a new method signature in getting the schema's root object
This method creates a new Schema together with its associated objects

Throws:
IllegalOperationException
java.io.IOException
UnsuccessfulReplyException
FailedOperationException
AutoMedException

getSchema

public Schema getSchema(Schema schema)
                 throws IllegalOperationException,
                        java.io.IOException,
                        UnsuccessfulReplyException,
                        FailedOperationException,
                        AutoMedException
An overloading method for creating a new Schema object
This method differs from the overloaded one getSchema(String schema)
in that it takes a pre-created Schema object and use it to create
the associated objects. Because a Schema might have been created with a
different local name we want to make sure that we are getting the Schema
using its original name.

Throws:
IllegalOperationException
java.io.IOException
UnsuccessfulReplyException
FailedOperationException
AutoMedException

checkModelsExist

public java.lang.String checkModelsExist(java.lang.String modelsToCheck)
For each model name in a name-delimited string, check if it exists in the local database. Return a similar name-delimited string of those models that don't exist

Parameters:
modelsToCheck - delimited string of model names to check
Returns:
String delimited string of names of models that don't exist

getModels

public java.util.Map getModels(java.lang.String modelsStr)
                        throws UnsuccessfulReplyException,
                               java.io.IOException,
                               AutoMedException
For each model name that does not exist in the local database, get it from the directory

Parameters:
modelsStr - the delimited string of model names
Throws:
UnsuccessfulReplyException
java.io.IOException
AutoMedException