Creates a mapping of a Mongo server placeholder value to the one or more mongo elements in the server.xml containing that placeholder

@param libertyServer
@return
977817
private Map<String, List<MongoElement>> getMongoElements() throws Exception {
        for (MongoElement mongo : serverConfig.getMongos()) {
            addMongoElementToMap(mongo);
        }
        for (MongoDBElement mongoDB : serverConfig.getMongoDBs()) {
            if (mongoDB.getMongo() != null) {
                addMongoElementToMap(mongoDB.getMongo());
            }
        }
        return mongoElements;
    }
83567
protected Map<String, AbstractServer> createServices(ServerSetup[] config, Managers mgr) {
        Map<String, AbstractServer> srvc = new HashMap<>();
        for (ServerSetup setup : config) {
            if (srvc.containsKey(setup.getProtocol())) {
                throw new IllegalArgumentException("Server '" + setup.getProtocol() + "' was found at least twice in the array");
            }
            final String protocol = setup.getProtocol();
            if (protocol.startsWith(ServerSetup.PROTOCOL_SMTP)) {
                srvc.put(protocol, new SmtpServer(setup, mgr));
            } else if (protocol.startsWith(ServerSetup.PROTOCOL_POP3)) {
                srvc.put(protocol, new Pop3Server(setup, mgr));
            } else if (protocol.startsWith(ServerSetup.PROTOCOL_IMAP)) {
                srvc.put(protocol, new ImapServer(setup, mgr));
            }
        }
        return srvc;
    }
306691
public static void createWar(LibertyServer server, String dir, String warName, boolean addWarResources, String jarName, boolean addJarResources,
                                 String... packageNames) throws Exception {
        addEarToServer(server, dir, null, false, warName, addWarResources, jarName, addJarResources, packageNames);
    }
234282
private Holder createHolder() {
        poll();
        Holder holder = new Holder(queue);
        WeakReference<Holder> ref = new WeakReference<>(holder);

        Holder old;
        do {
            old = strongRefs;
            holder.next = old;
        } while (!strongRefsUpdater.compareAndSet(this, old, holder));

        local.set(ref);
        return holder;
    }
1027037
def get_frontend_data_dict_for_placeholders(placeholders, request, editable=False):
    
    data_dict = {}
    for placeholder in placeholders:
        if placeholder:
            plugins = []

            # We don't use the helper method `placeholder.get_plugins()` because of the wrong order by path.
            placeholder_plugins = placeholder.cmsplugin_set.filter(language=request.LANGUAGE_CODE).order_by(
                settings.DJANGOCMS_SPA_PLUGIN_ORDER_FIELD)

            for plugin in placeholder_plugins:
                # We need the complete cascading structure of the plugins in the frontend. This is why we ignore the
                # children here and add them later in the loop.
                if not plugin.parent:
                    plugins.append(get_frontend_data_dict_for_plugin(
                        request=request,
                        plugin=plugin,
                        editable=editable)
                    )

            if plugins or editable:
                data_dict[placeholder.slot] = {
                    'type': 'cmp-%s' % placeholder.slot,
                    'plugins': plugins,
                }

            if editable:
                # This is the structure of the template `cms/toolbar/placeholder.html` that is used to register
                # the frontend editing.
                from cms.plugin_pool import plugin_pool
                plugin_types = [cls.__name__ for cls in plugin_pool.get_all_plugins(placeholder.slot, placeholder.page)]
                allowed_plugins = plugin_types + plugin_pool.get_system_plugins()

                data_dict[placeholder.slot]['cms'] = [
                    'cms-placeholder-{}'.format(placeholder.pk),
                    {
                        'type': 'placeholder',
                        'name': str(placeholder.get_label()),
                        'page_language': request.LANGUAGE_CODE,
                        'placeholder_id': placeholder.pk,
                        'plugin_language': request.LANGUAGE_CODE,
                        'plugin_restriction': [module for module in allowed_plugins],
                        'addPluginHelpTitle': 'Add plugin to placeholder {}'.format(placeholder.get_label()),
                        'urls': {
                            'add_plugin': placeholder.get_add_url(),
                            'copy_plugin': placeholder.get_copy_url()
                        }
                    }
                ]

    return data_dict
905743
@Override
    public BeansXml getBeansXml() {
        if (this.beansXml == null) {
            Resource beansXmlResource = archive.getBeansXml();
            if (beansXmlResource != null) {
                URL beansXmlUrl = beansXmlResource.getURL();
                Bootstrap bootstrap = getCDIDeployment().getBootstrap();
                final ClassLoader origTCCL = getContextClassLoader();
                try {
                    // Must use this class's loader as the context classloader to ensure
                    // that we load Liberty's XML parser rather than any parser defined
                    // in the application.
                    setContextClassLoader(BeanDeploymentArchiveImpl.class.getClassLoader());
                    beansXml = bootstrap.parse(beansXmlUrl);
                } finally {
                    setContextClassLoader(origTCCL);
                }
            }
        }
        return this.beansXml;
    }
