use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class ClientProxySessionManager method closeSession.
@Override
protected InternalCompletableFuture<Object> closeSession(RaftGroupId groupId, Long sessionId) {
ClientMessage request = CPSessionCloseSessionCodec.encodeRequest(groupId, sessionId);
ClientInvocationFuture future = new ClientInvocation(client, request, "sessionManager").invoke();
return new ClientDelegatingFuture<>(future, client.getSerializationService(), CPSessionCloseSessionCodec::decodeResponse);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class SessionlessSemaphoreProxy method init.
@Override
public boolean init(int permits) {
checkNotNegative(permits, "Permits must be non-negative!");
ClientMessage request = SemaphoreInitCodec.encodeRequest(groupId, objectName, permits);
HazelcastClientInstanceImpl client = getClient();
ClientMessage response = new ClientInvocation(client, request, objectName).invoke().joinInternal();
return SemaphoreInitCodec.decodeResponse(response);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class SessionlessSemaphoreProxy method availablePermits.
@Override
public int availablePermits() {
ClientMessage request = SemaphoreAvailablePermitsCodec.encodeRequest(groupId, objectName);
HazelcastClientInstanceImpl client = getClient();
ClientMessage response = new ClientInvocation(client, request, objectName).invoke().joinInternal();
return SemaphoreAvailablePermitsCodec.decodeResponse(response);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class SessionlessSemaphoreProxy method onDestroy.
@Override
public void onDestroy() {
ClientMessage request = CPGroupDestroyCPObjectCodec.encodeRequest(groupId, getServiceName(), objectName);
new ClientInvocation(getClient(), request, name).invoke().joinInternal();
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class SessionlessSemaphoreProxy method drainPermits.
@Override
public int drainPermits() {
long clusterWideThreadId = sessionManager.getOrCreateUniqueThreadId(groupId);
UUID invocationUid = newUnsecureUUID();
ClientMessage request = SemaphoreDrainCodec.encodeRequest(groupId, objectName, NO_SESSION_ID, clusterWideThreadId, invocationUid);
HazelcastClientInstanceImpl client = getClient();
ClientMessage response = new ClientInvocation(client, request, objectName).invoke().joinInternal();
return SemaphoreDrainCodec.decodeResponse(response);
}
Aggregations