Catch SecretNotFound exceptions

This commit is contained in:
Jim Norman 2006-10-23 16:23:30 +00:00
parent f60d8d1cc6
commit d9c92e679f

View File

@ -83,72 +83,79 @@ namespace Novell.CASA.DataEngines
StringEnumerator se = sc.GetEnumerator();
se.Reset();
while (se.MoveNext())
{
while (se.MoveNext())
{
try
{
Secret secret = store.getSecret(se.Current);
NameValueCollection nvc = secret.getKeyValueCollection();
mi_secret = doc.CreateElement(ConstStrings.CCF_SECRET);
synchAttr = doc.CreateAttribute(ConstStrings.CCF_SYNCH);
//TBD:
synchAttr.Value = "Persistent Secret";
secidAttr = doc.CreateAttribute(ConstStrings.CCF_ID);
secidAttr.Value = se.Current;
mi_secret.SetAttributeNode(secidAttr);
mi_secret.SetAttributeNode(synchAttr);
for (int i = 0; i < nvc.Count; i++)
{
sKey = nvc.GetKey(i);
sValue = nvc.Get(sKey);
//Key
key1 = doc.CreateElement(ConstStrings.CCF_KEY);
Atr = doc.CreateAttribute(ConstStrings.CCF_ID);
Atr.Value = sKey;
key1.SetAttributeNode(Atr);
//Value
value1 = doc.CreateElement(ConstStrings.CCF_VALUE);
value1.InnerText = sValue;
key1.AppendChild(value1);
mi_secret.AppendChild(key1);
}
/*
//Time
XmlElement Time1 = doc.CreateElement(ConstStrings.CCF_TIME);
Secret secret = store.getSecret(se.Current);
NameValueCollection nvc = secret.getKeyValueCollection();
XmlElement zone1 = doc.CreateElement(ConstStrings.CCF_ZONE);
zone1.InnerText = "IST";
mi_secret = doc.CreateElement(ConstStrings.CCF_SECRET);
synchAttr = doc.CreateAttribute(ConstStrings.CCF_SYNCH);
//TBD:
synchAttr.Value = "Persistent Secret" ;
secidAttr = doc.CreateAttribute(ConstStrings.CCF_ID);
secidAttr.Value = se.Current;
mi_secret.SetAttributeNode(secidAttr);
mi_secret.SetAttributeNode(synchAttr);
XmlElement cr1 = doc.CreateElement(ConstStrings.CCF_CRTIME);
cr1.InnerText = null;
XmlElement mod1 = doc.CreateElement(ConstStrings.CCF_MDTIME);
mod1.InnerText = null;
for (int i = 0; i < nvc.Count; i++)
{
XmlElement acc1 = doc.CreateElement(ConstStrings.CCF_ACTIME);
acc1.InnerText = null;
sKey = nvc.GetKey(i);
sValue = nvc.Get(sKey);
//Key
key1 = doc.CreateElement(ConstStrings.CCF_KEY);
Atr = doc.CreateAttribute(ConstStrings.CCF_ID);
Atr.Value = sKey;
key1.SetAttributeNode(Atr);
//Value
value1 = doc.CreateElement(ConstStrings.CCF_VALUE);
value1.InnerText = sValue;
key1.AppendChild(value1);
mi_secret.AppendChild(key1);
}
/*
//Time
XmlElement Time1 = doc.CreateElement(ConstStrings.CCF_TIME);
XmlElement zone1 = doc.CreateElement(ConstStrings.CCF_ZONE);
zone1.InnerText = "IST";
XmlElement cr1 = doc.CreateElement(ConstStrings.CCF_CRTIME);
cr1.InnerText = null;
XmlElement mod1 = doc.CreateElement(ConstStrings.CCF_MDTIME);
mod1.InnerText = null;
XmlElement acc1 = doc.CreateElement(ConstStrings.CCF_ACTIME);
acc1.InnerText = null;
Time1.AppendChild(zone1);
Time1.AppendChild(cr1);
Time1.AppendChild(mod1);
Time1.AppendChild(acc1);
mi_secret.AppendChild(Time1);
*/
//Finally Add Secret to Elem
keychain.AppendChild(mi_secret);
Time1.AppendChild(zone1);
Time1.AppendChild(cr1);
Time1.AppendChild(mod1);
Time1.AppendChild(acc1);
mi_secret.AppendChild(Time1);
*/
//Finally Add Secret to Elem
keychain.AppendChild(mi_secret);
}
catch (Exception)
{
//Console.WriteLine("Secret Not Found: " + se.Current);
}
}
}