All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.refinitiv.ema.access.ProviderSessionInfo Maven / Gradle / Ivy

The newest version!
package com.refinitiv.ema.access;

import com.refinitiv.eta.valueadd.reactor.ReactorChannel;

/**
 * Provides session information for {@link OmmProvider} when EMA throws {@link OmmJsonConverterException}.
 */
public class ProviderSessionInfo extends SessionInfo {

    private OmmProvider provider;
    private long clientHandle;
    private long handle;

    void loadProviderSession(OmmProvider provider, ReactorChannel reactorChannel) {
        super.loadSessionInfo(reactorChannel);
        final ClientSession clientSession = (ClientSession) reactorChannel.userSpecObj();
        if (clientSession != null) {
            handle = clientSession.getLoginHandle();
            clientHandle = clientSession.clientHandle().value();
        }
        this.provider = provider;
    }

    /**
     * Return {@link OmmProvider} instance for this event.
     * @return reference to {@link OmmProvider}
     */
    public OmmProvider getProvider() {
        return provider;
    }

    /**
     * Returns a unique client identifier (a.k.a., client handle) associated by EMA with a connected client.
     * @return client identifier or handle.
     */
    public long getClientHandle() {
        return clientHandle;
    }

    /**
     * Returns a unique login identifier for the client session of a connected client.
     * @return login identifier or login handle.
     */
    public long getHandle() {
        return handle;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy