Search in sources :

Example 61 with InvalidParameterException

use of java.security.InvalidParameterException in project wildfly by wildfly.

the class ComplexPropertiesParseUtils method xaDsProperties.

/**
     * Returns properties for complex XA datasource
     *
     * @param jndiName               jndi name
     * @param connectionSecurityType the connection security that will be configured in the properties
     */
public static Properties xaDsProperties(String jndiName, ConnectionSecurityType connectionSecurityType) {
    Properties params = commonDsProperties(jndiName, connectionSecurityType);
    //attributes
    //common
    params.put("xa-datasource-class", "org.jboss.as.connector.subsystems.datasources.ModifiableXaDataSource");
    //xa-pool
    params.put("same-rm-override", "true");
    params.put("interleaving", "true");
    params.put("no-tx-separate-pool", "true");
    params.put("pad-xid", "true");
    params.put("wrap-xa-resource", "true");
    //time-out
    params.put("xa-resource-timeout", "120");
    //recovery
    params.put("no-recovery", "false");
    params.put("recovery-plugin-class-name", "someClass5");
    switch(connectionSecurityType) {
        case ELYTRON_AUTHENTICATION_CONTEXT:
            params.put("recovery-authentication-context", "HsqlAuthCtxt");
        // fall thru!
        case ELYTRON:
            params.put("recovery-elytron-enabled", "true");
            break;
        case SECURITY_DOMAIN:
            params.put("recovery-security-domain", "HsqlDbRealm");
            break;
        case USER_PASSWORD:
            params.put("recovery-username", "sa");
            params.put("recovery-password", "sa");
            break;
        default:
            throw new InvalidParameterException("Unsupported connection security for data sources: " + connectionSecurityType);
    }
    return params;
}
Also used : InvalidParameterException(java.security.InvalidParameterException) Properties(java.util.Properties)

Example 62 with InvalidParameterException

use of java.security.InvalidParameterException in project wildfly by wildfly.

the class ComplexPropertiesParseUtils method raConnectionProperties.

/**
     * Returns properties for RA connection-definition element
     * @param connectionSecurityType the connection security that will be configured in the properties
     * @param recoverySecurityType   the connection recovery security that will be configured in the properties
     */
public static Properties raConnectionProperties(ConnectionSecurityType connectionSecurityType, ConnectionSecurityType recoverySecurityType) {
    Properties params = new Properties();
    //attributes
    params.put("use-java-context", "false");
    params.put("class-name", "Class1");
    params.put("use-ccm", "true");
    params.put("jndi-name", "java:jboss/name1");
    params.put("enabled", "false");
    //pool
    params.put("min-pool-size", "1");
    params.put("max-pool-size", "5");
    params.put("pool-prefill", "true");
    params.put("pool-use-strict-min", "true");
    params.put("flush-strategy", "IdleConnections");
    //xa-pool
    params.put("same-rm-override", "true");
    params.put("interleaving", "true");
    params.put("no-tx-separate-pool", "true");
    params.put("pad-xid", "true");
    params.put("wrap-xa-resource", "true");
    //security
    switch(connectionSecurityType) {
        case APPLICATION:
            params.put("security-application", "true");
            break;
        case SECURITY_DOMAIN:
            params.put("security-domain", "SecRealm");
            break;
        case SECURITY_DOMAIN_AND_APPLICATION:
            params.put("security-domain-and-application", "SecAndAppRealm");
            break;
        case ELYTRON:
            params.put("elytron-enabled", "true");
            break;
        case ELYTRON_AUTHENTICATION_CONTEXT:
            params.put("elytron-enabled", "true");
            params.put("authentication-context", "AuthCtxt");
            break;
        case ELYTRON_AUTHENTICATION_CONTEXT_AND_APPLICATION:
            params.put("elytron-enabled", "true");
            params.put("authentication-context-and-application", "AuthCtxtAndApp");
            break;
        default:
            throw new InvalidParameterException("Unsupported connection security type for rars: " + connectionSecurityType);
    }
    //validation
    params.put("background-validation", "true");
    params.put("background-validation-millis", "5000");
    params.put("use-fast-fail", "true");
    //time-out
    params.put("blocking-timeout-wait-millis", "5000");
    params.put("idle-timeout-minutes", "4");
    params.put("allocation-retry", "2");
    params.put("allocation-retry-wait-millis", "3000");
    params.put("xa-resource-timeout", "300");
    //recovery
    params.put("no-recovery", "false");
    params.put("recovery-plugin-class-name", "someClass2");
    if (recoverySecurityType != null)
        switch(recoverySecurityType) {
            case USER_PASSWORD:
                params.put("recovery-username", "sa");
                params.put("recovery-password", "sa-pass");
                break;
            case SECURITY_DOMAIN:
                params.put("recovery-security-domain", "SecRealm");
                break;
            case ELYTRON:
                params.put("recovery-elytron-enabled", "true");
                break;
            case ELYTRON_AUTHENTICATION_CONTEXT:
                params.put("recovery-elytron-enabled", "true");
                params.put("recovery-authentication-context", "AuthCtxt");
                break;
            default:
                throw new InvalidParameterException("Unsupported connection recovery security type for rars: " + connectionSecurityType);
        }
    return params;
}
Also used : InvalidParameterException(java.security.InvalidParameterException) Properties(java.util.Properties)

