com.hazelcast.client.impl.client
Class ClientRequest

java.lang.Object
  extended by com.hazelcast.client.impl.client.ClientRequest
All Implemented Interfaces:
SecureRequest, Portable, VersionedPortable
Direct Known Subclasses:
AllPartitionsClientRequest, CacheCreateConfigRequest, CacheDestroyRequest, CallableClientRequest, GetDistributedObjectsRequest, InvocationClientRequest, MultiPartitionClientRequest, MultiTargetClientRequest, PartitionClientRequest, TargetClientRequest

public abstract class ClientRequest
extends Object
implements SecureRequest, VersionedPortable


Field Summary
protected  int callId
           
protected  ClientEngineImpl clientEngine
           
protected  ClientEndpoint endpoint
           
protected  OperationService operationService
           
protected  SerializationService serializationService
           
protected  Object service
           
 
Constructor Summary
ClientRequest()
           
 
Method Summary
 int getCallId()
           
 int getClassVersion()
          Version for internal requests.
 ClientEngine getClientEngine()
           
 String getDistributedObjectName()
          Used for SecurityInterceptor
 String getDistributedObjectType()
          Used for SecurityInterceptor
 ClientEndpoint getEndpoint()
           
 String getMethodName()
          Used for SecurityInterceptor Method name which called via a distributedObject for map.put, methodName will be 'put' For requests which do not produced via a distributedObject should return null, for example internal client.
 Object[] getParameters()
          Used for SecurityInterceptor Parameters passed to the method by a distributedObject for map.put(key, value) parameters should be 'key' and 'value' parameters can be in binary or object form, underlying implementation will de-serialize lazily
<S> S
getService()
           
abstract  String getServiceName()
           
 boolean isSingleConnection()
           
abstract  void process()
           
 void read(PortableReader reader)
           
 void readPortable(PortableReader reader)
          Read portable fields using PortableReader
 void setCallId(int callId)
           
 void setClientEngine(ClientEngineImpl clientEngine)
           
 void setEndpoint(ClientEndpoint endpoint)
           
 void setOperationService(OperationService operationService)
           
 void setSerializationService(SerializationService serializationService)
           
 void setService(Object service)
           
 void setSingleConnection()
          mark this request as SingleConnection
 void write(PortableWriter writer)
           
 void writePortable(PortableWriter writer)
          Serialize this portable object using PortableWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hazelcast.client.impl.client.SecureRequest
getRequiredPermission
 
Methods inherited from interface com.hazelcast.nio.serialization.Portable
getClassId, getFactoryId
 

Field Detail

callId

protected volatile int callId

clientEngine

protected transient ClientEngineImpl clientEngine

operationService

protected transient OperationService operationService

serializationService

protected transient SerializationService serializationService

service

protected transient Object service

endpoint

protected transient ClientEndpoint endpoint
Constructor Detail

ClientRequest

public ClientRequest()
Method Detail

setSingleConnection

public void setSingleConnection()
mark this request as SingleConnection


isSingleConnection

public boolean isSingleConnection()
Returns:
true if this request is SingleConnection false otherwise

setOperationService

public void setOperationService(OperationService operationService)

setSerializationService

public void setSerializationService(SerializationService serializationService)

process

public abstract void process()
                      throws Exception
Throws:
Exception

getClientEngine

public ClientEngine getClientEngine()

setClientEngine

public final void setClientEngine(ClientEngineImpl clientEngine)

getService

public <S> S getService()

setService

public final void setService(Object service)

getEndpoint

public ClientEndpoint getEndpoint()

setEndpoint

public final void setEndpoint(ClientEndpoint endpoint)

getServiceName

public abstract String getServiceName()

getCallId

public int getCallId()

setCallId

public void setCallId(int callId)

writePortable

public final void writePortable(PortableWriter writer)
                         throws IOException
Description copied from interface: Portable
Serialize this portable object using PortableWriter

Specified by:
writePortable in interface Portable
Parameters:
writer - PortableWriter
Throws:
IOException

write

public void write(PortableWriter writer)
           throws IOException
Throws:
IOException

readPortable

public final void readPortable(PortableReader reader)
                        throws IOException
Description copied from interface: Portable
Read portable fields using PortableReader

Specified by:
readPortable in interface Portable
Parameters:
reader - PortableReader
Throws:
IOException

read

public void read(PortableReader reader)
          throws IOException
Throws:
IOException

getClassVersion

public int getClassVersion()
Version for internal requests. This version can be configured per class by overriding this method.

This should be updated/incremented when serialization of a request changes.

Specified by:
getClassVersion in interface VersionedPortable
Returns:
class version

getDistributedObjectType

public String getDistributedObjectType()
Description copied from interface: SecureRequest
Used for SecurityInterceptor

Specified by:
getDistributedObjectType in interface SecureRequest
Returns:

getDistributedObjectName

public String getDistributedObjectName()
Description copied from interface: SecureRequest
Used for SecurityInterceptor

Specified by:
getDistributedObjectName in interface SecureRequest
Returns:

getMethodName

public String getMethodName()
Description copied from interface: SecureRequest
Used for SecurityInterceptor Method name which called via a distributedObject for map.put, methodName will be 'put' For requests which do not produced via a distributedObject should return null, for example internal client.

Specified by:
getMethodName in interface SecureRequest
Returns:

getParameters

public Object[] getParameters()
Description copied from interface: SecureRequest
Used for SecurityInterceptor Parameters passed to the method by a distributedObject for map.put(key, value) parameters should be 'key' and 'value' parameters can be in binary or object form, underlying implementation will de-serialize lazily

Specified by:
getParameters in interface SecureRequest
Returns:


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.