@Override public boolean loadConfiguration(ParameterInclude params) throws AxisFault { String name = ParamUtils.getOptionalParam(params, PipeConstants.NAME_KEY); if (name == null) { return false; } pipe = new File(name); return super.loadConfiguration(params); }
public boolean loadConfiguration(ParameterInclude params) throws AxisFault { port = ParamUtils.getOptionalParamInt(params, TCPConstants.PARAM_PORT, -1); if (port == -1) { return false; } contentType = ParamUtils.getOptionalParam(params, TCPConstants.PARAM_CONTENT_TYPE); if (contentType == null) { contentType = TCPConstants.TCP_DEFAULT_CONTENT_TYPE; } host = ParamUtils.getOptionalParam(params, TCPConstants.PARAM_HOST); backlog = ParamUtils.getOptionalParamInt(params, TCPConstants.PARAM_BACKLOG, TCPConstants.TCP_DEFAULT_BACKLOG); return true; }
public void init(ParameterInclude paramInclude) throws AxisFault { delimiter = (byte)ParamUtils.getRequiredParamInt(paramInclude, "delimiter"); }
public static int getRequiredParamInt(ParameterInclude paramInclude, String paramName) throws AxisFault { Integer value = getOptionalParamInt(paramInclude, paramName); if (value == null) { throw new AxisFault("Cannot find parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } else { return value.intValue(); } }
resolveHostsDynamically = ParamUtils.getOptionalParamBoolean(params, VFSConstants.TRANSPORT_FILE_RESOLVEHOST_DYNAMICALLY, false); fileURI = ParamUtils.getOptionalParam(params, VFSConstants.TRANSPORT_FILE_FILE_URI); if (fileURI == null) { log.warn("transport.vfs.FileURI parameter is missing in the proxy service configuration"); replyFileURI = ParamUtils.getOptionalParam(params, VFSConstants.REPLY_FILE_URI); replyFileURI = resolveHostAtDeployment(replyFileURI); fileNamePattern = ParamUtils.getOptionalParam(params, VFSConstants.TRANSPORT_FILE_FILE_NAME_PATTERN); contentType = ParamUtils.getRequiredParam(params, VFSConstants.TRANSPORT_FILE_CONTENT_TYPE); String option = ParamUtils.getOptionalParam( params, VFSConstants.TRANSPORT_FILE_ACTION_AFTER_PROCESS); if (option == null) { option = ParamUtils.getOptionalParam( params, VFSConstants.TRANSPORT_FILE_ACTION_AFTER_ERRORS); actionAfterErrors = VFSTransportListener.MOVE.equals(option) ? PollTableEntry.MOVE : PollTableEntry.DELETE; option = ParamUtils.getOptionalParam( params, VFSConstants.TRANSPORT_FILE_ACTION_AFTER_FAILURE); if (option == null) { String moveDirectoryAfterProcess = ParamUtils.getOptionalParam(
public static int getOptionalParamInt(ParameterInclude paramInclude, String paramName, int defaultValue) throws AxisFault { Integer value = getOptionalParamInt(paramInclude, paramName); return value == null ? defaultValue : value.intValue(); }
public static void setupLogging(Session session, Log log, ParameterInclude params) throws AxisFault { // Note that debugging might already be enabled by the mail.debug property and we should // take care to override it. if (log.isTraceEnabled()) { // This is the old behavior: just set debug to true session.setDebug(true); } if (ParamUtils.getOptionalParamBoolean(params, MailConstants.TRANSPORT_MAIL_DEBUG, false)) { // Redirect debug output to where it belongs, namely to the logs! session.setDebugOut(new PrintStream(new WriterOutputStream(new LogWriter(log)), true)); // Only enable debug afterwards since the call to setDebug might already cause debug output session.setDebug(true); } } }
@Override protected void doInit() throws AxisFault { TransportInDescription transportIn = getTransportInDescription(); String protocolClassName = ParamUtils.getRequiredParam(transportIn, "protocol"); Class<? extends Protocol> protocolClass; try { protocolClass = Thread.currentThread().getContextClassLoader().loadClass(protocolClassName).asSubclass(Protocol.class); } catch (ClassNotFoundException ex) { throw new AxisFault("Unable to load the protocol implementation '" + protocolClassName + "'"); } catch (ClassCastException ex) { throw new AxisFault("The protocol implementation " + protocolClassName + " doesn't extend " + Protocol.class.getName()); } Protocol protocol; try { protocol = protocolClass.newInstance(); } catch (Exception ex) { throw new AxisFault("Couldn't instantiate " + protocolClassName); } protocol.init(transportIn); this.protocol = protocol; }
public static int getOptionalParamInt(ParameterInclude paramInclude, String paramName, int defaultValue) throws AxisFault { Integer value = getOptionalParamInt(paramInclude, paramName); return value == null ? defaultValue : value.intValue(); }
public static void setupLogging(Session session, Log log, ParameterInclude params) throws AxisFault { // Note that debugging might already be enabled by the mail.debug property and we should // take care to override it. if (log.isTraceEnabled()) { // This is the old behavior: just set debug to true session.setDebug(true); } if (ParamUtils.getOptionalParamBoolean(params, MailConstants.TRANSPORT_MAIL_DEBUG, false)) { // Redirect debug output to where it belongs, namely to the logs! session.setDebugOut(new PrintStream(new WriterOutputStream(new LogWriter(log)), true)); // Only enable debug afterwards since the call to setDebug might already cause debug output session.setDebug(true); } } }
public static int getRequiredParamInt(ParameterInclude paramInclude, String paramName) throws AxisFault { Integer value = getOptionalParamInt(paramInclude, paramName); if (value == null) { throw new AxisFault("Cannot find parameter '" + paramName + "' for " + getDescriptionFor(paramInclude)); } else { return value.intValue(); } }
@Override protected void doInit() throws AxisFault { TransportInDescription transportIn = getTransportInDescription(); String protocolClassName = ParamUtils.getRequiredParam(transportIn, "protocol"); Class<? extends Protocol> protocolClass; try { protocolClass = Thread.currentThread().getContextClassLoader().loadClass(protocolClassName).asSubclass(Protocol.class); } catch (ClassNotFoundException ex) { throw new AxisFault("Unable to load the protocol implementation '" + protocolClassName + "'"); } catch (ClassCastException ex) { throw new AxisFault("The protocol implementation " + protocolClassName + " doesn't extend " + Protocol.class.getName()); } Protocol protocol; try { protocol = protocolClass.newInstance(); } catch (Exception ex) { throw new AxisFault("Couldn't instantiate " + protocolClassName); } protocol.init(transportIn); this.protocol = protocol; }
@Override public boolean loadConfiguration(ParameterInclude params) throws AxisFault { String name = ParamUtils.getOptionalParam(params, PipeConstants.NAME_KEY); if (name == null) { return false; } pipe = new File(name); return super.loadConfiguration(params); }
public boolean loadConfiguration(ParameterInclude params) throws AxisFault { port = ParamUtils.getOptionalParamInt(params, TCPConstants.PARAM_PORT, -1); if (port == -1) { return false; } contentType = ParamUtils.getOptionalParam(params, TCPConstants.PARAM_CONTENT_TYPE); if (contentType == null) { contentType = TCPConstants.TCP_DEFAULT_CONTENT_TYPE; } host = ParamUtils.getOptionalParam(params, TCPConstants.PARAM_HOST); backlog = ParamUtils.getOptionalParamInt(params, TCPConstants.PARAM_BACKLOG, TCPConstants.TCP_DEFAULT_BACKLOG); return true; }
@Override public boolean loadConfiguration(ParameterInclude params) throws AxisFault { port = ParamUtils.getOptionalParamInt(params, UDPConstants.PORT_KEY, -1); if (port == -1) { return false; } maxPacketSize = ParamUtils.getOptionalParamInt(params, UDPConstants.MAX_PACKET_SIZE_KEY, UDPConstants.DEFAULT_MAX_PACKET_SIZE); return super.loadConfiguration(params); }
public static void setupLogging(Session session, Log log, ParameterInclude params) throws AxisFault { // Note that debugging might already be enabled by the mail.debug property and we should // take care to override it. if (log.isTraceEnabled()) { // This is the old behavior: just set debug to true session.setDebug(true); } if (ParamUtils.getOptionalParamBoolean(params, MailConstants.TRANSPORT_MAIL_DEBUG, false)) { // Redirect debug output to where it belongs, namely to the logs! session.setDebugOut(new PrintStream(new WriterOutputStream(new LogWriter(log)), true)); // Only enable debug afterwards since the call to setDebug might already cause debug output session.setDebug(true); } } }
@Override public boolean loadConfiguration(ParameterInclude params) throws AxisFault { contentType = ParamUtils.getRequiredParam( params, "transport." + getListener().getTransportName() + ".contentType"); return true; } }
public void init(ParameterInclude paramInclude) throws AxisFault { delimiter = (byte)ParamUtils.getRequiredParamInt(paramInclude, "delimiter"); }
private static void addOptions(Map<String, String> schemeFileOptions, ParameterInclude params) { for (VFSConstants.SFTP_FILE_OPTION option : VFSConstants.SFTP_FILE_OPTION.values()) { String paramValue = null; try { paramValue = ParamUtils.getOptionalParam( params, VFSConstants.SFTP_PREFIX + WordUtils.capitalize(option.toString())); } catch (AxisFault axisFault) { log.error("Error while loading VFS parameter. " + axisFault.getMessage()); } if (paramValue != null && !paramValue.isEmpty()) { schemeFileOptions.put(option.toString(), paramValue); } } }
@Override public boolean loadConfiguration(ParameterInclude params) throws AxisFault { port = ParamUtils.getOptionalParamInt(params, UDPConstants.PORT_KEY, -1); if (port == -1) { return false; } maxPacketSize = ParamUtils.getOptionalParamInt(params, UDPConstants.MAX_PACKET_SIZE_KEY, UDPConstants.DEFAULT_MAX_PACKET_SIZE); return super.loadConfiguration(params); }