Class PeerAdderClient

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

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


Constructor Summary
PeerAdderClient()
           
 
Method Summary
 void createInputPipe(java.lang.String fileName)
          Load the Pipe Advertisement.
 byte[] createMessage(java.lang.String msgStr, int messageType)
          create the message to be sent to gateway peer
static void main(java.lang.String[] args)
           
 void pipeMsgEvent(net.jxta.pipe.PipeMsgEvent event)
          Handles an incoming message.
 void sendMsgData(byte[] data)
          get the data as input parameter, use pipe to send the message
 void startService()
          start the ontology provider services daemon
 void stringToFile(java.lang.String par_str, java.lang.String fileName)
          convert strings to file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeerAdderClient

public PeerAdderClient()
Method Detail

main

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

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)
convert strings to file


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

createMessage

public byte[] createMessage(java.lang.String msgStr,
                            int messageType)
create the message to be sent to gateway peer

Returns:
byte[] return the message

sendMsgData

public void sendMsgData(byte[] data)
get the data as input parameter, use pipe to send the message


startService

public void startService()
start the ontology provider services daemon