P2PWrapper
Keywords: uk.ac.ic.doc.automed.wrappers.P2PWrapper class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
          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.
`ASG` | `executeIQL(ASG q, QueryEvaluationConfiguration qec)` Execute query with constraints.
`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.
`QueryParser` | `getQueryParser(ASG query)` Return a parser that will accept queries for the wrapper.
`void` | `getSODefinition(QuerySubGoal qsg)` Implement AutoMedWrapper abstract method
`static void` | `main(java.lang.String[] args)`

Methods inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedWrapper
`atDebugLevel, cacheWrapper, deleteIQL, executeIQL, executeLocalQuery, getAccessMethod, getAutoMedWrapper, getAutoMedWrapper, getAutoMedWrapperFactory, getDrivers, getOption, getOptionKeyProtection, getOptionKeys, getProtocol, getQueryCache, getQueryCache, getSchema, getSchema, getSODefinition, insertIQL, newAutoMedSchema, newAutoMedWrapper, newAutoMedWrapper, newAutoMedWrapper, registerWrapper, selectNewAutoMedWrapper, selectNewAutoMedWrapper, setDebugLevel, setOption, updateCache`

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,
                          QueryEvaluationConfiguration qec)
                   throws DataSourceException,
                          NotFoundException

  Execute query with constraints. At the moment this method is only implemented by P2PWrapper. Other wrappers do not have this yet!

  Throws:
    `DataSourceException`
    `NotFoundException`

### 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
  Throws:
    `DataSourceException`
    `NotFoundException`

### getSODefinition

    public void getSODefinition(QuerySubGoal qsg)
                         throws DataSourceException

  Implement AutoMedWrapper abstract method

  Specified by:
    `getSODefinition` in class `AutoMedWrapper`
  Throws:
    `DataSourceException`

### 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`

### getQueryParser

    public QueryParser getQueryParser(ASG query)

  Description copied from class: `AutoMedWrapper`
  Return a parser that will accept queries for the wrapper. The default parser is `Schemes`, which accepts only single schemes, with no other IQL operators supported. The `SimpleComp` parser will allow simple list comprehensions to be passed to the wrapper.

  Overrides:
    `getQueryParser` in class `AutoMedWrapper`

### main

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

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD