org.jboss.dna.graph.observe
Class Changes

java.lang.Object
  extended by org.jboss.dna.graph.observe.Changes
All Implemented Interfaces:
Serializable, Comparable<Changes>, Iterable<ChangeRequest>

@Immutable
public final class Changes
extends Object
implements Iterable<ChangeRequest>, 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

Constructor Summary
Changes(String userName, String sourceName, DateTime timestamp, List<ChangeRequest> requests)
           
Changes(String processId, String userName, String sourceName, DateTime timestamp, List<ChangeRequest> requests)
           
 
Method Summary
 int compareTo(Changes that)
          
 boolean equals(Object obj)
          
 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()
          
 Iterator<ChangeRequest> iterator()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Changes

public Changes(String userName,
               String sourceName,
               DateTime timestamp,
               List<ChangeRequest> requests)

Changes

public Changes(String processId,
               String userName,
               String sourceName,
               DateTime timestamp,
               List<ChangeRequest> requests)
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

iterator

public Iterator<ChangeRequest> iterator()

Specified by:
iterator in interface Iterable<ChangeRequest>
See Also:
Iterable.iterator()

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)


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