Skip to content

Add Ssl enum #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions embulk-input-jdbc/src/main/java/org/embulk/input/jdbc/Ssl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.embulk.input.jdbc;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import org.embulk.config.ConfigException;

public enum Ssl
{
ENABLE,
DISABLE,
VERIFY;

@JsonValue
@Override
public String toString()
{
return this.name().toLowerCase();
}

@JsonCreator
public static Ssl fromString(String value)
{
switch(value) {
case "enable":
case "true":
return ENABLE;
case "disable":
case "false":
return DISABLE;
case "verify":
return VERIFY;
default:
throw new ConfigException(String.format("Unknown SSL value '%s'. Supported values are enable, true, disable, false or verify.", value));
}
}
}