public function getDomainConfiguration($domain = null)
    {
        if ($domain && isset($this->domains[$domain])) {
            return $this->domains[$domain];
        } elseif ($domain) {
            throw new InvalidArgumentException(sprintf('Domain "%s" not found.', $domain));
        } else {
            return $this->domains;
        }
    }