1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.statesystem
.core
.tests
.stubs
.backend
;
13 import java
.io
.IOException
;
15 import org
.eclipse
.tracecompass
.internal
.statesystem
.core
.backend
.historytree
.HTConfig
;
16 import org
.eclipse
.tracecompass
.internal
.statesystem
.core
.backend
.historytree
.HistoryTree
;
17 import org
.eclipse
.tracecompass
.internal
.statesystem
.core
.backend
.historytree
.HistoryTreeBackend
;
20 * Stub class for the {@link HistoryTreeBackend}. It creates a
21 * {@link HistoryTreeStub} to grant access to some protected methods.
23 * @author Geneviève Bastien
25 public class HistoryTreeBackendStub
extends HistoryTreeBackend
{
28 * Constructor for new history files. Use this when creating a new history
32 * The state system's ID
34 * The filename/location where to store the state history (Should
36 * @param providerVersion
37 * Version of of the state provider. We will only try to reopen
38 * existing files if this version matches the one in the
41 * The earliest time stamp that will be stored in the history
43 * The size of the blocks in the history file. This should be a
46 * The maximum number of children each core node can have
48 * Thrown if we can't create the file for some reason
50 public HistoryTreeBackendStub(String ssid
,
55 int maxChildren
) throws IOException
{
56 super(ssid
, newStateFile
, providerVersion
, startTime
, blockSize
, maxChildren
);
60 * Existing history constructor. Use this to open an existing state-file.
63 * The state system's id
64 * @param existingStateFile
65 * Filename/location of the history we want to load
66 * @param providerVersion
67 * Expected version of of the state provider plugin.
69 * If we can't read the file, if it doesn't exist, is not
70 * recognized, or if the version of the file does not match the
71 * expected providerVersion.
73 public HistoryTreeBackendStub(String ssid
, File existingStateFile
, int providerVersion
)
75 super(ssid
, existingStateFile
, providerVersion
);
79 protected HistoryTree
initializeSHT(HTConfig conf
) throws IOException
{
80 return new HistoryTreeStub(conf
);
84 protected HistoryTree
initializeSHT(File existingStateFile
, int providerVersion
) throws IOException
{
85 return new HistoryTreeStub(existingStateFile
, providerVersion
);
89 * Get the History Tree built by this backend.
91 * @return The history tree
93 public HistoryTreeStub
getHistoryTree() {
94 return (HistoryTreeStub
) super.getSHT();
This page took 0.04485 seconds and 5 git commands to generate.