uk.ac.ic.doc.automed.wrappers
Class P2PWrapper

java.lang.Object
  extended by uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
      extended by uk.ac.ic.doc.automed.wrappers.P2PWrapper

public class P2PWrapper
extends AutoMedWrapper

Use the AutoMed P2P package to access other AutoMed repositories (called peers) that contain a common schema. This schema is called a public schema, which any peer is free to store in its own repository and provide pathways to its datasources.

Author:
Peter McBrien (pjm@doc.ic.ac.uk)

Field Summary
 
Fields inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
am, awf, debug, driver, emptyKeyProtection, emptyKeys, optionKeyProtection, optionKeys, password, protocol, s, url, username
 
Constructor Summary
P2PWrapper()
           
P2PWrapper(AccessMethod am, java.lang.String password)
           
 
Method Summary
protected  void connect()
          In a P2P network, communication is not guarenteed, and hence this method returning with an Exception does not ensure that all peers are contactable.
 ASG executeIQL(ASG q)
          Execute an IQL query on the datasource.
protected  AutoMedWrapperFactory getDefaultWrapperFactory()
          Return the default AutoMedWrapperFactory that is used to generate Schema instances from information in a data sources
 java.lang.String getProtocolName()
          The name of the Protocol that this wrapper uses.
static void main(java.lang.String[] args)
           
 
Methods inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
atDebugLevel, cacheWrapper, deleteIQL, executeLocalQuery, getAccessMethod, getAutoMedWrapper, getAutoMedWrapper, getAutoMedWrapperFactory, getDrivers, getOption, getOptionKeyProtection, getOptionKeys, getProtocol, getQueryParser, getSchema, getSchema, insertIQL, newAutoMedSchema, newAutoMedWrapper, newAutoMedWrapper, newAutoMedWrapper, registerWrapper, selectNewAutoMedWrapper, selectNewAutoMedWrapper, setDebugLevel, setOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P2PWrapper

public P2PWrapper()

P2PWrapper

public P2PWrapper(AccessMethod am,
                  java.lang.String password)
           throws DataSourceException
Throws:
DataSourceException
Method Detail

connect

protected void connect()
                throws DataSourceException
In a P2P network, communication is not guarenteed, and hence this method returning with an Exception does not ensure that all peers are contactable.

Specified by:
connect in class AutoMedWrapper
Throws:
DataSourceException - if unable to connect one of the peers

getProtocolName

public java.lang.String getProtocolName()
The name of the Protocol that this wrapper uses. For this wrapper it will always be "p2p"

Specified by:
getProtocolName in class AutoMedWrapper

executeIQL

public ASG executeIQL(ASG q)
               throws DataSourceException,
                      NotFoundException
Execute an IQL query on the datasource.

Specified by:
executeIQL in class AutoMedWrapper
Parameters:
q - An IQL query held in an ASG which complies with the limitations of what this wrapper is able to process
Returns:
An ASG containing the results of the query Edited by dmle on 17/11/2005: Add caching dmle 29/11/2005: remove caching
Throws:
DataSourceException
NotFoundException

getDefaultWrapperFactory

protected AutoMedWrapperFactory getDefaultWrapperFactory()
Return the default AutoMedWrapperFactory that is used to generate Schema instances from information in a data sources

Specified by:
getDefaultWrapperFactory in class AutoMedWrapper

main

public static void main(java.lang.String[] args)