com.kuka.roboticsAPI.controllerModel.sunrise.api
Class SSR

java.lang.Object
  extended by com.kuka.roboticsAPI.controllerModel.sunrise.api.SSR
All Implemented Interfaces:
com.kuka.common.IDataEquatable, ISegment, Iterable<ISerializableType>

public class SSR
extends Object
implements ISegment, Iterable<ISerializableType>

This class represents a "Sunrise Service Request (SSR)" which fetches arbitrary data from Sunrise.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

Constructor Summary
SSR()
           
 
Method Summary
 void addParam(byte[] value)
          Add a byte array parameter to the message.
 void addParam(double value)
          Add a double parameter to the message.
 void addParam(double[] value)
          Add a double array parameter to the message.
 void addParam(int value)
          Add an integer parameter to the message.
 void addParam(int[] value)
          Add a int array parameter to the message.
 void addParam(ISerializableType value)
          Add a generic parameter to the message.
 void addParam(String value)
          Add a string parameter to the message.
 Message await()
          Blocks the calling thread until the SSR is completed.
 Message await(int timeout, TimeUnit timeUnit)
          Blocks the calling thread until the SSR is completed or the timeout is reached.
 int getChecksum()
          Returns the checksum for the segment.
 String getComponentType()
          Gets the type of this component.
 String getComponentVersion()
          Gets the version of this component.
 String getErrorDevText()
          Gets the unlocalized development text of the error message.
 String getErrorKxrId()
          Gets the kxr ID for the error message.
 String getErrorKxrModule()
          Gets the kxr module name for the error message.
 SSRExecutionFailureReason getErrorReason()
          Gets the reason of the error which happened during SSR execution.
 long getId()
          Gets the unique id of this SSR.
 Message getResponseMessage()
          Gets the response message of this SSR.
 boolean hasCompletedWithError()
          Indicates whether the execution of the SSR exited with an exception.
 boolean hasSameDataAs(Object obj)
          
 boolean isCompleted()
          Checks whether this SSR has completed its request.
 boolean isExpired()
          Determines if this SSR was sent more that default SSR timeout (usually 5 seconds) ago.
 Iterator<ISerializableType> iterator()
          
 void setCompleted(Message responseMessage)
          Marks this SSR as completed.
 void setComponentVersion(int majorVersion, int minorVersion)
          Sets the version of the SSR.
 void setId(long id)
          Sets the id for this SSR.
 void setRequestType(String type)
          Sets the component type of this SSR.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SSR

public SSR()
Method Detail

setId

public void setId(long id)
Sets the id for this SSR.

Parameters:
id - The id.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getId

public long getId()
Gets the unique id of this SSR.

Returns:
The unique id of this SSR.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

setRequestType

public void setRequestType(String type)
Sets the component type of this SSR.

Parameters:
type - The type of the SSR.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getComponentType

public String getComponentType()
Gets the type of this component.

Specified by:
getComponentType in interface ISegment
Returns:
The type of this component.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getChecksum

public int getChecksum()
Returns the checksum for the segment.

Specified by:
getChecksum in interface ISegment
Returns:
The checksum for the segment.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getComponentVersion

public String getComponentVersion()
Gets the version of this component.

Specified by:
getComponentVersion in interface ISegment
Returns:
The version of this component.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

setComponentVersion

public void setComponentVersion(int majorVersion,
                                int minorVersion)
Sets the version of the SSR.

Parameters:
majorVersion - the major version to set
minorVersion - the minor version to set

await

public Message await()
Blocks the calling thread until the SSR is completed. This method should only be called once, because we only get one response.

Returns:
The response message for this SSR.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

await

public Message await(int timeout,
                     TimeUnit timeUnit)
Blocks the calling thread until the SSR is completed or the timeout is reached. This method should only be called once, because we only get one response.

Parameters:
timeout - the timeout for waiting for a SSR response (in seconds)
timeUnit - the unit for the timeout.
Returns:
The response message for this SSR.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getResponseMessage

public Message getResponseMessage()
Gets the response message of this SSR.

Returns:
The response message of this SSR.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

isCompleted

public boolean isCompleted()
Checks whether this SSR has completed its request.

Returns:
True if the SSR in completed, false otherwise.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

setCompleted

public void setCompleted(Message responseMessage)
Marks this SSR as completed. The waiting thread will continue to run.

Parameters:
responseMessage - The message containing the response.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

iterator

public Iterator<ISerializableType> iterator()

Specified by:
iterator in interface Iterable<ISerializableType>
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addParam

public void addParam(double value)
Add a double parameter to the message.

Parameters:
value - The value of the parameter.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addParam

public void addParam(int value)
Add an integer parameter to the message.

Parameters:
value - The value of the parameter.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addParam

public void addParam(double[] value)
Add a double array parameter to the message.

Parameters:
value - The value of the parameter.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addParam

public void addParam(int[] value)
Add a int array parameter to the message.

Parameters:
value - The value of the parameter.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addParam

public void addParam(byte[] value)
Add a byte array parameter to the message.

Parameters:
value - The value of the parameter.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addParam

public void addParam(String value)
Add a string parameter to the message.

Parameters:
value - The value of the parameter.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addParam

public void addParam(ISerializableType value)
Add a generic parameter to the message.

Parameters:
value - The value of the parameter.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

toString

public String toString()

Overrides:
toString in class Object
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

hasSameDataAs

public boolean hasSameDataAs(Object obj)

Specified by:
hasSameDataAs in interface com.kuka.common.IDataEquatable
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getErrorReason

public SSRExecutionFailureReason getErrorReason()
Gets the reason of the error which happened during SSR execution.

Returns:
the reason why the execution of the SSR has failed
null, if the SSR execution has finished without errors or if the execution hasn't completed yet
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getErrorKxrModule

public String getErrorKxrModule()
Gets the kxr module name for the error message.

If the execution of the SSR fails, the kxr module name specifies the kxr file which has to be used to localize the error message.

Returns:
the kxr module name to be used for localization
null, if the SSR execution has finished without errors or if the execution hasn't completed yet
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getErrorKxrId

public String getErrorKxrId()
Gets the kxr ID for the error message.

If the execution of the SSR fails, the kxr ID specifies the key from the kxr module which has to be used to localize the error message.

Returns:
the kxr ID to be used for localization
null, if the SSR execution has finished without errors or if the execution hasn't completed yet
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getErrorDevText

public String getErrorDevText()
Gets the unlocalized development text of the error message.

If the execution if the SSR fails, the internal development text can be used to specify the error reason without any localization.

Returns:
the unlocalized development text of the underlying error reason
null, if the SSR execution has finished without errors or if the execution hasn't completed yet
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

hasCompletedWithError

public boolean hasCompletedWithError()
Indicates whether the execution of the SSR exited with an exception.

Returns:
true, if the SSR execution was erroneous
false, if the SSR was executed successfully or hasn't completed yet
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

isExpired

public boolean isExpired()
Determines if this SSR was sent more that default SSR timeout (usually 5 seconds) ago.

if true is returned by the method there is no guarantee that the SSR is already evicted from request service.

Returns:
true if request was sent and is expired and can be evicted from request service. Independently whether SSR got a response or not. If somebody is currently actively waiting for a response, (using await() method, or SSR was sent synchronously, method will return false


Copyright © 2019. All rights reserved.