public void onSave() {
    if (config == null) {
      return;
    }

    removeUnusedEndpoints();

    // remove unused
    for (int c = 0; c < config.sizeOfEndpointArray(); c++) {
      EndpointConfig ec = config.getEndpointArray(c);
      if (StringUtils.isNullOrEmpty(ec.getDomain())
          && StringUtils.isNullOrEmpty(ec.getUsername())
          && StringUtils.isNullOrEmpty(ec.getPassword())
          && StringUtils.isNullOrEmpty(ec.getWssType())
          && StringUtils.isNullOrEmpty(ec.getWssTimeToLive())
          && StringUtils.isNullOrEmpty(ec.getIncomingWss())
          && StringUtils.isNullOrEmpty(ec.getOutgoingWss())
          && ec.getMode() == EndpointConfig.Mode.COMPLEMENT) {
        synchronized (defaults) {
          defaults.remove(ec.getStringValue());
          config.removeEndpoint(c);
          c--;
        }
      }
    }

    if (config.sizeOfEndpointArray() == 0) {
      project.getConfig().unsetEndpointStrategy();
      config = null;
    }
  }
    public EndpointDefaults(EndpointConfig endpointConfig) {
      this.endpointConfig = endpointConfig;

      if (!endpointConfig.isSetMode()) {
        endpointConfig.setMode(EndpointConfig.Mode.COMPLEMENT);
      }
    }
 public void setWssType(String wssPasswordType) {
   if (wssPasswordType == null || wssPasswordType.equals(WsdlRequest.PW_TYPE_NONE)) {
     if (endpointConfig.isSetWssType()) {
       endpointConfig.unsetWssType();
     }
   } else {
     endpointConfig.setWssType(wssPasswordType);
   }
 }
  public EndpointDefaults getEndpointDefaults(String endpoint) {
    if (config == null) {
      initConfig();
    }

    if (!defaults.containsKey(endpoint)) {
      synchronized (defaults) {
        EndpointConfig newEndpoint = config.addNewEndpoint();
        newEndpoint.setStringValue(endpoint);
        defaults.put(endpoint, new EndpointDefaults(newEndpoint));
      }
    }

    return defaults.get(endpoint);
  }
 public String getWssType() {
   String wssPasswordType = endpointConfig.getWssType();
   return StringUtils.isNullOrEmpty(wssPasswordType)
           || WsdlRequest.PW_TYPE_NONE.equals(wssPasswordType)
       ? null
       : wssPasswordType;
 }
  private void initConfig() {
    ProjectConfig projectConfig = this.project.getConfig();

    if (!projectConfig.isSetEndpointStrategy()) {
      projectConfig.addNewEndpointStrategy();
    }

    config =
        (DefaultEndpointStrategyConfig)
            projectConfig.getEndpointStrategy().changeType(DefaultEndpointStrategyConfig.type);

    for (EndpointConfig endpointConfig : config.getEndpointList()) {
      if (!endpointConfig.isSetMode()) {
        endpointConfig.setMode(EndpointConfig.Mode.COMPLEMENT);
      }

      defaults.put(endpointConfig.getStringValue(), new EndpointDefaults(endpointConfig));
    }
  }
 public String getIncomingWss() {
   return endpointConfig.getIncomingWss();
 }
 public String getUsername() {
   return endpointConfig.getUsername();
 }
 public String getPassword() {
   return endpointConfig.getPassword();
 }
 public EndpointConfig.Mode.Enum getMode() {
   return endpointConfig.getMode();
 }
 public void setMode(EndpointConfig.Mode.Enum mode) {
   endpointConfig.setMode(mode);
 }
 public void setOutgoingWss(String arg0) {
   endpointConfig.setOutgoingWss(arg0);
 }
 public String getWssTimeToLive() {
   return endpointConfig.getWssTimeToLive();
 }
 public String getOutgoingWss() {
   return endpointConfig.getOutgoingWss();
 }
 public void setIncomingWss(String arg0) {
   endpointConfig.setIncomingWss(arg0);
 }
 public String getDomain() {
   return endpointConfig.getDomain();
 }
 public void setWssTimeToLive(String arg0) {
   endpointConfig.setWssTimeToLive(arg0);
 }
 public void setUsername(String arg0) {
   endpointConfig.setUsername(arg0);
 }
 public void setPassword(String arg0) {
   endpointConfig.setPassword(arg0);
 }
 public void setDomain(String arg0) {
   endpointConfig.setDomain(arg0);
 }