/// <remarks/> public override String ToString() { String s = ""; for (IEnumerator enumeration = ht.Values.GetEnumerator(); enumeration.MoveNext();) { NVPair nvpair = (NVPair)enumeration.Current; String s1 = nvpair.ToString(); s = s + s1 + "\n"; } return(s); }
/// <remarks/> public virtual void initFromNVPair(NVPair nvpair) { init(); if (nvpair == null || !nvpair.Name.ToUpper().Equals("address".ToUpper())) { throw new Exception(); } NVNavigator nvnavigator = new NVNavigator(); NVPair nvpair1 = nvnavigator.findNVPair(nvpair, "PROTOCOL"); if (nvpair1 == null) { throw new Exception(); } prot = nvpair1.Atom; if (addr == null) { addr = nvpair.ToString(); } }
/// <remarks/> public virtual void initFromNVPair(NVPair nvpair) { init(); int i = nvpair.ListSize; if (i == 0) { throw new TnsException(); } for (int j = 0; j < i; j++) { childnv = nvpair.getListElement(j); if (childnv.Name.ToUpper().Equals("SOURCE_ROUTE".ToUpper())) { sourceRoute = childnv.Atom.ToUpper().Equals("yes".ToUpper()) || childnv.Atom.ToUpper().Equals("on".ToUpper()) || childnv.Atom.ToUpper().Equals("true".ToUpper()); continue; } if (childnv.Name.ToUpper().Equals("LOAD_BALANCE".ToUpper())) { loadBalance = childnv.Atom.ToUpper().Equals("yes".ToUpper()) || childnv.Atom.ToUpper().Equals("on".ToUpper()) || childnv.Atom.ToUpper().Equals("true".ToUpper()); continue; } if (childnv.Name.ToUpper().Equals("FAILOVER".ToUpper())) { failover = childnv.Atom.ToUpper().Equals("yes".ToUpper()) || childnv.Atom.ToUpper().Equals("on".ToUpper()) || childnv.Atom.ToUpper().Equals("true".ToUpper()); continue; } if (childnv.Name.ToUpper().Equals("ENABLE".ToUpper())) { keepAlive = childnv.Atom.ToUpper().Equals("broken".ToUpper()); continue; } if (childnv.Name.ToUpper().Equals("PROTOCOL_STACK".ToUpper())) { protocolStacks.Add(childnv.ToString()); continue; } if (childnv.Name.ToUpper().Equals("ADDRESS".ToUpper())) { child = f.create(0); child.initFromNVPair(childnv); children.Add(child); continue; } if (childnv.Name.ToUpper().Equals("ADDRESS_LIST".ToUpper())) { child = f.create(1); child.initFromNVPair(childnv); children.Add(child); continue; } if (childnv.Name.ToUpper().Equals("SDU".ToUpper())) { SDU = childnv.Atom; continue; } if (childnv.Name.ToUpper().Equals("TDU".ToUpper())) { TDU = childnv.Atom; continue; } if (childnv.Name.ToUpper().Equals("SEND_BUF_SIZE".ToUpper())) { sendBufSize = childnv.Atom; continue; } if (childnv.Name.ToUpper().Equals("RECV_BUF_SIZE".ToUpper())) { receiveBufSize = childnv.Atom; continue; } if (childnv.Name.ToUpper().Equals("CONNECT_DATA".ToUpper())) { connectData = childnv.valueToString(); int k = childnv.ListSize; if (k == 0) { throw new TnsException(); } int i1 = 0; do { if (i1 >= k) { continue; } NVPair nvpair1 = childnv.getListElement(i1); if (nvpair1.Name.ToUpper().Equals("SID".ToUpper())) { SID = nvpair1.Atom; } else if (nvpair1.Name.ToUpper().Equals("SERVER".ToUpper())) { server = nvpair1.Atom; } else if (nvpair1.Name.ToUpper().Equals("SERVICE_NAME".ToUpper())) { serviceName = nvpair1.Atom; } else if (nvpair1.Name.ToUpper().Equals("INSTANCE_NAME".ToUpper())) { instanceName = nvpair1.Atom; } else if (nvpair1.Name.ToUpper().Equals("HANDLER_NAME".ToUpper())) { handlerName = nvpair1.Atom; } else if (nvpair1.Name.ToUpper().Equals("ORACLE_HOME".ToUpper())) { oracleHome = nvpair1.Atom; } else if (nvpair1.Name.ToUpper().Equals("FAILOVER_MODE".ToUpper())) { failoverMode = childnv.getListElement(i1).ToString(); } else if (nvpair1.Name.ToUpper().Equals("INSTANCE_ROLE".ToUpper())) { instanceRole = nvpair1.Atom; } else { String s1 = nvpair1.ToString().Trim(); s1 = s1.Substring(1, (s1.Length - 1) - (1)); extraConnInfo.Add(s1); } i1++; } while (true); } if (childnv.Name.ToUpper().Equals("SECURITY".ToUpper())) { int l = childnv.ListSize; if (l == 0) { throw new TnsException(); } int j1 = 0; do { if (j1 >= l) { continue; } NVPair nvpair2 = childnv.getListElement(j1); if (nvpair2.Name.ToUpper().Equals("AUTHENTICATION".ToUpper())) { authTypes = nvpair2.ToString(); } if (nvpair2.Name.ToUpper().Equals("ssl_server_cert_dn".ToUpper())) { sslServerCertDN = nvpair2.Atom; if (sslServerCertDN != null && sslServerCertDN.StartsWith("\"") && sslServerCertDN.EndsWith("\"")) { sslServerCertDN = sslServerCertDN.Substring(1, (sslServerCertDN.Length - 1) - (1)); } } else { authParams.Add(nvpair2.ToString()); } j1++; } while (true); } if (childnv.Name.ToUpper().Equals("HS".ToUpper()) && childnv.Atom == null) { try { childnv.Atom = "OK"; } catch { } } String s = childnv.ToString().Trim(); s = s.Substring(1, (s.Length - 1) - (1)); extraInfo.Add(s); } }