  We study all-optical switches operating on a single four-level atom with the
$N$-type transition configuration in a two-mode nanofiber cavity with a
significant length (on the order of $20$ mm) and a moderate finesse (on the
order of 300) under the electromagnetically induced transparency (EIT)
conditions. In our model, the gate and probe fields are the quantum
nanofiber-cavity fields excited by weak classical light pulses, and the
parameters of the $D_2$ line of atomic cesium are used. We examine two
different switching schemes. The first scheme is based on the effect of the
presence of a photon in the gate mode on the EIT of the probe mode. The second
scheme is based on the use of EIT to store a photon of the gate mode in the
population of an appropriate atomic level, which leads to the reduction of the
transmission of the field in the probe mode. We investigate the dependencies of
the switching contrast on various parameters, such as the cavity length, the
mirror reflectivity, and the detunings and powers of the cavity driving field
pulses. For a nanofiber cavity with fiber radius of 250 nm, cavity length of 20
mm, and cavity finesse of 313 and a cesium atom at a distance of 200 nm from
the fiber surface, we numerically obtain a switching contrast on the order of
about 67% for the first scheme and of about 95% for the second scheme. These
switching operations require small mean numbers of photons in the nanofiber
cavity gate and probe modes.
