public Authenticator(AuthenticationHandler authenticationHandler, DataBridgeConfiguration dataBridgeConfiguration) { this.authenticationHandler = authenticationHandler; sessionCache = new SessionCache(dataBridgeConfiguration.getClientTimeoutMin()); }
public EventQueue(List<AgentCallback> subscribers, List<RawDataAgentCallback> rawDataSubscribers, DataBridgeConfiguration dataBridgeConfiguration) { this.subscribers = subscribers; this.rawDataSubscribers = rawDataSubscribers; // Note : Using a fixed worker thread pool and a bounded queue to prevent the server dying if load is too high executorService = Executors.newFixedThreadPool(dataBridgeConfiguration.getWorkerThreads(), new DataBridgeThreadFactory("Core")); eventQueue = new EventBlockingQueue(dataBridgeConfiguration.getEventBufferSize(), dataBridgeConfiguration.getMaxEventBufferCapacity()); }
public EventQueue(List<AgentCallback> subscribers, List<RawDataAgentCallback> rawDataSubscribers, DataBridgeConfiguration dataBridgeConfiguration) { this.subscribers = subscribers; this.rawDataSubscribers = rawDataSubscribers; // Note : Using a fixed worker thread pool and a bounded queue to prevent the server dying if load is too high executorService = Executors.newFixedThreadPool(dataBridgeConfiguration.getWorkerThreads(), new DataBridgeThreadFactory("Core")); eventQueue = new ArrayBlockingQueue<EventComposite>(dataBridgeConfiguration.getEventBufferCapacity()); }
private void startSecureEventTransmission(String hostName, int port, String sslProtocols, String ciphers, DataBridgeReceiverService dataBridgeReceiverService) throws DataBridgeException { try { String keyStore = dataBridgeReceiverService.getInitialConfig().getKeyStoreLocation(); if (keyStore == null) { keyStore = System.getProperty("Security.KeyStore.Location"); if (keyStore == null) { throw new DataBridgeException("Cannot start thrift agent server, not valid " + "Security.KeyStore.Location is null"); } } String keyStorePassword = dataBridgeReceiverService.getInitialConfig().getKeyStorePassword(); if (keyStorePassword == null) { keyStorePassword = System.getProperty("Security.KeyStore.Password"); if (keyStorePassword == null) { throw new DataBridgeException("Cannot start thrift agent server, not valid" + " Security.KeyStore.Password is null "); } } startSecureEventTransmission(hostName, port, sslProtocols, ciphers, keyStore, keyStorePassword, dataBridgeReceiverService); } catch (TransportException e) { throw new DataBridgeException("Cannot start agent server on port " + port, e); } catch (UnknownHostException e) { //ignore since localhost } }
public static DataBridgeConfiguration resolveAndSetDatabridgeConfiguration(LinkedHashMap databridgeConfigHashMap) { DataBridgeConfiguration dataBridgeConfiguration = new DataBridgeConfiguration(); dataBridgeConfiguration.setWorkerThreads(Integer.parseInt(workerThreadsObject.toString().trim())); dataBridgeConfiguration.setMaxEventBufferCapacity(Integer.parseInt(maxBufferCapacityObject. toString().trim())); dataBridgeConfiguration.setEventBufferSize(Integer.parseInt(eventBufferSizeObject.toString().trim())); dataBridgeConfiguration.setClientTimeoutMin(Integer.parseInt(clientTimeoutMinObject.toString().trim())); String keyStoreLocation = keyStoreLocationObject.toString().trim(); if (!keyStoreLocation.isEmpty()) { dataBridgeConfiguration.setKeyStoreLocation((DataBridgeCommonsUtils. replaceSystemProperty(keyStoreLocation))); dataBridgeConfiguration.setKeyStorePassword((keyStorePassword.toString().trim())); dataReceiverList.add(dataReceiver); dataBridgeConfiguration.setDataReceivers(dataReceiverList);
public ThriftDataReceiverConfiguration(DataBridgeConfiguration dataBridgeConfiguration) { DataReceiver dataReceiver = dataBridgeConfiguration.getDataReceiver(ThriftDataReceiverConstants. DATA_BRIDGE_RECEIVER_NAME); int portOffset = getPortOffset(); secureDataReceiverPort = Integer.parseInt(dataReceiver.getConfiguration(ThriftDataReceiverConstants.SECURE_PORT_ELEMENT, CommonThriftConstants.DEFAULT_RECEIVER_PORT+CommonThriftConstants.SECURE_EVENT_RECEIVER_PORT_OFFSET).toString()) + portOffset; dataReceiverPort = Integer.parseInt(dataReceiver.getConfiguration(ThriftDataReceiverConstants.PORT_ELEMENT, CommonThriftConstants.DEFAULT_RECEIVER_PORT).toString()) + portOffset; receiverHostName = dataReceiver.getConfiguration(ThriftDataReceiverConstants.RECEIVER_HOST_NAME, ThriftDataReceiverConstants.DEFAULT_HOSTNAME).toString(); }
String keyStore = dataBridgeReceiverService.getInitialConfig().getKeyStoreLocation(); if (keyStore == null) { String keyStorePassword = dataBridgeReceiverService.getInitialConfig().getKeyStorePassword(); if (keyStorePassword == null) { keyStorePassword = "wso2carbon";
public ThriftDataReceiverConfiguration(DataBridgeConfiguration dataBridgeConfiguration, int portOffset) { DataReceiverConfiguration dataReceiverConfiguration = dataBridgeConfiguration.getDataReceiver (ThriftDataReceiverConstants.DATA_BRIDGE_RECEIVER_NAME);
private void startSecureTransmission() throws IOException, DataBridgeException { try { String keyStore = dataBridgeReceiverService.getInitialConfig().getKeyStoreLocation(); if (keyStore == null) { keyStore = System.getProperty("Security.KeyStore.Location"); String keyStorePassword = dataBridgeReceiverService.getInitialConfig().getKeyStorePassword(); if (keyStorePassword == null) { keyStorePassword = System.getProperty("Security.KeyStore.Password");
public BinaryDataReceiverConfiguration(DataBridgeConfiguration dataBridgeConfiguration) { getDataReceiver(BinaryDataReceiverConstants.DATA_BRIDGE_RECEIVER_CONFIG_NAME); String sslPortConfiguration = dataReceiverConfiguration.getProperties().get( BinaryDataReceiverConstants.SSL_RECEIVER_PORT_CONFIG_NAME);
public Authenticator(AuthenticationHandler authenticationHandler, DataBridgeConfiguration dataBridgeConfiguration) { this.authenticationHandler = authenticationHandler; sessionCache = new SessionCache(dataBridgeConfiguration.getClientTimeoutMin()); }
public ThriftDataReceiverConfiguration(DataBridgeConfiguration dataBridgeConfiguration, int portOffset) { DataReceiverConfiguration dataReceiverConfiguration = dataBridgeConfiguration.getDataReceiver (ThriftDataReceiverConstants.DATA_BRIDGE_RECEIVER_NAME);