Class CommonRequest
java.lang.Object
pt.unl.fct.di.novasys.babel.generic.ProtoIPC
pt.unl.fct.di.novasys.babel.generic.ProtoRequest
pt.unl.fct.di.novasys.babel.protocols.storage.requests.common.CommonRequest
- Direct Known Subclasses:
CreateCollectionRequest,CreateKeySpaceRequest,DeleteCollectionRequest,DeleteKeySpaceRequest,ExecuteRequest,ModifyCollectionRequest,ModifyKeySpaceRequest
public abstract class CommonRequest
extends pt.unl.fct.di.novasys.babel.generic.ProtoRequest
A request common to all requests issued on the storage layer. The request
stores the keySpace where the request is being issued, as well as an optional
operationID.
The operationID can be used by the upper layer to associate a reply with the
request that issued it.
-
Nested Class Summary
Nested classes/interfaces inherited from class pt.unl.fct.di.novasys.babel.generic.ProtoIPC
pt.unl.fct.di.novasys.babel.generic.ProtoIPC.Type -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommonRequest(String keySpace, short requestID) Construct a common request with the keySpace and protocol identifier.CommonRequest(String keySpace, String opID, short requestID) Construct a common request with the keySpace and protocol identifier, as well as the unique requestID. -
Method Summary
Methods inherited from class pt.unl.fct.di.novasys.babel.generic.ProtoRequest
getIdMethods inherited from class pt.unl.fct.di.novasys.babel.generic.ProtoIPC
getType
-
Field Details
-
EMPTY_MSG
- See Also:
-
-
Constructor Details
-
CommonRequest
Construct a common request with the keySpace and protocol identifier.- Parameters:
keySpace- the keySpace identifierrequestID- the protocol identifier
-
CommonRequest
Construct a common request with the keySpace and protocol identifier, as well as the unique requestID. This requestID can later on be passed by the reply to allow the upper layers to connect a request it is reply.- Parameters:
keySpace- the keySpace identifieropID- the operation identifier associated with the requestrequestID- the request identifier
-
-
Method Details
-
getKeySpace
Gets the keySpace where the operation is being issued.- Returns:
- the keySpace
-
getOpID
Gets the operation identifier associated with the request. If none was passed in the construct, an empty string is returned.- Returns:
- the operation identifier or an empty string, if none was passed in the constructor.
-
hasOpID
public boolean hasOpID()Checks if the request has an operation identifier.- Returns:
- true if the request has an identifier, of false otherwise.
-