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 (luke@codegent.com)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Object[]
Call argumentsprotected Exception
Call exception if any, null by defaultprivate long
Timestamp at which the call was deserialized.private static final long
protected String
Service method nameprotected String
Service nameprotected byte
Call status, initial one is pendingstatic final byte
Access denied constantstatic final byte
The application for this service is currently shutting downstatic final byte
General exception constantstatic final byte
Exception on invocation constantstatic final byte
Service's method not found constantstatic final byte
The remote method cannot be invoked because the client is not connected.static final byte
Pending status constantstatic final byte
Service not found constantstatic final byte
Returned value is null constantstatic final byte
Success result constantstatic final byte
Service returns no value constantprivate long
Timestamp at which the call was serialized. -
Constructor Summary
ConstructorDescriptionCall()
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 exceptionlong
Returns the time stamp at which this object was deserialized.Returns service method nameReturns service namebyte
Get service call statuslong
Returns the time stamp at which this object was serialized.boolean
Whether call was successful or notvoid
void
setArguments
(Object[] args) Setter for arguments.void
setException
(Exception exception) Sets exceptionvoid
setServiceMethodName
(String serviceMethodName) Setter for service method namevoid
setServiceName
(String serviceName) Setter for service namevoid
setStatus
(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:
isSuccess
in interfaceIServiceCall
- Returns:
true
on success,false
otherwise
-
getServiceMethodName
Returns service method name- Specified by:
getServiceMethodName
in 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:
getServiceName
in interfaceIServiceCall
- Returns:
- Service name
-
setServiceName
Setter for service name- Parameters:
serviceName
- New service name value
-
getArguments
Returns array of service method arguments- Specified by:
getArguments
in interfaceIServiceCall
- Returns:
- array of service method arguments
-
setArguments
Setter for arguments.- Parameters:
args
- Arguments.
-
getStatus
public byte getStatus()Get service call status- Specified by:
getStatus
in interfaceIServiceCall
- Returns:
- service call status
-
setStatus
public void setStatus(byte status) Sets status- Specified by:
setStatus
in interfaceIServiceCall
- Parameters:
status
- Status as byte
-
getReadTime
public long getReadTime()Returns the time stamp at which this object was deserialized.- Specified by:
getReadTime
in interfaceIServiceCall
- Returns:
- the readTime
-
getWriteTime
public long getWriteTime()Returns the time stamp at which this object was serialized.- Specified by:
getWriteTime
in interfaceIServiceCall
- Returns:
- the writeTime
-
getException
Get service call exception- Specified by:
getException
in interfaceIServiceCall
- Returns:
- service call exception
-
setException
Sets exception- Specified by:
setException
in interfaceIServiceCall
- Parameters:
exception
- Call exception
-
toString
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-