Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (c) 2011. Axon Framework
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  * http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.axonframework.eventstore.fs;
Represents the relevant information of a snapshot event in regard to the event log. It combines the actual event (in serialized form) and the offset in bytes to use when reading from the event log.

Author(s):
Allard Buijze
Since:
0.5
    private final byte[] serializedEvent;
    private final long offset;
    private final long sequenceNumber;
    private final String timeStamp;

    
Instantiate a SnapshotEventEntry for the given serializedEvent, which allows the given offset number of bytes to be skipped when reading the Events file. The serializedEvent is not stored directly, instead, a copy is used.

Parameters:
serializedEvent The bytes representing the serialized event object
sequenceNumber The sequence number of the snapshot
timeStamp The ISO8601 timestamp of the event
offset The offset that the event allows in the event log
    public SnapshotEventEntry(byte[] serializedEventlong sequenceNumberString timeStamplong offset) {
        this. = offset;
        this. = timeStamp;
        this. = Arrays.copyOf(serializedEventserializedEvent.length);
        this. = sequenceNumber;
    }

    
Returns an input stream to read the serialized event. The InputStream does not have to be closed.

Returns:
An InputStream accessing the bytes.
    public byte[] getBytes() {
        return ;
    }

    
Returns the sequence number of the snapshot event. This is the sequence number of the last regular event that was included in this snapshot.

Returns:
the sequence number of the snapshot event
    public long getSequenceNumber() {
        return ;
    }

    
Returns the size of the serialized object (the number of bytes).

Returns:
the size of the serialized object in bytes.
    public int getEventSize() {
        return .;
    }

    
The number of bytes that may be skipped when applying the snapshot event contained in this entry.

Returns:
the offset for this snapshot event.
    public long getOffset() {
        return ;
    }

    
The ISO8601 timestamp of this entry

Returns:
the ISO8601 timestamp of this entry
    public String getTimeStamp() {
        return ;
    }
New to GrepCode? Check out our FAQ X