|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.roboticsAPI.controllerModel.sunrise.SunriseConnection
public class SunriseConnection
Holds a connection to a Sunrise controller.
| Field Summary | |
|---|---|
static String |
CURRENT_SUNRISE_VERSION
Holds the current expected Sunrise version. |
| Constructor Summary | |
|---|---|
protected |
SunriseConnection(NameserverProxy nameserver,
int keepAliveSendTimeout,
int keepAliveReceiveTimeout)
Creates a new connection to Sunrise. |
| Method Summary | |
|---|---|
protected void |
cancelSPR(SPRRuntime spr)
Cancels the specified SPR. |
void |
connectionLost()
Called to indicate that the connection was lost. |
protected long |
createNewId(long type,
long counter)
Creates a new message id as mix of API id, type and counter. |
protected long |
createNewSPRId()
Creates a new SPR id. |
protected long |
createNewSPRStackId()
Creates a new SPR stack id. |
long |
createNewSSRId()
Creates a new SSR id. |
void |
dispose()
Disposes the connection to the remote system. |
static void |
disposeAllSunriseConnections()
Disposes all available sunrise connections. |
long |
getInstanceId()
Gets the instance id which was assigned from the remote system. |
protected String |
getLocalSystemVersion()
Gets the version of the local system. |
protected NameserverProxy |
getNameserver()
|
protected String |
getRegisterChannelName()
Gets the channel name that is used for the registration process. |
String |
getRemoteSystemVersion()
Gets the version of the system to which this connection is connected. |
static SunriseConnection |
getSunriseConnectionAndRegisterAsHandler(NameserverProxy nameserver,
IMessageHandler handler,
int keepAliveSendInterval,
int keepAliveReceiveTimeout)
Gets the sunrise connection for the specified nameserver. |
static int |
getSunriseConnectionCount()
|
void |
handleMessage(Message message)
Handles the given message. |
boolean |
isConnected()
Checks if the connection is active, which means that the receiver is still active. |
static boolean |
isSPR(Message message)
Determines if the given message contains a SPR. |
static boolean |
isSSR(Message message)
Determines if the given message contains a SSR. |
void |
removeHandler(IMessageHandler handler)
Removes the specified message handler. |
protected void |
send(Message message)
Sends a message over the outchannel. |
protected void |
sendSPR(SPR spr)
Sends a SPR to Sunrise. |
protected void |
sendSSR(SSR ssr)
Sends a SSR to Sunrise. |
String |
toString()
|
protected void |
updateSPR(SPR spr)
Updates the given SPR. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String CURRENT_SUNRISE_VERSION
| Constructor Detail |
|---|
protected SunriseConnection(NameserverProxy nameserver,
int keepAliveSendTimeout,
int keepAliveReceiveTimeout)
nameserver - The nameserver used for the connection.keepAliveSendTimeout - timeout for Sunrise in which it must have received our KeepAlive signal, in milliseconds (0:disabled)keepAliveReceiveTimeout - timeout for receiving keep-alive messages in milliseconds (0:disabled)| Method Detail |
|---|
public static SunriseConnection getSunriseConnectionAndRegisterAsHandler(NameserverProxy nameserver,
IMessageHandler handler,
int keepAliveSendInterval,
int keepAliveReceiveTimeout)
If connection does not exists - creates it, otherwise - returns an existing connection. Registers the specified message handler for the returned connection.
nameserver - nameserver used to create the requested connection.handler - message handler that should be registered for the returned connectionkeepAliveSendInterval - interval for sending keep-alive messages in milliseconds (0:disabled, default 1000ms)keepAliveReceiveTimeout - timeout for receiving keep-alive messages in milliseconds (0:disabled - default)
public static void disposeAllSunriseConnections()
public void removeHandler(IMessageHandler handler)
handler - the message handler to remove.public boolean isConnected()
public long getInstanceId()
public String getRemoteSystemVersion()
public void dispose()
Will not throw an exception.
public String toString()
toString in class Objectprotected String getLocalSystemVersion()
This version is sent down during the registration process and if the version does not fix the remote system version, the registration will fails.
protected String getRegisterChannelName()
protected void send(Message message)
message - The message.
protected long createNewId(long type,
long counter)
type - The type if the message.counter - The counter.
protected long createNewSPRId()
protected long createNewSPRStackId()
public long createNewSSRId()
protected void sendSSR(SSR ssr)
ssr - The SSR to be sent.protected void sendSPR(SPR spr)
spr - The SPR to be sent.protected void updateSPR(SPR spr)
spr - The SPR to be updated. null is not allowed.protected void cancelSPR(SPRRuntime spr)
spr - The SPR to be cancelled. null is not allowed.public static boolean isSSR(Message message)
message - The message.
public static boolean isSPR(Message message)
message - The message.
protected NameserverProxy getNameserver()
public void handleMessage(Message message)
handleMessage in interface IMessageHandlermessage - The message to be handled. Will never be null.public void connectionLost()
connectionLost in interface IMessageHandlerpublic static int getSunriseConnectionCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||