// UplinkConnections retrieves the list of child UplinkConnections of the VLANTemplate
508633
func (o *VLANTemplate) UplinkConnections(info *bambou.FetchingInfo) (UplinkConnectionsList, *bambou.Error) {

	var list UplinkConnectionsList
	err := bambou.CurrentSession().FetchChildren(o, UplinkConnectionIdentity, &list, info)
	return list, err
}
1048350
func NetworkRestGetConnections(context *gin.Context) {
	body, err := network.ServiceGetConnections()
	util.RestHandleResponse(context, body, err)
}
40108
func (o *UplinkConnection) Metadatas(info *bambou.FetchingInfo) (MetadatasList, *bambou.Error) {

	var list MetadatasList
	err := bambou.CurrentSession().FetchChildren(o, MetadataIdentity, &list, info)
	return list, err
}
96549
func (client *Client) WrapConnection(wrapper ConnectionWrapper) {
	client.connection = wrapper.Wrap(client.connection)
}
453600
func (t *Template) GetAllAWSGlueConnectionResources() map[string]*resources.AWSGlueConnection {
	results := map[string]*resources.AWSGlueConnection{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSGlueConnection:
			results[name] = resource
		}
	}
	return results
}
832602
func (o *VLAN) IKEGatewayConnections(info *bambou.FetchingInfo) (IKEGatewayConnectionsList, *bambou.Error) {

	var list IKEGatewayConnectionsList
	err := bambou.CurrentSession().FetchChildren(o, IKEGatewayConnectionIdentity, &list, info)
	return list, err
}
1237509
func (s *Connections) SetConnections(v []*Connection) *Connections {
	s.Connections = v
	return s
}
1095924
func (s *DirectoryDescription) SetConnectSettings(v *DirectoryConnectSettingsDescription) *DirectoryDescription {
	s.ConnectSettings = v
	return s
}
168381
func (c *DefaultClient) PublishUplinkFields(appID string, devID string, fields map[string]interface{}) Token {
	flattenedFields := make(map[string]interface{})
	flatten("", "/", fields, flattenedFields)
	tokens := make([]Token, 0, len(flattenedFields))
	for field, value := range flattenedFields {
		topic := DeviceTopic{appID, devID, DeviceUplink, field}
		pld, _ := json.Marshal(value)
		token := c.publish(topic.String(), pld)
		tokens = append(tokens, token)
	}
	t := newToken()
	go func() {
		for _, token := range tokens {
			token.Wait()
			if token.Error() != nil {
				c.ctx.Warnf("mqtt: error publishing uplink fields: %s", token.Error())
				t.err = token.Error()
			}
		}
		t.flowComplete()
	}()
	return t
}
1180502
func (sw *OvsSwitch) RemoveUplinks() error {

	var err error

	// some error checking
	if sw.netType != "vlan" {
		log.Fatalf("Can not remove uplink from OVS type %s.", sw.netType)
	}

	for intfListObj := range sw.uplinkDb.IterBuffered() {
		intfList := intfListObj.Val.([]string)
		portName := intfListObj.Key

		// Remove uplink from agent
		err = sw.ofnetAgent.RemoveUplink(portName)
		if err != nil {
			log.Errorf("Error removing uplink %s. Err: %v", portName, err)
			return err
		}
		log.Infof("Removed uplink %s from ofnet", portName)

		isPortPresent := sw.ovsdbDriver.IsPortNamePresent(portName)
		if len(intfList) == 1 {
			isPortPresent = sw.ovsdbDriver.IsPortNamePresent(intfList[0])
		}
		if isPortPresent {
			if len(intfList) == 1 {
				err = sw.ovsdbDriver.DeletePort(intfList[0])
			} else {
				err = sw.ovsdbDriver.DeletePortBond(portName, intfList)
			}
			if err != nil {
				log.Errorf("Error deleting uplink %s from OVS. Err: %v", portName, err)
				return err
			}
		}
		time.Sleep(time.Second)
		sw.uplinkDb.Remove(portName)

		log.Infof("Removed uplink %s(%+v) from OVS switch %s.", portName, intfList, sw.bridgeName)
	}

	return nil
}
1331437
func (s *Job) SetConnections(v *ConnectionsList) *Job {
	s.Connections = v
	return s
}
404872
func (c *Client) ConnectToTLS(addr string, skipVerify bool) error {
	conn, err := tls.Dial("tcp", addr, &tls.Config{
		InsecureSkipVerify: skipVerify,
	})
	if err != nil {
		return err
	}
	c.conn = conn
	c.IncomingMsgChan = make(chan *message.Message, 10)

	if err = c.handleHandshake(); err != nil {
		return err
	}

	c.closeChan = make(chan struct{})
	return nil
}
154835
func (st *State) AllLinkLayerDevices() (devices []*LinkLayerDevice, err error) {
	devicesCollection, closer := st.db().GetCollection(linkLayerDevicesC)
	defer closer()

	sdocs := []linkLayerDeviceDoc{}
	err = devicesCollection.Find(nil).All(&sdocs)
	if err != nil {
		return nil, errors.Errorf("cannot get all link layer devices")
	}
	for _, d := range sdocs {
		devices = append(devices, newLinkLayerDevice(st, d))
	}
	return devices, nil
}
518618
func (n *NotifyRouter) AddConnection(xp rpc.Transporter, ch chan error) ConnectionID {
	if n == nil {
		return 0
	}
	id := n.cm.AddConnection(xp, ch)
	n.setNotificationChannels(id, keybase1.NotificationChannels{})
	return id
}
473434
func (c *Client) ListConnections() (rec []ConnectionInfo, err error) {
	req, err := newGETRequest(c, "connections")
	if err != nil {
		return []ConnectionInfo{}, err
	}

	if err = executeAndParseRequest(c, req, &rec); err != nil {
		return []ConnectionInfo{}, err
	}

	return rec, nil
}
1249276
func maybeWrapForConnectionUpgrades(restConfig *restclient.Config, rt http.RoundTripper, req *http.Request) (http.RoundTripper, bool, error) {
	if !httpstream.IsUpgradeRequest(req) {
		return rt, false, nil
	}

	tlsConfig, err := restclient.TLSConfigFor(restConfig)
	if err != nil {
		return nil, true, err
	}
	followRedirects := utilfeature.DefaultFeatureGate.Enabled(genericfeatures.StreamingProxyRedirects)
	requireSameHostRedirects := utilfeature.DefaultFeatureGate.Enabled(genericfeatures.ValidateProxyRedirects)
	upgradeRoundTripper := spdy.NewRoundTripper(tlsConfig, followRedirects, requireSameHostRedirects)
	wrappedRT, err := restclient.HTTPWrappersForConfig(restConfig, upgradeRoundTripper)
	if err != nil {
		return nil, true, err
	}

	return wrappedRT, true, nil
}
603031
func (s *Server) GetConnections() []Connection {
	// first call of Range to get the total length, we don't want to use append or manually grow the list here for many reasons.
	length := s.GetTotalConnections()
	conns := make([]Connection, length, length)
	i := 0
	// second call of Range.
	s.connections.Range(func(k, v interface{}) bool {
		conn, ok := v.(*connection)
		if !ok {
			// if for some reason (should never happen), the value is not stored as *connection
			// then stop the iteration and don't continue insertion of the result connections
			// in order to avoid any issues while end-dev will try to iterate a nil entry.
			return false
		}
		conns[i] = conn
		i++
		return true
	})

	return conns
}