/*
 *
 * Copyright 2016, TeamDev Ltd. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
package org.spine3.server.storage;

import com.google.common.collect.ImmutableCollection;
import com.google.protobuf.Any;
import com.google.protobuf.FieldMask;
import org.spine3.protobuf.TypeUrl;
import org.spine3.server.stand.AggregateStateId;
import org.spine3.server.stand.Stand;

/**
 * Contract for {@link Stand} storage.
 *
 * // TODO[alex.tymchenko]: describe
 *
 * @author Alex Tymchenko
 * @see Any#getTypeUrl()
 * @see Stand
 */
public abstract class StandStorage extends RecordStorage<AggregateStateId> {

    protected StandStorage(boolean multitenant) {
        super(multitenant);
    }


    /**
     * Reads all the state records by the given type.
     *
     * @param type a {@link TypeUrl} instance
     * @return the state records which {@link Any#getTypeUrl()} equals the argument value
     */
    public abstract ImmutableCollection<EntityStorageRecord> readAllByType(TypeUrl type);

    /**
     * Reads all the state records by the given type.
     *
     * @param type a {@link TypeUrl} instance
     * @return the state records which {@link Any#getTypeUrl()} equals the argument value
     */
    public abstract ImmutableCollection<EntityStorageRecord> readAllByType(TypeUrl type, FieldMask fieldMask);
}

@@ -1310,83 +1310,201 @@
 %0A * 
-Contract for %7B@link Stand%7D storage.%0A *%0A * // TODO%5Balex.tymchenko%5D: describe
+Serves as a storage for the latest %7B@link org.spine3.server.aggregate.Aggregate%7D states.%0A *%0A * %3Cp%3EUsed by an instance of %7B@link Stand%7D to optimize the %7B@code Aggregate%7D state fetch performance.
 %0A *%0A

Add a short description for the StandStorage.