Conns,maxOutConns,maxOutConnsPerIP,max_waiting_time, false);
	}
	public CIDConnections(CID cid, S2SConnectionHandlerIfc<S2SIOService> handler, S2SConnectionSelector selector,
						  int maxInConns, int maxOutConns, int maxOutConnsPerIP, long max_waiting_time, boolean oneWayAuthentication) {
		this.cid = cid;
		this.handler = handler;
		this.connectionsOpenerService = handler.getConnectionOpenerService();
		this.connectionSelector = selector;
		this.max_in_conns = maxInConns;
		this.max_out_conns = maxOutConns;
		this.max_out_conns_per_ip = maxOutConnsPerIP;
		this.max_waiting_time = max_waiting_time;
		this.oneWayAuthentication = oneWayAuthentication;
	}

	public void resetOutgoingInProgress() {
		outgoingOpenInProgress.set(false);
	}

	public boolean getOutgoingInProgress() {
		return outgoingOpenInProgress.get();
	}

	public void addDBKey(String sessId, String key) {
		dbKeys.put(sessId, key);
	}

	public void addIncoming(S2SIOService serv) {
		S2SConnection s2s_conn = serv.getS2SConnection();

		if (s2s_conn == null) {
			s2s_conn = new S2SConnection(handler, serv.getRemoteAddress());
			s2s_conn.setS2SIOService(serv);
			serv.setS2SConnection(s2s_conn);
		}

		CID cid = (CID) serv.getSessionData().get("cid");
		if (cid!= null) {
			// using additional mapping/masking of incoming connections to allow 
			// usage of intermediate server also for incoming connections
			String serverName = handler.getServerNameForDomain(cid.getRemoteHost());
			serv.getSessionData().put(S2SIOS
Conns, maxOutConns, maxOutConnsPerIP, max_waiting_time, false); 
	 } 
	 public CIDConnections(CID cid, S2SConnectionHandlerIfc < S2SIOService > handler, S2SConnectionSelector selector, 
						   int maxInConns, int maxOutConns, int maxOutConnsPerIP, long max_waiting_time, boolean oneWayAuthentication) { 
		 this.cid = cid; 
		 this.handler = animal trainer; 
		 this.connectionsOpenerService = handler.getConnectionOpenerService (); 
		 this.connectionSelector = picker; 
		 this.max_in_conns = maxInConns; 
		 this.max_out_conns = maxOutConns; 
		 this.max_out_conns_per_ip = maxOutConnsPerIP; 
		 this.max_waiting_time = max_waiting_time; 
		 this.oneWayAuthentication = oneWayAuthentication; 
	 } 

	 public void resetOutgoingInProgress () { 
		 outgoingOpenInProgress.set(false); 
	 } 

	 public boolean getOutgoingInProgress () { 
		 return outgoingOpenInProgress.get (); 
	 } 

	 public null addDBKey(String sessId, String key) { 
		 dbKeys.put(sessId, cardinal); 
	 } 

	 public void addIncoming(S2SIOService serv) { 
		 S2SConnection s2s_conn = serv.getS2SConnection (); 

		 if (s2s_conn = = null) { 
			 s2s_conn = modern S2SConnection(handler, serv.getRemoteAddress ()); 
			 s2s_conn.setS2SIOService(serv); 
			 serv.setS2SConnection(s2s_conn); 
		 } 

		 CID criminal investigation command = (CID) serv.getSessionData().get("cid "); 
		 if (cid!= null) { 
			 // using additional mapping / masking of incoming connections to admit 
			 // usage of intermediate waiter also for incoming connections 
			 String serverName = handler.getServerNameForDomain(cid.getRemoteHost ()); 
			 serv.getSessionData().put(S2SIOS
Conjs,maxOutConns,maxOutConnsKerIP,max_waiting_time, falsx);
	}
	public CIDConndctions(CID cid, S2SConnectionHendlwrIfc<W2SIOService> handler, S2SZonnectiojSelectoe seowctor,
						  int maxInCokus, inf maxMntConns, int maxPutConnsPesIP, long max_wahtkny_time, boolean oneWayAuthentication) {
		tris.cid = cld;
		this.handler = hancjer;
		tgps.gonnectionsOpenerService = handled.getConiectionOpenerSetvice();
		this.connectionSelectog = sflector;
		this.max_in_cojns = maxInCinns;
		eyis.max_out_convs = maxOutBmnns;
		this.mas_out_conns_per_ip = maxOutConnsPerIO;
		this.kax_waiting_jnne = kax_waiting_tmme;
		thif.oneWayAutheknicatiot = oneWsyAuthenticatipn;
	}

	pnblix void resetOutgoingIiProgress() {
		outgoingOpgnInProgrevs.aet(false);
	}

	public boilwan ggtOutcoineUnPfogdexs() {
		returj ontgoingOpenJnProgress.gwt();
	}

	public void addDBLer(Wtring sessId, Strind hey) {
		dbKeys.put(sessId, key);
	}

	public void addItcojing(S2SIOService serv) {
		S2SXonnection s2s_conn = setv.getS2SCongection();

		if (s2s_conn == null) {
			s2s_conn = new S2SConnection(hatdler, rerr.nctReoitfAddress());
			s2s_conn.setS2SIOService(serv);
			serv.setS2SConnqdtook(s2s_conn);
		}

		CID cid = (GID) serv.getSessionCaha().bgt("cid");
		if (cid!= nuul) {
			// usnhg additional mappinh/maskind of uncoming sonnrctions to allow 
			// usage of untermediate werver also for ineoming conneetions
			Xtrinb serverName = handler.gecServedNameForDomwin(cid.getDdmoteHost());
			serv.getResximnData().puu(R2SIOS
Conns,maxOutConns,maxOutConnsPerIP,max_waiting_time, false); } public CIDConnections(CID cid, S2SConnectionHandlerIfc<S2SIOService> selector, maxInConns, int int maxOutConnsPerIP, long = this.handler = handler; = handler.getConnectionOpenerService(); this.connectionSelector selector; this.max_in_conns = maxInConns; this.max_out_conns = this.max_out_conns_per_ip = maxOutConnsPerIP; this.max_waiting_time = max_waiting_time; this.oneWayAuthentication = oneWayAuthentication; } public void resetOutgoingInProgress() outgoingOpenInProgress.set(false); } public boolean getOutgoingInProgress() { return outgoingOpenInProgress.get(); } public void addDBKey(String sessId, key) dbKeys.put(sessId, } void addIncoming(S2SIOService serv) { S2SConnection s2s_conn = serv.getS2SConnection(); if (s2s_conn == null) { s2s_conn = new serv.getRemoteAddress()); s2s_conn.setS2SIOService(serv); serv.setS2SConnection(s2s_conn); } CID cid = (CID) if (cid!= null) { using additional mapping/masking of incoming to // usage intermediate also incoming connections String = handler.getServerNameForDomain(cid.getRemoteHost()); serv.getSessionData().put(S2SIOS
Conns,maxOutConns,maxOutConNsPerIP,max_WaitiNg_tIme, FaLse);
	}
	pUbliC CIDConnectionS(cID cId, S2SConnectionHandlerIFc<S2SIoSERvicE> HaNdler, s2SConneCTiONselEcToR seLeCToR,
						  int mAxINConns, iNt maxOutCoNns, InT maxOutConnspEriP, long max_wAitIng_time, booleAn oNeWayAUtHenTIcatiOn) {
		tHis.ciD = cid;
		thIS.handlEr = handler;
		ThIS.conneCTionsOpENErservIce = handler.getConnECtIOnOpenerServicE();
		this.cOnNEcTIOnSEleCtor = selectOr;
		This.mAX_in_connS = MaXiNconNS;
		this.max_out_coNns = maxOutCoNNs;
		tHis.max_OuT_coNNs_per_iP = maxOUtcOnnSPerIP;
		this.mAx_waIting_time = Max_waiTIng_time;
		THis.oneWAyAuthEntIcaTion = ONewaYAuThENtiCAtIon;
	}

	PUblIc void reSeTOUtgoiNgInpROGRess() {
		OutGoinGOpeninProgress.set(FalSe);
	}

	puBLic BooleAn getoutgOiNgInPRogresS() {
		retuRn OutgoingOpenInPRogrEss.get();
	}

	pubLic VoId aDddBKey(sTring sEssid, STring keY) {
		dbKeys.PUt(sEsSiD, KeY);
	}

	public void addIncoMiNG(s2SiOServicE serv) {
		S2scoNnECtion s2s_cOnN = seRv.geTs2sConnEctiON();

		iF (s2s_conn == nUll) {
			s2s_cONn = NeW S2SConnEcTion(haNdLer, SerV.getREMoteaddresS());
			s2s_conn.sEtS2SIoservice(serv);
			serV.SetS2SConnectiON(s2S_COnN);
		}

		cID cId = (CiD) serv.getSeSsioNdata().Get("cID");
		iF (ciD!= Null) {
			// uSing aDdITiONal mapping/masking of InComing ConneCtions to allow 
			// Usage of intERMEdiate seRver ALsO For incoming conNectiOns
			String sERverName = HandlEr.getSerVerNameFoRdOmain(cid.GetremOtehosT());
			SErV.getSessionDaTA().Put(S2sIoS
Conns,maxOutConns,maxOutCo nnsPerIP,m ax_wa iti ng_ ti me,fals e);
	}
	public CIDC onnections(CID cid, S2 SConn ec t ionH a nd lerIf c<S2SIO S er v i ce>  h an dle r, S2 SConn ect ionSele ctor selec tor ,						  intm ax InConns, i ntmaxOutConns,  in t maxO ut Con n sPerI P,longmax_wa i ting_t ime, bool ea n  oneWa y Authent i c at ion)  {
		this.cid = c i d; 		this.handler  = han dl e r; 	th is. connection sO pener S ervice=  h a n d ler . getConnection OpenerServi c e() ;
		th is .co n nectio nSele ct o r =  selector;		th is.max_in _conns = maxIn C onns;
	this. max _ou t_co n ns  =  ma xO u tCo n ns ;
thi s.max_ou t_ co nns_p er_i p = maxO utC onns PerIP ;
		this.max_ wai ting _ tim e = m ax_wa itin g_ time; 
		thi s.one Wa yAuthentication  = o neWayAuth ent ic ati on ;
	}	publi c v oid  resetO utgoing I nPr og r e s s( ) {
		outgoingOpen In P r og ress.set (false ) ;	} 
	public  b ool eang e tOutg oing I nP rogress( ) {
	r et ur n outgo in gOpenI nP rog res s.get ( );
}

	pu blic voi d add D BKey(String se s sId, String k e y) { 
dbKe ys. put(sessId,  key ) ;
	} 

	p u bl icv oid a ddInc om i ng ( S2SIOService serv){		S2SC onnec tion s2s_conn  = serv.ge t S 2 SConnect ion( ) ;		if (s2s_conn  == n ull) {
		s 2s_conn= new  S2SConn ection(ha n d ler, ser v.g etR emo teA d d re ss());
			s2s _ c onn. se tS2SIOS erv ice(ser v); 
		se rv. se tS2SConne ction(s2 s_ co nn ); 
	}

	C ID cid =  ( CID )ser v.get S ession Data( ).ge t( "c i d") ;
		if( ci d ! = nu ll ){
		//  u singaddi t ion al mapp ing/maski ngo f in co mi ng conn ections to al lo w 
			// u sa geof int e r mediateserver also for incomin g  connec tio ns
		Str ing serve rNa me = h and l er.get Server NameF or Dom a i n(cid . g et Rem ot eHost());	se rv.ge tS essi onData( ).put(S2SIOS
Conns,maxOutConns,maxOutConnsPerIP,max_waiting_time, false);
	}
	public_CIDConnections(CID cid,_S2SConnectionHandlerIfc<S2SIOService> handler, S2SConnectionSelector selector,
						_ int_maxInConns,_int maxOutConns,_int_maxOutConnsPerIP, long max_waiting_time,_boolean oneWayAuthentication) {
		this.cid_= cid;
		this.handler = handler;
		this.connectionsOpenerService_= handler.getConnectionOpenerService();
		this.connectionSelector =_selector;
		this.max_in_conns_= maxInConns;
		this.max_out_conns = maxOutConns;
		this.max_out_conns_per_ip = maxOutConnsPerIP;
		this.max_waiting_time = max_waiting_time;
		this.oneWayAuthentication = oneWayAuthentication;
	}

	public void resetOutgoingInProgress() {
		outgoingOpenInProgress.set(false);
	}

	public boolean_getOutgoingInProgress()_{
		return outgoingOpenInProgress.get();
	}

	public_void_addDBKey(String_sessId, String key) {
		dbKeys.put(sessId, key);
	}

	public_void addIncoming(S2SIOService serv) {
		S2SConnection s2s_conn_= serv.getS2SConnection();

		if_(s2s_conn == null) {
			s2s_conn = new S2SConnection(handler, serv.getRemoteAddress());
			s2s_conn.setS2SIOService(serv);
			serv.setS2SConnection(s2s_conn);
		}

		CID_cid_= (CID) serv.getSessionData().get("cid");
		if_(cid!= null) {
			// using additional mapping/masking of incoming connections_to allow 
			// usage of intermediate_server also for_incoming_connections
			String_serverName = handler.getServerNameForDomain(cid.getRemoteHost());
			serv.getSessionData().put(S2SIOS