Catch SecretNotFound exceptions

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

View File

@ -85,70 +85,77 @@ namespace Novell.CASA.DataEngines
while (se.MoveNext())
{
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);
try
{
for (int i = 0; i < nvc.Count; i++)
{
Secret secret = store.getSecret(se.Current);
NameValueCollection nvc = secret.getKeyValueCollection();
sKey = nvc.GetKey(i);
sValue = nvc.Get(sKey);
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);
//Key
key1 = doc.CreateElement(ConstStrings.CCF_KEY);
Atr = doc.CreateAttribute(ConstStrings.CCF_ID);
Atr.Value = sKey;
key1.SetAttributeNode(Atr);
for (int i = 0; i < nvc.Count; i++)
{
//Value
value1 = doc.CreateElement(ConstStrings.CCF_VALUE);
value1.InnerText = sValue;
sKey = nvc.GetKey(i);
sValue = nvc.Get(sKey);
key1.AppendChild(value1);
//Key
key1 = doc.CreateElement(ConstStrings.CCF_KEY);
Atr = doc.CreateAttribute(ConstStrings.CCF_ID);
mi_secret.AppendChild(key1);
Atr.Value = sKey;
key1.SetAttributeNode(Atr);
}
//Value
value1 = doc.CreateElement(ConstStrings.CCF_VALUE);
value1.InnerText = sValue;
/*
//Time
XmlElement Time1 = doc.CreateElement(ConstStrings.CCF_TIME);
key1.AppendChild(value1);
XmlElement zone1 = doc.CreateElement(ConstStrings.CCF_ZONE);
zone1.InnerText = "IST";
mi_secret.AppendChild(key1);
XmlElement cr1 = doc.CreateElement(ConstStrings.CCF_CRTIME);
cr1.InnerText = null;
}
XmlElement mod1 = doc.CreateElement(ConstStrings.CCF_MDTIME);
mod1.InnerText = null;
/*
//Time
XmlElement Time1 = doc.CreateElement(ConstStrings.CCF_TIME);
XmlElement acc1 = doc.CreateElement(ConstStrings.CCF_ACTIME);
acc1.InnerText = null;
XmlElement zone1 = doc.CreateElement(ConstStrings.CCF_ZONE);
zone1.InnerText = "IST";
Time1.AppendChild(zone1);
Time1.AppendChild(cr1);
Time1.AppendChild(mod1);
Time1.AppendChild(acc1);
XmlElement cr1 = doc.CreateElement(ConstStrings.CCF_CRTIME);
cr1.InnerText = null;
mi_secret.AppendChild(Time1);
*/
XmlElement mod1 = doc.CreateElement(ConstStrings.CCF_MDTIME);
mod1.InnerText = null;
//Finally Add Secret to Elem
keychain.AppendChild(mi_secret);
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);
}
catch (Exception)
{
//Console.WriteLine("Secret Not Found: " + se.Current);
}
}
}