1 package org.csc.phynixx.loggersystem.logrecord; 2 3 /* 4 * #%L 5 * phynixx-common 6 * %% 7 * Copyright (C) 2014 csc 8 * %% 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 * #L% 21 */ 22 23 24 /** 25 * logs binary data. The persistence media depends on the implementation 26 */ 27 public interface IXADataRecorder extends IDataRecordSequence { 28 29 /** 30 * 31 * @return true if no records 32 */ 33 boolean isEmpty(); 34 35 /** 36 * logs the given data 37 * 38 * These data can be replyed to perform rollback. 39 * If writeRollforwardData is called once this method can not be called any more 40 * 41 * @param data 42 */ 43 void writeRollbackData(byte[] data); 44 45 /** 46 * logs the given data to perform rollback 47 * If writeRollforwardData is called once 48 * this method can not be called any more 49 * 50 * @param data 51 */ 52 void writeRollbackData(byte[][] data); 53 54 /** 55 * logs the given data to perfrom rollforward 56 * If writeRollforwardData is called once 57 * this method can not be called any more 58 * 59 * @param data 60 */ 61 void writeRollforwardData(byte[][] data); 62 63 64 /** 65 * logs the given data to perfrom rollforward 66 * If writeRollforwardData is called once 67 * this method can not be called any more 68 * 69 * @param data 70 */ 71 void writeRollforwardData(byte[] data); 72 73 /** 74 * tries to recover all persistent information 75 */ 76 void recover(); 77 78 /** 79 * @return indicates that current sequence has received a ROLLFORWARD_DATA message no more logrecord are 80 * accepted except XA_DONE to complete the sequence .... 81 */ 82 public boolean isCommitting(); 83 84 85 /** 86 * @param replay 87 */ 88 void replayRecords(IDataRecordReplay replay); 89 90 91 boolean isClosed(); 92 93 94 IDataRecord createDataRecord(XALogRecordType logRecordType, byte[][] recordData); 95 96 IDataRecord createDataRecord(XALogRecordType logRecordType, byte[] recordData); 97 98 /** 99 * closes the dataLogger, but keeps all resources, so the dataLogger can be reopened 100 */ 101 void close(); 102 103 /** 104 * resets the dataLogger and prepares it for reuse 105 */ 106 void reset(); 107 108 109 /** 110 * closes the dataRecorder and destroys all resources 111 */ 112 void destroy(); 113 }