PeerApplication
Keywords: uk.ac.ic.doc.automed.p2p.gui.PeerApplication 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.p2p.gui
Class PeerApplication

    java.lang.Object
      uk.ac.ic.doc.automed.p2p.gui.PeerApplication

    public class PeerApplication

extends java.lang.Object

Author:
  Charis TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
`PeerApplication()` Equivalent to PeerApplication(null,true)
`PeerApplication(AutoMedPeer peer)` Start peer app with a peer
`PeerApplication(Gui gui, boolean standalone)` Create a GUI application to access the P2P system.

Method Summary
`void` | `advertizePath(SchemaDescription publicSchema)`
`void` | `broker(PeerDescription peerDesc)` Ask a peer to act as a broker for a query, executing the query against its local data sources, and those of any other peers that the peer knows about that implement public schemas of that peer.
`void` | `broker(PeerDescription peerDesc, java.lang.String schema, java.lang.String query)`
`void` | `close()` Close the AutoMedPeer, and allow to register as a new peer
`AutoMedPeer` | `getAutoMedPeer()` Return the `AutoMedPeer` this application provides a UI for.
`java.util.Collection` | `getObjectsFor(MainFrame frame)`
`void` | `getPathway(PeerDescription peer)`
`PeerCache` | `getPeerCache()` Return the reference to `PeerCache` object which stores peer data
`void` | `getSchema(SchemaDescription schema)` Edited by MDLE on 19/10/2005 to also query associated models if required
`void` | `getSourcePath(PeerDescription peerDesc)` Get the pathway from a peer between a public schema and any named schema at that peer.
`PeerStateHandler` | `getStateHandler()` Return the peer-wise state handler object.
`java.lang.String` | `getTitleFor(MainFrame frame)`
`static UserActionResult` | `getTool(java.lang.Object[] o)` Method for the AutoMed GUI to call to launch the P2P system.
`protected void` | `initPeer(java.lang.String name, PeerStateHandler stateHandler)` Intialise peer by creating a singleton object to be used throughout the application This method is only invoked by LoginFrame and not by outside classes.
`void` | `joinNetwork()`
`void` | `launchGui()`
`void` | `launchLoginFrame()`
`void` | `launchMainFrame()`
`void` | `loggedIn()` The application has now logged in to the Directory, so enter "running" state where communication with Directory can be made.
`static void` | `main(java.lang.String[] args)`
`void` | `publishSchema()`
`void` | `query(PeerDescription peerDesc)` Run a query on a peer.
`void` | `refreshFor(MainFrame frame)`
`void` | `setGui(Gui gui)` Set a GUI object
`void` | `showAllSchemas()`
`void` | `showSchema(SchemaDescription schema)`
`void` | `wrap(PeerDescription peerDesc)` Store the details of a PeerDescription as an AccessMethod in the local repository.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PeerApplication

    public PeerApplication()

  Equivalent to PeerApplication(null,true)

### PeerApplication

    public PeerApplication(Gui gui,
                           boolean standalone)

  Create a GUI application to access the P2P system.

  Parameters:
    `gui` - An AutoMed @link{Gui} that this `PeerApplication` should inform of changes to the P2P connection state.
    `standalone` - When set to true, the application is designed to run alone, and has extra buttons to allow its different windows to open each other, and also run the AutoMed GUI. Normally the gui being non-null implies this parameter is false.

### PeerApplication

    public PeerApplication(AutoMedPeer peer)

  Start peer app with a peer

Method Detail

### initPeer

    protected void initPeer(java.lang.String name,
                            PeerStateHandler stateHandler)
                     throws P2PException,
                            java.io.IOException,
                            AutoMedException

  Intialise peer by creating a singleton object to be used throughout the application
  This method is only invoked by LoginFrame and not by outside classes. Use constructor to create a pplication with a new AutoMedPeer object

  Throws:
    `P2PException`
    `java.io.IOException`
    `AutoMedException`

### getAutoMedPeer

    public AutoMedPeer getAutoMedPeer()

  Return the `AutoMedPeer` this application provides a UI for. The peer will only be returned once the user has logged in to both the local `P2PRegistry` and global `P2PDirectory`

### getPeerCache

    public PeerCache getPeerCache()

  Return the reference to `PeerCache` object which stores peer data

### close

    public void close()

  Close the AutoMedPeer, and allow to register as a new peer

### setGui

    public void setGui(Gui gui)

  Set a GUI object

### launchLoginFrame

    public void launchLoginFrame()

### launchMainFrame

    public void launchMainFrame()

### loggedIn

    public void loggedIn()
                  throws AutoMedException

  The application has now logged in to the Directory, so enter "running" state where communication with Directory can be made.

  Throws:
    `AutoMedException`

### main

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

### getObjectsFor

    public java.util.Collection getObjectsFor(MainFrame frame)

  Parameters:
    `frame` -
  Returns:

### getTitleFor

    public java.lang.String getTitleFor(MainFrame frame)

  Parameters:
    `frame` -
  Returns:

### getStateHandler

    public PeerStateHandler getStateHandler()

  Return the peer-wise state handler object. Create one if it not already exists

### refreshFor

    public void refreshFor(MainFrame frame)

### showSchema

    public void showSchema(SchemaDescription schema)

  Parameters:
    `schema` -

### showAllSchemas

    public void showAllSchemas()

### launchGui

    public void launchGui()

### advertizePath

    public void advertizePath(SchemaDescription publicSchema)

### publishSchema

    public void publishSchema()

### getSchema

    public void getSchema(SchemaDescription schema)

  Edited by MDLE on 19/10/2005 to also query associated models if required

  Parameters:
    `schema` -

### broker

    public void broker(PeerDescription peerDesc,
                       java.lang.String schema,
                       java.lang.String query)

### broker

    public void broker(PeerDescription peerDesc)

  Ask a peer to act as a broker for a query, executing the query against its local data sources, and those of any other peers that the peer knows about that implement public schemas of that peer.

  Parameters:
    `peerDesc` - the Peer on which the broker query should start at

### query

    public void query(PeerDescription peerDesc)

  Run a query on a peer.

  Parameters:
    `peerDesc` - The description of the peer on which to run the query.

### wrap

    public void wrap(PeerDescription peerDesc)

  Store the details of a PeerDescription as an AccessMethod in the local repository. This makes the peer available as as data source for the query processor in the local repository.

### getSourcePath

    public void getSourcePath(PeerDescription peerDesc)

  Get the pathway from a peer between a public schema and any named schema at that peer.

  Parameters:
    `peerDesc` - peer to retrieve path from public schema to data sources.

### getPathway

    public void getPathway(PeerDescription peer)

  Parameters:
    `peer` -

### getTool

    public static UserActionResult getTool(java.lang.Object[] o)

  Method for the AutoMed GUI to call to launch the P2P system.

### joinNetwork

    public void joinNetwork()
                     throws AutoMedException

  Throws:
    `AutoMedException`

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