org.exoplatform.services.jcr.ext.replication
Class PendingChangesLog

java.lang.Object
  extended by org.exoplatform.services.jcr.ext.replication.PendingChangesLog

public class PendingChangesLog
extends java.lang.Object

Created by The eXo Platform SAS.

Version:
$Id: PendingChangesLog.java 35186 2009-08-07 14:23:43Z pnedonosko $
Author:
Alex Reshetnyak

Nested Class Summary
 class PendingChangesLog.Type
          The definition of ChangesLog types.
 
Constructor Summary
PendingChangesLog(java.lang.String identifier, int dataLength)
          PendingChangesLog constructor.
PendingChangesLog(TransactionChangesLog itemDataChangesLog, FileCleaner fileCleaner)
          PendingChangesLog constructor.
PendingChangesLog(TransactionChangesLog transactionChangesLog, java.util.List<FixupStream> listFixupStreams, java.util.List<java.io.File> listFiles, FileCleaner fileCleaner)
          PendingChangesLog constructor.
PendingChangesLog(TransactionChangesLog itemDataChangesLog, java.lang.String identifier, int type, FileCleaner fileCleaner)
          PendingChangesLog constructor.
 
Method Summary
 void addNewStream(FixupStream fs)
          addNewStream.
static byte[] getAsByteArray(TransactionChangesLog dataChangesLog)
          getAsByteArray.
static TransactionChangesLog getAsItemDataChangesLog(byte[] byteArray)
          getAsItemDataChangesLog.
 int getConteinerType()
          getConteinerType.
 byte[] getData()
          getData.
 java.util.List<FixupStream> getFixupStreams()
          getFixupStreams.
 java.lang.String getIdentifier()
          getIdentifier.
 java.util.List<java.io.InputStream> getInputStreams()
          getInputStreams.
 TransactionChangesLog getItemDataChangesLog()
          getItemDataChangesLog.
 java.util.List<java.io.File> getListFile()
          getListFile.
 java.util.List<java.io.RandomAccessFile> getListRandomAccessFiles()
          getListRandomAccessFiles.
 java.io.RandomAccessFile getRandomAccessFile(FixupStream fs)
          getRandomAccessFile.
 void putData(int offset, byte[] tempData)
          putData.
 void restore()
          Restore ChangesLog(set the InputStreams to ValueData).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PendingChangesLog

public PendingChangesLog(TransactionChangesLog itemDataChangesLog,
                         FileCleaner fileCleaner)
                  throws java.io.IOException
PendingChangesLog constructor.

Parameters:
itemDataChangesLog - ChangesLog with data
fileCleaner - the FileCleaner
Throws:
java.io.IOException - will be generated the IOExaption

PendingChangesLog

public PendingChangesLog(TransactionChangesLog itemDataChangesLog,
                         java.lang.String identifier,
                         int type,
                         FileCleaner fileCleaner)
                  throws java.io.IOException
PendingChangesLog constructor.

Parameters:
itemDataChangesLog - ChangesLog with data
identifier - identifier to this PendingChangesLog.
type - type of PendingChangesLog
fileCleaner - the FileCleaner
Throws:
java.io.IOException - will be generated the IOExaption

PendingChangesLog

public PendingChangesLog(java.lang.String identifier,
                         int dataLength)
PendingChangesLog constructor.

Parameters:
identifier - identifier to this PendingChangesLog.
dataLength - the length of binary data

PendingChangesLog

public PendingChangesLog(TransactionChangesLog transactionChangesLog,
                         java.util.List<FixupStream> listFixupStreams,
                         java.util.List<java.io.File> listFiles,
                         FileCleaner fileCleaner)
PendingChangesLog constructor.

Parameters:
transactionChangesLog - ChangesLog with data
listFixupStreams - list of FixupStreams
listFiles - list of Files
fileCleaner - the FileCleaner
Method Detail

putData

public void putData(int offset,
                    byte[] tempData)
putData.

Parameters:
offset - offset in 'data'
tempData - piece of binary data

getData

public byte[] getData()
getData.

Returns:
byte[] return the binary data

getItemDataChangesLog

public TransactionChangesLog getItemDataChangesLog()
getItemDataChangesLog.

Returns:
TransactionChangesLog return the ChangesLog

getInputStreams

public java.util.List<java.io.InputStream> getInputStreams()
getInputStreams.

Returns:
List return the list of input streams

getListRandomAccessFiles

public java.util.List<java.io.RandomAccessFile> getListRandomAccessFiles()
getListRandomAccessFiles.

Returns:
List return the list of RandomAccessFiles

getListFile

public java.util.List<java.io.File> getListFile()
getListFile.

Returns:
List return list of Files

getFixupStreams

public java.util.List<FixupStream> getFixupStreams()
getFixupStreams.

Returns:
List return list of FixupStreams

getConteinerType

public int getConteinerType()
getConteinerType.

Returns:
int return the type of ChangesLog

getIdentifier

public java.lang.String getIdentifier()
getIdentifier.

Returns:
String return the identifier string

getAsByteArray

public static byte[] getAsByteArray(TransactionChangesLog dataChangesLog)
                             throws java.io.IOException
getAsByteArray. Make the array of bytes from ChangesLog.

Parameters:
dataChangesLog - the ChangesLog with data
Returns:
byte[] return the serialized ChangesLog
Throws:
java.io.IOException - will be generated the IOException

getAsItemDataChangesLog

public static TransactionChangesLog getAsItemDataChangesLog(byte[] byteArray)
                                                     throws java.io.IOException,
                                                            java.lang.ClassNotFoundException
getAsItemDataChangesLog. Make the ChangesLog from array of bytes.

Parameters:
byteArray - the serialized ChangesLog
Returns:
TransactionChangesLog return the deserialized ChangesLog
Throws:
java.io.IOException - will be generated the IOException
java.lang.ClassNotFoundException - will be generated the ClassNotFoundException

getRandomAccessFile

public java.io.RandomAccessFile getRandomAccessFile(FixupStream fs)
                                             throws java.io.IOException
getRandomAccessFile.

Parameters:
fs - the FixupStream
Returns:
RandomAccessFile return the RandomAccessFile by FixupStream
Throws:
java.io.IOException - will be generated the IOException

addNewStream

public void addNewStream(FixupStream fs)
                  throws java.io.IOException
addNewStream.

Parameters:
fs - the FixupStream
Throws:
java.io.IOException - will be generated the IOException

restore

public void restore()
             throws java.io.IOException
Restore ChangesLog(set the InputStreams to ValueData).

Throws:
java.io.IOException - will be generated the IOException


Copyright © 2011 eXo Platform SAS. All Rights Reserved.