protected void loadTimeOuts(Configuration config) { CEA_TIMEOUT = config.getLongValue(CeaTimeOut.ordinal(), (Long) CeaTimeOut.defValue()); IAC_TIMEOUT = config.getLongValue(IacTimeOut.ordinal(), (Long) IacTimeOut.defValue()); DWA_TIMEOUT = config.getLongValue(DwaTimeOut.ordinal(), (Long) DwaTimeOut.defValue()); DPA_TIMEOUT = config.getLongValue(DpaTimeOut.ordinal(), (Long) DpaTimeOut.defValue()); REC_TIMEOUT = config.getLongValue(RecTimeOut.ordinal(), (Long) RecTimeOut.defValue()); }
@Override public long getFirmware() { return stack.getConfiguration().getLongValue(OwnFirmwareRevision.ordinal(), -1L); }
public NetworkGuard(InetAddress[] inetAddress, int port, IConcurrentFactory concurrentFactory, IMessageParser parser, IMetaData data) throws Exception { this.parser = parser; this.localAddresses = inetAddress; this.port = port; this.bindDelay = data.getConfiguration().getLongValue(BindDelay.ordinal(), (Long) BindDelay.defValue()); this.binderExecutor.schedule(binderTask, bindDelay, TimeUnit.MILLISECONDS); }
long vnd = a.getLongValue(VendorId.ordinal(), 0L); long auth = a.getLongValue(AuthApplId.ordinal(), 0L); long acc = a.getLongValue(AcctApplId.ordinal(), 0L); if (logger.isDebugEnabled()) { logger.debug("Adding app id vendor [{}] auth [{}] acc [{}]", new Object[]{vnd, auth, acc});
@Override public boolean elementChanged(int i, Object data) { Configuration newConf = (Configuration) data; stopTimeOut = newConf.getLongValue(StopTimeOut.ordinal(), (Long) StopTimeOut.defValue()); duplicateTimer = newConf.getLongValue(DuplicateTimer.ordinal(), (Long) DuplicateTimer.defValue()); isAcceptUndefinedPeer = newConf.getBooleanValue(AcceptUndefinedPeer.ordinal(), false); return true; }
@Override public long getVendorId() { return stack.getConfiguration().getLongValue(OwnVendorID.ordinal(), (Long) OwnVendorID.defValue()); }
public StatisticManagerImpl(Configuration config) { long pause = (Long) Parameters.StatisticsLoggerPause.defValue(); long delay = (Long) Parameters.StatisticsLoggerDelay.defValue(); boolean enabled = (Boolean) Parameters.StatisticsEnabled.defValue(); String activeRecords = (String) Parameters.Statistics.defValue(); Configuration[] loggerParams = config.getChildren(Parameters.Statistics.ordinal()); if (loggerParams != null && loggerParams.length > 0) { pause = loggerParams[0].getLongValue(Parameters.StatisticsLoggerPause.ordinal(), pause); delay = loggerParams[0].getLongValue(Parameters.StatisticsLoggerDelay.ordinal(), delay); enabled = loggerParams[0].getBooleanValue(Parameters.StatisticsEnabled.ordinal(), enabled); activeRecords = loggerParams[0].getStringValue(Parameters.StatisticsActiveList.ordinal(), activeRecords); } this.pause = pause; this.delay = delay; this.enabled = enabled; Set<String> enabledSet = new HashSet<String>(); if (activeRecords != null && activeRecords.length() > 0) { for (String s : activeRecords.split(",")) { enabledSet.add(s); } } this.activeRecords = Collections.unmodifiableSet(enabledSet); }
/** * Initializes the RA Diameter Stack. * * @throws Exception */ private synchronized void initStack() throws Exception { // Register in the Mux as an app listener. this.diameterMux.registerListener(this, (ApplicationId[]) authApplicationIds.toArray(new ApplicationId[authApplicationIds.size()])); // Get the stack (should not mess with) this.stack = this.diameterMux.getStack(); this.messageTimeout = stack.getMetaData().getConfiguration().getLongValue(MessageTimeOut.ordinal(), (Long) MessageTimeOut.defValue()); if (tracer.isInfoEnabled()) { tracer.info("Diameter S6a RA :: Successfully initialized stack."); } }
public NetworkGuard(InetAddress[] inetAddress, int port, IConcurrentFactory concurrentFactory, IMessageParser parser, IMetaData data) throws Exception { this.port = port; this.parser = parser; this.concurrentFactory = concurrentFactory == null ? new DummyConcurrentFactory() : concurrentFactory; //this.thread = this.concurrentFactory.getThread("NetworkGuard", this); this.bindDelay = data.getConfiguration().getLongValue(BindDelay.ordinal(), (Long) BindDelay.defValue()); try { for (int addrIdx = 0; addrIdx < inetAddress.length; addrIdx++) { GuardTask guardTask = new GuardTask(new InetSocketAddress(inetAddress[addrIdx], port)); Thread t = this.concurrentFactory.getThread(guardTask); guardTask.thread = t; tasks.add(guardTask); } isWork = true; for (GuardTask gt : this.tasks) { gt.start(); } //thread.start(); } catch (Exception exc) { destroy(); throw new Exception(exc); } }
protected void genericSend(Message message, EventListener listener) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException { if (isValid) { long timeOut = container.getConfiguration().getLongValue(MessageTimeOut.ordinal(), (Long) MessageTimeOut.defValue()); genericSend(message, listener, timeOut, TimeUnit.MILLISECONDS); } else { throw new IllegalDiameterStateException("Session already released"); } }
/** * Initializes the RA Diameter Stack. * * @throws Exception */ private synchronized void initStack() throws Exception { // Register in the Mux as app listener. this.diameterMux.registerListener(this, (ApplicationId[]) authApplicationIds.toArray(new ApplicationId[authApplicationIds.size()])); // Get the stack (should not mess with) this.stack = this.diameterMux.getStack(); this.messageTimeout = this.stack.getMetaData().getConfiguration().getLongValue(MessageTimeOut.ordinal(), (Long) MessageTimeOut.defValue()); if(tracer.isInfoEnabled()) { tracer.info("Diameter CCA RA :: Successfully initialized stack."); } }
public NetworkGuard(InetAddress[] inetAddress, int port, IConcurrentFactory concurrentFactory, IMessageParser parser, IMetaData data) throws Exception { this.parser = parser; this.localAddresses = inetAddress; this.port = port; this.concurrentFactory = concurrentFactory == null ? new DummyConcurrentFactory() : concurrentFactory; // extract sec_ref from local peer; Configuration conf = data.getConfiguration(); if (!conf.isAttributeExist(Parameters.SecurityRef.ordinal())) { throw new IllegalArgumentException("No security_ref attribute present in local peer!"); } String secRef = conf.getStringValue(Parameters.SecurityRef.ordinal(), ""); logger.debug("secRef: {}", secRef); // now need to get proper security data. this.localPeerSSLConfig = TLSUtils.getSSLConfiguration(conf, secRef); if (this.localPeerSSLConfig == null) { throw new IllegalArgumentException("No Security for security_reference '" + secRef + "'"); } this.bindDelay = data.getConfiguration().getLongValue(BindDelay.ordinal(), (Long) BindDelay.defValue()); this.binderExecutor.schedule(binderTask, bindDelay, TimeUnit.MILLISECONDS); }
/** * Initializes the RA Diameter Stack. * * @throws Exception */ private synchronized void initStack() throws Exception { // Register in the Mux as a Sh app listener. this.diameterMux.registerListener(this, (ApplicationId[]) authApplicationIds.toArray(new ApplicationId[authApplicationIds.size()])); // Get the stack (should not mess with) this.stack = this.diameterMux.getStack(); this.messageTimeout = stack.getMetaData().getConfiguration().getLongValue(MessageTimeOut.ordinal(), (Long) MessageTimeOut.defValue()); if(tracer.isInfoEnabled()) { tracer.info("Diameter ShClient RA :: Successfully initialized stack."); } } private void initActivitiesMgmt()
/** * Initializes the RA Diameter Stack. * * @throws Exception */ private synchronized void initStack() throws Exception { // Register in the Mux as an app listener. this.diameterMux.registerListener(this, (ApplicationId[]) authApplicationIds.toArray(new ApplicationId[authApplicationIds.size()])); // Get the stack (should not mess with) this.stack = this.diameterMux.getStack(); this.messageTimeout = stack.getMetaData().getConfiguration().getLongValue(MessageTimeOut.ordinal(), (Long) MessageTimeOut.defValue()); if(tracer.isInfoEnabled()) { tracer.info("Diameter Cx/Dx RA :: Successfully initialized stack."); } } private void initActivitiesMgmt() {
public AppSessionImpl(ISessionFactory sf, IAppSessionData appSessionData) { if (sf == null) { throw new IllegalArgumentException("SessionFactory must not be null"); } if (appSessionData == null) { throw new IllegalArgumentException("IAppSessionData must not be null"); } try { this.sf = sf; this.appSessionData = appSessionData; IAssembler assembler = ( this.sf).getContainer().getAssemblerFacility(); this.scheduler = assembler.getComponentInstance(IConcurrentFactory.class). getScheduledExecutorService(IConcurrentFactory.ScheduledExecServices.ApplicationSession.name()); this.timerFacility = assembler.getComponentInstance(ITimerFacility.class); this.maxIdleTime = this.sf.getContainer().getConfiguration().getLongValue(SessionTimeOut.ordinal(), (Long) SessionTimeOut.defValue()); this.session = this.sf.getNewSession(this.appSessionData.getSessionId()); //annoying ;[ ArrayList<Session> list = new ArrayList<Session>(); list.add(this.session); this.sessions = Collections.unmodifiableList(list); } catch (Exception e) { throw new IllegalArgumentException(e); } }
Configuration[] cAppId = e.getChildren(ApplicationId.ordinal()); for (Configuration i : cAppId) { if ( i.getLongValue(AuthApplId.ordinal(), 0) != 0 ) { appId = org.jdiameter.api.ApplicationId.createByAuthAppId( i.getLongValue(VendorId.ordinal(), 0), i.getLongValue(AuthApplId.ordinal(), 0) ); i.getLongValue(VendorId.ordinal(), 0), i.getLongValue(AcctApplId.ordinal(), 0) );
protected long setLastAccessTime() { lastAccessedTime = System.currentTimeMillis(); if (sessionId != null) { maxIdleTime = container.getConfiguration().getLongValue(SessionTimeOut.ordinal(), (Long) SessionTimeOut.defValue()); if (maxIdleTime > 0) { IAssembler assembler = container.getAssemblerFacility(); ITimerFacility timerFacility = assembler.getComponentInstance(ITimerFacility.class); if (istTimerId != null) { timerFacility.cancel(istTimerId); } istTimerId = timerFacility.schedule(this.getSessionId(), IDLE_SESSION_TIMER_NAME, maxIdleTime); } } return lastAccessedTime; }
/** * Initializes the RA Diameter Stack. * * @throws Exception */ private synchronized void initStack() throws Exception { // Register in the Mux as app listener. List<ApplicationId> allAppIds = new ArrayList<ApplicationId>(); allAppIds.addAll(authApplicationIds); allAppIds.addAll(acctApplicationIds); this.diameterMux.registerListener( this, allAppIds.toArray(new ApplicationId[allAppIds.size()])); // Get the stack (should not mess with) this.stack = this.diameterMux.getStack(); this.messageTimeout = stack.getMetaData().getConfiguration().getLongValue(MessageTimeOut.ordinal(), (Long) MessageTimeOut.defValue()); // Obtain parser and store it in AvpUtilities MessageParser parser = ((IContainer)stack).getAssemblerFacility().getComponentInstance(MessageParser.class); AvpUtilities.setParser(parser); AvpUtilities.setDictionary(stack.getDictionary()); if(tracer.isInfoEnabled()) { tracer.info("Diameter Base RA :: Successfully initialized stack."); } } private void initActivitiesMgmt() {
/** * Initializes the RA Diameter Stack. * * @throws Exception */ private synchronized void initStack() throws Exception { // Register in the Mux as app listener. List<ApplicationId> allAppIds = new ArrayList<ApplicationId>(); allAppIds.addAll(authApplicationIds); allAppIds.addAll(acctApplicationIds); this.diameterMux.registerListener( this, allAppIds.toArray(new ApplicationId[allAppIds.size()])); // Get the stack (should not mess with) this.stack = this.diameterMux.getStack(); this.messageTimeout = stack.getMetaData().getConfiguration().getLongValue(MessageTimeOut.ordinal(), (Long) MessageTimeOut.defValue()); // Obtain parser and store it in AvpUtilities MessageParser parser = ((IContainer)stack).getAssemblerFacility().getComponentInstance(MessageParser.class); AvpUtilities.setParser(parser); AvpUtilities.setDictionary(stack.getDictionary()); if(tracer.isInfoEnabled()) { tracer.info("Diameter Base RA :: Successfully initialized stack."); } } private void initActivitiesMgmt() {
this.metaData = metaData; this.concurrentFactory = concurrentFactory; this.stopTimeOut = globalConfig.getLongValue(StopTimeOut.ordinal(), (Long) StopTimeOut.defValue()); this.sessionDatasource = stack.getAssemblerFacility().getComponentInstance(ISessionDatasource.class);