cometa.combine
Class Combiner

java.lang.Object
  extended by cometa.combine.Combiner
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AMFEvent, AMFEventCloudTop, AMFEventRadar

public abstract class Combiner
extends java.lang.Object
implements java.io.Serializable

This is an abstract class that defines the methods that must be implemented by every combination method class. Such classes are referenced by the element

ref
in the method's metadata.

See Also:
Serialized Form

Constructor Summary
Combiner()
          It creates a new instance of
 
Method Summary
abstract  CombProc combineMetadata(Method method, CombProc combProc)
          This method must be implemented by all subclasses.
 java.lang.String convertEntities(java.lang.String input)
          It converts the html entities (used to stored special characters in the XML database) to normal characters.
 java.lang.String executeCommand(java.lang.String command)
          This method is used to run a shell command in a UNIX environment.
 java.lang.String getCurrentTimestamp()
          It returns the current time, in milliseconds.
 java.lang.String getWorkingDirectory()
          It returns the working directory string.
 void persist(java.lang.String dir)
          This method must be called at the end of every
 void postProcessing()
          The subclasses that extend this class must implement in
 java.lang.String reverseString(java.lang.String inputString)
          This method reverses a given input string.
 void setWorkingDirectory(java.lang.String workingDirectory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Combiner

public Combiner()
It creates a new instance of
Combiner
.

Method Detail

executeCommand

public java.lang.String executeCommand(java.lang.String command)
                                throws java.io.IOException
This method is used to run a shell command in a UNIX environment.

Parameters:
command - The command to execute.
Returns:
The output of the command.
Throws:
java.io.IOException - Throws an exception if something went wrong (usually, if the UNIX program could not be executed).

getCurrentTimestamp

public java.lang.String getCurrentTimestamp()
It returns the current time, in milliseconds.

Returns:
The current timestamp.

convertEntities

public java.lang.String convertEntities(java.lang.String input)
It converts the html entities (used to stored special characters in the XML database) to normal characters.

Parameters:
input - A string.
Returns:
The input string, where the entities have been substituted by the corresponding characters.

reverseString

public java.lang.String reverseString(java.lang.String inputString)
This method reverses a given input string.

Parameters:
inputString - The string to be reversed.
Returns:
A new string, that is the input string in the reverse order.

postProcessing

public void postProcessing()
The subclasses that extend this class must implement in
postProcessing
the actions to be exectued at the end of the data combination phase.


persist

public void persist(java.lang.String dir)
This method must be called at the end of every
combineMetadata
method. It serializes a copy of the current class, in order to save the information needed for the post processing.

Parameters:
dir - The directory to which the file has to be written.

combineMetadata

public abstract CombProc combineMetadata(Method method,
                                         CombProc combProc)
This method must be implemented by all subclasses. The combineMetadata methods contain instructions on how the product metadata are handled in order to consistently combine the data. Remember that this method must always contain a call to
super.setWorkingDirectory(dir);
!

Parameters:
method - The method according to which the metadata has to be combined.
combProc - The procedure containing the operations to be executed on the real data.
Returns:
The procedure containing the operations to be executed on the real data.

getWorkingDirectory

public java.lang.String getWorkingDirectory()
It returns the working directory string.

Returns:
The working directory.

setWorkingDirectory

public void setWorkingDirectory(java.lang.String workingDirectory)