All DataStore Miners subclass from the abstract class org.eclipse.cdt.dstore.core.miners.miner.Miner provided by the DataStore.
The Miner Class
Abstract Methods
- public abstract void extendSchema(DataElement schemaRoot)
Called when the miner is first loaded by the DataStore. Allows the miner to add any miner specific descriptors to the schema. All schema additions should be made from this method. The DataElement input parameter is the root of the descriptor tree.
- public abstract DataElement handleCommand(DataElement theElement)
Called by the DataStore when a command is received whose source attribute is this miner's class name. The DataElement input parameter is the command object. The method returns the status object for the command.
Possible methods for overriding (default implementation provided by Miner class)
- public void load()
Called when the miner is loaded by the DataStore. Allows the miner to perform and configurations and load any persisted information.
- public void finish()
Called by the DataStore when the server is ending. Allows the miner to perform cleanup and persist information.
- public void updateMinerInfo()
Called when the DataStore receives a C_INIT_MINERS command.
Helper Methods
- public int getNumberOfCommandArguments(DataElement command)
Given a command object, returns the number of arguments passed to the command. This provides a quick method for checking if all the required arguments are passed with a command.
- public DataElement getCommandArgument(DataElement command, int arg)
Given an command object and argument number (argument numbers started a zero) returns the corresponding argument.
- public String getCommandName(DataElement command)
Given a command object returns the command name (name attribute)
- public String getCommandFilter(DataElement command)
Given a command object, getCommandFilter searches for a child DataElement of type "filter" and returns the DataElement's name attribute. If no child DataElement is found then "details" is returned.
- public DataElement getCommandStatus(DataElement command)
Given a command object returns the child DataElement of type "status"
- public DataElement getMinerData()
Returns the DataElement representing the root of the Miner Data subtree. All data objects created by the miner should be added in this subtree.
- public void makeTransient(DataElement objectDescriptor)
Flags a data object as being transient.
|