Set deployment time settings for import
@param catalog The catalog to be updated.
@param importType A reference to the <exports> element of the deployment.xml file.
184292
private static void setImportInfo(Catalog catalog, ImportType importType) {
        if (importType == null) {
            return;
        }
        List<String> streamList = new ArrayList<>();
        List<ImportConfigurationType> kafkaConfigs = new ArrayList<>();

        for (ImportConfigurationType importConfiguration : importType.getConfiguration()) {

            boolean connectorEnabled = importConfiguration.isEnabled();
            if (!connectorEnabled) {
                continue;
            }

            if (importConfiguration.getType().equals(ServerImportEnum.KAFKA)) {
                kafkaConfigs.add(importConfiguration);
            }

            if (!streamList.contains(importConfiguration.getModule())) {
                streamList.add(importConfiguration.getModule());
            }

            buildImportProcessorConfiguration(importConfiguration, true);
        }
        validateKafkaConfig(kafkaConfigs);
    }
444815
public void setType(int type) {
        this.type = type;
        if (level == LEVEL_UNDEFINED) {
            switch (type) {
                case TYPE_INT:
                case TYPE_LONG:
                case TYPE_DOUBLE:
                    level = LEVEL_LOW;
                    break;
                case TYPE_STAT:
                    level = LEVEL_MEDIUM;
                    unit = "unit.ms";
                    break;
                case TYPE_LOAD:
                    level = LEVEL_HIGH;
                    break;
                case TYPE_SUBMODULE:
                    level = LEVEL_MAX;
                    break;
                default:
                    break;
            }
        }
    }
297685
public boolean validateImportType(ImportType importType, DiagnosticChain diagnostics, Map<Object, Object> context) {
		return validate_EveryDefaultConstraint(importType, diagnostics, context);
	}
584481
public void setStaticExportManager(CmsStaticExportManager manager) {

        m_staticExportManager = manager;
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_STATEXP_MANAGER_0));
        }
    }
502357
public void setCdnConfigurationType(com.google.api.ads.admanager.axis.v201811.CdnConfigurationType cdnConfigurationType) {
        this.cdnConfigurationType = cdnConfigurationType;
    }
956649
private void writeImports() {

    for (String importType : importTypes) {
      writer.append("import %s;", importType).eol();
    }
    writer.eol();
  }
575085
public boolean updateImportTask(int importJobId, int importTaskId,
                                    AbstractRESTEntity updateTaskEntity) throws Exception {

        LOG.debug("Updating the import task " + importTaskId + " in job " + importJobId +
            " with " + updateTaskEntity);

        Response httpResponse = HttpUtil.put(
            this.addEndPoint(importJobId + "/tasks/" + importTaskId),
            this.asJSON(updateTaskEntity),
            ContentType.APPLICATION_JSON,
            this.username,
            this.password
        );

        boolean success = httpResponse.getStatusCode().equals(HttpStatus.NO_CONTENT);

        if (success) {
            LOG.debug("Successfully updated the task " + importTaskId);
        } else {
            LOG.error("Unknown error occured while updating the task " + importTaskId);
        }

        return success;
    }
1027775
@Check
	public void checkImportsMapping(XImportDeclaration importDeclaration) {
		final JvmDeclaredType type = importDeclaration.getImportedType();
		doTypeMappingCheck(importDeclaration, type, this.typeErrorHandler1);
	}
316899
protected void initExplorerTypeSettings() {

        try {
            CmsResource res = getCms().readResource(getParamResource(), CmsResourceFilter.ALL);
            if (res.isFolder()) {
                if (!getParamResource().endsWith("/")) {
                    // append folder separator to resource name
                    setParamResource(getParamResource() + "/");
                }
            }
            String resTypeName = OpenCms.getResourceManager().getResourceType(res.getTypeId()).getTypeName();
            // get settings for resource type
            setExplorerTypeSettings(getSettingsForType(resTypeName));
            setShowNavigation(getExplorerTypeSettings().isShowNavigation());
        } catch (Throwable e) {
            // error reading file, show error dialog
            try {
                includeErrorpage(this, e);
            } catch (JspException exc) {
                LOG.error(
                    Messages.get().getBundle().key(Messages.LOG_ERROR_INCLUDE_FAILED_1, FILE_DIALOG_SCREEN_ERRORPAGE));
            }
        }
    }
538864
private static void addTimePerComponent(HashMap<String, Long> mapComponentTimes,	Component component) {
    Long currentTimeOfComponent = 0L;
    String key = component.getComponentType();
    if (mapComponentTimes.containsKey(key)) {
      currentTimeOfComponent = mapComponentTimes.get(key);
    }
    //when transactions are run in parallel, we should log the longest transaction only to avoid that 
    //for ex 'Total time' would be 100ms and transactions in parallel to hornetQ will be 2000ms 
    Long maxTime =  Math.max(component.getTime(), currentTimeOfComponent);
    mapComponentTimes.put(key, maxTime);
  }
1337440
public void setDeploy(java.util.Collection<String> deploy) {
        if (deploy == null) {
            this.deploy = null;
            return;
        }

        this.deploy = new com.amazonaws.internal.SdkInternalList<String>(deploy);
    }
320831
public void setImportExportManager(CmsImportExportManager manager) {

        m_importExportManager = manager;
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_IMPORT_MANAGER_0));
        }
    }
