Catch SecretNotFound exceptions
This commit is contained in:
		| @@ -85,70 +85,77 @@ namespace Novell.CASA.DataEngines | |||||||
|  |  | ||||||
|                      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++) |                              Secret secret = store.getSecret(se.Current); | ||||||
|                         { |                              NameValueCollection nvc = secret.getKeyValueCollection(); | ||||||
|  |  | ||||||
|                                sKey = nvc.GetKey(i); |                              mi_secret = doc.CreateElement(ConstStrings.CCF_SECRET); | ||||||
|                                sValue = nvc.Get(sKey); |                              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; |                              for (int i = 0; i < nvc.Count; i++) | ||||||
|                                 key1.SetAttributeNode(Atr); |                              { | ||||||
|  |  | ||||||
|                                 //Value |                                  sKey = nvc.GetKey(i); | ||||||
|                                 value1 = doc.CreateElement(ConstStrings.CCF_VALUE); |                                  sValue = nvc.Get(sKey); | ||||||
|                                 value1.InnerText = sValue; |  | ||||||
|  |  | ||||||
|                                 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; | ||||||
|  |  | ||||||
| /* |                                  key1.AppendChild(value1); | ||||||
|                        //Time |  | ||||||
|                        XmlElement Time1 = doc.CreateElement(ConstStrings.CCF_TIME); |  | ||||||
|  |  | ||||||
|                        XmlElement zone1 = doc.CreateElement(ConstStrings.CCF_ZONE); |                                  mi_secret.AppendChild(key1); | ||||||
|                        zone1.InnerText = "IST"; |  | ||||||
|  |  | ||||||
|                        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); |                                                     XmlElement zone1 = doc.CreateElement(ConstStrings.CCF_ZONE); | ||||||
|                        acc1.InnerText = null; |                                                     zone1.InnerText = "IST"; | ||||||
|  |  | ||||||
|                        Time1.AppendChild(zone1); |                                                     XmlElement cr1 = doc.CreateElement(ConstStrings.CCF_CRTIME); | ||||||
|                        Time1.AppendChild(cr1); |                                                     cr1.InnerText = null; | ||||||
|                        Time1.AppendChild(mod1); |  | ||||||
|                        Time1.AppendChild(acc1); |  | ||||||
|  |  | ||||||
|                        mi_secret.AppendChild(Time1); |                                                     XmlElement mod1 = doc.CreateElement(ConstStrings.CCF_MDTIME); | ||||||
| */ |                                                 mod1.InnerText = null; | ||||||
|  |  | ||||||
|                       //Finally Add Secret to Elem |                                                     XmlElement acc1 = doc.CreateElement(ConstStrings.CCF_ACTIME); | ||||||
|                        keychain.AppendChild(mi_secret); |                                                     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);                              | ||||||
|  |                          } | ||||||
|                      } |                      } | ||||||
|               } |               } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user