/** * Handles the events ClientConnectionCloseNotificationEvent * * @param fermatEvent */ @Override public void handleClientConnectionCloseNotificationEvent(FermatEvent fermatEvent) { if (fermatEvent instanceof ClientConnectionCloseNotificationEvent) { // // try { // // List<CryptoPaymentRequest> cryptoAddressRequestList = // cryptoPaymentRequestNetworkServiceDao.listRequestsByProtocolState(RequestProtocolState.WAITING_RESPONSE); // // for(CryptoPaymentRequest record : cryptoAddressRequestList) { // // // cryptoPaymentRequestNetworkServiceDao.changeProtocolState(record.getRequestId(),RequestProtocolState.PROCESSING_SEND); // } // } // catch(CantListRequestsException | CantChangeRequestProtocolStateException // |RequestNotFoundException e) // { // System.out.print("EXCEPCION REPROCESANDO WAIT MESSAGE"); // e.printStackTrace(); // } this.register = false; if (communicationNetworkServiceConnectionManager != null) communicationNetworkServiceConnectionManager.closeAllConnection(); } }
public void handleCompleteComponentConnectionRequestNotificationEvent( PlatformComponentProfile applicantComponentProfile, PlatformComponentProfile remoteComponentProfile) { communicationNetworkServiceConnectionManager.handleEstablishedRequestedNetworkServiceConnection( remoteComponentProfile); }
@Override public void resume() { // resume connections manager. communicationNetworkServiceConnectionManager.resume(); this.serviceStatus = ServiceStatus.STARTED; }
@Override public void pause() { // pause connections manager. communicationNetworkServiceConnectionManager.pause(); this.serviceStatus = ServiceStatus.PAUSED; }
/** Handles the events CompleteRequestListComponentRegisteredNotificationEvent */ public void handleCompleteComponentConnectionRequestNotificationEvent( final PlatformComponentProfile remoteComponentProfile) { /* * Tell the manager to handler the new connection established */ communicationNetworkServiceConnectionManager.handleEstablishedRequestedNetworkServiceConnection( remoteComponentProfile); if (remoteNetworkServicesRegisteredList != null && !remoteNetworkServicesRegisteredList.isEmpty()) remoteNetworkServicesRegisteredList.add(remoteComponentProfile); }
/** * Handles the events VPNConnectionCloseNotificationEvent * * @param fermatEvent */ @Override public void handleVpnConnectionCloseNotificationEvent(FermatEvent fermatEvent) { if (fermatEvent instanceof VPNConnectionCloseNotificationEvent) { VPNConnectionCloseNotificationEvent vpnConnectionCloseNotificationEvent = (VPNConnectionCloseNotificationEvent) fermatEvent; if (vpnConnectionCloseNotificationEvent.getNetworkServiceApplicant() == getNetworkServiceType()) { if (communicationNetworkServiceConnectionManager != null) communicationNetworkServiceConnectionManager.closeConnection( vpnConnectionCloseNotificationEvent.getRemoteParticipant().getIdentityPublicKey()); } } }
@Override public void stop() { // remove all listeners from the event manager and from the plugin. for (FermatEventListener listener : listenersAdded) eventManager.removeListener(listener); listenersAdded.clear(); // close all connections. communicationNetworkServiceConnectionManager.closeAllConnection(); // interrupt the registration agent execution communicationRegistrationProcessNetworkServiceAgent.stop(); // interrupt the executor agent execution cryptoPaymentRequestExecutorAgent.stop(); // set to not registered. register = Boolean.FALSE; this.serviceStatus = ServiceStatus.STOPPED; }
/* * Handles the events ClientSuccessfullReconnectNotificationEvent */ @Override public void handleClientSuccessfullReconnectNotificationEvent(FermatEvent fermatEvent) { if (communicationNetworkServiceConnectionManager != null) communicationNetworkServiceConnectionManager.restart(); }
/* * Handles the events ClientConnectionLooseNotificationEvent */ @Override public void handleClientConnectionLooseNotificationEvent(FermatEvent fermatEvent) { if (communicationNetworkServiceConnectionManager != null) communicationNetworkServiceConnectionManager.stop(); }