All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.jrtps.udds.HistoryCache Maven / Gradle / Ivy

There is a newer version: 1.5.1
Show newest version
package net.sf.jrtps.udds;

import java.util.Set;

import net.sf.jrtps.message.parameter.KeyHash;

/**
 * HistoryCache represents a uDDS history cache. 
 *
 * @author mcr70
 */
public interface HistoryCache {
    /**
     * Calling this method starts a new coherent set.
     */
    void coherentChangesBegin();
    
    /**
     * Calling this method ends current coherent set.
     */
    void coherentChangesEnd();
    
    /**
     * Dispose an instance represented by given sample
     * @param sample  Sample to dispose
     * @param timestamp timestamp of the disposal
     */
    void dispose(T sample, long timestamp);
    /**
     * Unregister an instance represented by given sample.
     * @param sample Sample representing instance to unregister
     * @param timestamp timestamp of unregister
     */
    void unregister(T sample, long timestamp);
    /**
     * Writes a Sample.
     * @param sample Sample to write
     * @param timestamp timestamp of the write
     */
    void write(T sample, long timestamp);
    
    /**
     * Registers an instance represented by given sample.
     * @param sample
     * @param timestamp
     * @return an Instance
     */
    Instance register(T sample, long timestamp);

    /**
     * Gets instances of this HistoryCache.
     * @return a Set of instances
     */
    Set> getInstances();
    
    /**
     * Get an Instance represented by given Key
     * @param key
     * @return Instance, or null if there was not Instance with given key
     */
    Instance getInstance(KeyHash key);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy