/*
   * @see org.societies.privacytrust.trust.api.model.ITrustedService#setProvider(org.societies.privacytrust.trust.api.model.ITrustedCss)
   */
  @Override
  public void setProvider(ITrustedCss provider) {

    if (this.provider == null && provider != null) {

      if (!provider.getServices().contains(this)) provider.getServices().add(this);
    } else if (this.provider != null) {

      if (this.provider.getServices().contains(this)) this.provider.getServices().remove(this);

      if (provider != null && !provider.getServices().contains(this))
        provider.getServices().add(this);
    }

    this.provider = provider;
  }