753574
public void addProperty(String propertyType) {

        if (m_properties == null) {
            // this list will be used and clean up in the importResource method
            m_properties = new HashMap<String, CmsProperty>();
        }
        try {
            if ((m_propertyName == null) || getIgnoredProperties().contains(m_propertyName)) {
                // continue if the current property (name) should be ignored or is null
                return;
            }
            CmsProperty property = m_properties.get(m_propertyName);
            if (property == null) {
                property = new CmsProperty();
                property.setName(m_propertyName);
                property.setAutoCreatePropertyDefinition(true);
                m_properties.put(m_propertyName, property);
            }

            if (m_propertyValue == null) {
                m_propertyValue = "";
            }

            if ((propertyType != null) && propertyType.equals(PROPERTY_ATTRIB_TYPE_SHARED)) {
                // it is a shared/resource property value
                property.setResourceValue(m_propertyValue);
            } else {
                // it is an individual/structure value
                property.setStructureValue(m_propertyValue);
            }
        } finally {
            m_propertyName = null;
            m_propertyValue = null;
        }
    }
1026518
private static void setSnapshotInfo(Catalog catalog, SnapshotType snapshotSettings) {
        Database db = catalog.getClusters().get("cluster").getDatabases().get("database");
        SnapshotSchedule schedule = db.getSnapshotschedule().get("default");
        if (schedule == null) {
            schedule = db.getSnapshotschedule().add("default");
        }
        schedule.setEnabled(snapshotSettings.isEnabled());
        String frequency = snapshotSettings.getFrequency();
        if (!frequency.endsWith("s") &&
                !frequency.endsWith("m") &&
                !frequency.endsWith("h")) {
            hostLog.error(
                    "Snapshot frequency " + frequency +
                    " needs to end with time unit specified" +
                    " that is one of [s, m, h] (seconds, minutes, hours)" +
                    " Defaulting snapshot frequency to 10m.");
            frequency = "10m";
        }

        int frequencyInt = 0;
        String frequencySubstring = frequency.substring(0, frequency.length() - 1);
        try {
            frequencyInt = Integer.parseInt(frequencySubstring);
        } catch (Exception e) {
            hostLog.error("Frequency " + frequencySubstring +
                    " is not an integer. Defaulting frequency to 10m.");
            frequency = "10m";
            frequencyInt = 10;
        }

        String prefix = snapshotSettings.getPrefix();
        if (prefix == null || prefix.isEmpty()) {
            hostLog.error("Snapshot prefix " + prefix +
            " is not a valid prefix. Using prefix of 'SNAPSHOTNONCE' ");
            prefix = "SNAPSHOTNONCE";
        }

        if (prefix.contains("-") || prefix.contains(",")) {
            String oldprefix = prefix;
            prefix = prefix.replaceAll("-", "_");
            prefix = prefix.replaceAll(",", "_");
            hostLog.error("Snapshot prefix " + oldprefix + " cannot include , or -." +
                    " Using the prefix: " + prefix + " instead.");
        }

        int retain = snapshotSettings.getRetain();
        if (retain < 1) {
            hostLog.error("Snapshot retain value " + retain +
                    " is not a valid value. Must be 1 or greater." +
                    " Defaulting snapshot retain to 1.");
            retain = 1;
        }

        schedule.setFrequencyunit(
                frequency.substring(frequency.length() - 1, frequency.length()));
        schedule.setFrequencyvalue(frequencyInt);
        schedule.setPrefix(prefix);
        schedule.setRetain(retain);
    }
161301
@Autowired
    public void setDataTypeImportOrder(List<IPortalDataType> dataTypeImportOrder) {
        final ArrayList<PortalDataKey> dataKeyImportOrder =
                new ArrayList<>(dataTypeImportOrder.size() * 2);

        for (final IPortalDataType portalDataType : dataTypeImportOrder) {
            final List<PortalDataKey> supportedDataKeys = portalDataType.getDataKeyImportOrder();
            for (final PortalDataKey portalDataKey : supportedDataKeys) {
                /*
                 * Special Handling:  Need to prevent some keys from entering our
                 * sorted collection because they attempt to import both a group
                 * part and the membership parts of a group (either local or PAGS)
                 * in one go.  We import several entities at once, so it's important
                 * to do these in 2 phases.
                 */
                if (!KEYS_TO_IGNORE.contains(portalDataKey)) {
                    dataKeyImportOrder.add(portalDataKey);
                }
            }
        }
        dataKeyImportOrder.trimToSize();
        this.dataKeyImportOrder = Collections.unmodifiableList(dataKeyImportOrder);
    }
694564
protected void registerJavaTimeDatatypes() {

    // prevent compile-time dependencies and GWT availability problems
    registerStandardDatatype("java.time.LocalTime");
    registerStandardDatatype("java.time.LocalDate");
    registerStandardDatatype("java.time.LocalDateTime");
    registerStandardDatatype("java.time.MonthDay");
    registerStandardDatatype("java.time.Year");
    registerStandardDatatype("java.time.YearMonth");
    registerStandardDatatype("java.time.Instant");
    registerStandardDatatype("java.time.Duration");
    registerStandardDatatype("java.time.Period");
    registerStandardDatatype("java.time.OffsetTime");
    registerStandardDatatype("java.time.OffsetDate");
    registerStandardDatatype("java.time.OffsetDateTime");
    registerStandardDatatype("java.time.ZoneId");
    registerStandardDatatype("java.time.ZonedDateTime");
    registerStandardDatatype("java.time.ZoneOffset");
    registerStandardDatatype("java.time.ZoneRegion");
  }
1043753
public void addType(I_CmsXmlSchemaType type) throws CmsXmlException {

        // check if the type to add actually exists in the type manager
        CmsXmlContentTypeManager typeManager = OpenCms.getXmlContentTypeManager();
        if (type.isSimpleType() && (typeManager.getContentType(type.getTypeName()) == null)) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_UNREGISTERED_TYPE_1, type.getTypeName()));
        }

        // add the type to the internal type sequence and lookup table
        m_typeSequence.add(type);
        m_types.put(type.getName(), type);

        // store reference to the content definition in the type
        type.setContentDefinition(this);
    }