|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rhq.core.domain.drift.JPADriftChangeSet
public class JPADriftChangeSet
The JPA Drift Server plugin (the RHQ default) implementation of DriftChangeSet. A change set instance has slightly different behavior based on whether or not it is version zero, that is the initial change set. This is due to the way in which pinned templates are supported.
All change sets belong to a drift definition, and the definition is created from a
DriftDefinitionTemplate
. Templates can be pinned or unpinned. Each change set
encapsulates a collection of changes that are represented by JPADrift
.
When a template is pinned there is a corresponding pinned snapshot that belongs to the
template. Each definition created from that template uses that same pinned snapshot. In
terms of implementation, the pinned snapshot is always change set version zero. As an
optimization (of the default driftserver plugin data model design), the pinned snapshot
is shared among definitions to avoid the overhead of making copies of what could
potentially be very large numbers of Drift entities.
When an instance of this class represents change set version zero, different fields will be "live" (i.e., non-null and in use) versus when it is not the initial change set.
Note: Because persistence of this entity is managed by a drift server plugin, other entities managed by the RHQ core server cannot maintain direct references or JPA associations to this class. This restriction is necessary because entities managed by the RHQ core server interact with instance of this class through its drift entity interface which may have multiple implementation. Those implementations need not even be based on a RDBMS. Even though this entity is managed via a drift server plugin, it can maintain direct references and JPA associations to entities managed by the RHQ core server since they reside in the same database. That is however an implementation detail only of this class. It cannot be exposed in the drift interfaces.
Field Summary | |
---|---|
static String |
QUERY_DELETE_BY_DRIFTDEF_RESOURCE
|
static String |
QUERY_DELETE_BY_RESOURCES
|
Constructor Summary | |
---|---|
protected |
JPADriftChangeSet()
|
|
JPADriftChangeSet(Resource resource,
int version,
DriftChangeSetCategory category,
DriftDefinition driftDefinition)
|
Method Summary | |
---|---|
DriftChangeSetCategory |
getCategory()
Retturns the category that identifies the change set type. |
Long |
getCtime()
|
DriftDefinition |
getDriftDefinition()
|
int |
getDriftDefinitionId()
Returns the id of the owning drift definition. |
DriftConfigurationDefinition.DriftHandlingMode |
getDriftHandlingMode()
Returns the drift handling mode of the owning drift definition at the time of change set creation. |
Set<JPADrift> |
getDrifts()
|
String |
getId()
Returns a string that uniquely identifies the change set. |
JPADriftSet |
getInitialDriftSet()
|
Resource |
getResource()
|
int |
getResourceId()
Returns the id of the resource to which the drift definition is assigned. |
int |
getVersion()
Every change set must be assigned a version that is unique within the context of the owning DriftDefinition . |
void |
setCategory(DriftChangeSetCategory category)
Sets the change set category. |
void |
setDriftDefinition(DriftDefinition driftDefinition)
|
void |
setDriftDefinitionId(int id)
Sets the id of the owning drift definition. |
void |
setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode driftHandlingMode)
Sets the drift handling mode for the change set. |
void |
setDrifts(Set<JPADrift> drifts)
|
void |
setId(String id)
Sets the change set id which should be unique. |
void |
setInitialDriftSet(JPADriftSet driftSet)
|
void |
setResource(Resource resource)
|
void |
setResourceId(int id)
Sets the id of the resource to which the drift definition is assigned. |
void |
setVersion(int version)
Sets the change set version number. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String QUERY_DELETE_BY_RESOURCES
public static final String QUERY_DELETE_BY_DRIFTDEF_RESOURCE
Constructor Detail |
---|
protected JPADriftChangeSet()
public JPADriftChangeSet(Resource resource, int version, DriftChangeSetCategory category, DriftDefinition driftDefinition)
Method Detail |
---|
public String getId()
DriftChangeSet
getId
in interface DriftChangeSet<JPADrift>
public void setId(String id)
DriftChangeSet
setId
in interface DriftChangeSet<JPADrift>
id
- The change set identifier that should be uniquepublic Long getCtime()
getCtime
in interface DriftChangeSet<JPADrift>
public int getVersion()
DriftChangeSet
DriftDefinition
. This is analgous to a revision number in a
version control system like SVN.
getVersion
in interface DriftChangeSet<JPADrift>
DriftDefinition
.public void setVersion(int version)
DriftChangeSet
DriftDefinition
. Change sets should be assigned version numbers in
increasing order. The first change set saved should have a version of N, the second
should have a value of N + 1, etc.
setVersion
in interface DriftChangeSet<JPADrift>
version
- The version number.public DriftChangeSetCategory getCategory()
DriftChangeSet
getCategory
in interface DriftChangeSet<JPADrift>
DriftChangeSetCategory
public void setCategory(DriftChangeSetCategory category)
DriftChangeSet
setCategory
in interface DriftChangeSet<JPADrift>
category
- The category that identifies the change set typeDriftChangeSetCategory
public int getResourceId()
DriftChangeSet
getResourceId
in interface DriftChangeSet<JPADrift>
public void setResourceId(int id)
DriftChangeSet
setResourceId
in interface DriftChangeSet<JPADrift>
id
- The Resource
idpublic Resource getResource()
public void setResource(Resource resource)
public DriftDefinition getDriftDefinition()
public void setDriftDefinition(DriftDefinition driftDefinition)
public DriftConfigurationDefinition.DriftHandlingMode getDriftHandlingMode()
DriftChangeSet
getDriftHandlingMode
in interface DriftChangeSet<JPADrift>
DriftDefinition.DriftHandlingMode
modepublic void setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode driftHandlingMode)
DriftChangeSet
setDriftHandlingMode
in interface DriftChangeSet<JPADrift>
driftHandlingMode
- The DriftDefinition.DriftHandlingMode
modepublic int getDriftDefinitionId()
DriftChangeSet
getDriftDefinitionId
in interface DriftChangeSet<JPADrift>
DriftDefinition
idpublic void setDriftDefinitionId(int id)
DriftChangeSet
setDriftDefinitionId
in interface DriftChangeSet<JPADrift>
id
- The DriftDefinition
idpublic Set<JPADrift> getDrifts()
getDrifts
in interface DriftChangeSet<JPADrift>
public void setDrifts(Set<JPADrift> drifts)
setDrifts
in interface DriftChangeSet<JPADrift>
drifts
- The entries that make up this change setpublic JPADriftSet getInitialDriftSet()
public void setInitialDriftSet(JPADriftSet driftSet)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |