/**
   * (non-Javadoc)
   *
   * @see FermatEventHandler#handleEvent(FermatEvent)
   * @param platformEvent
   * @throws Exception
   */
  @Override
  public void handleEvent(FermatEvent platformEvent) throws FermatException {

    // System.out.println("FailureComponentConnectionRequestNotificationEventListener - handleEvent
    // platformEvent ="+platformEvent.getEventType() );

    if (((Service) this.networkService).getStatus() == ServiceStatus.STARTED) {

      FailureComponentConnectionRequestNotificationEvent
          failureComponentConnectionRequestNotificationEvent =
              (FailureComponentConnectionRequestNotificationEvent) platformEvent;

      if (failureComponentConnectionRequestNotificationEvent
                  .getNetworkServiceApplicant()
                  .getPlatformComponentType()
              == networkService.getPlatformComponentType()
          && failureComponentConnectionRequestNotificationEvent
                  .getNetworkServiceApplicant()
                  .getNetworkServiceType()
              == networkService.getNetworkServiceType()) {

        /*
         *  networkService make the job
         */
        this.networkService.handleFailureComponentRegistrationNotificationEvent(
            failureComponentConnectionRequestNotificationEvent.getNetworkServiceApplicant(),
            failureComponentConnectionRequestNotificationEvent.getRemoteParticipant());
      }
    }
  }
Ejemplo n.º 2
0
  /**
   * Handle the event FailureComponentConnectionRequestNotificationEvent
   *
   * @param event
   */
  public void handleFailureComponentConnectionRequest(
      FailureComponentConnectionRequestNotificationEvent event) {

    try {

      System.out.println("Executing handleFailureComponentConnectionRequest ");
      communicationNetworkServiceConnectionManager.removeRequestedConnection(
          event.getRemoteParticipant().getIdentityPublicKey());
      communicationSupervisorPendingMessagesAgent.removeConnectionWaitingForResponse(
          event.getRemoteParticipant().getIdentityPublicKey());
      checkFailedSendMessage(event.getRemoteParticipant().getIdentityPublicKey());
      onFailureComponentConnectionRequest(event.getRemoteParticipant());

    } catch (Exception e) {
      e.printStackTrace();
    }
  }