private void LookupQueue(ILookupContext searcher, String name) { TIBCO.EMS.Queue queue = (TIBCO.EMS.Queue)searcher.Lookup(name); if (queue != null) { Console.WriteLine(""); Console.WriteLine("########## Topic ######### "); Console.WriteLine(queue.ToString()); Console.WriteLine("########################## "); } }
private void LookupTopic(ILookupContext searcher, String name) { Topic topic = (Topic)searcher.Lookup(name); if (topic != null) { Console.WriteLine(""); Console.WriteLine("########## Topic ######### "); Console.WriteLine(topic.ToString()); Console.WriteLine("########################## "); } }
private void LookupFactory(ILookupContext searcher, String name) { ConnectionFactory cf = (ConnectionFactory)searcher.Lookup(name); if (cf != null) { Console.WriteLine(""); Console.WriteLine("######### Connection Factory ###########"); Console.WriteLine(cf.ToString()); Console.WriteLine("#########################################"); } }
/// <summary> /// Create the JndiLookupContext if it has not been explicitly set. /// </summary> public virtual void AfterPropertiesSet() { if (_jndiLookupContext == null) { if (JndiContextType == JndiContextType.JMS) { this._jndiLookupContext = contextFactoryObject.CreateContext(LookupContextFactory.TIBJMS_NAMING_CONTEXT, jndiProperties); } else { this._jndiLookupContext = contextFactoryObject.CreateContext(LookupContextFactory.LDAP_CONTEXT, jndiProperties); } } }
/// <summary> /// Create the JndiLookupContext if it has not been explicitly set. /// </summary> public virtual void AfterPropertiesSet() { if (_jndiLookupContext == null) { if (JndiContextType == JndiContextType.JMS) { this._jndiLookupContext = contextFactoryObject.CreateContext(LookupContextFactory.TIBJMS_NAMING_CONTEXT, jndiProperties); } else { this._jndiLookupContext = contextFactoryObject.CreateContext(LookupContextFactory.LDAP_CONTEXT, jndiProperties); } } }
private void lookup() { Hashtable table = new Hashtable(); if (ldapURL != null) { table.Add(LdapLookupConsts.LDAP_SERVER_URL, ldapURL); } if (ldapBaseDN != null) { table.Add(LdapLookupConsts.LDAP_BASE_DN, ldapBaseDN); } if (ldapPrincipal != null) { table.Add(LdapLookupConsts.LDAP_PRINCIPAL, ldapPrincipal); } else { table.Add(LdapLookupConsts.LDAP_PRINCIPAL, ""); } if (ldapPassword != null) { table.Add(LdapLookupConsts.LDAP_CREDENTIAL, ldapPassword); } else { table.Add(LdapLookupConsts.LDAP_CREDENTIAL, ""); } if (searchScope != null) { table.Add(LdapLookupConsts.LDAP_SEARCH_SCOPE, searchScope); } if (ldapProtocol != null) { if (ldapProtocol.Equals("ldaps")) { table.Add(LdapLookupConsts.LDAP_CONN_TYPE, "ldaps"); if (certName != null) { table.Add(LdapLookupConsts.LDAP_CERT_NAME, certName); } if (storeName != null) { table.Add(LdapLookupConsts.LDAP_CERT_STORE_NAME, storeName); } if (storeLocation != null) { table.Add(LdapLookupConsts.LDAP_CERT_STORE_LOCATION, storeLocation); } LdapLookupSSLParams parms = new LdapLookupSSLParams(); table.Add(LdapLookupConsts.LDAP_SSL_PARAMS, parms); } else if (ldapProtocol.Equals("ldap")) { // nothing } else { Console.WriteLine("invalid protocol name: only ldap or ldaps supported"); System.Environment.Exit(-1); } } LookupContextFactory fc = new LookupContextFactory(); ILookupContext searcher = fc.CreateContext(LookupContextFactory.LDAP_CONTEXT, table); // now lookup if (factoryName != null) { LookupFactory(searcher, factoryName); } if (topicName != null) { LookupTopic(searcher, topicName); } if (queueName != null) { LookupQueue(searcher, queueName); } }