Returns our cached LDAPObject, which may or may not be bound.
430195
def _get_connection(self):
        
        if self._connection is None:
            uri = self.settings.SERVER_URI
            if callable(uri):
                if func_supports_parameter(uri, "request"):
                    uri = uri(self._request)
                else:
                    warnings.warn(
                        "Update AUTH_LDAP_SERVER_URI callable %s.%s to accept "
                        "a positional `request` argument. Support for callables "
                        "accepting no arguments will be removed in a future "
                        "version." % (uri.__module__, uri.__name__),
                        DeprecationWarning,
                    )
                    uri = uri()

            self._connection = self.backend.ldap.initialize(uri, bytes_mode=False)

            for opt, value in self.settings.CONNECTION_OPTIONS.items():
                self._connection.set_option(opt, value)

            if self.settings.START_TLS:
                logger.debug("Initiating TLS")
                self._connection.start_tls_s()

        return self._connection
1064772
public Object getCachedObject(CmsObject cms, String rootPath) {

        String key = getCacheKeyForCurrentProject(cms, rootPath);
        return OpenCms.getMemoryMonitor().getCachedVfsObject(key);
    }
1246639
private CachedProviderServiceInstance getCachedServiceInstance(
            String serviceName, String providerId) {
        try {
            read.lock();
            ServiceInstanceId id = new ServiceInstanceId(serviceName, providerId);
            return getCacheServiceInstances().get(id);
        } finally {
            read.unlock();
        }
    }
1180296
def get_object(self):
        """"""

        from ..util import AttrDict

        c = self.record.unpacked_contents

        if not c:
            c = yaml.safe_load(self.default)

        return AttrDict(c)
71638
def get_conn(cls):
        """"""
        conn = cls._conn
        if conn is None or conn.closed:
            conn = ldap3.Connection(
                settings.CAS_LDAP_SERVER,
                settings.CAS_LDAP_USER,
                settings.CAS_LDAP_PASSWORD,
                client_strategy="RESTARTABLE",
                auto_bind=True
            )
            cls._conn = conn
        return conn
477947
public static LdapHelper getInstance(String instance) {
        if (!helpers.containsKey(instance)) {
            helpers.put(instance, new LdapHelper(instance));
        }
        LdapHelper helper = helpers.get(instance);
        if (!helper.online) {
            helper.loadProperties();
        }
        return helper;
    }
778617
def get_enclosed_object(self):
        """"""
        if self._enclosed_object is None:
            enclosed_object_id = self.get_enclosed_object_id()
            package_name = enclosed_object_id.get_identifier_namespace().split('.')[0]
            obj_name = enclosed_object_id.get_identifier_namespace().split('.')[1]
            mgr = self.my_osid_object._get_provider_manager(package_name.upper())
            try:
                lookup_session = getattr(mgr, 'get_' + obj_name.lower() + '_lookup_session')(self.my_osid_object._proxy)
            except TypeError:
                lookup_session = getattr(mgr, 'get_' + obj_name.lower() + '_lookup_session')()
            getattr(lookup_session, 'use_federated_' + CATALOG_LOOKUP[package_name] + '_view')()
            self._enclosed_object = getattr(
                lookup_session, 'get_' + obj_name.lower())(enclosed_object_id)
        return self._enclosed_object
139296
def get_ldap(cls, global_options=None):
        
        # Apply global LDAP options once
        if not cls._ldap_configured and global_options is not None:
            for opt, value in global_options.items():
                ldap.set_option(opt, value)

            cls._ldap_configured = True

        return ldap
701336
def __cache(self):
        
        if self.options.cachingpolicy == 1:
            return self.options.cache
        return suds.cache.NoCache()
807251
def service
      return nil if config[:enabled] == false
      if @ldap_service.nil?
        @ldap_service = Net::LDAP.new(host: config[:host], auth: config[:auth])
        raise Net::LDAP::Error unless @ldap_service.bind
      end
      @ldap_service
    end
786181
public static ClassDescriptorCache getInstance() {
    if (INSTANCE == null) {
      synchronized (ClassDescriptorCache.class) {
        if (INSTANCE == null) {
          INSTANCE = new ClassDescriptorCache();
        }
      }
    }
    return INSTANCE;
  }
321158
private ObjectCache getCachePerClass(Class objectClass, int methodCall)
    {
        ObjectCache cache = (ObjectCache) cachesByClass.get(objectClass.getName());
        if (cache == null && methodCall == AbstractMetaCache.METHOD_CACHE)
        {
            /**
             * the cache wasn't found, and the cachesByClass didn't contain the key with a
             * null value, so create a new cache for this classtype
             */
            cache = new ObjectCacheJCSImpl(objectClass.getName());
            cachesByClass.put(objectClass.getName(), cache);
        }
        return cache;
    }
1186002
private Object storeCachedObject(K key, CachedObject<V> co) {
		//data is only locked if cleanup removes cached objects
		synchronized (data) {
			data.put(key, co);
		}
		//mirror is also locked if cleanup is busy collecting cached objects
		synchronized (mirror) {
			mirror.put(key, co);
		}
		System.out.println(new LogEntry("object with key " + key + " stored in cache"));
		return co;
	}
477875
private Object getUserObject(Identity oid, Object cacheObject)
    {
        Object userObject = _editingContext.lookup(oid);

        if (userObject == null)
        {
            ObjectCopyStrategy copyStrategy = _tx.getKit().getCopyStrategy(oid);
            userObject = copyStrategy.copy(cacheObject, _pb);
        }
        return userObject;
    }
267136
@Trivial
    private String getString(boolean isOctet, Object ldapValue) {
        if (isOctet) {
            return LdapHelper.getOctetString((byte[]) ldapValue);
        } else {
            return ldapValue.toString();
        }
    }
49944
private DirectoryLookupService getLookupService(){
        if(lookupService == null){
            synchronized(this){
                if(lookupService == null){
                    boolean cacheEnabled = Configurations.getBoolean(SD_API_CACHE_ENABLED_PROPERTY,
                            SD_API_CACHE_ENABLED_DEFAULT);
                    if(cacheEnabled){
                        CachedDirectoryLookupService service = new CachedDirectoryLookupService(directoryServiceClientManager);
                        service.start();
                        lookupService = service;
                        LOGGER.info("Created the CachedDirectoryLookupService in LookupManager");
                    } else {
                        lookupService = new DirectoryLookupService(directoryServiceClientManager);
                        LOGGER.info("Created the DirectoryLookupService in LookupManager");
                    }
                }
            }
        }
        return lookupService;
    }
1239905
@Override
    public synchronized Subject getSubject () {
        if ( this.cachedSubject != null ) {
            return this.cachedSubject;
        }

        try {
            log.debug("Logging on");
            LoginContext lc;

	    Subject ps = super.getSubject();

            if ( this.configuration != null ) {
                lc = new LoginContext(this.serviceName, ps, this, this.configuration);
            }
            else if ( ps != null ) {
                lc = new LoginContext(this.serviceName, ps, this);
            } else {
                lc = new LoginContext(this.serviceName, this);
	    }
            lc.login();

            Subject s = lc.getSubject();
            if ( log.isDebugEnabled() ) {
                log.debug("Got subject: " + s.getPrincipals());
            }
            if ( log.isTraceEnabled() ) {
                log.trace("Got subject " + s);
            }

            this.cachedSubject = s;
            return this.cachedSubject;
        }
        catch ( LoginException e ) {
            log.error("Failed to create login context", e);
            this.cachedSubject = new Subject();
            return null;
        }
    }