We show that a stationary IDp process (i.e., an infinitely divisible stationary process without Gaussian part) can be written as the independent sum of four stationary IDp processes, each of them belonging to a different class characterized by its Lévy measure. The ergodic properties of each class are, respectively, nonergodicity, weak mixing, mixing of all order and Bernoullicity. To obtain these results, we use the representation of an IDp process as an integral with respect to a Poisson measure, which, more generally, has led us to study basic ergodic properties of these objects.