The Casimir effect in the boundary state formalism