public LdapConfigurationResponse(final String hostname, final int port, final String domainId) { this(hostname, port); setDomainId(domainId); }
public LdapConfigurationResponse(final String hostname) { super(); setHostname(hostname); }
public LdapConfigurationResponse(final String hostname, final int port) { this(hostname); setPort(port); }
@Override public void execute() throws ServerApiException { try { final LdapConfigurationResponse response = _ldapManager.addConfiguration(hostname, port, domainId); response.setObjectName("LdapAddConfiguration"); response.setResponseName(getCommandName()); setResponseObject(response); } catch (final InvalidParameterValueException e) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.toString()); } }
private List<LdapConfigurationResponse> createLdapConfigurationResponses(final List<? extends LdapConfigurationVO> configurations) { final List<LdapConfigurationResponse> responses = new ArrayList<LdapConfigurationResponse>(); for (final LdapConfigurationVO resource : configurations) { final LdapConfigurationResponse configurationResponse = _ldapManager.createLdapConfigurationResponse(resource); configurationResponse.setObjectName("LdapConfiguration"); responses.add(configurationResponse); } return responses; }
@Override public LdapConfigurationResponse createLdapConfigurationResponse(final LdapConfigurationVO configuration) { String domainUuid = null; if(configuration.getDomainId() != null) { domainUuid = domainDao.findById(configuration.getDomainId()).getUuid(); } return new LdapConfigurationResponse(configuration.getHostname(), configuration.getPort(), domainUuid); }
@Override public void execute() throws ServerApiException { try { final LdapConfigurationResponse response = _ldapManager.deleteConfiguration(this); response.setObjectName("LdapDeleteConfiguration"); response.setResponseName(getCommandName()); setResponseObject(response); } catch (final InvalidParameterValueException e) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.toString()); } }