org.electrocodeogram.cpc.core.api.hub.event
Class EclipseTeamEvent

java.lang.Object
  extended by org.electrocodeogram.cpc.core.api.hub.event.CPCEvent
      extended by org.electrocodeogram.cpc.core.api.hub.event.EclipseEvent
          extended by org.electrocodeogram.cpc.core.api.hub.event.EclipseTeamEvent
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<CPCEvent>

public class EclipseTeamEvent
extends EclipseEvent

A special team action event which is generated by repository provider specific CPC sensors whenever files are committed to or updated from the repository.

Author:
vw

Nested Class Summary
static class EclipseTeamEvent.Type
          Type for EclipseTeamEvents.
 
Field Summary
 
Fields inherited from class org.electrocodeogram.cpc.core.api.hub.event.EclipseEvent
fileLocatedInWorkspace, fileLocatedInWorkspaceCached, filePath, project, supportedFile, supportedFileCached, user
 
Constructor Summary
EclipseTeamEvent(java.lang.String user, java.lang.String project)
           
 
Method Summary
 java.lang.String getNewRevision()
          Retrieves the new revision identifier as provided by the repository provider.
 java.lang.String getOldRevision()
          Retrieves the old revision identifier as provided by the repository provider.
 EclipseTeamEvent.Type getType()
          Retrieves the type of this event.
 boolean isValid()
          Checks if this event has been fully initialised.
 void setNewRevision(java.lang.String revision)
          Sets the new revision identifier as provided by the repository provider.
 void setOldRevision(java.lang.String oldRevision)
          Sets the old revision identifier as provided by the repository provider.
 void setType(EclipseTeamEvent.Type type)
          Sets the type of this event.
 java.lang.String toString()
          Every event should implement a sensible toString method for use in debugging log messages.
 
Methods inherited from class org.electrocodeogram.cpc.core.api.hub.event.EclipseEvent
getFilePath, getProject, getUser, isFileLocatedInWorkspace, isSupportedFile, setFilePath, subToString
 
Methods inherited from class org.electrocodeogram.cpc.core.api.hub.event.CPCEvent
checkSeal, clone, compareTo, getCreationTime, seal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EclipseTeamEvent

public EclipseTeamEvent(java.lang.String user,
                        java.lang.String project)
Method Detail

getType

public EclipseTeamEvent.Type getType()
Retrieves the type of this event.

Returns:
the type of this event, never null.

setType

public void setType(EclipseTeamEvent.Type type)
Sets the type of this event.

Parameters:
type - the type of this event, never null.

getNewRevision

public java.lang.String getNewRevision()
Retrieves the new revision identifier as provided by the repository provider.
May be NULL, if no revision data was provided by the repository provider.

Returns:
new revision identifier for this file version, may be NULL.

setNewRevision

public void setNewRevision(java.lang.String revision)
Sets the new revision identifier as provided by the repository provider.

Parameters:
revision - new revision identifier for this file version, may be NULL.

getOldRevision

public java.lang.String getOldRevision()
Retrieves the old revision identifier as provided by the repository provider.
May be NULL, if no old revision data was available.

Returns:
old revision identifier for the file before this team action, may be NULL.

setOldRevision

public void setOldRevision(java.lang.String oldRevision)
Sets the old revision identifier as provided by the repository provider.

Parameters:
oldRevision - the old revision identifier for the file before this team action, may be NULL.

isValid

public boolean isValid()
Description copied from class: CPCEvent
Checks if this event has been fully initialised.
Will return false if one of the mandatory fields of the event has not yet been filled out.

Subclasses should override this method but should never return true. Instead they should delegate to the super class implementation once all validity checks on their level have passed.

The CPCEvent.isValid() implementation always returns true.

Overrides:
isValid in class EclipseEvent
Returns:
true if this event is valid, false otherwise.
See Also:
IEventHubRegistry.dispatch(CPCEvent)

toString

public java.lang.String toString()
Description copied from class: CPCEvent
Every event should implement a sensible toString method for use in debugging log messages.

Specified by:
toString in class CPCEvent
Returns:
debug string representation, never null.