use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class FileSystemActor method checkConfiguration.
private void checkConfiguration(FileSystemAction action2) throws ConfigurationException {
if (!actions.contains(action2))
throw new ConfigurationException(ClassUtils.nameOf(owner) + ": unknown or invalid action [" + action2 + "] supported actions are " + actions.toString() + "");
// Check if necessary parameters are available
actionRequiresAtLeastOneOfTwoParametersOrAttribute(owner, parameterList, action2, FileSystemAction.WRITE, PARAMETER_CONTENTS1, PARAMETER_FILENAME, "filename", getFilename());
actionRequiresAtLeastOneOfTwoParametersOrAttribute(owner, parameterList, action2, FileSystemAction.MOVE, PARAMETER_DESTINATION, null, "destination", getDestination());
actionRequiresAtLeastOneOfTwoParametersOrAttribute(owner, parameterList, action2, FileSystemAction.COPY, PARAMETER_DESTINATION, null, "destination", getDestination());
actionRequiresAtLeastOneOfTwoParametersOrAttribute(owner, parameterList, action2, FileSystemAction.RENAME, PARAMETER_DESTINATION, null, "destination", getDestination());
actionRequiresAtLeastOneOfTwoParametersOrAttribute(owner, parameterList, action2, FileSystemAction.FORWARD, PARAMETER_DESTINATION, null, "destination", getDestination());
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class FileSystemActor method configure.
public void configure(FS fileSystem, ParameterList parameterList, IConfigurable owner) throws ConfigurationException {
this.owner = owner;
this.fileSystem = fileSystem;
this.parameterList = parameterList;
if (fileSystem instanceof IWritableFileSystem) {
actions.addAll(Arrays.asList(ACTIONS_WRITABLE_FS));
}
if (fileSystem instanceof IMailFileSystem) {
actions.addAll(Arrays.asList(ACTIONS_MAIL_FS));
}
if (parameterList != null && parameterList.findParameter(PARAMETER_CONTENTS2) != null && parameterList.findParameter(PARAMETER_CONTENTS1) == null) {
ConfigurationWarnings.add(owner, log, "parameter [" + PARAMETER_CONTENTS2 + "] has been replaced with [" + PARAMETER_CONTENTS1 + "]");
parameterList.findParameter(PARAMETER_CONTENTS2).setName(PARAMETER_CONTENTS1);
}
if (action != null) {
if (getAction() == FileSystemAction.DOWNLOAD) {
ConfigurationWarnings.add(owner, log, "action [" + FileSystemAction.DOWNLOAD + "] has been replaced with [" + FileSystemAction.READ + "]");
action = FileSystemAction.READ;
}
if (getAction() == FileSystemAction.UPLOAD) {
ConfigurationWarnings.add(owner, log, "action [" + FileSystemAction.UPLOAD + "] has been replaced with [" + FileSystemAction.WRITE + "]");
action = FileSystemAction.WRITE;
}
checkConfiguration(getAction());
} else if (parameterList == null || parameterList.findParameter(PARAMETER_ACTION) == null) {
throw new ConfigurationException(ClassUtils.nameOf(owner) + ": either attribute [action] or parameter [" + PARAMETER_ACTION + "] must be specified");
}
if (StringUtils.isNotEmpty(getInputFolder()) && parameterList != null && parameterList.findParameter(PARAMETER_INPUTFOLDER) != null) {
ConfigurationWarnings.add(owner, log, "inputFolder configured via attribute [inputFolder] as well as via parameter [" + PARAMETER_INPUTFOLDER + "], parameter will be ignored");
}
if (!(fileSystem instanceof IWritableFileSystem)) {
if (getNumberOfBackups() > 0) {
throw new ConfigurationException("FileSystem [" + ClassUtils.nameOf(fileSystem) + "] does not support setting attribute 'numberOfBackups'");
}
if (getRotateDays() > 0) {
throw new ConfigurationException("FileSystem [" + ClassUtils.nameOf(fileSystem) + "] does not support setting attribute 'rotateDays'");
}
}
eolArray = System.getProperty("line.separator").getBytes();
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class WebServiceListener method configure.
/**
* initialize listener and register <code>this</code> to the JNDI
*/
@Override
public void configure() throws ConfigurationException {
super.configure();
if (StringUtils.isEmpty(getAddress()) && isMtomEnabled())
throw new ConfigurationException("can only use MTOM when address attribute has been set");
if (StringUtils.isNotEmpty(getAddress()) && getAddress().contains(":"))
throw new ConfigurationException("address cannot contain colon ( : ) character");
if (StringUtils.isNotEmpty(getAttachmentSessionKeys())) {
StringTokenizer stringTokenizer = new StringTokenizer(getAttachmentSessionKeys(), " ,;");
while (stringTokenizer.hasMoreTokens()) {
attachmentSessionKeysList.add(stringTokenizer.nextToken());
}
}
if (isSoap()) {
// String msg = ClassUtils.nameOf(this) +"["+getName()+"]: the use of attribute soap=true has been deprecated. Please use the SoapWrapperPipe instead";
// ConfigurationWarnings.getInstance().add(log, msg, true);
soapWrapper = SoapWrapper.getInstance();
}
if (StringUtils.isEmpty(getServiceNamespaceURI()) && StringUtils.isEmpty(getAddress())) {
String msg = "calling webservices via de ServiceDispatcher_ServiceProxy is deprecated. Please specify an address or serviceNamespaceURI and modify the call accordingly";
ConfigurationWarnings.add(this, log, msg, SuppressKeys.DEPRECATION_SUPPRESS_KEY, null);
}
Bus bus = getApplicationContext().getBean("cxf", Bus.class);
if (bus instanceof SpringBus) {
cxfBus = (SpringBus) bus;
log.debug("found CXF SpringBus id [" + bus.getId() + "]");
} else {
throw new ConfigurationException("unable to find SpringBus, cannot register " + this.getClass().getSimpleName());
}
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class Samba1FileSystem method configure.
@Override
public void configure() throws ConfigurationException {
if (getShare() == null)
throw new ConfigurationException("server share endpoint is required");
if (!getShare().startsWith("smb://"))
throw new ConfigurationException("attribute share must begin with [smb://]");
// Setup credentials if applied, may be null.
// NOTE: When using NtmlPasswordAuthentication without username it returns GUEST
CredentialFactory cf = new CredentialFactory(getAuthAlias(), getUsername(), getPassword());
if (StringUtils.isNotEmpty(cf.getUsername())) {
auth = new NtlmPasswordAuthentication(getDomain(), cf.getUsername(), cf.getPassword());
log.debug("setting authentication to [" + auth.toString() + "]");
}
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class IbisWebServiceSender method configure.
@Override
public void configure() throws ConfigurationException {
if (ibisInstance == null) {
ibisInstance = AppConstants.getInstance().getResolvedProperty("instance.name");
}
try {
proxy = new ServiceDispatcher_ServiceProxy();
proxy.setEndPoint(new URL(getEndPoint()));
} catch (MalformedURLException e) {
throw new ConfigurationException("IbisWebServiceSender cannot find URL from [" + getEndPoint() + "]", e);
}
}
Aggregations