Class Call

java.lang.Object
org.red5.server.service.Call
All Implemented Interfaces:
Externalizable, Serializable, IServiceCall
Direct Known Subclasses:
PendingCall

public class Call extends Object implements IServiceCall, Externalizable
Basic service call (remote call) implementation
Author:
The Red5 Project, Luke Hubbard, Codegent Ltd (luke@codegent.com)
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • STATUS_PENDING

      public static final byte STATUS_PENDING
      Pending status constant
      See Also:
    • STATUS_SUCCESS_RESULT

      public static final byte STATUS_SUCCESS_RESULT
      Success result constant
      See Also:
    • STATUS_SUCCESS_NULL

      public static final byte STATUS_SUCCESS_NULL
      Returned value is null constant
      See Also:
    • STATUS_SUCCESS_VOID

      public static final byte STATUS_SUCCESS_VOID
      Service returns no value constant
      See Also:
    • STATUS_SERVICE_NOT_FOUND

      public static final byte STATUS_SERVICE_NOT_FOUND
      Service not found constant
      See Also:
    • STATUS_METHOD_NOT_FOUND

      public static final byte STATUS_METHOD_NOT_FOUND
      Service's method not found constant
      See Also:
    • STATUS_ACCESS_DENIED

      public static final byte STATUS_ACCESS_DENIED
      Access denied constant
      See Also:
    • STATUS_INVOCATION_EXCEPTION

      public static final byte STATUS_INVOCATION_EXCEPTION
      Exception on invocation constant
      See Also:
    • STATUS_GENERAL_EXCEPTION

      public static final byte STATUS_GENERAL_EXCEPTION
      General exception constant
      See Also:
    • STATUS_APP_SHUTTING_DOWN

      public static final byte STATUS_APP_SHUTTING_DOWN
      The application for this service is currently shutting down
      See Also:
    • STATUS_NOT_CONNECTED

      public static final byte STATUS_NOT_CONNECTED
      The 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

      protected String serviceName
      Service name
    • serviceMethodName

      protected String serviceMethodName
      Service method name
    • arguments

      protected Object[] arguments
      Call arguments
    • status

      protected byte status
      Call status, initial one is pending
    • exception

      protected Exception exception
      Call exception if any, null by default
    • readTime

      private long readTime
      Timestamp at which the call was deserialized.
    • writeTime

      private long writeTime
      Timestamp at which the call was serialized.
  • Constructor Details

    • Call

      public Call()
    • Call

      public Call(String method)
      Creates call from method name
      Parameters:
      method - Method name
    • Call

      public Call(String method, Object[] args)
      Creates call from method name and array of call parameters
      Parameters:
      method - Method name
      args - Call parameters
    • Call

      public Call(String name, String method, Object[] args)
      Creates call from given service name, method name and array of call parameters
      Parameters:
      name - Service name
      method - Service method name
      args - Call parameters
  • Method Details

    • isSuccess

      public boolean isSuccess()
      Whether call was successful or not
      Specified by:
      isSuccess in interface IServiceCall
      Returns:
       true
       
      on success,
       false
       
      otherwise
    • getServiceMethodName

      public String getServiceMethodName()
      Returns service method name
      Specified by:
      getServiceMethodName in interface IServiceCall
      Returns:
      Service method name as string
    • setServiceMethodName

      public void setServiceMethodName(String serviceMethodName)
      Setter for service method name
      Parameters:
      serviceMethodName - New service method name value
    • getServiceName

      public String getServiceName()
      Returns service name
      Specified by:
      getServiceName in interface IServiceCall
      Returns:
      Service name
    • setServiceName

      public void setServiceName(String serviceName)
      Setter for service name
      Parameters:
      serviceName - New service name value
    • getArguments

      public Object[] getArguments()
      Returns array of service method arguments
      Specified by:
      getArguments in interface IServiceCall
      Returns:
      array of service method arguments
    • setArguments

      public void setArguments(Object[] args)
      Setter for arguments.
      Parameters:
      args - Arguments.
    • getStatus

      public byte getStatus()
      Get service call status
      Specified by:
      getStatus in interface IServiceCall
      Returns:
      service call status
    • setStatus

      public void setStatus(byte status)
      Sets status
      Specified by:
      setStatus in interface IServiceCall
      Parameters:
      status - Status as byte
    • getReadTime

      public long getReadTime()
      Returns the time stamp at which this object was deserialized.
      Specified by:
      getReadTime in interface IServiceCall
      Returns:
      the readTime
    • getWriteTime

      public long getWriteTime()
      Returns the time stamp at which this object was serialized.
      Specified by:
      getWriteTime in interface IServiceCall
      Returns:
      the writeTime
    • getException

      public Exception getException()
      Get service call exception
      Specified by:
      getException in interface IServiceCall
      Returns:
      service call exception
    • setException

      public void setException(Exception exception)
      Sets exception
      Specified by:
      setException in interface IServiceCall
      Parameters:
      exception - Call exception
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException