test_class.file: tigase-server 7.1.0/src/test/java/tigase/io/SSLContextContainerTest.java
test_class.identifier: SSLContextContainerTest
test_case.body: @Test
  	public void testFind() {
  		final HashMap<String, String> domains = new HashMap<String, String>();
  		domains.put("one.com", "one.com");
  		domains.put("a.two.com", "a.two.com");
  		domains.put("*.two.com", "*.two.com");
  
  		assertEquals("one.com", SSLContextContainer.find(domains, "one.com"));
  		assertNull(SSLContextContainer.find(domains, "tone.com"));
  		assertNull(SSLContextContainer.find(domains, "zero.com"));
  		assertEquals("a.two.com", SSLContextContainer.find(domains, "a.two.com"));
  		assertEquals("*.two.com", SSLContextContainer.find(domains, "b.two.com"));
  		assertEquals("*.two.com", SSLContextContainer.find(domains, "b.two.com"));
  		assertNull(SSLContextContainer.find(domains, "btwo.com"));
  		assertEquals("*.two.com", SSLContextContainer.find(domains, ".two.com"));
  	}
test_case.class_method_signature: SSLContextContainerTest.testFind()
test_case.full_signature: @Test public void testFind()
test_case.identifier: testFind
test_case.invocations: put put put assertEquals find assertNull find assertNull find assertEquals find assertEquals find assertEquals find assertNull find assertEquals find
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFind()
focal_class.declarator: log = Logger.getLogger(SSLContextContainer.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = Logger.getLogger(SSLContextContainer.class.getName());
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: PER_DOMAIN_CERTIFICATE_KEY = "virt-hosts-cert-"
focal_class.modifier: public final static
focal_class.original_string: public final static String PER_DOMAIN_CERTIFICATE_KEY = "virt-hosts-cert-";
focal_class.type: String
focal_class.var_name: PER_DOMAIN_CERTIFICATE_KEY
focal_class.declarator: acceptedIssuers = new ArrayList<X509Certificate>(200)
focal_class.modifier: private
focal_class.original_string: private ArrayList<X509Certificate> acceptedIssuers = new ArrayList<X509Certificate>(200);
focal_class.type: ArrayList<X509Certificate>
focal_class.var_name: acceptedIssuers
focal_class.declarator: certsDirs = null
focal_class.modifier: private
focal_class.original_string: private File[] certsDirs = null;
focal_class.type: File[]
focal_class.var_name: certsDirs
focal_class.declarator: def_cert_alias = DEFAULT_DOMAIN_CERT_VAL
focal_class.modifier: protected
focal_class.original_string: protected String def_cert_alias = DEFAULT_DOMAIN_CERT_VAL;
focal_class.type: String
focal_class.var_name: def_cert_alias
focal_class.declarator: email = "admin@tigase.org"
focal_class.modifier: private
focal_class.original_string: private String email = "admin@tigase.org";
focal_class.type: String
focal_class.var_name: email
focal_class.declarator: emptyPass = new char[0]
focal_class.modifier: private
focal_class.original_string: private char[] emptyPass = new char[0];
focal_class.type: char[]
focal_class.var_name: emptyPass
focal_class.declarator: kmfs = new ConcurrentSkipListMap<String, KeyManagerFactory>()
focal_class.modifier: protected
focal_class.original_string: protected Map<String, KeyManagerFactory> kmfs = new ConcurrentSkipListMap<String, KeyManagerFactory>();
focal_class.type: Map<String, KeyManagerFactory>
focal_class.var_name: kmfs
focal_class.declarator: o = "Tigase.org"
focal_class.modifier: private
focal_class.original_string: private String o = "Tigase.org";
focal_class.type: String
focal_class.var_name: o
focal_class.declarator: ou = "XMPP Service"
focal_class.modifier: private
focal_class.original_string: private String ou = "XMPP Service";
focal_class.type: String
focal_class.var_name: ou
focal_class.declarator: secureRandom = new SecureRandom()
focal_class.modifier: private
focal_class.original_string: private SecureRandom secureRandom = new SecureRandom();
focal_class.type: SecureRandom
focal_class.var_name: secureRandom
focal_class.declarator: sslContexts = new ConcurrentSkipListMap<>()
focal_class.modifier: protected
focal_class.original_string: protected Map<String, SSLContextsHolder> sslContexts = new ConcurrentSkipListMap<>();
focal_class.type: Map<String, SSLContextsHolder>
focal_class.var_name: sslContexts
focal_class.declarator: tms = new X509TrustManager[] { new FakeTrustManager() }
focal_class.modifier: private
focal_class.original_string: private X509TrustManager[] tms = new X509TrustManager[] { new FakeTrustManager() };
focal_class.type: X509TrustManager[]
focal_class.var_name: tms
focal_class.declarator: kms = null
focal_class.modifier: protected
focal_class.original_string: protected X509KeyManager[] kms = null;
focal_class.type: X509KeyManager[]
focal_class.var_name: kms
focal_class.declarator: trustKeyStore = null
focal_class.modifier: private
focal_class.original_string: private KeyStore trustKeyStore = null;
focal_class.type: KeyStore
focal_class.var_name: trustKeyStore
focal_class.file: tigase-server 7.1.0/src/main/java/tigase/io/SSLContextContainer.java
focal_class.identifier: SSLContextContainer
focal_class.interfaces: implements SSLContextContainerIfc
focal_class.class_method_signature: SSLContextContainer.addCertificateEntry(CertificateEntry entry, String alias, boolean store)
focal_class.full_signature: private KeyManagerFactory addCertificateEntry(CertificateEntry entry, String alias, boolean store)
focal_class.identifier: addCertificateEntry
focal_class.modifiers: private
focal_class.parameters: (CertificateEntry entry, String alias, boolean store)
focal_class.return: KeyManagerFactory
focal_class.signature: KeyManagerFactory addCertificateEntry(CertificateEntry entry, String alias, boolean store)
focal_class.class_method_signature: SSLContextContainer.addCertificates(Map<String, String> params)
focal_class.full_signature: @Override public void addCertificates(Map<String, String> params)
focal_class.identifier: addCertificates
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String, String> params)
focal_class.return: void
focal_class.signature: void addCertificates(Map<String, String> params)
focal_class.class_method_signature: SSLContextContainer.findPredefinedCertificates(Map<String, Object> params)
focal_class.full_signature: private Map<String, File> findPredefinedCertificates(Map<String, Object> params)
focal_class.identifier: findPredefinedCertificates
focal_class.modifiers: private
focal_class.parameters: (Map<String, Object> params)
focal_class.return: Map<String, File>
focal_class.signature: Map<String, File> findPredefinedCertificates(Map<String, Object> params)
focal_class.class_method_signature: SSLContextContainer.getSSLContext(String protocol, String hostname, boolean clientMode)
focal_class.full_signature: public SSLContext getSSLContext(String protocol, String hostname, boolean clientMode)
focal_class.identifier: getSSLContext
focal_class.modifiers: public
focal_class.parameters: (String protocol, String hostname, boolean clientMode)
focal_class.return: SSLContext
focal_class.signature: SSLContext getSSLContext(String protocol, String hostname, boolean clientMode)
focal_class.class_method_signature: SSLContextContainer.find(Map<String, T> data, String key)
focal_class.full_signature: public static T find(Map<String, T> data, String key)
focal_class.identifier: find
focal_class.modifiers: public static
focal_class.parameters: (Map<String, T> data, String key)
focal_class.return: T
focal_class.signature: T find(Map<String, T> data, String key)
focal_class.class_method_signature: SSLContextContainer.getSSLContext(String protocol, String hostname, boolean clientMode, TrustManager... tms)
focal_class.full_signature: @Override public SSLContext getSSLContext(String protocol, String hostname, boolean clientMode, TrustManager... tms)
focal_class.identifier: getSSLContext
focal_class.modifiers: @Override public
focal_class.parameters: (String protocol, String hostname, boolean clientMode, TrustManager... tms)
focal_class.return: SSLContext
focal_class.signature: SSLContext getSSLContext(String protocol, String hostname, boolean clientMode, TrustManager... tms)
focal_class.class_method_signature: SSLContextContainer.getTrustStore()
focal_class.full_signature: @Override public KeyStore getTrustStore()
focal_class.identifier: getTrustStore
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: KeyStore
focal_class.signature: KeyStore getTrustStore()
focal_class.class_method_signature: SSLContextContainer.init(Map<String, Object> params)
focal_class.full_signature: @Override public void init(Map<String, Object> params)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String, Object> params)
focal_class.return: void
focal_class.signature: void init(Map<String, Object> params)
focal_class.class_method_signature: SSLContextContainer.loadTrustedCerts(String[] trustLocations)
focal_class.full_signature: private void loadTrustedCerts(String[] trustLocations)
focal_class.identifier: loadTrustedCerts
focal_class.modifiers: private
focal_class.parameters: (String[] trustLocations)
focal_class.return: void
focal_class.signature: void loadTrustedCerts(String[] trustLocations)
focal_method.body: public static <T> T find(Map<String, T> data, String key) {
  		if (data.containsKey(key)) {
  			return data.get(key);
  		}
  
  		// should be faster than code commented below
  		// in case when there is no value at all
  		int idx = key.indexOf(".");
  		if (idx >= 0) {
  			String asteriskKey = "*" + key.substring(idx);
  			T value = data.get(asteriskKey);
  			if (value != null) {
  				data.put(key, value);
  				return value;
  			}
  		}
  //		for (Entry<String, T> entry : data.entrySet()) {
  //			final String k = entry.getKey();
  //			if (k.startsWith("*") && key.endsWith(k.substring(1))) {
  //				data.put(key, entry.getValue());
  //				return entry.getValue();
  //			}
  //		}
  
  		return null;
  	}
focal_method.class_method_signature: SSLContextContainer.find(Map<String, T> data, String key)
focal_method.full_signature: public static T find(Map<String, T> data, String key)
focal_method.identifier: find
focal_method.invocations: containsKey get indexOf substring get put
focal_method.modifiers: public static
focal_method.parameters: (Map<String, T> data, String key)
focal_method.return: T
focal_method.signature: T find(Map<String, T> data, String key)