@Override public String getName() { return this.wrappedAssociation.getName(); }
@Override public void onCommunicationShutdown(Association association) { logger.warn(String.format("Communication channel shutdown for AspFactroy=%s Association=%s", this.name, association.getName())); this.handleCommDown(); }
/** * AssociationListener methods */ @Override public void onCommunicationLost(Association association) { logger.warn(String.format("Communication channel lost for AspFactroy=%s Association=%s", this.name, association.getName())); this.handleCommDown(); }
/** * AssociationListener methods */ @Override public void onCommunicationLost(Association association) { logger.warn(String.format("Communication channel lost for AspFactroy=%s Association=%s", this.name, association.getName())); this.handleCommDown(); }
@Override public void onCommunicationShutdown(Association association) { logger.warn(String.format("Communication channel shutdown for AspFactroy=%s Association=%s", this.name, association.getName())); this.handleCommDown(); }
protected void start() throws Exception { this.transportManagement.startAssociation(this.association.getName()); this.started = true; }
protected void start() throws Exception { this.transportManagement.startAssociation(this.association.getName()); this.started = true; }
@Override public void tick(long now) { if (now - this.initiatedTime >= STOP_TIMER_TIMEOUT) { if (this.aspFactoryImpl.association.isConnected()) { logger.warn(String .format("Asp=%s was stopped but underlying Association=%s was not stopped after TIMEOUT=%d ms. Forcing stop now", this.aspFactoryImpl.getName(), this.aspFactoryImpl.association.getName(), STOP_TIMER_TIMEOUT)); try { this.aspFactoryImpl.transportManagement.stopAssociation(this.aspFactoryImpl.association.getName()); } catch (Exception e) { logger.error(String.format("Exception while trying to stop Association=%s", this.aspFactoryImpl.association.getName())); } } // Finally cancel this.cancel(); }// if(now-this.initiatedTime >= STOP_TIMER_TIMEOUT) }
@Override public void tick(long now) { if (now - this.initiatedTime >= STOP_TIMER_TIMEOUT) { if (this.aspFactoryImpl.association.isConnected()) { logger.warn(String .format("Asp=%s was stopped but underlying Association=%s was not stopped after TIMEOUT=%d ms. Forcing stop now", this.aspFactoryImpl.getName(), this.aspFactoryImpl.association.getName(), STOP_TIMER_TIMEOUT)); try { this.aspFactoryImpl.transportManagement.stopAssociation(this.aspFactoryImpl.association.getName()); } catch (Exception e) { logger.error(String.format("Exception while trying to stop Association=%s", this.aspFactoryImpl.association.getName())); } } // Finally cancel this.cancel(); }// if(now-this.initiatedTime >= STOP_TIMER_TIMEOUT) }
protected void unsetAssociation() throws Exception { if (this.association != null) { if (this.association.isStarted()) { throw new Exception(String.format("Association=%s is still started. Stop first", this.association.getName())); } this.association.setAssociationListener(null); this.association = null; } }
/** * methods - private */ private void addAssociationToManagement(Association asso) { synchronized (this) { Association assBean = new SctpAssociationJmx(this, asso); this.ss7Management.registerMBean(Ss7Layer.SCTP, SctpManagementType.ASSOCIATION, asso.getName(), assBean); lstAssociations.put(asso.getName(), assBean); } }
protected void unsetAssociation() throws Exception { if (this.association != null) { if (this.association.isStarted()) { throw new Exception(String.format("Association=%s is still started. Stop first", this.association.getName())); } this.association.setAssociationListener(null); this.association = null; } }
protected void setAssociation(Association association) { // Unset the listener to previous association if (this.association != null) { this.association.setAssociationListener(null); } this.association = association; this.associationName = this.association.getName(); // Set the listener for new association this.association.setAssociationListener(this); }
protected void setAssociation(Association association) { // Unset the listener to previous association if (this.association != null) { this.association.setAssociationListener(null); } this.association = association; this.associationName = this.association.getName(); // Set the listener for new association this.association.setAssociationListener(this); }
@Override public void onCommunicationRestart(Association association) { logger.warn(String.format("Communication channel restart for AspFactroy=%s Association=%s", this.name, association.getName())); //TODO : Is this correct way to handle? try { this.transportManagement.stopAssociation(this.associationName); } catch (Exception e) { logger.warn(String.format("Error while trying to stop underlying Association for AspFactpry=%s", this.getName()), e); } try { this.transportManagement.startAssociation(this.associationName); } catch (Exception e) { logger.error(String.format("Error while trying to start underlying Association for AspFactpry=%s", this.getName()), e); } }
@Override public void onCommunicationRestart(Association association) { logger.warn(String.format("Communication channel restart for AspFactroy=%s Association=%s", this.name, association.getName())); //TODO : Is this correct way to handle? try { this.transportManagement.stopAssociation(this.associationName); } catch (Exception e) { logger.warn(String.format("Error while trying to stop underlying Association for AspFactpry=%s", this.getName()), e); } try { this.transportManagement.startAssociation(this.associationName); } catch (Exception e) { logger.error(String.format("Error while trying to start underlying Association for AspFactpry=%s", this.getName()), e); } }
protected void stop() throws Exception { FastList<String> tempAssociations = associations; for (FastList.Node<String> n = tempAssociations.head(), end = tempAssociations.tail(); (n = n.getNext()) != end;) { String assocName = n.getValue(); Association associationTemp = this.management.getAssociation(assocName); if (associationTemp.isStarted()) { throw new Exception(String.format("Stop all the associations first. Association=%s is still started", associationTemp.getName())); } } synchronized (this.anonymAssociations) { // stopping all anonymous associations for (Association ass : this.anonymAssociations) { ass.stopAnonymousAssociation(); } this.anonymAssociations.clear(); } this.started = false; if (logger.isInfoEnabled()) { logger.info(String.format("Stoped Server=%s", this.name)); } // Stop underlying channel and wait till its done if (this.getIpChannel() != null) { try { this.getIpChannel().close().sync(); } catch (Exception e) { logger.warn(String.format("Error while stopping the Server=%s", this.name), e); } } }
protected void stop() throws Exception { FastList<String> tempAssociations = associations; for (FastList.Node<String> n = tempAssociations.head(), end = tempAssociations.tail(); (n = n.getNext()) != end;) { String assocName = n.getValue(); Association associationTemp = this.management.getAssociation(assocName); if (associationTemp.isStarted()) { throw new Exception(String.format("Stop all the associations first. Association=%s is still started", associationTemp.getName())); } } synchronized (this.anonymAssociations) { // stopping all anonymous associations for (Association ass : this.anonymAssociations) { ass.stopAnonymousAssociation(); } this.anonymAssociations.clear(); } if (this.getIpChannel() != null) { try { this.getIpChannel().close(); } catch (Exception e) { logger.warn(String.format("Error while stopping the Server=%s", this.name), e); } } this.started = false; if (logger.isInfoEnabled()) { logger.info(String.format("Stoped Server=%s", this.name)); } }
private AlarmMessage generateAssociationAlarm(Association ass, boolean isCleared, boolean isCurrentAlarmList, String event) { AlarmMessageImpl alm = new AlarmMessageImpl(); alm.setIsCleared(isCleared); alm.setAlarmSeverity(AlarmSeverity.minor); alm.setAlarmSource("SS7_SCTP_" + this.getName()); alm.setObjectName("Association: " + ass.getName()); alm.setObjectPath("/Sctp:" + this.getName() + "/Associations/Association:" + ass.getName()); alm.setProblemName("SCTP association is down"); alm.setCause(event); alm.setTimeAlarm(Calendar.getInstance()); if (!isCurrentAlarmList) { if (isCleared) alm.setCurentTimeClear(); else alm.setCurentTimeAlarm(); } return alm; }