protected internal override object CreateBehavior ()
		{
			var table = RoutingSection.CreateFilterTable (FilterTableName);

			var cfg = new RoutingConfiguration (table, RouteOnHeadersOnly) { SoapProcessingEnabled = this.SoapProcessingEnabled };
			return new RoutingBehavior (cfg);
		}
Exemple #2
0
 public void Configuration(IAppBuilder app)
 {
     var config = new RoutingConfiguration();
     config.MapAttributeRoutes();
 }
        protected internal override object CreateBehavior()
        {
            RoutingConfiguration config;
            if (string.IsNullOrEmpty(this.FilterTableName))
            {
                config = new RoutingConfiguration();
                config.RouteOnHeadersOnly = this.RouteOnHeadersOnly;
            }
            else
            {
                config = new RoutingConfiguration(RoutingSection.CreateFilterTable(this.FilterTableName), this.RouteOnHeadersOnly);
            }

            config.SoapProcessingEnabled = this.SoapProcessingEnabled;
            config.EnsureOrderedDispatch = this.EnsureOrderedDispatch;
            RoutingBehavior behavior = new RoutingBehavior(config);
            //behavior.Impersonation = this.Impersonation;
            return behavior;
        }
 public void Setup()
 {
     var config = new RoutingConfiguration();
     config.MapAttributeRoutes();
 }
