Esempio n. 1
0
 @Override
 public void onProtocolMessageReceived(ProtocolMessage msg) {
   SdlSession session = findSessionById(msg.getSessionID());
   if (session != null) {
     session.onProtocolMessageReceived(msg);
   }
 }
Esempio n. 2
0
 @Override
 public void onProtocolSessionNACKed(
     SessionType sessionType, byte sessionID, byte version, String correlationID) {
   for (SdlSession session : listenerList) {
     session.onProtocolSessionNACKed(sessionType, sessionID, version, correlationID);
   }
 }
Esempio n. 3
0
 @Override
 public void onProtocolSessionEnded(
     SessionType sessionType, byte sessionID, String correlationID) {
   SdlSession session = findSessionById(sessionID);
   if (session != null) {
     session.onProtocolSessionEnded(sessionType, sessionID, correlationID);
   }
 }
Esempio n. 4
0
 private SdlSession findSessionById(byte id) {
   for (SdlSession listener : listenerList) {
     if (listener.getSessionId() == id) {
       return listener;
     }
   }
   return null;
 }
Esempio n. 5
0
 @Override
 public void onProtocolSessionStarted(
     SessionType sessionType, byte sessionID, byte version, String correlationID) {
   for (SdlSession session : listenerList) {
     if (session.getSessionId() == 0 || sessionType == SessionType.NAV) {
       session.onProtocolSessionStarted(sessionType, sessionID, version, correlationID);
       break; // FIXME: need changes on SDL side, as the sessionID is devided by SDL.
     }
   }
 }
Esempio n. 6
0
    @Override
    public void onTransportError(String info, Exception e) {
      SdlSession mySession = null;
      for (int z = 0; z < listenerList.size(); z++) {

        mySession = listenerList.get(0);
        if (mySession == null) continue;
        mySession.onTransportError(info, e);
      }
    }
Esempio n. 7
0
 @Override
 public void onTransportConnected() {
   synchronized (PROTOCOL_REFERENCE_LOCK) {
     if (_protocol != null) {
       for (SdlSession s : listenerList) {
         if (s.getSessionId() == 0) {
           startHandShake();
         }
       }
     }
   }
 }
Esempio n. 8
0
  public void unregisterSession(SdlSession registerListener) {
    synchronized (SESSION_LOCK) {
      listenerList.remove(registerListener);

      closeConnection(listenerList.size() == 0, registerListener.getSessionId());
    }
  }
Esempio n. 9
0
 @Override
 public void onHeartbeatTimedOut(byte sessionID) {
   for (SdlSession session : listenerList) {
     session.onHeartbeatTimedOut(sessionID);
   }
 }
Esempio n. 10
0
 @Override
 public void onProtocolError(String info, Exception e) {
   for (SdlSession session : listenerList) {
     session.onProtocolError(info, e);
   }
 }
Esempio n. 11
0
 @Override
 public void onTransportDisconnected(String info) {
   for (SdlSession session : listenerList) {
     session.onTransportDisconnected(info);
   }
 }
Esempio n. 12
0
 public void sendHeartbeat(SdlSession mySession) {
   if (_protocol != null && mySession != null) _protocol.SendHeartBeat(mySession.getSessionId());
 }