org.rhq.enterprise.server.plugins.drift.mongodb.entities
Class MongoDBChangeSetEntry

java.lang.Object
  extended by org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSetEntry
All Implemented Interfaces:
Serializable, Drift<MongoDBChangeSet,MongoDBFile>

@Embedded
public class MongoDBChangeSetEntry
extends Object
implements Drift<MongoDBChangeSet,MongoDBFile>, Serializable

A MongoChangeSetEntry is embedded in a MongoDBChangeSet. In the database, a change set is stored as a single document, and the document contains an array of its entries.

See Also:
Serialized Form

Constructor Summary
MongoDBChangeSetEntry()
           
MongoDBChangeSetEntry(String path, DriftCategory category)
           
 
Method Summary
 DriftCategory getCategory()
           
 MongoDBChangeSet getChangeSet()
           
 Long getCtime()
           
 String getDirectory()
           
 String getId()
          Returns an id that uniquely identifies this entry.
 MongoDBFile getNewDriftFile()
           
 String getNewFileHash()
           
 MongoDBFile getOldDriftFile()
           
 String getOldFileHash()
           
 String getPath()
           
 void setCategory(DriftCategory category)
           
 void setChangeSet(MongoDBChangeSet changeSet)
           
 void setCtime(Long ctime)
          This is here only for testing.
 void setDirectory(String directory)
           
 void setId(String id)
          This method does not actually set the id.
 void setIndex(int index)
          Sets the index of the entry which is the array index within the document stored in the database.
 void setNewDriftFile(MongoDBFile newDriftFile)
           
 void setNewFileHash(String newFileHash)
           
 void setOldDriftFile(MongoDBFile oldDriftFile)
           
 void setOldFileHash(String oldFileHash)
           
 void setPath(String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MongoDBChangeSetEntry

public MongoDBChangeSetEntry()

MongoDBChangeSetEntry

public MongoDBChangeSetEntry(String path,
                             DriftCategory category)
Method Detail

getId

public String getId()
Returns an id that uniquely identifies this entry. Since a MongoChangeSetEntry does not have a PK in the database, this is a combination of the change set id with its index which is assigned by the owning change set. The format is:

     <changeset_id>:<n>
 

where n is an integer id assigned by the owning change set that is unique within that change set.

Specified by:
getId in interface Drift<MongoDBChangeSet,MongoDBFile>
Returns:
A unique identifier for the change set entry

setId

public void setId(String id)
This method does not actually set the id. It is here only because it is required by the Drift interface.

Specified by:
setId in interface Drift<MongoDBChangeSet,MongoDBFile>
Parameters:
id -

setIndex

public void setIndex(int index)
Sets the index of the entry which is the array index within the document stored in the database. The index is used to form a unique id for the entry.

Parameters:
index - The array index of the entry as it is stored in the change set document in the database.

getCtime

public Long getCtime()
Specified by:
getCtime in interface Drift<MongoDBChangeSet,MongoDBFile>

setCtime

public void setCtime(Long ctime)
This is here only for testing.

Parameters:
ctime - The timestamp

getChangeSet

public MongoDBChangeSet getChangeSet()
Specified by:
getChangeSet in interface Drift<MongoDBChangeSet,MongoDBFile>

setChangeSet

public void setChangeSet(MongoDBChangeSet changeSet)
Specified by:
setChangeSet in interface Drift<MongoDBChangeSet,MongoDBFile>

getCategory

public DriftCategory getCategory()
Specified by:
getCategory in interface Drift<MongoDBChangeSet,MongoDBFile>

setCategory

public void setCategory(DriftCategory category)
Specified by:
setCategory in interface Drift<MongoDBChangeSet,MongoDBFile>

getPath

public String getPath()
Specified by:
getPath in interface Drift<MongoDBChangeSet,MongoDBFile>

setPath

public void setPath(String path)
Specified by:
setPath in interface Drift<MongoDBChangeSet,MongoDBFile>

getDirectory

public String getDirectory()
Specified by:
getDirectory in interface Drift<MongoDBChangeSet,MongoDBFile>

setDirectory

public void setDirectory(String directory)
Specified by:
setDirectory in interface Drift<MongoDBChangeSet,MongoDBFile>

getOldFileHash

public String getOldFileHash()

setOldFileHash

public void setOldFileHash(String oldFileHash)

getNewFileHash

public String getNewFileHash()

setNewFileHash

public void setNewFileHash(String newFileHash)

getOldDriftFile

public MongoDBFile getOldDriftFile()
Specified by:
getOldDriftFile in interface Drift<MongoDBChangeSet,MongoDBFile>

setOldDriftFile

public void setOldDriftFile(MongoDBFile oldDriftFile)
Specified by:
setOldDriftFile in interface Drift<MongoDBChangeSet,MongoDBFile>

getNewDriftFile

public MongoDBFile getNewDriftFile()
Specified by:
getNewDriftFile in interface Drift<MongoDBChangeSet,MongoDBFile>

setNewDriftFile

public void setNewDriftFile(MongoDBFile newDriftFile)
Specified by:
setNewDriftFile in interface Drift<MongoDBChangeSet,MongoDBFile>


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.