com.nhncorp.neptune.changelog.pipe
Class Pipe

java.lang.Object
  extended by com.nhncorp.neptune.changelog.pipe.Pipe

public class Pipe
extends java.lang.Object


Field Summary
static int G_PORT
           
 
Constructor Summary
Pipe(java.nio.channels.SocketChannel prevChannel, int timeout)
           
 
Method Summary
 void backupFile()
           
 void changeState(com.nhncorp.neptune.changelog.pipe.PipeState newState)
           
 void close()
           
 boolean connect(java.nio.channels.SelectableChannel ch)
           
 void fini(int bytes)
           
 long getLogFileSize()
           
 java.lang.String getPipeKey()
           
 void init()
           
 boolean isActivated()
           
 boolean isCloseState()
           
 boolean isCloseTriggered()
           
 boolean isExpired(long processTime)
           
 boolean read(java.nio.channels.SelectableChannel ch)
           
 void register(java.nio.channels.Selector selector)
           
 void removeBackupFiles()
           
 void removeLogFile()
           
 void restoreLastLogFile()
           
 void setEventHandler(PipeEventHandler handler)
           
 void setListenPortNumber(int port)
           
 void setLogPath(java.lang.String logPath)
           
 java.lang.String toString()
           
 void touch()
           
 void triggerClose()
           
 boolean write(java.nio.channels.SelectableChannel ch)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

G_PORT

public static int G_PORT
Constructor Detail

Pipe

public Pipe(java.nio.channels.SocketChannel prevChannel,
            int timeout)
Method Detail

setListenPortNumber

public void setListenPortNumber(int port)

setEventHandler

public void setEventHandler(PipeEventHandler handler)

setLogPath

public void setLogPath(java.lang.String logPath)

init

public void init()
          throws java.io.IOException
Throws:
java.io.IOException

getPipeKey

public java.lang.String getPipeKey()

write

public boolean write(java.nio.channels.SelectableChannel ch)
              throws java.io.IOException
Throws:
java.io.IOException

read

public boolean read(java.nio.channels.SelectableChannel ch)
             throws java.io.IOException
Throws:
java.io.IOException

connect

public boolean connect(java.nio.channels.SelectableChannel ch)
                throws java.io.IOException
Throws:
java.io.IOException

fini

public void fini(int bytes)
          throws java.io.IOException
Throws:
java.io.IOException

triggerClose

public void triggerClose()

isCloseTriggered

public boolean isCloseTriggered()

isCloseState

public boolean isCloseState()

close

public void close()

removeLogFile

public void removeLogFile()

backupFile

public void backupFile()
                throws java.io.IOException
Throws:
java.io.IOException

restoreLastLogFile

public void restoreLastLogFile()
                        throws java.io.IOException
Throws:
java.io.IOException

removeBackupFiles

public void removeBackupFiles()

getLogFileSize

public long getLogFileSize()
                    throws java.io.IOException
Throws:
java.io.IOException

changeState

public void changeState(com.nhncorp.neptune.changelog.pipe.PipeState newState)
                 throws java.io.IOException
Throws:
java.io.IOException

isExpired

public boolean isExpired(long processTime)

isActivated

public boolean isActivated()

touch

public void touch()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

register

public void register(java.nio.channels.Selector selector)