The measures mentioned in article 515-11 are taken for a maximum period of six months from notification of the order. They may be extended if, during this period, an application for divorce or legal separation has been filed or if the family court has been seised of an application relating to the exercise of parental authority. The family affairs judge may, at any time, at the request of the public prosecutor or either of the parties, or after having carried out any useful investigative measure, and after having invited each of them to express their views, cancel or modify all or part of the measures set out in the protection order, decide on new measures, grant the defendant a temporary dispensation from observing some of the obligations imposed on him or her, or revoke the protection order.