com.notuvy.singleapp.multiuser
Class BrokerConnection

java.lang.Object
  extended by com.notuvy.singleapp.multiuser.BrokerConnection

public class BrokerConnection
extends Object

Basic description

Author:
murali

Field Summary
protected static org.apache.log4j.Logger LOG
           
 
Constructor Summary
BrokerConnection(Socket pSocket)
          Create an incoming connection.
BrokerConnection(String pUser, Socket pSocket)
           
 
Method Summary
protected  boolean canCommunicate()
           
protected  void closeByInput()
           
protected  void closeByOutput()
           
 ObjectInputStream getInput()
           
 ObjectOutputStream getOutput()
           
 String getUser()
           
protected  int readAck()
           
protected  Object readObjectMessage()
           
protected  boolean readOwnedBrokerWasShutdown()
           
protected  boolean readUserConflict(String pUser)
           
protected  void writeAck()
           
protected  void writeObjectMessage(Object pMessage)
           
protected  void writeOwnedBrokerWasShutdown(boolean pShutdown)
           
protected  void writeUserConflict(boolean pConflict)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG
Constructor Detail

BrokerConnection

public BrokerConnection(String pUser,
                        Socket pSocket)
                 throws IOException
Throws:
IOException

BrokerConnection

public BrokerConnection(Socket pSocket)
                 throws IOException
Create an incoming connection. This will read the username from the inputstream.

Parameters:
pSocket - incoming socket.
Throws:
IOException
Method Detail

getUser

public String getUser()

getInput

public ObjectInputStream getInput()

getOutput

public ObjectOutputStream getOutput()

canCommunicate

protected boolean canCommunicate()

readObjectMessage

protected Object readObjectMessage()
                            throws IOException
Throws:
IOException

writeObjectMessage

protected void writeObjectMessage(Object pMessage)
                           throws IOException
Throws:
IOException

closeByInput

protected void closeByInput()
                     throws IOException
Throws:
IOException

closeByOutput

protected void closeByOutput()
                      throws IOException
Throws:
IOException

readUserConflict

protected boolean readUserConflict(String pUser)
                            throws IOException
Throws:
IOException

writeUserConflict

protected void writeUserConflict(boolean pConflict)
                          throws IOException
Throws:
IOException

readOwnedBrokerWasShutdown

protected boolean readOwnedBrokerWasShutdown()
                                      throws IOException
Throws:
IOException

writeOwnedBrokerWasShutdown

protected void writeOwnedBrokerWasShutdown(boolean pShutdown)
                                    throws IOException
Throws:
IOException

readAck

protected int readAck()
               throws IOException
Throws:
IOException

writeAck

protected void writeAck()
                 throws IOException
Throws:
IOException


Copyright © 2012. All Rights Reserved.