final String description,
final String redirectUri) {
// Basic validation for the authentication token.
if(authToken == null) {
throw new OmhException("The authentication token is null.");
}
else {
this.authToken = authToken;
}
// Basic validation for the name.
if(name == null) {
throw new OmhException("The name is null.");
}
else {
this.name = name;
}
// Basic validation for the description.
if(description == null) {
throw new OmhException("The description is null.");
}
else {
this.description = description;
}
// Basic validation for the redirect URI.
if(redirectUri == null) {
throw new OmhException("The redirect URI is null.");
}
else {
try {
this.redirectUri = new URI(redirectUri);
}
catch(URISyntaxException e) {
throw
new OmhException(
"The redirect URI is not a valid URI.",
e);
}
// TODO: We may want to do more thorough validation of the request