Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import org.mule.runtime.api.connection.ConnectionException;
import org.mule.runtime.extension.api.annotation.param.Parameter;
import org.mule.runtime.extension.api.annotation.param.Optional;
import org.mule.runtime.api.connection.ConnectionValidationResult;
import org.mule.runtime.api.connection.ConnectionProvider;
import org.mule.runtime.extension.api.annotation.param.display.DisplayName;
public class MyFirstConnectorConnectionProvider
implements PoolingConnectionProvider<MyFirstConnectorConnection> {
@Parameter
private String requiredParameter;
@Parameter
@DisplayName("Optional Parameter")
@Optional(defaultValue = "100")
private int optionalParam;
@Override
public MyFirstConnectorConnection connect() throws ConnectionException {
//TODO: Connect
}
@Override
public void disconnect(MyFirstConnectorConnection connection) {
//TODO: Disconnect
}
@Override
public ConnectionValidationResult validate(MyFirstConnectorConnection connection) {
//TODO: Validate the connection
return ConnectionValidationResult.success();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.