Search in sources :

Example 1 with SessionResponse

use of com.hazelcast.cp.internal.session.SessionResponse in project hazelcast by hazelcast.

the class ClientProxySessionManager method requestNewSession.

@Override
protected SessionResponse requestNewSession(RaftGroupId groupId) {
    ClientMessage request = CPSessionCreateSessionCodec.encodeRequest(groupId, client.getName());
    ClientMessage response = new ClientInvocation(client, request, "sessionManager").invoke().joinInternal();
    CPSessionCreateSessionCodec.ResponseParameters params = CPSessionCreateSessionCodec.decodeResponse(response);
    return new SessionResponse(params.sessionId, params.ttlMillis, params.heartbeatMillis);
}
Also used : ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) SessionResponse(com.hazelcast.cp.internal.session.SessionResponse) CPSessionCreateSessionCodec(com.hazelcast.client.impl.protocol.codec.CPSessionCreateSessionCodec)

Aggregations

ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)1 CPSessionCreateSessionCodec (com.hazelcast.client.impl.protocol.codec.CPSessionCreateSessionCodec)1 ClientInvocation (com.hazelcast.client.impl.spi.impl.ClientInvocation)1 SessionResponse (com.hazelcast.cp.internal.session.SessionResponse)1