org.glite.lb
Class ILProto

java.lang.Object
  extended by org.glite.lb.ILProto

public class ILProto
extends java.lang.Object

this class handles communication with LB server (reads messages it sends)


Constructor Summary
ILProto(java.net.Socket socket)
          construcor initializes the class' socket, inStream and outStream attributes
 
Method Summary
 int errMin()
           
 java.lang.String errMsg()
           
 java.lang.String receiveMessage()
          this method reads from the inpuStream of the provided socket, checks for the magic word and returns relevant info
 int receiveReply()
           
 void sendMessage(java.lang.String msg)
           
 void sendReply(int errCode, int minErrCode, java.lang.String message)
          this method encodes and sends a reply to the interlogger via the socket's outputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ILProto

public ILProto(java.net.Socket socket)
        throws java.io.IOException
construcor initializes the class' socket, inStream and outStream attributes

Parameters:
socket - an SSLSocket
Throws:
java.io.IOException
Method Detail

receiveMessage

public java.lang.String receiveMessage()
                                throws java.io.IOException
this method reads from the inpuStream of the provided socket, checks for the magic word and returns relevant info

Returns:
a String containing third line of the inputStream data, without the info about its length
Throws:
java.io.IOException

sendMessage

public void sendMessage(java.lang.String msg)
                 throws java.io.IOException
Throws:
java.io.IOException

receiveReply

public int receiveReply()
                 throws java.io.IOException,
                        LBException
Throws:
java.io.IOException
LBException

errMin

public int errMin()

errMsg

public java.lang.String errMsg()

sendReply

public void sendReply(int errCode,
                      int minErrCode,
                      java.lang.String message)
               throws java.io.IOException
this method encodes and sends a reply to the interlogger via the socket's outputStream

Parameters:
errCode - errCode of the calling
minErrCode - minimum available errcode
message - message for the interlogger - could be any String
Throws:
java.io.IOException