Package org.apache.muse.ws.resource.properties.schema

Examples of org.apache.muse.ws.resource.properties.schema.ResourcePropertiesSchema


    private Object _securityToken = new Object();
   
    public synchronized void addCapability(WsResourceCapability capability)
    {
        QName[] names = capability.getPropertyNames();
        ResourcePropertiesSchema schema = getSchema();
       
        for (int n = 0; n < names.length; ++n)
            schema.setCapability(names[n], capability);
    }
View Full Code Here


     *
     */
    protected void validateInsert(QName qname, int currentSize, Element[] values)
        throws BaseFault
    {
        ResourcePropertiesSchema schema = getSchema();
       
        //
        // make sure that adding value.length instances will not put us
        // above the maximum (if any)
        //
        int max = schema.getMaxOccurs(qname);
        int total = currentSize + values.length;
       
        if (!_schema.isMaxUnbounded(qname) && total > max)
        {
            Object[] filler = { qname, new Integer(max), new Integer(total) };
            throw new SchemaValidationFault(_MESSAGES.get("AboveMaximumPotential", filler));
        }
       
        //
        // are we trying to set to null when we shouldn't be?
        //
        boolean isNillable = schema.isNillable(qname);
       
        for (int n = 0; n < values.length; ++n)
        {
            if (!isNillable && !values[n].hasChildNodes())
            {
View Full Code Here

        throws BaseFault
    {       
        //
        // for every property in the schema, check the size constraints
        //
        ResourcePropertiesSchema schema = getSchema();
        Iterator i = schema.getPropertyNames().iterator();
       
        while (i.hasNext())
        {
            QName qname = (QName)i.next();
           
            if (!schema.hasCapability(qname))
            {
                Object[] filler = { qname };
                throw new IllegalStateException(_MESSAGES.get("NoCapabilityForProperty", filler));
            }
           
            int max = schema.getMaxOccurs(qname);
            boolean maxUnbounded = schema.isMaxUnbounded(qname);
           
            int min = schema.getMinOccurs(qname);
           
            boolean isNillable = schema.isNillable(qname);
           
            //
            // get all current instances
            //
            Element[] instances = getResourceProperty(qname);
View Full Code Here

        //
        // get the WSDL, which has the WS-RP definition/schema
        //
        Document wsdl = WsdlUtils.createWSDL(getEnvironment(), getWsdlPath(), true);
       
        ResourcePropertiesSchema schema = createPropertiesSchema(wsdl);
        _properties.setSchema(schema);
       
        MetadataDescriptor metadata = createMetadataDescriptor(wsdl);
        _properties.setMetadata(metadata);
       
View Full Code Here

        //
        // get the WSDL, which has the WS-RP definition/schema
        //
        Document wsdl = WsdlUtils.createWSDL(getEnvironment(), getWsdlPath(), true);
       
        ResourcePropertiesSchema schema = createPropertiesSchema(wsdl);
        _properties.setSchema(schema);
       
        MetadataDescriptor metadata = createMetadataDescriptor(wsdl);
        _properties.setMetadata(metadata);
       
View Full Code Here

    private Object _securityToken = new Object();
   
    public synchronized void addCapability(WsResourceCapability capability)
    {
        QName[] names = capability.getPropertyNames();
        ResourcePropertiesSchema schema = getSchema();
       
        for (int n = 0; n < names.length; ++n)
            schema.setCapability(names[n], capability);
    }
View Full Code Here

     *
     */
    protected void validateInsert(QName qname, int currentSize, Element[] values)
        throws BaseFault
    {
        ResourcePropertiesSchema schema = getSchema();
       
        //
        // make sure that adding value.length instances will not put us
        // above the maximum (if any)
        //
        int max = schema.getMaxOccurs(qname);
        int total = currentSize + values.length;
       
        if (!_schema.isMaxUnbounded(qname) && total > max)
        {
            Object[] filler = { qname, new Integer(max), new Integer(total) };
            throw new SchemaValidationFault(_MESSAGES.get("AboveMaximumPotential", filler));
        }
       
        //
        // not nillable yet still null?
        //
        validateNillable(qname, values, schema.isNillable(qname));
    }
View Full Code Here

        throws BaseFault
    {       
        //
        // for every property in the schema, check the size constraints
        //
        ResourcePropertiesSchema schema = getSchema();
        Iterator i = schema.getPropertyNames().iterator();
       
        while (i.hasNext())
        {
            QName qname = (QName)i.next();
           
            if (!schema.hasCapability(qname))
            {
                Object[] filler = { qname };
                throw new IllegalStateException(_MESSAGES.get("NoCapabilityForProperty", filler));
            }
           
            int max = schema.getMaxOccurs(qname);
            boolean maxUnbounded = schema.isMaxUnbounded(qname);
            int min = schema.getMinOccurs(qname);
            boolean isNillable = schema.isNillable(qname);
           
            //
            // get all current instances
            //
            Element[] instances = getResourceProperty(qname);
View Full Code Here

        //
        // get the WSDL, which has the WS-RP definition/schema
        //
        Document wsdl = WsdlUtils.createWSDL(getEnvironment(), getWsdlPath(), true);
       
        ResourcePropertiesSchema schema = createPropertiesSchema(wsdl);
        _properties.setSchema(schema);
       
        MetadataDescriptor metadata = createMetadataDescriptor(wsdl);
        _properties.setMetadata(metadata);
       
View Full Code Here

    private Object _securityToken = new Object();
   
    public synchronized void addCapability(WsResourceCapability capability)
    {
        QName[] names = capability.getPropertyNames();
        ResourcePropertiesSchema schema = getSchema();
       
        for (int n = 0; n < names.length; ++n)
            schema.setCapability(names[n], capability);
    }
View Full Code Here

TOP

Related Classes of org.apache.muse.ws.resource.properties.schema.ResourcePropertiesSchema

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.