package com.capgemini.reports.teamcenter.queries.saved;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.framework.teamcenter.queries.saved.AbstractReplicatedQuery;
import com.teamcenter.soa.client.model.strong.ItemRevision;

/**
 * This class performs requests to obtain all sequences and revisions of an object, given its ID.
 */
public class AllSequencesOfItemQuery extends AbstractReplicatedQuery<ItemRevision, AllSequencesOfItemQuery> {

    /**
     * Query name of Teamcenter for request in WKF objects.
     */
    private static final String QUERY_SUFFIX = "All_Sequences";

    /**
     * Usual constructor with a {@link TcSession} using a proper policy.
     *
     * @param session an active session
     */
    public AllSequencesOfItemQuery(final TcSession session) {
        super(session, QUERY_SUFFIX);
    }

    /**
     * Obtains all sequences fo all revisions of an Item.
     *
     * @param itemId the item whose sequences we are looking for
     * @return the query
     */

    @Override
    public AllSequencesOfItemQuery searchID(final String itemId) {
        return this.addParam(PARAM_ITEM_ID, itemId);
    }

    @Override
    protected AllSequencesOfItemQuery selfCast() {
        return this;
    }

}
