Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (c) 2010-2011. Axon Framework
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.axonframework.domain;

Interface defining a contract for entities that represent the aggregate root.

Allard Buijze
See also:
public interface AggregateRoot {

Returns the identifier of this aggregate.

the identifier of this aggregate
Clears the events currently marked as "uncommitted".
    void commitEvents();

Returns the number of uncommitted events currently available in the aggregate.

the number of uncommitted events currently available in the aggregate.
    int getUncommittedEventCount();

Returns a DomainEventStream to the events in the aggregate that have been raised since creation or the last commit.

the DomainEventStream to the uncommitted events.
Returns the current version number of the aggregate, or null if the aggregate is newly created. This version must reflect the version number of the aggregate on which changes are applied.

Each time the aggregate is modified and stored in a repository, the version number must be increased by at least 1. This version number can be used by optimistic locking strategies and detection of conflicting concurrent modification.

Typically the sequence number of the last committed event on this aggregate is used as version number.

the current version number of this aggregate, or null if no events were ever committed
    Long getVersion();

Indicates whether this aggregate has been marked as deleted. When true, it is an instruction to the repository to remove this instance at an appropriate time.

Repositories should not return any instances of Aggregates that return true on isDeleted().

true if this aggregate was marked as deleted, otherwise false.
    boolean isDeleted();
New to GrepCode? Check out our FAQ X