package ru.yandex.qe.bus.features.version;

import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;

/**
 * User: terry
 * Date: 05.10.13
 * Time: 22:34
 */
public class InVersionInterceptor extends AbstractPhaseInterceptor<Message> {

    private final VersionFeature versionFeature;

    public InVersionInterceptor(VersionFeature versionFeature) {
        super(Phase.RECEIVE);
        this.versionFeature = versionFeature;
    }

    @Override
    public void handleMessage(Message message) throws Fault {
        if (isRequestor(message)) {
            //logic for check version compatibility on client
        } else {
            //logic for check version compatibility on server
        }
    }
}
