com.azure.cosmos.implementation.changefeed.common.ChangeFeedProcessorContextImpl Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.implementation.changefeed.common;
import com.azure.cosmos.ChangeFeedProcessorContext;
import com.azure.cosmos.implementation.changefeed.ChangeFeedObserverContext;
public final class ChangeFeedProcessorContextImpl implements ChangeFeedProcessorContext {
private final ChangeFeedObserverContext changeFeedObserverContext;
public ChangeFeedProcessorContextImpl(ChangeFeedObserverContext changeFeedObserverContext) {
this.changeFeedObserverContext = changeFeedObserverContext;
}
@Override
public String getLeaseToken() {
if (changeFeedObserverContext == null) {
throw new IllegalStateException("changeFeedObserverContext cannot be null!");
}
return changeFeedObserverContext.getLeaseToken();
}
}