@Test public void getsSameSOLRAPIClientForSameAlfresco() { SOLRAPIClient solrapiClient = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService, namespaceDAO); assertNotNull(solrapiClient); SOLRAPIClient solrapiClient2 = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService, namespaceDAO); assertNotNull(solrapiClient2); assertSame(solrapiClient, solrapiClient2); }
public SOLRAPIClient getSOLRAPIClient(Properties props, KeyResourceLoader keyResourceLoader, DictionaryService dictionaryService, NamespaceDAO namespaceDAO) { if (Boolean.parseBoolean(System.getProperty("alfresco.test", "false"))) { return new SOLRAPIQueueClient(namespaceDAO); } alfrescoHost = props.getProperty("alfresco.host", "localhost"); alfrescoPort = Integer.parseInt(props.getProperty("alfresco.port", "8080")); alfrescoPortSSL = Integer.parseInt(props.getProperty("alfresco.port.ssl", "8443")); boolean compression = Boolean.parseBoolean(props.getProperty("solr.request.content.compress", "false")); SOLRAPIClient client = getCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL); if (client == null) { baseUrl = props.getProperty("alfresco.baseUrl", "/alfresco"); secureCommsType = props.getProperty("alfresco.secureComms", "none"); if (secureCommsType.equals("https")) { sslKeyStoreType = getProperty(props, "alfresco.encryption.ssl.keystore.type", "JCEKS"); sslKeyStoreProvider = getProperty(props, "alfresco.encryption.ssl.keystore.provider", ""); sslKeyStoreLocation = getProperty(props, "alfresco.encryption.ssl.keystore.location", "ssl.repo.client.keystore"); sslKeyStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.keystore.passwordFileLocation", ""); sslTrustStoreType = getProperty(props, "alfresco.encryption.ssl.truststore.type", "JCEKS"); sslTrustStoreProvider = getProperty(props, "alfresco.encryption.ssl.truststore.provider", ""); sslTrustStoreLocation = getProperty(props, "alfresco.encryption.ssl.truststore.location", "ssl.repo.client.truststore"); sslTrustStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.truststore.passwordFileLocation", ""); } maxTotalConnections = Integer.parseInt(props.getProperty("alfresco.maxTotalConnections", "40")); maxHostConnections = Integer.parseInt(props.getProperty("alfresco.maxHostConnections", "40")); socketTimeout = Integer.parseInt(props.getProperty("alfresco.socketTimeout", "60000")); client = new SOLRAPIClient(getRepoClient(keyResourceLoader), dictionaryService, namespaceDAO, compression); setCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL, client); } return client; }
SOLRAPIClientFactory { public SOLRAPIClient getSOLRAPIClient(Properties props, KeyResourceLoader keyResourceLoader, DictionaryService dictionaryService, NamespaceDAO namespaceDAO) { if (Boolean.parseBoolean(System.getProperty("alfresco.test", "false"))) { return new SOLRAPIQueueClient(namespaceDAO); } alfrescoHost = props.getProperty("alfresco.host", "localhost"); alfrescoPort = Integer.parseInt(props.getProperty("alfresco.port", "8080")); alfrescoPortSSL = Integer.parseInt(props.getProperty("alfresco.port.ssl", "8443")); boolean compression = Boolean.parseBoolean(props.getProperty("solr.request.content.compress", "false")); SOLRAPIClient client = getCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL); if (client == null) { baseUrl = props.getProperty("alfresco.baseUrl", "/alfresco"); secureCommsType = props.getProperty("alfresco.secureComms", "none"); if (secureCommsType.equals("https")) { sslKeyStoreType = getProperty(props, "alfresco.encryption.ssl.keystore.type", "JCEKS"); sslKeyStoreProvider = getProperty(props, "alfresco.encryption.ssl.keystore.provider", ""); sslKeyStoreLocation = getProperty(props, "alfresco.encryption.ssl.keystore.location", "ssl.repo.client.keystore"); sslKeyStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.keystore.passwordFileLocation", ""); sslTrustStoreType = getProperty(props, "alfresco.encryption.ssl.truststore.type", "JCEKS"); sslTrustStoreProvider = getProperty(props, "alfresco.encryption.ssl.truststore.provider", ""); sslTrustStoreLocation = getProperty(props, "alfresco.encryption.ssl.truststore.location", "ssl.repo.client.truststore"); sslTrustStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.truststore.passwordFileLocation", ""); } maxTotalConnections = Integer.parseInt(props.getProperty("alfresco.maxTotalConnections", "40")); maxHostConnections = Integer.parseInt(props.getProperty("alfresco.maxHostConnections", "40")); socketTimeout = Integer.parseInt(props.getProperty("alfresco.socketTimeout", "60000")); client = new SOLRAPIClient(getRepoClient(keyResourceLoader), dictionaryService, namespaceDAO, compression); setCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL, client); } return client; } }
SOLRAPIClientFactory { public SOLRAPIClient getSOLRAPIClient(Properties props, KeyResourceLoader keyResourceLoader, DictionaryService dictionaryService, NamespaceDAO namespaceDAO) { if (Boolean.parseBoolean(System.getProperty("alfresco.test", "false"))) { return new SOLRAPIQueueClient(namespaceDAO); } alfrescoHost = props.getProperty("alfresco.host", "localhost"); alfrescoPort = Integer.parseInt(props.getProperty("alfresco.port", "8080")); alfrescoPortSSL = Integer.parseInt(props.getProperty("alfresco.port.ssl", "8443")); boolean compression = Boolean.parseBoolean(props.getProperty("solr.request.content.compress", "false")); SOLRAPIClient client = getCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL); if (client == null) { baseUrl = props.getProperty("alfresco.baseUrl", "/alfresco"); secureCommsType = props.getProperty("alfresco.secureComms", "none"); if (secureCommsType.equals("https")) { sslKeyStoreType = getProperty(props, "alfresco.encryption.ssl.keystore.type", "JCEKS"); sslKeyStoreProvider = getProperty(props, "alfresco.encryption.ssl.keystore.provider", ""); sslKeyStoreLocation = getProperty(props, "alfresco.encryption.ssl.keystore.location", "ssl.repo.client.keystore"); sslKeyStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.keystore.passwordFileLocation", ""); sslTrustStoreType = getProperty(props, "alfresco.encryption.ssl.truststore.type", "JCEKS"); sslTrustStoreProvider = getProperty(props, "alfresco.encryption.ssl.truststore.provider", ""); sslTrustStoreLocation = getProperty(props, "alfresco.encryption.ssl.truststore.location", "ssl.repo.client.truststore"); sslTrustStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.truststore.passwordFileLocation", ""); } maxTotalConnections = Integer.parseInt(props.getProperty("alfresco.maxTotalConnections", "40")); maxHostConnections = Integer.parseInt(props.getProperty("alfresco.maxHostConnections", "40")); socketTimeout = Integer.parseInt(props.getProperty("alfresco.socketTimeout", "60000")); client = new SOLRAPIClient(getRepoClient(keyResourceLoader), dictionaryService, namespaceDAO, compression); setCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL, client); } return client; }  }
SOLRAPIClientFactory { public SOLRAPIClient getSOLRAPIClient(Properties props, KeyResourceLoader keyResourceLoader, DictionaryService dictionaryService, NamespaceDAO namespaceDAO) { if (Boolean.parseBoolean(System.getProperty("alfresco.test", "false"))) { return new SOLRAPIQueueClient(namespaceDAO); } alfrescoHost = props.getProperty("alfresco.host", "localhost"); alfrescoPort = Integer.parseInt(props.getProperty("alfresco.port", "8080")); alfrescoPortSSL = Integer.parseInt(props.getProperty("alfresco.port.ssl", "8443")); boolean compression = Boolean.parseBoolean(props.getProperty("solr.request.content.compress", "false")); SOLRAPIClient client = getCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL); if (client == null) { baseUrl = props.getProperty("alfresco.baseUrl", "/alfresco"); secureCommsType = props.getProperty("alfresco.secureComms", "none"); if (secureCommsType.equals("https")) { sslKeyStoreType = getProperty(props, "alfresco.encryption.ssl.keystore.type", "JCEKS"); sslKeyStoreProvider = getProperty(props, "alfresco.encryption.ssl.keystore.provider", ""); sslKeyStoreLocation = getProperty(props, "alfresco.encryption.ssl.keystore.location", "ssl.repo.client.keystore"); sslKeyStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.keystore.passwordFileLocation", ""); sslTrustStoreType = getProperty(props, "alfresco.encryption.ssl.truststore.type", "JCEKS"); sslTrustStoreProvider = getProperty(props, "alfresco.encryption.ssl.truststore.provider", ""); sslTrustStoreLocation = getProperty(props, "alfresco.encryption.ssl.truststore.location", "ssl.repo.client.truststore"); sslTrustStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.truststore.passwordFileLocation", ""); } maxTotalConnections = Integer.parseInt(props.getProperty("alfresco.maxTotalConnections", "40")); maxHostConnections = Integer.parseInt(props.getProperty("alfresco.maxHostConnections", "40")); socketTimeout = Integer.parseInt(props.getProperty("alfresco.socketTimeout", "60000")); client = new SOLRAPIClient(getRepoClient(keyResourceLoader), dictionaryService, namespaceDAO, compression); setCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL, client); } return client; }  static void close(); SOLRAPIClient getSOLRAPIClient(Properties props, KeyResourceLoader keyResourceLoader, DictionaryService dictionaryService, NamespaceDAO namespaceDAO); }
SOLRAPIClientFactory { public SOLRAPIClient getSOLRAPIClient(Properties props, KeyResourceLoader keyResourceLoader, DictionaryService dictionaryService, NamespaceDAO namespaceDAO) { if (Boolean.parseBoolean(System.getProperty("alfresco.test", "false"))) { return new SOLRAPIQueueClient(namespaceDAO); } alfrescoHost = props.getProperty("alfresco.host", "localhost"); alfrescoPort = Integer.parseInt(props.getProperty("alfresco.port", "8080")); alfrescoPortSSL = Integer.parseInt(props.getProperty("alfresco.port.ssl", "8443")); boolean compression = Boolean.parseBoolean(props.getProperty("solr.request.content.compress", "false")); SOLRAPIClient client = getCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL); if (client == null) { baseUrl = props.getProperty("alfresco.baseUrl", "/alfresco"); secureCommsType = props.getProperty("alfresco.secureComms", "none"); if (secureCommsType.equals("https")) { sslKeyStoreType = getProperty(props, "alfresco.encryption.ssl.keystore.type", "JCEKS"); sslKeyStoreProvider = getProperty(props, "alfresco.encryption.ssl.keystore.provider", ""); sslKeyStoreLocation = getProperty(props, "alfresco.encryption.ssl.keystore.location", "ssl.repo.client.keystore"); sslKeyStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.keystore.passwordFileLocation", ""); sslTrustStoreType = getProperty(props, "alfresco.encryption.ssl.truststore.type", "JCEKS"); sslTrustStoreProvider = getProperty(props, "alfresco.encryption.ssl.truststore.provider", ""); sslTrustStoreLocation = getProperty(props, "alfresco.encryption.ssl.truststore.location", "ssl.repo.client.truststore"); sslTrustStorePasswordFileLocation = getProperty(props, "alfresco.encryption.ssl.truststore.passwordFileLocation", ""); } maxTotalConnections = Integer.parseInt(props.getProperty("alfresco.maxTotalConnections", "40")); maxHostConnections = Integer.parseInt(props.getProperty("alfresco.maxHostConnections", "40")); socketTimeout = Integer.parseInt(props.getProperty("alfresco.socketTimeout", "60000")); client = new SOLRAPIClient(getRepoClient(keyResourceLoader), dictionaryService, namespaceDAO, compression); setCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL, client); } return client; }  static void close(); SOLRAPIClient getSOLRAPIClient(Properties props, KeyResourceLoader keyResourceLoader, DictionaryService dictionaryService, NamespaceDAO namespaceDAO);  }