class CumulusVlanHelper {

    protected Configuration updateVlanConfiguration( SwitchVlan vlan, Configuration configuration )
        throws HmsOobNetworkException
    {
        Bridge vRackBridge = configuration.bridges.get( 0 );

        List<SwitchPort> taggedPorts = configuration.convertToSwitchPorts( vlan.getTaggedPorts() );

        // TODO: Untagged ports !!!
        // List<SwitchPort> untaggedPorts = configuration.convertToSwitchPorts(vlan.getUntaggedPorts());

        if ( vRackBridge.vlans == null )
            vRackBridge.vlans = new ArrayList<>();

        if ( !vRackBridge.vlans.contains( vlan.getId() ) )
            vRackBridge.vlans.add( vlan.getId() );
        if ( taggedPorts != null )
        {
            for ( SwitchPort taggedPort : taggedPorts )
            {
                if ( taggedPort.vlans == null )
                    taggedPort.vlans = new ArrayList<>();

                if ( !taggedPort.vlans.contains( vlan.getId() ) )
                    taggedPort.vlans.add( vlan.getId() );

                if ( configuration.getConfigBlock( taggedPort.name ) == null )
                    configuration.switchPorts.add( taggedPort );

                taggedPort.setParentBridge( vRackBridge );

                if ( !vRackBridge.members.contains( taggedPort ) )
                    vRackBridge.members.add( taggedPort );
            }
        }

        /*****************************************************************
         * Switch Virtual Interface handling
         *****************************************************************/
        CumulusSviHelper.updateVlanInConfiguration( vRackBridge.name, vlan, configuration );

        return configuration;
    }

    public  CumulusVlanHelper( CumulusTorSwitchService service );

}