Examples of InvalidAttributeValueException


Examples of javax.management.InvalidAttributeValueException

            Object cookie)
            throws InvalidAttributeValueException {
        if (!validParameter(setter, arg, 0, cookie)) {
            final String msg =
                    "Invalid value for attribute " + name + ": " + arg;
            throw new InvalidAttributeValueException(msg);
        }
    }
View Full Code Here

Examples of javax.management.InvalidAttributeValueException

            // unrecognized attribute name:
            throw new AttributeNotFoundException("Attribute " + name
                    + " not found in " + m_className);
        }
        if (!propertyField.isWritable()) {
            throw new InvalidAttributeValueException("Attribute " + name
                    + " can not be set");
        }

        if (value == null) {
            try {
                m_instanceManager.onSet(null, propertyField.getField(), null);
            } catch (Exception e) {
                throw new InvalidAttributeValueException(
                    "Cannot set attribute " + name + " to null");
            }
        } else { // if non null value, make sure it is assignable to the
            // attribute
            if (true /* TODO type.class.isAssignableFrom(value.getClass()) */) {
                // propertyField.setValue(value);
                // setValue(attributeField.getField(),null);
                m_instanceManager.onSet(null, propertyField.getField(), value);
            } else {
                throw new InvalidAttributeValueException(
                    "Cannot set attribute " + name + " to a "
                            + value.getClass().getName()
                            + " object, String expected");
            }
        }
View Full Code Here

Examples of javax.management.InvalidAttributeValueException

            try
            {
                property.validate(attribute.getValue());
            } catch(ValidationException exception)
            {
                throw new InvalidAttributeValueException(exception.getMessage());
            }
            throw new RuntimeException("Not yet implemented.");
        }
View Full Code Here

Examples of javax.management.InvalidAttributeValueException

      throw new AttributeNotFoundException(
                                     "Attribute name cannot be null");
  }

  if (value == null) {
      throw new InvalidAttributeValueException(
                                      "Attribute value for attribute " +
                                      name + " cannot be null");
  }

        try {
            if (name.equals(ATT_SET_READ_ONLY)) {
                openConfig.setReadOnly(((Boolean) value).booleanValue());
            } else if (name.equals(ATT_SET_TRANSACTIONAL)) {
                openConfig.setTransactional(((Boolean) value).booleanValue());
            } else if (name.equals(ATT_SET_SERIALIZABLE)) {
                openConfig.setTxnSerializableIsolation(
                                             ((Boolean) value).booleanValue());
            } else {
                /* Set the specified attribute if the environment is open. */
                if (targetEnv != null) {

                    EnvironmentMutableConfig config =
                        targetEnv.getMutableConfig();

                    if (name.equals(ATT_CACHE_SIZE)) {
                        config.setCacheSize(((Long) value).longValue());
                        targetEnv.setMutableConfig(config);
                    } else if (name.equals(ATT_CACHE_PERCENT)) {
                        config.setCachePercent(((Integer) value).intValue());
                        targetEnv.setMutableConfig(config);
                    } else {
                        throw new AttributeNotFoundException("attribute " +
                                                             name +
                                                             " is not valid.");
                    }
                } else {
                    throw new AttributeNotFoundException("attribute " +
                                                         name +
                                                         " is not valid.");
                }
            }
        } catch (NumberFormatException e) {
            throw new InvalidAttributeValueException("attribute name=" + name);
        } catch (DatabaseException e) {
            throw new InvalidAttributeValueException("attribute name=" + name +
                                                     e.getMessage());
        }
    }
View Full Code Here

Examples of javax.management.InvalidAttributeValueException

    public void setConfigFileName(String fileName) throws InvalidAttributeValueException {
        try {
            controller.setConfigFile(fileName != null ? new File(fileName) : null);
        } catch (CruiseControlException e) {
            throw new InvalidAttributeValueException(e.getMessage());
        }
    }
View Full Code Here

Examples of javax.management.InvalidAttributeValueException

   
    public void setConfigFileName(String fileName) throws InvalidAttributeValueException {
        try {
            controller.setConfigFile(fileName != null ? new File(fileName) : null);
        } catch (CruiseControlException e) {
            throw new InvalidAttributeValueException(e.getMessage());
        }
    }
View Full Code Here

Examples of javax.naming.directory.InvalidAttributeValueException

            {
                modifier.setExpiration( KerberosTime.getTime( val ) );
            }
            catch ( ParseException e )
            {
                throw new InvalidAttributeValueException( "Account expiration attribute "
                    + KerberosAttribute.KRB5_ACCOUNT_EXPIRATION_TIME_AT + " contained an invalid value for generalizedTime: "
                    + val );
            }
        }

        if ( entry.get( KerberosAttribute.APACHE_SAM_TYPE_AT ) != null )
        {
            String samType = entry.get( KerberosAttribute.APACHE_SAM_TYPE_AT ).getString();
            modifier.setSamType( SamType.getTypeByOrdinal( Integer.parseInt( samType ) ) );
        }

        if ( entry.get( KerberosAttribute.KRB5_KEY_AT ) != null )
        {
            EntryAttribute krb5key = entry.get( KerberosAttribute.KRB5_KEY_AT );
           
            try
            {
                Map<EncryptionType, EncryptionKey> keyMap = modifier.reconstituteKeyMap( krb5key );
                modifier.setKeyMap( keyMap );
            }
            catch ( IOException ioe )
            {
                throw new InvalidAttributeValueException( I18n.err( I18n.ERR_623, KerberosAttribute.KRB5_KEY_AT ) );
            }
        }

        return modifier.getEntry();
    }
View Full Code Here

Examples of javax.naming.directory.InvalidAttributeValueException

        {
            ne = new InvalidAttributeIdentifierException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapInvalidAttributeValueException )
        {
            ne = new InvalidAttributeValueException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapInvalidDnException )
        {
            ne = new InvalidNameException( t.getLocalizedMessage() );
        }
View Full Code Here

Examples of javax.naming.directory.InvalidAttributeValueException

        {
            ne = new InvalidAttributeIdentifierException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapInvalidAttributeValueException )
        {
            ne = new InvalidAttributeValueException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapInvalidDnException )
        {
            ne = new InvalidNameException( t.getLocalizedMessage() );
        }
View Full Code Here

Examples of javax.naming.directory.InvalidAttributeValueException

        {
            throw new InvalidAttributesException( lnsae.getMessage() );
        }
        catch ( LdapException le )
        {
            throw new InvalidAttributeValueException( le.getMessage() );
        }

        try
        {
            doModifyOperation( buildTarget( JndiUtils.fromName( name ) ), newMods );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.