207617
@Override
    public Map<String, Object> getValuesMap() throws AtlasException {
        Map<String, Object> m = new HashMap<>();
        for (String attr : fieldMapping.fields.keySet()) {
//            int pos = fieldMapping.fieldNullPos.get(attr);
//            if (  explicitSets[pos] ) {
                m.put(attr, get(attr));
//            }
        }
        return m;
    }
505262
public static void waitForMongoSSL(LibertyServer server) throws Exception {
        // Just because SSL feature is reported as starting doesn't mean it is really ready,
        // nor that Mongo is functional, so wait for SSL to report the keystore has been
        // added, then wait for MongoDBService to activate.
        server.resetLogMarks(); // look from start of logs
        assertNotNull("Did not find trace message indicating SSL trustStore had been added",
                      server.waitForStringInTraceUsingMark("Adding keystore: (myDefaultTrustStore|differentTrustStore)"));
        assertNotNull("Did not find message indicating MongoDBService had activated", server.waitForStringInTraceUsingMark("MongoDBService * < activate"));
    }
714262
public void deployMicroProfileApp(LibertyServer server) throws Exception {
        List<String> classList = createAppClassList("com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.ApplicationScoped.Instance.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.NotScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.RequestScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.SessionScoped.Instance.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjectionAllTypesMicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjectionInstanceMicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.CommonMicroProfileMarker",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.Injection.ApplicationScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.Injection.NotScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.Injection.RequestScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.Injection.SessionScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.JsonWebTokenInjectionMicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContext.ApplicationScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContext.NotScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContext.RequestScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContext.SessionScoped.MicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContextMicroProfileApp",
                                                    "com.ibm.ws.jaxrs.fat.microProfileApp.Utils");
        ShrinkHelper.exportAppToServer(server, genericCreateArchiveWithJsps(MpJwtFatConstants.MICROPROFILE_SERVLET, classList));
        server.addInstalledAppForValidation(MpJwtFatConstants.MICROPROFILE_SERVLET);

    }
124352
private String[] getMappedServers(final ServerInformationCatalog serverInformationCatalog,
            final Map<String, String> mappedServers) {

        if (serverInformationCatalog.containsServer(HadoopResource.DEFAULT_CLUSTERREFERENCE)) {
            mappedServers.put("(default)", HadoopResource.DEFAULT_CLUSTERREFERENCE);
        }

        final String[] serverNames = serverInformationCatalog.getServerNames();
        for (int i = 0; i < serverNames.length; i++) {
            final String serverName = serverNames[i];
            if (!serverName.equals(HadoopResource.DEFAULT_CLUSTERREFERENCE)) {
                mappedServers.put(serverName, serverName);
            }
        }
        return mappedServers.keySet().toArray(new String[serverNames.length]);
    }
161517
public static Map<String, Object> createSessionMap(HttpServletRequest request) {
        Map<String, Object> sessionMap = new HashMap<>();
        HttpSession session = request.getSession(false);

        if (session != null) {
            for (Enumeration attributeNameEnum = session.getAttributeNames(); attributeNameEnum.hasMoreElements(); ) {
                String attributeName = (String)attributeNameEnum.nextElement();
                sessionMap.put(attributeName, session.getAttribute(attributeName));
            }
        }

        return sessionMap;
    }
1008440
private static Document createSurroundingXMLResp() throws ParserConfigurationException {
        final Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        return document;
    }
599774
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "dmsAngle")
    public JAXBElement<DMSAngleType> createDmsAngle(DMSAngleType value) {
        return new JAXBElement<DMSAngleType>(_DmsAngle_QNAME, DMSAngleType.class, null, value);
    }
75327
public Map<String, Object> create(String entityName, String groupId, String jsonStr, MnoHttpClient httpClient) throws AuthenticationException, ApiException, InvalidRequestException {
		String jsonBody = httpClient.post(getCollectionUrl(entityName, groupId), jsonStr);
		Type typeOfHashMap = HashMap.class;
		return GSON.fromJson(jsonBody, typeOfHashMap);
	}
232699
public List<String> createEntity(String... entitiesAsJson) throws AtlasServiceException {
        return createEntity(new JSONArray(Arrays.asList(entitiesAsJson)));
    }
973861
private DocumentBuilder getDocumentBuilderFromPool()
            throws ParserConfigurationException {
        DocumentBuilder builder = documentBuilderPool.pollFirst();
        if (builder == null){
            builder = getDomFactory().newDocumentBuilder();
        }
        builder.setErrorHandler(errorHandler);
        return builder;
    }
406402
public static RequiredConfigurationHolder populateHostResolutionContext(final HostInfo hostInfo, final Resource root, final ExtensionRegistry extensionRegistry) {
        final RequiredConfigurationHolder rc = new RequiredConfigurationHolder();
        for (IgnoredNonAffectedServerGroupsUtil.ServerConfigInfo info : hostInfo.getServerConfigInfos()) {
            processServerConfig(root, rc, info, extensionRegistry);
        }
        return rc;
    }