Example 63 with InvalidParameterException

use of java.security.InvalidParameterException in project AisenWeiBo by wangdan.

the class SimpleMonthView method setMonthParams.

public void setMonthParams(HashMap<String, Integer> params) {
    if (!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)) {
        throw new InvalidParameterException("You must specify month and year for this view");
    }
    setTag(params);
    if (params.containsKey(VIEW_PARAMS_HEIGHT)) {
        mRowHeight = params.get(VIEW_PARAMS_HEIGHT);
        if (mRowHeight < MIN_HEIGHT) {
            mRowHeight = MIN_HEIGHT;
        }
    }
    if (params.containsKey(VIEW_PARAMS_SELECTED_DAY)) {
        mSelectedDay = params.get(VIEW_PARAMS_SELECTED_DAY);
    }
    mMonth = params.get(VIEW_PARAMS_MONTH);
    mYear = params.get(VIEW_PARAMS_YEAR);
    final Time today = new Time(Time.getCurrentTimezone());
    today.setToNow();
    mHasToday = false;
    mToday = -1;
    mCalendar.set(Calendar.MONTH, mMonth);
    mCalendar.set(Calendar.YEAR, mYear);
    mCalendar.set(Calendar.DAY_OF_MONTH, 1);
    mDayOfWeekStart = mCalendar.get(Calendar.DAY_OF_WEEK);
    if (params.containsKey(VIEW_PARAMS_WEEK_START)) {
        mWeekStart = params.get(VIEW_PARAMS_WEEK_START);
    } else {
        mWeekStart = mCalendar.getFirstDayOfWeek();
    }
    mNumCells = Utils.getDaysInMonth(mMonth, mYear);
    for (int i = 0; i < mNumCells; i++) {
        final int day = i + 1;
        if (sameDay(day, today)) {
            mHasToday = true;
            mToday = day;
        }
    }
    mNumRows = calculateNumRows();
}
Also used : InvalidParameterException(java.security.InvalidParameterException) Time(android.text.format.Time) Paint(android.graphics.Paint)

Example 64 with InvalidParameterException

use of java.security.InvalidParameterException in project MaterialDateTimePicker by wdullaer.

the class MonthView method setMonthParams.

/**
     * Sets all the parameters for displaying this week. The only required
     * parameter is the week number. Other parameters have a default value and
     * will only update if a new value is included, except for focus month,
     * which will always default to no focus month if no value is passed in. See
     * {@link #VIEW_PARAMS_HEIGHT} for more info on parameters.
     *
     * @param params A map of the new parameters, see
     *            {@link #VIEW_PARAMS_HEIGHT}
     */
