Package org.apache.ws.resource.properties.faults

Examples of org.apache.ws.resource.properties.faults.InvalidSetResourcePropertiesRequestContentFaultException


    private void throwFaultIfInsertionViolatesSchema( ResourceProperty prop, XmlObject[] propElemsToBeInserted )
    {
        //todo probably need to check this for xsd:any to check for possible violations
        if ( prop.getMetaData().getMaxOccurs() != -1 &&( prop.size() + propElemsToBeInserted.length ) > prop.getMetaData().getMaxOccurs() )
        {
            throw new InvalidSetResourcePropertiesRequestContentFaultException( MSG.getMessage( Keys.ERROR_PROPERTY_INSERT_VIOLATES_SCHEMA,
                    ( ( propElemsToBeInserted.length > 1 )
                    ? "s" : "" ),
                    prop.getMetaData().getName() ) );
        }
    }
View Full Code Here


    private void throwFaultIfUpdateViolatesSchema( ResourceProperty prop, XmlObject[] newPropElems )
    {
        if ( prop.getMetaData().getMaxOccurs() != -1 && newPropElems.length > prop.getMetaData().getMaxOccurs() )
        {
            throw new InvalidSetResourcePropertiesRequestContentFaultException( MSG.getMessage( Keys.ERROR_PROPERTY_UPDATE_VIOLATES_SCHEMA,
                    prop.getMetaData().getName() ) );
        }
    }
View Full Code Here

            {
                throw new SetResourcePropertyRequestFailedFaultException( getNamespaceSet(), fault.getFaultString() );
            }
            catch ( InvalidInsertResourcePropertiesRequestContentFaultException fault )
            {
                throw new InvalidSetResourcePropertiesRequestContentFaultException( getNamespaceSet(), fault.getFaultString() );
            }
        }

        DeleteType[] deleteElems = requestElem.getDeleteArray();
        for ( int i = 0; i < deleteElems.length; i++ )
        {
            try
            {
                deleteResourceProperty( deleteElems[i].getResourceProperty() );
            }
            catch ( DeleteResourcePropertyRequestFailedFaultException fault )
            {
                throw new SetResourcePropertyRequestFailedFaultException( getNamespaceSet(), fault.getFaultString() );
            }
        }

        UpdateType[] updateElems = requestElem.getUpdateArray();
        for ( int i = 0; i < updateElems.length; i++ )
        {
            XmlObject[] newPropElems = XmlBeanUtils.getChildElements( updateElems[i] );
            try
            {
                updateResourceProperty( newPropElems );
            }
            catch ( UpdateResourcePropertyRequestFailedFaultException fault )
            {
                throw new SetResourcePropertyRequestFailedFaultException( getNamespaceSet(), fault.getFaultString() );
            }
            catch ( InvalidUpdateResourcePropertiesRequestContentFaultException fault )
            {
                throw new InvalidSetResourcePropertiesRequestContentFaultException( getNamespaceSet(), fault.getFaultString() );
            }
        }

        return responseDoc;
    }
View Full Code Here

            {
                prop.add( propElemsToBeInserted[i] );
            }
            catch ( MetaDataViolationException mdve )
            {
                throw new InvalidSetResourcePropertiesRequestContentFaultException( getNamespaceSet(), mdve );
            }
        }
        Object[] newValue = getValue( prop );
        if ( prop.getChangeListener() != null )
        {
View Full Code Here

                prop.add( newPropElems[i] );
            }
        }
        catch ( MetaDataViolationException mdve )
        {
            throw new InvalidSetResourcePropertiesRequestContentFaultException( getNamespaceSet(), mdve );
        }
        Object[] newValue = getValue( prop );
        if ( prop.getChangeListener() != null )
        {
            firePropChangeEvent( prop, oldValue, newValue );
View Full Code Here

    private void throwFaultIfDeletionViolatesSchema( ResourceProperty prop )
    {
        if ( prop.getMetaData().getMinOccurs() != 0 )
        {
            throw new InvalidSetResourcePropertiesRequestContentFaultException( getNamespaceSet(), MSG.getMessage( Keys.ERROR_PROPERTY_DELETE_VIOLATES_SCHEMA,
                    prop.getMetaData().getName() ) );
        }
    }
View Full Code Here

            {
                throw new SetResourcePropertyRequestFailedFaultException( getNamespaceSet(), fault.getFaultString() );
            }
            catch ( InvalidInsertResourcePropertiesRequestContentFaultException fault )
            {
                throw new InvalidSetResourcePropertiesRequestContentFaultException( getNamespaceSet(), fault.getFaultString() );
            }
        }

        DeleteType[] deleteElems = requestElem.getDeleteArray();
        for ( int i = 0; i < deleteElems.length; i++ )
        {
            try
            {
                deleteResourceProperty( deleteElems[i].getResourceProperty() );
            }
            catch ( DeleteResourcePropertyRequestFailedFaultException fault )
            {
                throw new SetResourcePropertyRequestFailedFaultException( getNamespaceSet(), fault.getFaultString() );
            }
        }

        UpdateType[] updateElems = requestElem.getUpdateArray();
        for ( int i = 0; i < updateElems.length; i++ )
        {
            XmlObject[] newPropElems = XmlBeanUtils.getChildElements( updateElems[i] );
            try
            {
                updateResourceProperty( newPropElems );
            }
            catch ( UpdateResourcePropertyRequestFailedFaultException fault )
            {
                throw new SetResourcePropertyRequestFailedFaultException( getNamespaceSet(), fault.getFaultString() );
            }
            catch ( InvalidUpdateResourcePropertiesRequestContentFaultException fault )
            {
                throw new InvalidSetResourcePropertiesRequestContentFaultException( getNamespaceSet(), fault.getFaultString() );
            }
        }

        return responseDoc;
    }
View Full Code Here

          Exception
   {
      checkPropertyQNameIsValid( propQName );
      if ( !isLegalNumberOfProperties( propQName, 0 ) )
      {
         throw new InvalidSetResourcePropertiesRequestContentFaultException( "Delete not allowed - the schema mandates a minimum of "
                                                                             + getMinOccursValue( propQName )
                                                                             + " " + propQName + " properties." );
      }

      if ( !isSetResourceProperty( propQName ) )
View Full Code Here

         throw new SetResourcePropertyRequestFailedFaultException( "Failed to insert property " + propQName );
      }

      if ( !isLegalNumberOfProperties( propQName, currentPropXbeans.length + requestPropElems.length ) )
      {
         throw new InvalidSetResourcePropertiesRequestContentFaultException( "Invalid number of properties specified for insert - the schema mandates a minimum of "
                                                                             + getMinOccursValue( propQName )
                                                                             + " and a maximum of "
                                                                             + getMaxOccursValue( propQName )
                                                                             + " " + propQName + " properties." );
      }
View Full Code Here

      checkContainsAtLeastOneProperty( requestPropElems );
      checkPropertyQNamesAreValid( requestPropElems );
      QName propQName = SaajUtils.getQualifiedName( requestPropElems[0] );
      if ( !isLegalNumberOfProperties( propQName, requestPropElems.length ) )
      {
         throw new InvalidSetResourcePropertiesRequestContentFaultException( "Invalid number of properties specified for update - the schema mandates a minimum of "
                                                                             + getMinOccursValue( propQName )
                                                                             + " and a maximum of "
                                                                             + getMaxOccursValue( propQName )
                                                                             + " " + propQName + " properties." );
      }
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.properties.faults.InvalidSetResourcePropertiesRequestContentFaultException

Copyright © 2018 www.massapicom. 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.