org.modeshape.graph.observe
Class Changes

java.lang.Object
  extended by org.modeshape.graph.observe.Changes
All Implemented Interfaces:
Serializable, Comparable<Changes>
Direct Known Subclasses:
NetChangeObserver.NetChanges

@Immutable
public class Changes
extends Object
implements Comparable<Changes>, Serializable

A set of changes that were made atomically. Each change is in the form of a frozen ChangeRequest.

See Also:
Serialized Form

Field Summary
protected  List<ChangeRequest> changeRequests
           
protected  String contextId
           
protected  Map<String,String> data
           
protected  String processId
           
protected  String sourceName
           
protected  DateTime timestamp
           
protected  String userName
           
 
Constructor Summary
protected Changes(Changes changes)
           
  Changes(String processId, String contextId, String userName, String sourceName, DateTime timestamp, List<ChangeRequest> requests, Map<String,String> data)
           
 
Method Summary
 int compareTo(Changes that)
          
 boolean equals(Object obj)
          
 List<ChangeRequest> getChangeRequests()
          Get the list of changes.
 String getContextId()
          Get the identifier of the ExecutionContext where these changes originated.
 Map<String,String> getData()
          Get the data associated with these changes.
 String getProcessId()
          Get the identifier of the process where these changes originated.
 String getSourceName()
          Get the name of the source that was changed.
 DateTime getTimestamp()
          Get the timestamp that the changes were made.
 String getUserName()
          Get the user that made these changes.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

processId

protected final String processId

contextId

protected final String contextId

userName

protected final String userName

sourceName

protected final String sourceName

timestamp

protected final DateTime timestamp

data

protected final Map<String,String> data

changeRequests

protected final List<ChangeRequest> changeRequests
Constructor Detail

Changes

public Changes(String processId,
               String contextId,
               String userName,
               String sourceName,
               DateTime timestamp,
               List<ChangeRequest> requests,
               Map<String,String> data)
Parameters:
processId - the process identifier; may be null
contextId - the context identifier; may be null
userName - the username; may not be null
sourceName - the source name; may not be null
timestamp - the timestamp; may not be null
requests - the requests; may not be null or empty
data - the immutable customized map of data to be associated with these changes; or null if there is no such data

Changes

protected Changes(Changes changes)
Method Detail

getUserName

public String getUserName()
Get the user that made these changes.

Returns:
the user; never null
See Also:
SecurityContext.getUserName()

getSourceName

public String getSourceName()
Get the name of the source that was changed.

Returns:
the source name; never null

getTimestamp

public DateTime getTimestamp()
Get the timestamp that the changes were made. All changes within the change set were all made at this instant in time.

Returns:
the timestamp of the changes; never null

getProcessId

public String getProcessId()
Get the identifier of the process where these changes originated. This identifier may be useful in preventing feedbacks.

Returns:
the process identifier; never null

getContextId

public String getContextId()
Get the identifier of the ExecutionContext where these changes originated. This identifier may be useful in preventing feedbacks.

Returns:
the context identifier; never null

getChangeRequests

public List<ChangeRequest> getChangeRequests()
Get the list of changes.

Returns:
the immutable list of change requests; never null and never empty

getData

public Map<String,String> getData()
Get the data associated with these changes.

Returns:
the immutable data; never null but possibly empty

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

compareTo

public int compareTo(Changes that)

Specified by:
compareTo in interface Comparable<Changes>
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.