Class Client

java.lang.Object
  |
  +--Client
All Implemented Interfaces:
java.util.EventListener, net.jxta.pipe.PipeMsgListener

public class Client
extends java.lang.Object
implements net.jxta.pipe.PipeMsgListener

This class implements Client that searches for Registries Metadata and displays that in the Registry Browser for Publishing/Querying registry


Constructor Summary
Client()
           
 
Method Summary
 void createInputPipe(java.lang.String fileName)
          Load the Pipe Advertisement.
 byte[] createMessage(java.lang.String msgStr, int messageType)
          Creates the message as bytes to be sent to other peer
static void main(java.lang.String[] args)
           
 void pipeMsgEvent(net.jxta.pipe.PipeMsgEvent event)
          Handles an incoming message.
 void sendDomainOntoRequest(java.lang.String pipeAdv)
          Sends Message in the pipe
 void startClient()
          Starts Client Peer that searches for Registries Metadata and gets the ontology to display that in the Registry browser
 void startJxta()
          Starts JXTA Peer by instantiating netpeer group and its pipe, Discovery services
 void stringToFile(java.lang.String par_str, java.lang.String fileName)
          Converts a String to a File.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Client

public Client()
Method Detail

main

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

startJxta

public void startJxta()
Starts JXTA Peer by instantiating netpeer group and its pipe, Discovery services


startClient

public void startClient()
Starts Client Peer that searches for Registries Metadata and gets the ontology to display that in the Registry browser


pipeMsgEvent

public void pipeMsgEvent(net.jxta.pipe.PipeMsgEvent event)
Handles an incoming message.

Specified by:
pipeMsgEvent in interface net.jxta.pipe.PipeMsgListener
Parameters:
event - the incoming event containing the arriving message.

stringToFile

public void stringToFile(java.lang.String par_str,
                         java.lang.String fileName)
Converts a String to a File. Used for Advertisement xml file management

Parameters:
par_str - String that is to be converted to a file
fileName - Name of the file that is to be created from the string

createInputPipe

public void createInputPipe(java.lang.String fileName)
                     throws java.io.FileNotFoundException,
                            java.io.IOException
Load the Pipe Advertisement. This method tries to create an input pipe that can be used to send messages.

Parameters:
fileName - the name of the file from which to load the Pipe Advertisement.
Throws:
FileNoteFoundException - if the Pipe Advertisement file can't be found.
java.io.IOException - if there is an error binding the pipe.
java.io.FileNotFoundException

sendDomainOntoRequest

public void sendDomainOntoRequest(java.lang.String pipeAdv)
Sends Message in the pipe

Parameters:
pipeAdv - the pipe advertisement of domain ontology server

createMessage

public byte[] createMessage(java.lang.String msgStr,
                            int messageType)
Creates the message as bytes to be sent to other peer

Parameters:
msgStr - String Message that is to be sent
Returns:
ByteArray Message as array of bytes