private long getCurrentSequenceNumber() { try { return new ServerStateReader().getServerState(dataDirectory.toURI().toURL()).getSequenceNumber(); } catch (MalformedURLException e) { throw new OsmosisRuntimeException("Unable to get the current sequence number", e); } }
/** * Retrieves the latest state from the server. * * @param baseUrl * The url of the directory containing change files. * @return The state. */ public ReplicationState getServerState(URL baseUrl) { return getServerState(baseUrl, SERVER_STATE_FILE); }
/** * Creates a new instance. * * @param workingDirectory * The directory containing configuration and tracking files. * @param humanReadable * Print the replication lag in a Hours, Minutes and Seconds * instead of the raw number of seconds */ public ReplicationLagReader(File workingDirectory, boolean humanReadable) { this.workingDirectory = workingDirectory; this.humanReadable = humanReadable; serverStateReader = new ServerStateReader(); }
/** * Retrieves the latest state from the server. * * @param baseUrl * The url of the directory containing change files. * @return The state. */ public ReplicationState getServerState(URL baseUrl) { return getServerState(baseUrl, SERVER_STATE_FILE); }
/** * Creates a new instance. * * @param workingDirectory * The directory containing configuration and tracking files. * @param humanReadable * Print the replication lag in a Hours, Minutes and Seconds * instead of the raw number of seconds */ public ReplicationLagReader(File workingDirectory, boolean humanReadable) { this.workingDirectory = workingDirectory; this.humanReadable = humanReadable; serverStateReader = new ServerStateReader(); }
/** * Retrieves the specified state from the server. * * @param baseUrl * The url of the directory containing change files. * @param sequenceNumber * The sequence number of the state to be retrieved from the server. * @return The state. */ public ReplicationState getServerState(URL baseUrl, long sequenceNumber) { return getServerState(baseUrl, sequenceFormatter.getFormattedName(sequenceNumber, SEQUENCE_STATE_FILE_SUFFIX)); }
/** * Creates a new instance. * * @param workingDirectory * The directory containing configuration and tracking files. */ public BaseReplicationDownloader(File workingDirectory) { this.workingDirectory = workingDirectory; sequenceFormatter = new ReplicationSequenceFormatter(9, 3); serverStateReader = new ServerStateReader(); }
/** * Retrieves the specified state from the server. * * @param baseUrl * The url of the directory containing change files. * @param sequenceNumber * The sequence number of the state to be retrieved from the server. * @return The state. */ public ReplicationState getServerState(URL baseUrl, long sequenceNumber) { return getServerState(baseUrl, sequenceFormatter.getFormattedName(sequenceNumber, SEQUENCE_STATE_FILE_SUFFIX)); }
/** * Creates a new instance. * * @param workingDirectory * The directory containing configuration and tracking files. */ public BaseReplicationDownloader(File workingDirectory) { this.workingDirectory = workingDirectory; sequenceFormatter = new ReplicationSequenceFormatter(9, 3); serverStateReader = new ServerStateReader(); }
serverState = serverStateReader.getServerState(configuration.getBaseUrl());
serverState = serverStateReader.getServerState(configuration.getBaseUrl());
serverState = serverStateReader.getServerState(configuration.getBaseUrl());
serverState = serverStateReader.getServerState(configuration.getBaseUrl());
fileReplicationState = serverStateReader.getServerState(baseUrl, sequenceNumber);
fileReplicationState = serverStateReader.getServerState(baseUrl, sequenceNumber);