use of com.helger.commons.collection.attr.IStringMap in project as2-server by phax.
the class SocketCommandProcessor method initDynamicComponent.
@Override
public void initDynamicComponent(@Nonnull final IAS2Session aSession, @Nullable final IStringMap aParams) throws OpenAS2Exception {
final StringMap aParameters = aParams == null ? new StringMap() : new StringMap(aParams);
final String sPort = aParameters.getAsString(ATTR_PORTID);
try {
final int nPort = Integer.parseInt(sPort);
final SSLServerSocketFactory aSSLServerSocketFactory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
m_aSSLServerSocket = (SSLServerSocket) aSSLServerSocketFactory.createServerSocket(nPort);
final String[] aEnabledCipherSuites = getEnabledAnonymousCipherSuites(m_aSSLServerSocket.getEnabledCipherSuites(), m_aSSLServerSocket.getSupportedCipherSuites());
m_aSSLServerSocket.setEnabledCipherSuites(aEnabledCipherSuites);
} catch (final IOException e) {
throw new OpenAS2Exception(e);
} catch (final NumberFormatException e) {
throw new OpenAS2Exception("Error converting portid parameter '" + sPort + "': " + e);
}
m_sUserID = aParameters.getAsString(ATTR_USERID);
if (StringHelper.hasNoText(m_sUserID))
throw new OpenAS2Exception("missing 'userid' parameter");
m_sPassword = aParameters.getAsString(ATTR_PASSWORD);
if (StringHelper.hasNoText(m_sPassword))
throw new OpenAS2Exception("missing 'password' parameter");
try {
m_aParser = new SocketCommandParser();
} catch (final Exception e) {
throw new OpenAS2Exception(e);
}
}
Aggregations