Package org.red5.server.service
Class Call
java.lang.Object
org.red5.server.service.Call
- All Implemented Interfaces:
Externalizable,Serializable,IServiceCall
- Direct Known Subclasses:
PendingCall
Basic service call (remote call) implementation
- Author:
- The Red5 Project, Luke Hubbard, Codegent Ltd ([email protected])
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Object[]Call argumentsprotected ExceptionCall exception if any, null by defaultprivate longTimestamp at which the call was deserialized.private static final longprotected StringService method nameprotected StringService nameprotected byteCall status, initial one is pendingstatic final byteAccess denied constantstatic final byteThe application for this service is currently shutting downstatic final byteGeneral exception constantstatic final byteException on invocation constantstatic final byteService's method not found constantstatic final byteThe remote method cannot be invoked because the client is not connected.static final bytePending status constantstatic final byteService not found constantstatic final byteReturned value is null constantstatic final byteSuccess result constantstatic final byteService returns no value constantprivate longTimestamp at which the call was serialized. -
Constructor Summary
ConstructorsConstructorDescriptionCall()Creates call from method nameCreates call from method name and array of call parametersCreates call from given service name, method name and array of call parameters -
Method Summary
Modifier and TypeMethodDescriptionObject[]Returns array of service method argumentsGet service call exceptionlongReturns the time stamp at which this object was deserialized.Returns service method nameReturns service namebyteGet service call statuslongReturns the time stamp at which this object was serialized.booleanWhether call was successful or notvoidvoidsetArguments(Object[] args) Setter for arguments.voidsetException(Exception exception) Sets exceptionvoidsetServiceMethodName(String serviceMethodName) Setter for service method namevoidsetServiceName(String serviceName) Setter for service namevoidsetStatus(byte status) Sets statustoString()void
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
STATUS_PENDING
public static final byte STATUS_PENDINGPending status constant- See Also:
-
STATUS_SUCCESS_RESULT
public static final byte STATUS_SUCCESS_RESULTSuccess result constant- See Also:
-
STATUS_SUCCESS_NULL
public static final byte STATUS_SUCCESS_NULLReturned value is null constant- See Also:
-
STATUS_SUCCESS_VOID
public static final byte STATUS_SUCCESS_VOIDService returns no value constant- See Also:
-
STATUS_SERVICE_NOT_FOUND
public static final byte STATUS_SERVICE_NOT_FOUNDService not found constant- See Also:
-
STATUS_METHOD_NOT_FOUND
public static final byte STATUS_METHOD_NOT_FOUNDService's method not found constant- See Also:
-
STATUS_ACCESS_DENIED
public static final byte STATUS_ACCESS_DENIEDAccess denied constant- See Also:
-
STATUS_INVOCATION_EXCEPTION
public static final byte STATUS_INVOCATION_EXCEPTIONException on invocation constant- See Also:
-
STATUS_GENERAL_EXCEPTION
public static final byte STATUS_GENERAL_EXCEPTIONGeneral exception constant- See Also:
-
STATUS_APP_SHUTTING_DOWN
public static final byte STATUS_APP_SHUTTING_DOWNThe application for this service is currently shutting down- See Also:
-
STATUS_NOT_CONNECTED
public static final byte STATUS_NOT_CONNECTEDThe remote method cannot be invoked because the client is not connected. NOTE that it is possible that this error is returned in the situation where the method has been invoked on the server the connection has failed before the result returned could be read. There is no way to establish whether this has happened.- See Also:
-
serviceName
Service name -
serviceMethodName
Service method name -
arguments
Call arguments -
status
protected byte statusCall status, initial one is pending -
exception
Call exception if any, null by default -
readTime
private long readTimeTimestamp at which the call was deserialized. -
writeTime
private long writeTimeTimestamp at which the call was serialized.
-
-
Constructor Details
-
Call
public Call() -
Call
Creates call from method name- Parameters:
method- Method name
-
Call
Creates call from method name and array of call parameters- Parameters:
method- Method nameargs- Call parameters
-
Call
Creates call from given service name, method name and array of call parameters- Parameters:
name- Service namemethod- Service method nameargs- Call parameters
-
-
Method Details
-
isSuccess
public boolean isSuccess()Whether call was successful or not- Specified by:
isSuccessin interfaceIServiceCall- Returns:
true
on success,false
otherwise
-
getServiceMethodName
Returns service method name- Specified by:
getServiceMethodNamein interfaceIServiceCall- Returns:
- Service method name as string
-
setServiceMethodName
Setter for service method name- Parameters:
serviceMethodName- New service method name value
-
getServiceName
Returns service name- Specified by:
getServiceNamein interfaceIServiceCall- Returns:
- Service name
-
setServiceName
Setter for service name- Parameters:
serviceName- New service name value
-
getArguments
Returns array of service method arguments- Specified by:
getArgumentsin interfaceIServiceCall- Returns:
- array of service method arguments
-
setArguments
Setter for arguments.- Parameters:
args- Arguments.
-
getStatus
public byte getStatus()Get service call status- Specified by:
getStatusin interfaceIServiceCall- Returns:
- service call status
-
setStatus
public void setStatus(byte status) Sets status- Specified by:
setStatusin interfaceIServiceCall- Parameters:
status- Status as byte
-
getReadTime
public long getReadTime()Returns the time stamp at which this object was deserialized.- Specified by:
getReadTimein interfaceIServiceCall- Returns:
- the readTime
-
getWriteTime
public long getWriteTime()Returns the time stamp at which this object was serialized.- Specified by:
getWriteTimein interfaceIServiceCall- Returns:
- the writeTime
-
getException
Get service call exception- Specified by:
getExceptionin interfaceIServiceCall- Returns:
- service call exception
-
setException
Sets exception- Specified by:
setExceptionin interfaceIServiceCall- Parameters:
exception- Call exception
-
toString
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-