Пример #1
0
        /// ****************************************************************
        ///   public Get
        ///	----------------------------------------------------------------
        ///	  <summary>
        ///		Retrieves the bindingTemplate details from the database.
        ///	  </summary>
        ///	----------------------------------------------------------------
        ///   <returns>
        ///	  </returns>
        ///	----------------------------------------------------------------
        ///	  <remarks>
        ///	    The bindingKey must be set prior to execution of this call.
        ///	  </remarks>
        /// ****************************************************************
        ///
        public override void Get()
        {
            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_bindingTemplate_get_batch");

            sp.Parameters.Add("@bindingKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@serviceKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output);
            sp.Parameters.Add("@URLTypeID", SqlDbType.TinyInt, ParameterDirection.Output);
            sp.Parameters.Add("@accessPoint", SqlDbType.NVarChar, UDDI.Constants.Lengths.AccessPoint, ParameterDirection.Output);
            sp.Parameters.Add("@hostingRedirector", SqlDbType.UniqueIdentifier, ParameterDirection.Output);

            sp.Parameters.SetGuidFromString("@bindingKey", BindingKey);

            SqlDataReaderAccessor reader      = null;
            ArrayList             instanceIds = new ArrayList();

            try
            {
                //
                // net_bindingTemplate_get will return the objects contained in a business in the following order:
                //
                //	- descriptions
                //  - tmodel instance infos
                reader = sp.ExecuteReader();

                //
                // Read the descriptions
                //
                Descriptions.Read(reader);

                //
                // Read the tmodel instance infos
                //
                if (true == reader.NextResult())
                {
                    instanceIds = TModelInstanceInfos.Read(reader);
                }
            }
            finally
            {
                if (null != reader)
                {
                    reader.Close();
                }
            }

            //
            // These calls will make separate sproc calls, so we have to close our reader first.
            //
            TModelInstanceInfos.Populate(instanceIds);

            //
            // Get output parameters
            //
            ServiceKey                   = sp.Parameters.GetGuidString("@serviceKey");
            AccessPoint.URLType          = (URLType)sp.Parameters.GetInt("@URLTypeID");
            AccessPoint.Value            = sp.Parameters.GetString("@accessPoint");
            HostingRedirector.BindingKey = sp.Parameters.GetGuidString("@hostingRedirector");

#if never
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_bindingTemplate_get");

            sp.Parameters.Add("@bindingKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@serviceKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output);
            sp.Parameters.Add("@URLTypeID", SqlDbType.TinyInt, ParameterDirection.Output);
            sp.Parameters.Add("@accessPoint", SqlDbType.NVarChar, UDDI.Constants.Lengths.AccessPoint, ParameterDirection.Output);
            sp.Parameters.Add("@hostingRedirector", SqlDbType.UniqueIdentifier, ParameterDirection.Output);

            sp.Parameters.SetGuidFromString("@bindingKey", BindingKey);

            sp.ExecuteNonQuery();

            ServiceKey                   = sp.Parameters.GetGuidString("@serviceKey");
            AccessPoint.URLType          = (URLType)sp.Parameters.GetInt("@URLTypeID");
            AccessPoint.Value            = sp.Parameters.GetString("@accessPoint");
            HostingRedirector.BindingKey = sp.Parameters.GetGuidString("@hostingRedirector");

            //
            // Get all contained objects.
            //
            Descriptions.Get(BindingKey, EntityType.BindingTemplate);
            TModelInstanceInfos.Get(BindingKey);
#endif

            QueryLog.Write(QueryType.Get, EntityType.BindingTemplate);
        }
Пример #2
0
        /// ****************************************************************
        ///   public Get
        /// ----------------------------------------------------------------
        ///   <summary>
        ///   </summary>
        /// ****************************************************************
        ///
        public override void Get()
        {
            Debug.Enter();

            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_businessEntity_get_batch");

            sp.Parameters.Add("@businessKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName, ParameterDirection.Output);
            sp.Parameters.Add("@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output);

            sp.Parameters.SetGuidFromString("@businessKey", BusinessKey);

            SqlDataReaderAccessor reader     = null;
            ArrayList             contactIds = new ArrayList();

            try
            {
                //
                // net_businessEntity_get will return the objects contained in a business in the following order:
                //
                //	- descriptions
                //	- names
                //	- discoveryURLs
                //  - contacts
                //  - identifier bags
                //  - category bags
                //  - services
                //
                reader = sp.ExecuteReader();

                //
                // Read the descriptions
                //
                Descriptions.Read(reader);

                //
                // Read the names
                //
                if (true == reader.NextResult())
                {
                    Names.Read(reader);
                }

                //
                //
                // Read the discoveryURLs
                //
                if (true == reader.NextResult())
                {
                    DiscoveryUrls.Read(reader);
                }

                //
                // Read the contacts
                //
                if (true == reader.NextResult())
                {
                    contactIds = Contacts.Read(reader);
                }

                //
                // Read the identifier bags
                //
                if (true == reader.NextResult())
                {
                    IdentifierBag.Read(reader);
                }

                //
                // Read the category bags
                //
                if (true == reader.NextResult())
                {
                    CategoryBag.Read(reader);
                }

                //
                // Read the services
                //
                if (true == reader.NextResult())
                {
                    BusinessServices.Read(reader);
                }
            }
            finally
            {
                if (null != reader)
                {
                    reader.Close();
                }
            }

            //
            // These calls will make separate sproc calls, so we have to close our reader first.
            //
            BusinessServices.Populate();
            Contacts.Populate(contactIds);

            //
            // Get our output parameters.
            //
            Operator       = sp.Parameters.GetString("@operatorName");
            AuthorizedName = sp.Parameters.GetString("@authorizedName");

            //
            // If this entity was published to this node than add the
            // default discoveryURL.
            //
            if (Operator == Config.GetString("Operator"))
            {
                //
                // Only add the default discovery Url to this business
                // if it was published at this site.
                //
                DiscoveryUrls.AddDefaultDiscoveryUrl(BusinessKey);
            }

#if never
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_businessEntity_get");

            sp.Parameters.Add("@businessKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName, ParameterDirection.Output);
            sp.Parameters.Add("@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output);

            sp.Parameters.SetGuidFromString("@businessKey", BusinessKey);

            sp.ExecuteNonQuery();

            Operator       = sp.Parameters.GetString("@operatorName");
            AuthorizedName = sp.Parameters.GetString("@authorizedName");

            //
            // Retrieve contained objects.
            //
            Descriptions.Get(BusinessKey, EntityType.BusinessEntity);
            Names.Get(BusinessKey, EntityType.BusinessEntity);
            DiscoveryUrls.Get(BusinessKey);

            //
            // If this entity was published to this node than add the
            // default discoveryURL.
            //
            if (Operator == Config.GetString("Operator"))
            {
                //
                // Only add the default discovery Url to this business
                // if it was published at this site.
                //
                DiscoveryUrls.AddDefaultDiscoveryUrl(BusinessKey);
            }

            Contacts.Get(BusinessKey);
            BusinessServices.Get(BusinessKey);
            IdentifierBag.Get(BusinessKey, EntityType.BusinessEntity, KeyedReferenceType.IdentifierBag);
            CategoryBag.Get(BusinessKey, EntityType.BusinessEntity, KeyedReferenceType.CategoryBag);
#endif
            QueryLog.Write(QueryType.Get, EntityType.BusinessEntity);

            Debug.Leave();
        }
Пример #3
0
        public void Get(bool getServiceInfos)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_businessInfo_get_batch");

            sp.Parameters.Add("@businessKey", SqlDbType.UniqueIdentifier);
            sp.Parameters.Add("@getServiceInfos", SqlDbType.Bit);

            sp.Parameters.SetGuidFromString("@businessKey", BusinessKey);
            sp.Parameters.SetBool("@getServiceInfos", getServiceInfos);

            SqlDataReaderAccessor reader     = null;
            ArrayList             contactIds = new ArrayList();
            bool readServiceInfos            = false;

            try
            {
                //
                // net_businessInfo_get_batch will return the objects contained in a business in the following order:
                //
                //	- descriptions
                //	- names
                //	- serviceInfos (if specified)
                reader = sp.ExecuteReader();

                //
                // Read the descriptions
                //
                Descriptions.Read(reader);

                //
                // Read the names
                //
                if (true == reader.NextResult())
                {
                    Names.Read(reader);
                }

                //
                // Read the service infos, maybe
                //
                if (true == getServiceInfos)
                {
                    if (true == reader.NextResult())
                    {
                        ServiceInfos.Read(reader);
                        readServiceInfos = true;
                    }
                }
            }
            finally
            {
                if (null != reader)
                {
                    reader.Close();
                }
            }

            if (true == getServiceInfos && true == readServiceInfos)
            {
                ServiceInfos.Populate();
            }
#if never
            Names.Get(BusinessKey, EntityType.BusinessEntity);
            Descriptions.Get(BusinessKey, EntityType.BusinessEntity);

            if (getServiceInfos)
            {
                ServiceInfos.Get(BusinessKey);
            }
#endif
        }
Пример #4
0
        public void Get(int contactId)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_businessEntity_contact_get_batch");

            sp.Parameters.Add("@contactId", SqlDbType.BigInt);
            sp.Parameters.SetLong("@contactId", contactId);

            SqlDataReaderAccessor reader     = null;
            ArrayList             addressIDs = new ArrayList();

            try
            {
                //
                // net_businessEntity_contact_get_batch will return the objects contained in a business in the following order:
                //
                //	- descriptions
                //	- phones
                //	- emails
                //  - addresses
                reader = sp.ExecuteReader();

                //
                // Read the descriptions
                //
                Descriptions.Read(reader);

                //
                // Read the phones
                //
                if (true == reader.NextResult())
                {
                    Phones.Read(reader);
                }

                //
                // Read the emails
                //
                if (true == reader.NextResult())
                {
                    Emails.Read(reader);
                }

                //
                // Read the addresses
                //
                if (true == reader.NextResult())
                {
                    addressIDs = Addresses.Read(reader);
                }
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }

            //
            // These calls will make separate sproc calls, so we have to close our reader first.
            //
            Addresses.Populate(addressIDs);

#if never
            //
            // Call get method on sub-objects personName and UseType
            // should have been populate by contacts.get() method;
            //
            Descriptions.Get(contactId, EntityType.Contact);
            Phones.Get(contactId);
            Emails.Get(contactId);
            Addresses.Get(contactId);
#endif
        }