Exemple #5
0
        internal static VpnConnectionData DeserializeVpnConnectionData(JsonElement element)
        {
            Optional <ETag> etag = default;
            Optional <ResourceIdentifier>  id            = default;
            Optional <string>              name          = default;
            Optional <ResourceType>        type          = default;
            Optional <WritableSubResource> remoteVpnSite = default;
            Optional <int> routingWeight     = default;
            Optional <int> dpdTimeoutSeconds = default;
            Optional <VpnConnectionStatus> connectionStatus = default;
            Optional <VirtualNetworkGatewayConnectionProtocol> vpnConnectionProtocolType = default;
            Optional <long>   ingressBytesTransferred = default;
            Optional <long>   egressBytesTransferred  = default;
            Optional <int>    connectionBandwidth     = default;
            Optional <string> sharedKey = default;
            Optional <bool>   enableBgp = default;
            Optional <bool>   usePolicyBasedTrafficSelectors                  = default;
            Optional <IList <IPsecPolicy> >           ipsecPolicies           = default;
            Optional <IList <TrafficSelectorPolicy> > trafficSelectorPolicies = default;
            Optional <bool> enableRateLimiting     = default;
            Optional <bool> enableInternetSecurity = default;
            Optional <bool> useLocalAzureIpAddress = default;
            Optional <NetworkProvisioningState>           provisioningState  = default;
            Optional <IList <VpnSiteLinkConnectionData> > vpnLinkConnections = default;
            Optional <RoutingConfiguration> routingConfiguration             = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    etag = new ETag(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("remoteVpnSite"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            remoteVpnSite = JsonSerializer.Deserialize <WritableSubResource>(property0.Value.ToString());
                            continue;
                        }
                        if (property0.NameEquals("routingWeight"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            routingWeight = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("dpdTimeoutSeconds"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            dpdTimeoutSeconds = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("connectionStatus"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            connectionStatus = new VpnConnectionStatus(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("vpnConnectionProtocolType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            vpnConnectionProtocolType = new VirtualNetworkGatewayConnectionProtocol(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("ingressBytesTransferred"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            ingressBytesTransferred = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("egressBytesTransferred"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            egressBytesTransferred = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("connectionBandwidth"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            connectionBandwidth = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("sharedKey"))
                        {
                            sharedKey = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("enableBgp"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            enableBgp = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("usePolicyBasedTrafficSelectors"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            usePolicyBasedTrafficSelectors = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("ipsecPolicies"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <IPsecPolicy> array = new List <IPsecPolicy>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(IPsecPolicy.DeserializeIPsecPolicy(item));
                            }
                            ipsecPolicies = array;
                            continue;
                        }
                        if (property0.NameEquals("trafficSelectorPolicies"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <TrafficSelectorPolicy> array = new List <TrafficSelectorPolicy>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(TrafficSelectorPolicy.DeserializeTrafficSelectorPolicy(item));
                            }
                            trafficSelectorPolicies = array;
                            continue;
                        }
                        if (property0.NameEquals("enableRateLimiting"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            enableRateLimiting = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("enableInternetSecurity"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            enableInternetSecurity = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("useLocalAzureIpAddress"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            useLocalAzureIpAddress = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new NetworkProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("vpnLinkConnections"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <VpnSiteLinkConnectionData> array = new List <VpnSiteLinkConnectionData>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(VpnSiteLinkConnectionData.DeserializeVpnSiteLinkConnectionData(item));
                            }
                            vpnLinkConnections = array;
                            continue;
                        }
                        if (property0.NameEquals("routingConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            routingConfiguration = RoutingConfiguration.DeserializeRoutingConfiguration(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new VpnConnectionData(id.Value, name.Value, Optional.ToNullable(type), Optional.ToNullable(etag), remoteVpnSite, Optional.ToNullable(routingWeight), Optional.ToNullable(dpdTimeoutSeconds), Optional.ToNullable(connectionStatus), Optional.ToNullable(vpnConnectionProtocolType), Optional.ToNullable(ingressBytesTransferred), Optional.ToNullable(egressBytesTransferred), Optional.ToNullable(connectionBandwidth), sharedKey.Value, Optional.ToNullable(enableBgp), Optional.ToNullable(usePolicyBasedTrafficSelectors), Optional.ToList(ipsecPolicies), Optional.ToList(trafficSelectorPolicies), Optional.ToNullable(enableRateLimiting), Optional.ToNullable(enableInternetSecurity), Optional.ToNullable(useLocalAzureIpAddress), Optional.ToNullable(provisioningState), Optional.ToList(vpnLinkConnections), routingConfiguration.Value));
        }
        internal static HubVirtualNetworkConnectionData DeserializeHubVirtualNetworkConnectionData(JsonElement element)
        {
            Optional <string>               name = default;
            Optional <string>               etag = default;
            ResourceIdentifier              id   = default;
            Optional <SubResource>          remoteVirtualNetwork                = default;
            Optional <bool>                 allowHubToRemoteVnetTransit         = default;
            Optional <bool>                 allowRemoteVnetToUseHubVnetGateways = default;
            Optional <bool>                 enableInternetSecurity              = default;
            Optional <RoutingConfiguration> routingConfiguration                = default;
            Optional <ProvisioningState>    provisioningState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("remoteVirtualNetwork"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            remoteVirtualNetwork = SubResource.DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("allowHubToRemoteVnetTransit"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            allowHubToRemoteVnetTransit = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("allowRemoteVnetToUseHubVnetGateways"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            allowRemoteVnetToUseHubVnetGateways = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("enableInternetSecurity"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            enableInternetSecurity = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("routingConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            routingConfiguration = RoutingConfiguration.DeserializeRoutingConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new HubVirtualNetworkConnectionData(id, name.Value, etag.Value, remoteVirtualNetwork.Value, Optional.ToNullable(allowHubToRemoteVnetTransit), Optional.ToNullable(allowRemoteVnetToUseHubVnetGateways), Optional.ToNullable(enableInternetSecurity), routingConfiguration.Value, Optional.ToNullable(provisioningState)));
        }
 internal HubVirtualNetworkConnectionData(string id, string name, string etag, Models.SubResource remoteVirtualNetwork, bool?allowHubToRemoteVnetTransit, bool?allowRemoteVnetToUseHubVnetGateways, bool?enableInternetSecurity, RoutingConfiguration routingConfiguration, ProvisioningState?provisioningState) : base(id)
 {
     Name = name;
     Etag = etag;
     RemoteVirtualNetwork                = remoteVirtualNetwork;
     AllowHubToRemoteVnetTransit         = allowHubToRemoteVnetTransit;
     AllowRemoteVnetToUseHubVnetGateways = allowRemoteVnetToUseHubVnetGateways;
     EnableInternetSecurity              = enableInternetSecurity;
     RoutingConfiguration                = routingConfiguration;
     ProvisioningState = provisioningState;
 }
Exemple #8
0
 public T SetRoutingConfiguration(RoutingConfiguration routingConfiguration)
 {
     RoutingConfiguration = routingConfiguration;
     return(Self);
 }
Exemple #9
0
 internal ExpressRouteConnectionData(string id, string name, ProvisioningState?provisioningState, ExpressRouteCircuitPeeringId expressRouteCircuitPeering, string authorizationKey, int?routingWeight, bool?enableInternetSecurity, bool?expressRouteGatewayBypass, RoutingConfiguration routingConfiguration) : base(id)
 {
     Name = name;
     ProvisioningState          = provisioningState;
     ExpressRouteCircuitPeering = expressRouteCircuitPeering;
     AuthorizationKey           = authorizationKey;
     RoutingWeight             = routingWeight;
     EnableInternetSecurity    = enableInternetSecurity;
     ExpressRouteGatewayBypass = expressRouteGatewayBypass;
     RoutingConfiguration      = routingConfiguration;
 }
 void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
 {
     if (e.Index == 1)
     {
         LogicalName = GXCommon.ToLogicalName(e.Value);
     }
     else if (e.Index == 2)
     {
         MaxHops = Convert.ToByte(e.Value);
     }
     else if (e.Index == 3)
     {
         WeakLqiValue = Convert.ToByte(e.Value);
     }
     else if (e.Index == 4)
     {
         SecurityLevel = Convert.ToByte(e.Value);
     }
     else if (e.Index == 5)
     {
         List <object> list = new List <object>();
         if (e.Value != null)
         {
             list.AddRange((object[])e.Value);
         }
         PrefixTable = list.ToArray();
     }
     else if (e.Index == 6)
     {
         RoutingConfiguration.Clear();
         if (e.Value != null)
         {
             foreach (object v in (object[])e.Value)
             {
                 object[] tmp = (object[])v;
                 GXDLMSRoutingConfiguration it = new GXDLMSRoutingConfiguration();
                 it.NetTraversalTime     = Convert.ToByte(tmp[0]);
                 it.RoutingTableEntryTtl = Convert.ToUInt16(tmp[1]);
                 it.Kr                     = Convert.ToByte(tmp[2]);
                 it.Km                     = Convert.ToByte(tmp[3]);
                 it.Kc                     = Convert.ToByte(tmp[4]);
                 it.Kq                     = Convert.ToByte(tmp[5]);
                 it.Kh                     = Convert.ToByte(tmp[6]);
                 it.Krt                    = Convert.ToByte(tmp[7]);
                 it.RreqRetries            = Convert.ToByte(tmp[8]);
                 it.RreqRerrWait           = Convert.ToByte(tmp[9]);
                 it.BlacklistTableEntryTtl = Convert.ToUInt16(tmp[10]);
                 it.UnicastRreqGenEnable   = Convert.ToBoolean(tmp[11]);
                 it.RlcEnabled             = Convert.ToBoolean(tmp[12]);
                 it.AddRevLinkCost         = Convert.ToByte(tmp[13]);
                 RoutingConfiguration.Add(it);
             }
         }
     }
     else if (e.Index == 7)
     {
         BroadcastLogTableEntryTtl = Convert.ToUInt16(e.Value);
     }
     else if (e.Index == 8)
     {
         RoutingTable.Clear();
         if (e.Value != null)
         {
             foreach (object v in (object[])e.Value)
             {
                 object[]           tmp = (object[])v;
                 GXDLMSRoutingTable it  = new GXDLMSRoutingTable();
                 it.DestinationAddress = Convert.ToUInt16(tmp[10]);
                 it.NextHopAddress     = Convert.ToUInt16(tmp[10]);
                 it.RouteCost          = Convert.ToUInt16(tmp[10]);
                 it.HopCount           = Convert.ToByte(tmp[10]);
                 it.WeakLinkCount      = Convert.ToByte(tmp[10]);
                 it.ValidTime          = Convert.ToUInt16(tmp[10]);
                 RoutingTable.Add(it);
             }
         }
     }
     else if (e.Index == 9)
     {
         ContextInformationTable.Clear();
         if (e.Value != null)
         {
             foreach (object v in (object[])e.Value)
             {
                 object[] tmp = (object[])v;
                 GXDLMSContextInformationTable it = new GXDLMSContextInformationTable();
                 it.CID           = (string)tmp[0];
                 it.Context       = (byte[])tmp[2];
                 it.Compression   = Convert.ToBoolean(tmp[3]);
                 it.ValidLifetime = Convert.ToUInt16(tmp[4]);
                 ContextInformationTable.Add(it);
             }
         }
     }
     else if (e.Index == 10)
     {
         List <GXKeyValuePair <UInt16, UInt16> > list = new List <GXKeyValuePair <UInt16, UInt16> >();
         if (e.Value != null)
         {
             foreach (object v in (object[])e.Value)
             {
                 object[] tmp = (object[])v;
                 list.Add(new GXKeyValuePair <UInt16, UInt16>(Convert.ToUInt16(tmp[0]), Convert.ToUInt16(tmp[1])));
             }
         }
         BlacklistTable = list;
     }
     else if (e.Index == 11)
     {
         BroadcastLogTable.Clear();
         if (e.Value != null)
         {
             foreach (object v in (object[])e.Value)
             {
                 object[] tmp = (object[])v;
                 GXDLMSBroadcastLogTable it = new GXDLMSBroadcastLogTable();
                 it.SourceAddress  = Convert.ToUInt16(tmp[0]);
                 it.SequenceNumber = Convert.ToByte(tmp[1]);
                 it.ValidTime      = Convert.ToUInt16(tmp[2]);
                 BroadcastLogTable.Add(it);
             }
         }
     }
     else if (e.Index == 12)
     {
         List <UInt16> list = new List <UInt16>();
         if (e.Value != null)
         {
             foreach (object it in (object[])e.Value)
             {
                 list.Add(Convert.ToUInt16(it));
             }
         }
         GroupTable = list.ToArray();
     }
     else if (e.Index == 13)
     {
         MaxJoinWaitTime = Convert.ToUInt16(e.Value);
     }
     else if (e.Index == 14)
     {
         PathDiscoveryTime = Convert.ToByte(e.Value);
     }
     else if (e.Index == 15)
     {
         ActiveKeyIndex = Convert.ToByte(e.Value);
     }
     else if (e.Index == 16)
     {
         MetricType = Convert.ToByte(e.Value);
     }
     else if (e.Index == 17)
     {
         CoordShortAddress = Convert.ToUInt16(e.Value);
     }
     else if (e.Index == 18)
     {
         DisableDefaultRouting = (bool)e.Value;
     }
     else if (e.Index == 19)
     {
         DeviceType = (DeviceType)Convert.ToInt32(e.Value);
     }
     else
     {
         e.Error = ErrorCode.ReadWriteDenied;
     }
 }
Exemple #11
0
        internal static ExpressRouteConnectionData DeserializeExpressRouteConnectionData(JsonElement element)
        {
            Optional <ResourceIdentifier>       id   = default;
            Optional <string>                   name = default;
            Optional <ResourceType>             type = default;
            Optional <NetworkProvisioningState> provisioningState          = default;
            Optional <WritableSubResource>      expressRouteCircuitPeering = default;
            Optional <string>                   authorizationKey           = default;
            Optional <int>  routingWeight                        = default;
            Optional <bool> enableInternetSecurity               = default;
            Optional <bool> expressRouteGatewayBypass            = default;
            Optional <RoutingConfiguration> routingConfiguration = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new NetworkProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("expressRouteCircuitPeering"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            expressRouteCircuitPeering = JsonSerializer.Deserialize <WritableSubResource>(property0.Value.ToString());
                            continue;
                        }
                        if (property0.NameEquals("authorizationKey"))
                        {
                            authorizationKey = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("routingWeight"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            routingWeight = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("enableInternetSecurity"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            enableInternetSecurity = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("expressRouteGatewayBypass"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            expressRouteGatewayBypass = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("routingConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            routingConfiguration = RoutingConfiguration.DeserializeRoutingConfiguration(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ExpressRouteConnectionData(id.Value, name.Value, Optional.ToNullable(type), Optional.ToNullable(provisioningState), expressRouteCircuitPeering, authorizationKey.Value, Optional.ToNullable(routingWeight), Optional.ToNullable(enableInternetSecurity), Optional.ToNullable(expressRouteGatewayBypass), routingConfiguration.Value));
        }
 public BootstrapBuilder SetRoutingConfiguration(RoutingConfiguration routingConfiguration)
 {
     RoutingConfiguration = routingConfiguration;
     return(this);
 }
Exemple #13
0
 internal VpnConnectionData(string id, string name, string etag, WritableSubResource remoteVpnSite, int?routingWeight, int?dpdTimeoutSeconds, VpnConnectionStatus?connectionStatus, VirtualNetworkGatewayConnectionProtocol?vpnConnectionProtocolType, long?ingressBytesTransferred, long?egressBytesTransferred, int?connectionBandwidth, string sharedKey, bool?enableBgp, bool?usePolicyBasedTrafficSelectors, IList <IpsecPolicy> ipsecPolicies, IList <TrafficSelectorPolicy> trafficSelectorPolicies, bool?enableRateLimiting, bool?enableInternetSecurity, bool?useLocalAzureIpAddress, ProvisioningState?provisioningState, IList <VpnSiteLinkConnection> vpnLinkConnections, RoutingConfiguration routingConfiguration) : base(id)
 {
     Name                           = name;
     Etag                           = etag;
     RemoteVpnSite                  = remoteVpnSite;
     RoutingWeight                  = routingWeight;
     DpdTimeoutSeconds              = dpdTimeoutSeconds;
     ConnectionStatus               = connectionStatus;
     VpnConnectionProtocolType      = vpnConnectionProtocolType;
     IngressBytesTransferred        = ingressBytesTransferred;
     EgressBytesTransferred         = egressBytesTransferred;
     ConnectionBandwidth            = connectionBandwidth;
     SharedKey                      = sharedKey;
     EnableBgp                      = enableBgp;
     UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors;
     IpsecPolicies                  = ipsecPolicies;
     TrafficSelectorPolicies        = trafficSelectorPolicies;
     EnableRateLimiting             = enableRateLimiting;
     EnableInternetSecurity         = enableInternetSecurity;
     UseLocalAzureIpAddress         = useLocalAzureIpAddress;
     ProvisioningState              = provisioningState;
     VpnLinkConnections             = vpnLinkConnections;
     RoutingConfiguration           = routingConfiguration;
 }
Exemple #14
0
 internal P2SConnectionConfiguration(string id, string name, string etag, AddressSpace vpnClientAddressPool, RoutingConfiguration routingConfiguration, bool?enableInternetSecurity, ProvisioningState?provisioningState) : base(id)
 {
     Name = name;
     Etag = etag;
     VpnClientAddressPool   = vpnClientAddressPool;
     RoutingConfiguration   = routingConfiguration;
     EnableInternetSecurity = enableInternetSecurity;
     ProvisioningState      = provisioningState;
 }
    public Port(string name, Action <TransportExtensions <T> > transportCustomization, RoutingConfiguration routingConfiguration, string poisonQueue, int?maximumConcurrency, InterceptMessageForwarding interceptMethod, bool autoCreateQueues, string autoCreateQueuesIdentity, int immediateRetries, int delayedRetries, int circuitBreakerThreshold, InterBridgeRoutingSettings forwarding)
    {
        this.routingConfiguration = routingConfiguration;
        this.interceptMethod      = interceptMethod;
        this.forwarding           = forwarding;
        Name        = name;
        sendRouter  = routingConfiguration.PrepareSending();
        replyRouter = new ReplyRouter();

        rawConfig = new ThrottlingRawEndpointConfig <T>(name, poisonQueue, ext =>
        {
            SetTransportSpecificFlags(ext.GetSettings(), poisonQueue, name);
            transportCustomization?.Invoke(ext);
        },
                                                        async(context, _) =>
        {
            var intent = GetMesssageIntent(context);
            if (intent == MessageIntentEnum.Subscribe || intent == MessageIntentEnum.Unsubscribe)
            {
                await subscriptionReceiver.Receive(context, intent);
            }
            await onMessage(context);
        },
                                                        (context, dispatcher) => context.MoveToErrorQueue(poisonQueue),
                                                        maximumConcurrency,
                                                        immediateRetries, delayedRetries, circuitBreakerThreshold, autoCreateQueues, autoCreateQueuesIdentity);
    }