use of password.pwm.config.value.data.RemoteWebServiceConfiguration in project pwm by pwm-project.
the class RemoteWebServiceCertImportFunction method getUri.
@Override
String getUri(final StoredConfigurationImpl storedConfiguration, final PwmSetting pwmSetting, final String profile, final String extraData) throws PwmOperationalException {
final RemoteWebServiceValue actionValue = (RemoteWebServiceValue) storedConfiguration.readSetting(pwmSetting, profile);
final String serviceName = actionNameFromExtraData(extraData);
final RemoteWebServiceConfiguration action = actionValue.forName(serviceName);
final String uriString = action.getUrl();
if (uriString == null || uriString.isEmpty()) {
final ErrorInformation errorInformation = new ErrorInformation(PwmError.CONFIG_FORMAT_ERROR, "Setting " + pwmSetting.toMenuLocationDebug(profile, null) + " action " + serviceName + " must first be configured");
throw new PwmOperationalException(errorInformation);
}
try {
URI.create(uriString);
} catch (IllegalArgumentException e) {
final ErrorInformation errorInformation = new ErrorInformation(PwmError.CONFIG_FORMAT_ERROR, "Setting " + pwmSetting.toMenuLocationDebug(profile, null) + " action " + serviceName + " has an invalid URL syntax");
throw new PwmOperationalException(errorInformation);
}
return uriString;
}
Aggregations