public void setMonthParams(HashMap<String, Integer> params) {
    if (!params.containsKey(VIEW_PARAMS_MONTH) && !params.containsKey(VIEW_PARAMS_YEAR)) {
        throw new InvalidParameterException("You must specify month and year for this view");
    }
    setTag(params);
    // We keep the current value for any params not present
    if (params.containsKey(VIEW_PARAMS_HEIGHT)) {
        mRowHeight = params.get(VIEW_PARAMS_HEIGHT);
        if (mRowHeight < MIN_HEIGHT) {
            mRowHeight = MIN_HEIGHT;
        }
    }
    if (params.containsKey(VIEW_PARAMS_SELECTED_DAY)) {
        mSelectedDay = params.get(VIEW_PARAMS_SELECTED_DAY);
    }
    // Allocate space for caching the day numbers and focus values
    mMonth = params.get(VIEW_PARAMS_MONTH);
    mYear = params.get(VIEW_PARAMS_YEAR);
    // Figure out what day today is
    //final Time today = new Time(Time.getCurrentTimezone());
    //today.setToNow();
    final Calendar today = Calendar.getInstance(mController.getTimeZone());
    mHasToday = false;
    mToday = -1;
    mCalendar.set(Calendar.MONTH, mMonth);
    mCalendar.set(Calendar.YEAR, mYear);
    mCalendar.set(Calendar.DAY_OF_MONTH, 1);
    mDayOfWeekStart = mCalendar.get(Calendar.DAY_OF_WEEK);
    if (params.containsKey(VIEW_PARAMS_WEEK_START)) {
        mWeekStart = params.get(VIEW_PARAMS_WEEK_START);
    } else {
        mWeekStart = mCalendar.getFirstDayOfWeek();
    }
    mNumCells = mCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);
    for (int i = 0; i < mNumCells; i++) {
        final int day = i + 1;
        if (sameDay(day, today)) {
            mHasToday = true;
            mToday = day;
        }
    }
    mNumRows = calculateNumRows();
    // Invalidate cached accessibility information.
    mTouchHelper.invalidateRoot();
}
Also used : InvalidParameterException(java.security.InvalidParameterException) Calendar(java.util.Calendar) Paint(android.graphics.Paint)

Example 65 with InvalidParameterException

use of java.security.InvalidParameterException in project sakuli by ConSol.

the class ScreenBasedSettings method setDefaults.

@PostConstruct
public void setDefaults() {
    setMinSimilarity(currentSimilarity);
    WaitScanRate = 10f;
    ObserveScanRate = 10f;
    ClickDelay = props.getClickDelay();
    RobotDesktop.stdAutoDelay = props.getTypeDelayMs();
    //if stdAutoDelay is set TypeDelay is no longer needed!
    TypeDelay = 0;
    OcrDataPath = sakuliProps.getTessDataLibFolder().toAbsolutePath().toString();
    OcrTextSearch = true;
    OcrTextRead = true;
    Highlight = props.isAutoHighlightEnabled();
    if (props.getDefaultHighlightSeconds() < 1) {
        /**
             * because of the mehtode {@link org.sikuli.script.ScreenHighlighter#closeAfter(float)}
             * */
        throw new InvalidParameterException("the property '" + ActionProperties.DEFAULT_HIGHLIGHT_SEC + "' has to be greater as 1, but was " + props.getDefaultHighlightSeconds());
    }
    DefaultHighlightTime = props.getDefaultHighlightSeconds();
    WaitAfterHighlight = 0.1f;
    /***
         * Logging for sikuliX => {@link SysOutOverSLF4J} will send the logs to SLF4J
         */
    Logger sikuliLogger = LoggerFactory.getLogger(Debug.class);
    if (sikuliLogger.isInfoEnabled()) {
        LOGGER.debug("sikuli log level INFO enabled");
        ActionLogs = true;
        InfoLogs = true;
        ProfileLogs = true;
    }
    if (sikuliLogger.isDebugEnabled()) {
        LOGGER.debug("sikuli log level DEBUG enabled");
        DebugLogs = true;
    }
}
Also used : InvalidParameterException(java.security.InvalidParameterException) Logger(org.slf4j.Logger) PostConstruct(javax.annotation.PostConstruct)

Aggregations

InvalidParameterException (java.security.InvalidParameterException)135 SecureRandom (java.security.SecureRandom)15 ActionEvent (com.cloud.event.ActionEvent)11 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)11 IOException (java.io.IOException)10 ArrayList (java.util.ArrayList)10 Map (java.util.Map)10 LoadBalancerVO (com.cloud.network.dao.LoadBalancerVO)9 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)8 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)8 Paint (android.graphics.Paint)7 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)7 DB (com.cloud.utils.db.DB)7 File (java.io.File)7 Properties (java.util.Properties)7 NimbusClient (backtype.storm.utils.NimbusClient)6 FirewallRule (com.cloud.network.rules.FirewallRule)6 InvalidKeyException (java.security.InvalidKeyException)6 Time (android.text.format.Time)4 FileNotFoundException (java.io.FileNotFoundException)4