Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

984 lines
20 KiB

  1. using System;
  2. using System.IO;
  3. using System.Collections;
  4. using System.Collections.Specialized;
  5. using System.Diagnostics;
  6. using System.ComponentModel;
  7. using System.Xml.Serialization;
  8. using Microsoft.Uddi;
  9. using Microsoft.Uddi.Business;
  10. using Microsoft.Uddi.Service;
  11. using Microsoft.Uddi.ServiceType;
  12. namespace Microsoft.Uddi.Business
  13. {
  14. [XmlRootAttribute("delete_business", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  15. public class DeleteBusiness : UddiSecureMessage
  16. {
  17. private StringCollection businessKeys;
  18. [XmlElement("businessKey")]
  19. public StringCollection BusinessKeys
  20. {
  21. get
  22. {
  23. if( null == businessKeys )
  24. {
  25. businessKeys = new StringCollection();
  26. }
  27. return businessKeys;
  28. }
  29. set { businessKeys = value; }
  30. }
  31. }
  32. [XmlRootAttribute("find_business", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  33. public class FindBusiness : UddiQueryMessage
  34. {
  35. private NameCollection names;
  36. private KeyedReferenceCollection identifierBag;
  37. private KeyedReferenceCollection categoryBag;
  38. private StringCollection tModelKeys;
  39. private DiscoveryUrlCollection discoveryUrls;
  40. [XmlElement("name")]
  41. public NameCollection Names
  42. {
  43. get
  44. {
  45. if( null == names )
  46. {
  47. names = new NameCollection();
  48. }
  49. return names;
  50. }
  51. set { names = value; }
  52. }
  53. [XmlArray("identifierBag"), XmlArrayItem("keyedReference")]
  54. public KeyedReferenceCollection IdentifierBag
  55. {
  56. get
  57. {
  58. if( true == SerializeMode &&
  59. true == Utility.CollectionEmpty( identifierBag ) )
  60. {
  61. return null;
  62. }
  63. if( null == identifierBag )
  64. {
  65. identifierBag = new KeyedReferenceCollection();
  66. }
  67. return identifierBag;
  68. }
  69. set { identifierBag = value; }
  70. }
  71. [XmlArray("categoryBag"), XmlArrayItem("keyedReference")]
  72. public KeyedReferenceCollection CategoryBag
  73. {
  74. get
  75. {
  76. if( true == SerializeMode &&
  77. true == Utility.CollectionEmpty( categoryBag ) )
  78. {
  79. return null;
  80. }
  81. if( null == categoryBag )
  82. {
  83. categoryBag = new KeyedReferenceCollection();
  84. }
  85. return categoryBag;
  86. }
  87. set { categoryBag = value; }
  88. }
  89. [XmlArray("tModelBag"), XmlArrayItem("tModelKey")]
  90. public StringCollection TModelKeys
  91. {
  92. get
  93. {
  94. if( true == SerializeMode &&
  95. true == Utility.CollectionEmpty( tModelKeys ) )
  96. {
  97. return null;
  98. }
  99. if( null == tModelKeys )
  100. {
  101. tModelKeys = new StringCollection();
  102. }
  103. return tModelKeys;
  104. }
  105. set { tModelKeys = value; }
  106. }
  107. [XmlArray("discoveryURLs"), XmlArrayItem("discoveryURL")]
  108. public DiscoveryUrlCollection DiscoveryUrls
  109. {
  110. get
  111. {
  112. if( true == SerializeMode &&
  113. true == Utility.CollectionEmpty( discoveryUrls ) )
  114. {
  115. return null;
  116. }
  117. if( null == discoveryUrls )
  118. {
  119. discoveryUrls = new DiscoveryUrlCollection();
  120. }
  121. return discoveryUrls;
  122. }
  123. set { discoveryUrls = value; }
  124. }
  125. }
  126. [XmlRootAttribute("get_businessDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  127. public class GetBusinessDetail : UddiMessage
  128. {
  129. private StringCollection businessKeys;
  130. [XmlElement("businessKey")]
  131. public StringCollection BusinessKeys
  132. {
  133. get
  134. {
  135. if( null == businessKeys )
  136. {
  137. businessKeys = new StringCollection();
  138. }
  139. return businessKeys;
  140. }
  141. set { businessKeys = value; }
  142. }
  143. }
  144. [XmlRootAttribute("save_business", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  145. public class SaveBusiness : UddiSecureMessage
  146. {
  147. private BusinessEntityCollection businessEntities;
  148. private StringCollection uploadRegisters;
  149. [XmlElement("businessEntity")]
  150. public BusinessEntityCollection BusinessEntities
  151. {
  152. get
  153. {
  154. if( true == SerializeMode &&
  155. true == Utility.CollectionEmpty( businessEntities ) )
  156. {
  157. return null;
  158. }
  159. if( null == businessEntities )
  160. {
  161. businessEntities = new BusinessEntityCollection();
  162. }
  163. return businessEntities;
  164. }
  165. set { businessEntities = value; }
  166. }
  167. [XmlElement("uploadRegister")]
  168. public StringCollection UploadRegisters
  169. {
  170. get
  171. {
  172. if( true == SerializeMode &&
  173. true == Utility.CollectionEmpty( uploadRegisters ) )
  174. {
  175. return null;
  176. }
  177. if( null == uploadRegisters )
  178. {
  179. uploadRegisters = new StringCollection();
  180. }
  181. return uploadRegisters;
  182. }
  183. set { uploadRegisters = value; }
  184. }
  185. public override bool SerializeMode
  186. {
  187. get
  188. {
  189. return base.SerializeMode;
  190. }
  191. set
  192. {
  193. if( !Utility.CollectionEmpty( businessEntities ) )
  194. {
  195. foreach( BusinessEntity business in businessEntities )
  196. {
  197. business.SerializeMode = value;
  198. }
  199. }
  200. base.SerializeMode = value;
  201. }
  202. }
  203. }
  204. [XmlRootAttribute("get_businessDetailExt", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  205. public class GetBusinessDetailExt : UddiMessage
  206. {
  207. private StringCollection businessKeys;
  208. [XmlElement("businessKey")]
  209. public StringCollection BusinessKeys
  210. {
  211. get
  212. {
  213. if( null == businessKeys )
  214. {
  215. businessKeys = new StringCollection();
  216. }
  217. return businessKeys;
  218. }
  219. set { businessKeys = value; }
  220. }
  221. }
  222. [XmlRootAttribute("get_registeredInfo", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  223. public class GetRegisteredInfo : UddiSecureMessage
  224. {
  225. }
  226. [XmlRootAttribute("businessDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  227. public class BusinessDetail : UddiCore
  228. {
  229. private string node;
  230. private bool truncated;
  231. private BusinessEntityCollection businessEntities;
  232. [XmlAttribute("operator")]
  233. public string Operator
  234. {
  235. get { return node; }
  236. set { node = value; }
  237. }
  238. [XmlAttribute("truncated")]
  239. public bool Truncated
  240. {
  241. get { return truncated; }
  242. set { truncated = value; }
  243. }
  244. [XmlElement("businessEntity")]
  245. public BusinessEntityCollection BusinessEntities
  246. {
  247. get
  248. {
  249. if( null == businessEntities )
  250. {
  251. businessEntities = new BusinessEntityCollection();
  252. }
  253. return businessEntities;
  254. }
  255. set { businessEntities = value; }
  256. }
  257. }
  258. [XmlRootAttribute("businessDetailExt", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  259. public class BusinessDetailExt : UddiCore
  260. {
  261. private string node;
  262. private bool truncated;
  263. private BusinessEntityExtCollection businessEntitiesExt;
  264. [XmlAttribute("operator")]
  265. public string Operator
  266. {
  267. get { return node; }
  268. set { node = value; }
  269. }
  270. [XmlAttribute("truncated")]
  271. public bool Truncated
  272. {
  273. get { return truncated; }
  274. set { truncated = value; }
  275. }
  276. [XmlElement("businessEntityExt")]
  277. public BusinessEntityExtCollection BusinessEntitiesExt
  278. {
  279. get
  280. {
  281. if( null == businessEntitiesExt )
  282. {
  283. businessEntitiesExt = new BusinessEntityExtCollection();
  284. }
  285. return businessEntitiesExt;
  286. }
  287. set { businessEntitiesExt = value; }
  288. }
  289. }
  290. [XmlRootAttribute("businessList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  291. public class BusinessList : UddiCore
  292. {
  293. private string node;
  294. private bool truncated;
  295. private BusinessInfoCollection businessInfos;
  296. [XmlAttribute("operator")]
  297. public string Operator
  298. {
  299. get { return node; }
  300. set { node = value; }
  301. }
  302. [XmlAttribute("truncated")]
  303. public bool Truncated
  304. {
  305. get { return truncated; }
  306. set { truncated = value; }
  307. }
  308. [XmlArray("businessInfos"), XmlArrayItem("businessInfo")]
  309. public BusinessInfoCollection BusinessInfos
  310. {
  311. get
  312. {
  313. if( null == businessInfos )
  314. {
  315. businessInfos = new BusinessInfoCollection();
  316. }
  317. return businessInfos;
  318. }
  319. set { businessInfos = value; }
  320. }
  321. }
  322. public class BusinessEntity : UddiCore
  323. {
  324. private string businessKey;
  325. private string node;
  326. private string authorizedName;
  327. private DiscoveryUrlCollection discoveryUrls;
  328. private NameCollection names;
  329. private DescriptionCollection descriptions;
  330. private ContactCollection contacts;
  331. private BusinessServiceCollection businessServices;
  332. private KeyedReferenceCollection identifierBag;
  333. private KeyedReferenceCollection categoryBag;
  334. public BusinessEntity() : this( "" )
  335. {}
  336. public BusinessEntity( string businessKey )
  337. {
  338. BusinessKey = businessKey;
  339. }
  340. [XmlAttribute("businessKey")]
  341. public string BusinessKey
  342. {
  343. get { return businessKey; }
  344. set { businessKey = value; }
  345. }
  346. [XmlAttribute("operator")]
  347. public string Operator
  348. {
  349. get { return node; }
  350. set { node = value; }
  351. }
  352. [XmlAttribute("authorizedName")]
  353. public string AuthorizedName
  354. {
  355. get { return authorizedName; }
  356. set { authorizedName = value; }
  357. }
  358. [XmlArray("discoveryURLs"), XmlArrayItem("discoveryURL")]
  359. public DiscoveryUrlCollection DiscoveryUrls
  360. {
  361. get
  362. {
  363. if( true == SerializeMode &&
  364. true == Utility.CollectionEmpty( discoveryUrls ) )
  365. {
  366. return null;
  367. }
  368. if( null == discoveryUrls )
  369. {
  370. discoveryUrls = new DiscoveryUrlCollection();
  371. }
  372. return discoveryUrls;
  373. }
  374. set { discoveryUrls = value; }
  375. }
  376. [XmlElement("name")]
  377. public NameCollection Names
  378. {
  379. get
  380. {
  381. if( null == names )
  382. {
  383. names = new NameCollection();
  384. }
  385. return names;
  386. }
  387. set { names = value; }
  388. }
  389. [XmlElement("description")]
  390. public DescriptionCollection Descriptions
  391. {
  392. get
  393. {
  394. if( true == SerializeMode &&
  395. true == Utility.CollectionEmpty( descriptions ) )
  396. {
  397. return null;
  398. }
  399. if( null == descriptions )
  400. {
  401. descriptions = new DescriptionCollection();
  402. }
  403. return descriptions;
  404. }
  405. set { descriptions = value; }
  406. }
  407. [XmlArray("contacts"),XmlArrayItem("contact")]
  408. public ContactCollection Contacts
  409. {
  410. get
  411. {
  412. if( true == SerializeMode &&
  413. true == Utility.CollectionEmpty( contacts ) )
  414. {
  415. return null;
  416. }
  417. if( null == contacts )
  418. {
  419. contacts = new ContactCollection();
  420. }
  421. return contacts;
  422. }
  423. set { contacts = value; }
  424. }
  425. [XmlArray("businessServices"), XmlArrayItem("businessService")]
  426. public BusinessServiceCollection BusinessServices
  427. {
  428. get
  429. {
  430. if( true == SerializeMode &&
  431. true == Utility.CollectionEmpty( businessServices ) )
  432. {
  433. return null;
  434. }
  435. if( null == businessServices )
  436. {
  437. businessServices = new BusinessServiceCollection();
  438. }
  439. return businessServices;
  440. }
  441. set { businessServices = value; }
  442. }
  443. [XmlArray("identifierBag"), XmlArrayItem("keyedReference")]
  444. public KeyedReferenceCollection IdentifierBag
  445. {
  446. get
  447. {
  448. if( true == SerializeMode &&
  449. true == Utility.CollectionEmpty( identifierBag ) )
  450. {
  451. return null;
  452. }
  453. if( null == identifierBag )
  454. {
  455. identifierBag = new KeyedReferenceCollection();
  456. }
  457. return identifierBag;
  458. }
  459. set { identifierBag = value; }
  460. }
  461. [XmlArray("categoryBag"), XmlArrayItem("keyedReference")]
  462. public KeyedReferenceCollection CategoryBag
  463. {
  464. get
  465. {
  466. if( true == SerializeMode &&
  467. true == Utility.CollectionEmpty( categoryBag ) )
  468. {
  469. return null;
  470. }
  471. if( null == categoryBag )
  472. {
  473. categoryBag = new KeyedReferenceCollection();
  474. }
  475. return categoryBag;
  476. }
  477. set { categoryBag = value; }
  478. }
  479. public override bool SerializeMode
  480. {
  481. get { return base.SerializeMode; }
  482. set
  483. {
  484. if( !Utility.CollectionEmpty( businessServices ) )
  485. {
  486. foreach( BusinessService service in businessServices )
  487. {
  488. service.SerializeMode = value;
  489. }
  490. }
  491. base.SerializeMode = value;
  492. }
  493. }
  494. }
  495. public class BusinessEntityExt : UddiCore
  496. {
  497. private BusinessEntity businessEntity;
  498. public BusinessEntityExt() : this( "" )
  499. {}
  500. public BusinessEntityExt( string businessKey )
  501. {
  502. BusinessEntity.BusinessKey = businessKey;
  503. }
  504. [XmlElement("businessEntity")]
  505. public BusinessEntity BusinessEntity
  506. {
  507. get
  508. {
  509. if( null == businessEntity )
  510. {
  511. businessEntity = new BusinessEntity();
  512. }
  513. return businessEntity;
  514. }
  515. set { businessEntity = value; }
  516. }
  517. }
  518. public class BusinessInfo : UddiCore
  519. {
  520. private string businessKey;
  521. private string name;
  522. private DescriptionCollection descriptions;
  523. private ServiceInfoCollection serviceInfos;
  524. public BusinessInfo() : this( "", "" )
  525. {}
  526. public BusinessInfo( string businessKey, string name )
  527. {
  528. BusinessKey = businessKey;
  529. Name = name;
  530. }
  531. [XmlAttribute("businessKey")]
  532. public string BusinessKey
  533. {
  534. get { return businessKey; }
  535. set { businessKey = value; }
  536. }
  537. [XmlElement("name")]
  538. public string Name
  539. {
  540. get { return name; }
  541. set { name = value; }
  542. }
  543. [XmlElement("description")]
  544. public DescriptionCollection Descriptions
  545. {
  546. get
  547. {
  548. if( null == descriptions )
  549. {
  550. descriptions = new DescriptionCollection();
  551. }
  552. return descriptions;
  553. }
  554. set { descriptions = value; }
  555. }
  556. [XmlArray("serviceInfos"), XmlArrayItem("serviceInfo")]
  557. public ServiceInfoCollection ServiceInfos
  558. {
  559. get
  560. {
  561. if( null == serviceInfos )
  562. {
  563. serviceInfos = new ServiceInfoCollection();
  564. }
  565. return serviceInfos;
  566. }
  567. set { serviceInfos = value; }
  568. }
  569. }
  570. [XmlRootAttribute("registeredInfo", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  571. public class RegisteredInfo : UddiCore
  572. {
  573. private string node;
  574. private bool truncated;
  575. private BusinessInfoCollection businessInfos;
  576. private TModelInfoCollection tModelInfos;
  577. [XmlAttribute("operator")]
  578. public string Operator
  579. {
  580. get { return node; }
  581. set { node = value; }
  582. }
  583. [XmlAttribute("truncated")]
  584. public bool Truncated
  585. {
  586. get { return truncated; }
  587. set { truncated = value; }
  588. }
  589. [XmlArray("businessInfos"), XmlArrayItem("businessInfo")]
  590. public BusinessInfoCollection BusinessInfos
  591. {
  592. get
  593. {
  594. if( null == businessInfos )
  595. {
  596. businessInfos = new BusinessInfoCollection();
  597. }
  598. return businessInfos;
  599. }
  600. set { businessInfos = value; }
  601. }
  602. [XmlArray("tModelInfos"), XmlArrayItem("tModelInfo")]
  603. public TModelInfoCollection TModelInfos
  604. {
  605. get
  606. {
  607. if( null == tModelInfos )
  608. {
  609. tModelInfos = new TModelInfoCollection();
  610. }
  611. return tModelInfos;
  612. }
  613. set { tModelInfos = value; }
  614. }
  615. }
  616. public class BusinessInfoCollection : CollectionBase
  617. {
  618. public BusinessInfo this[int index]
  619. {
  620. get { return (BusinessInfo)List[index]; }
  621. set { List[index] = value; }
  622. }
  623. public int Add()
  624. {
  625. return List.Add( new BusinessInfo() );
  626. }
  627. public int Add( string businessKey, string name )
  628. {
  629. return List.Add( new BusinessInfo( businessKey, name ) );
  630. }
  631. public int Add(BusinessInfo businessInfo)
  632. {
  633. return List.Add(businessInfo);
  634. }
  635. public void Insert(int index, BusinessInfo value)
  636. {
  637. List.Insert(index, value);
  638. }
  639. public int IndexOf(BusinessInfo value)
  640. {
  641. return List.IndexOf(value);
  642. }
  643. public bool Contains(BusinessInfo value)
  644. {
  645. return List.Contains(value);
  646. }
  647. public void Remove(BusinessInfo value)
  648. {
  649. List.Remove(value);
  650. }
  651. public void CopyTo(BusinessInfo[] array, int index)
  652. {
  653. List.CopyTo(array, index);
  654. }
  655. public new BusinessInfoEnumerator GetEnumerator()
  656. {
  657. return new BusinessInfoEnumerator( List.GetEnumerator() );
  658. }
  659. }
  660. public sealed class BusinessInfoEnumerator : IEnumerator
  661. {
  662. private IEnumerator enumerator;
  663. public BusinessInfoEnumerator( IEnumerator enumerator )
  664. {
  665. this.enumerator = enumerator;
  666. }
  667. public BusinessInfo Current
  668. {
  669. get { return ( BusinessInfo ) enumerator.Current; }
  670. }
  671. object IEnumerator.Current
  672. {
  673. get{ return enumerator.Current; }
  674. }
  675. public bool MoveNext()
  676. {
  677. return enumerator.MoveNext();
  678. }
  679. public void Reset()
  680. {
  681. enumerator.Reset();
  682. }
  683. }
  684. public class BusinessEntityCollection : CollectionBase
  685. {
  686. public BusinessEntity this[int index]
  687. {
  688. get { return (BusinessEntity)List[index]; }
  689. set { List[index] = value; }
  690. }
  691. public int Add()
  692. {
  693. return List.Add( new BusinessEntity() );
  694. }
  695. public int Add( string businessKey )
  696. {
  697. return List.Add( new BusinessEntity( businessKey ) );
  698. }
  699. public int Add( BusinessEntity businessEntity )
  700. {
  701. return List.Add( businessEntity );
  702. }
  703. public void Insert( int index, BusinessEntity value )
  704. {
  705. List.Insert( index, value );
  706. }
  707. public int IndexOf( BusinessEntity value )
  708. {
  709. return List.IndexOf( value );
  710. }
  711. public bool Contains( BusinessEntity value )
  712. {
  713. return List.Contains( value );
  714. }
  715. public void Remove( BusinessEntity value )
  716. {
  717. List.Remove( value );
  718. }
  719. public void CopyTo( BusinessEntity[] array, int index )
  720. {
  721. List.CopyTo( array, index );
  722. }
  723. public new BusinessEntityEnumerator GetEnumerator()
  724. {
  725. return new BusinessEntityEnumerator( List.GetEnumerator() );
  726. }
  727. }
  728. public sealed class BusinessEntityEnumerator : IEnumerator
  729. {
  730. private IEnumerator enumerator;
  731. public BusinessEntityEnumerator( IEnumerator enumerator )
  732. {
  733. this.enumerator = enumerator;
  734. }
  735. public BusinessEntity Current
  736. {
  737. get { return ( BusinessEntity ) enumerator.Current; }
  738. }
  739. object IEnumerator.Current
  740. {
  741. get{ return enumerator.Current; }
  742. }
  743. public bool MoveNext()
  744. {
  745. return enumerator.MoveNext();
  746. }
  747. public void Reset()
  748. {
  749. enumerator.Reset();
  750. }
  751. }
  752. public class BusinessEntityExtCollection : CollectionBase
  753. {
  754. public BusinessEntityExt this[ int index ]
  755. {
  756. get { return ( BusinessEntityExt)List[index]; }
  757. set { List[ index ] = value; }
  758. }
  759. public int Add( string businessKey )
  760. {
  761. return List.Add( new BusinessEntityExt( businessKey ) );
  762. }
  763. public int Add( BusinessEntityExt businessEntityExt )
  764. {
  765. return List.Add( businessEntityExt );
  766. }
  767. public void Insert( int index, BusinessEntityExt value )
  768. {
  769. List.Insert( index, value );
  770. }
  771. public int IndexOf( BusinessEntityExt value )
  772. {
  773. return List.IndexOf( value );
  774. }
  775. public bool Contains( BusinessEntityExt value )
  776. {
  777. return List.Contains( value );
  778. }
  779. public void Remove( BusinessEntityExt value )
  780. {
  781. List.Remove( value );
  782. }
  783. public void CopyTo( BusinessEntityExt[] array, int index )
  784. {
  785. List.CopyTo( array, index );
  786. }
  787. public new BusinessEntityExtEnumerator GetEnumerator()
  788. {
  789. return new BusinessEntityExtEnumerator( List.GetEnumerator() );
  790. }
  791. }
  792. public sealed class BusinessEntityExtEnumerator : IEnumerator
  793. {
  794. private IEnumerator enumerator;
  795. public BusinessEntityExtEnumerator( IEnumerator enumerator )
  796. {
  797. this.enumerator = enumerator;
  798. }
  799. public BusinessEntityExt Current
  800. {
  801. get { return ( BusinessEntityExt ) enumerator.Current; }
  802. }
  803. object IEnumerator.Current
  804. {
  805. get{ return enumerator.Current; }
  806. }
  807. public bool MoveNext()
  808. {
  809. return enumerator.MoveNext();
  810. }
  811. public void Reset()
  812. {
  813. enumerator.Reset();
  814. }
  815. }
  816. }