How to Avoid Impl Abstract class in custom connector , as like standard connector's source code
hello , i m using Bonita community 6.3.1 i downloaded email connector from github to just examine code . i found that there is no abstract class there ,there is direct : Connector abstract class
i want to create connector same like that so i just create one connector which take 3 input and print it . when i run this ,ti done but nothing print . pl help what i done wrong .
here is connector code
package org.mycompany.connector;
import org.bonitasoft.engine.connector.ConnectorException;
import org.bonitasoft.engine.connector.ConnectorValidationException;
import org.bonitasoft.engine.connector.AbstractConnector;
import java.util.logging.Logger;
public class Log_TestImpl extends AbstractConnector {
protected final static String IP1_INPUT_PARAMETER = "ip1";
protected final static String IP2_INPUT_PARAMETER = "ip2";
protected final static String IP3_INPUT_PARAMETER = "ip3";
private Logger LOGGER = Logger.getLogger(this.getClass().getName());
@Override
public void validateInputParameters() throws ConnectorValidationException {
final String ip1 = (String) getInputParameter(IP1_INPUT_PARAMETER);
final String ip2 = (String) getInputParameter(IP2_INPUT_PARAMETER);
final String ip3 = (String) getInputParameter(IP3_INPUT_PARAMETER);
if(ip1 ==null || ip2 == null || ip3==null)
{
LOGGER.info("no null");
}
}
private void logInputParameters() {
logInputParameter(IP1_INPUT_PARAMETER);
logInputParameter(IP2_INPUT_PARAMETER);
logInputParameter(IP3_INPUT_PARAMETER);
}
private void logInputParameter(String parameterName) {
LOGGER.info(parameterName + " " + String.valueOf(getInputParameter(parameterName)));
}
@Override
protected void executeBusinessLogic() throws ConnectorException {
try {
validateInputParameters();
logInputParameters();
} catch (ConnectorValidationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void connect() throws ConnectorException {
// [Optional] Open a connection to remote server
}
@Override
public void disconnect() throws ConnectorException {
// [Optional] Close connection to remote server
}
}
import org.bonitasoft.engine.connector.ConnectorException;
import org.bonitasoft.engine.connector.ConnectorValidationException;
import org.bonitasoft.engine.connector.AbstractConnector;
import java.util.logging.Logger;
public class Log_TestImpl extends AbstractConnector {
protected final static String IP1_INPUT_PARAMETER = "ip1";
protected final static String IP2_INPUT_PARAMETER = "ip2";
protected final static String IP3_INPUT_PARAMETER = "ip3";
private Logger LOGGER = Logger.getLogger(this.getClass().getName());
@Override
public void validateInputParameters() throws ConnectorValidationException {
final String ip1 = (String) getInputParameter(IP1_INPUT_PARAMETER);
final String ip2 = (String) getInputParameter(IP2_INPUT_PARAMETER);
final String ip3 = (String) getInputParameter(IP3_INPUT_PARAMETER);
if(ip1 ==null || ip2 == null || ip3==null)
{
LOGGER.info("no null");
}
}
private void logInputParameters() {
logInputParameter(IP1_INPUT_PARAMETER);
logInputParameter(IP2_INPUT_PARAMETER);
logInputParameter(IP3_INPUT_PARAMETER);
}
private void logInputParameter(String parameterName) {
LOGGER.info(parameterName + " " + String.valueOf(getInputParameter(parameterName)));
}
@Override
protected void executeBusinessLogic() throws ConnectorException {
try {
validateInputParameters();
logInputParameters();
} catch (ConnectorValidationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void connect() throws ConnectorException {
// [Optional] Open a connection to remote server
}
@Override
public void disconnect() throws ConnectorException {
// [Optional] Close connection to remote server
}
}
here is server log
No answers yet.