FileDocCategorySizeDatePackage
BindingEntry.javaAPI DocApache Axis 1.418718Sat Apr 22 18:57:28 BST 2006org.apache.axis.wsdl.symbolTable

BindingEntry

public class BindingEntry extends SymTabEntry
This class represents a WSDL binding. It encompasses the WSDL4J Binding object so it can reside in the SymbolTable. It also adds a few bits of information that are a nuisance to get from the WSDL4J Binding object: binding type, binding style, input/output/fault body types.

Fields Summary
public static final int
TYPE_SOAP
Field TYPE_SOAP
public static final int
TYPE_HTTP_GET
Field TYPE_HTTP_GET
public static final int
TYPE_HTTP_POST
Field TYPE_HTTP_POST
public static final int
TYPE_UNKNOWN
Field TYPE_UNKNOWN
public static final int
USE_ENCODED
Field USE_ENCODED
public static final int
USE_LITERAL
Field USE_LITERAL
private javax.wsdl.Binding
binding
Field binding
private int
bindingType
Field bindingType
private org.apache.axis.constants.Style
bindingStyle
Field bindingStyle
private boolean
hasLiteral
Field hasLiteral
private HashMap
attributes
Field attributes
private HashMap
parameters
Field parameters
private HashMap
faults
Field faults
private Map
mimeTypes
Field mimeTypes
private Map
headerParts
Field headerParts
private ArrayList
dimeOps
Field dimeOps
public static final int
NO_HEADER
Get the flag indicating what sort of header this part is.
public static final int
IN_HEADER
Field IN_HEADER
public static final int
OUT_HEADER
Field OUT_HEADER
Constructors Summary
public BindingEntry(javax.wsdl.Binding binding, int bindingType, org.apache.axis.constants.Style bindingStyle, boolean hasLiteral, HashMap attributes, Map mimeTypes, Map headerParts)
Construct a BindingEntry from a WSDL4J Binding object and the additional binding info: binding type, binding style, whether there is any literal binding, and the attributes which contain the input/output/fault body type information.

param
binding
param
bindingType
param
bindingStyle
param
hasLiteral
param
attributes
param
mimeTypes
param
headerParts


                                                                              
          
                             
                          

        super(binding.getQName());

        this.binding = binding;
        this.bindingType = bindingType;
        this.bindingStyle = bindingStyle;
        this.hasLiteral = hasLiteral;

        if (attributes == null) {
            this.attributes = new HashMap();
        } else {
            this.attributes = attributes;
        }

        if (mimeTypes == null) {
            this.mimeTypes = new HashMap();
        } else {
            this.mimeTypes = mimeTypes;
        }

        if (headerParts == null) {
            this.headerParts = new HashMap();
        } else {
            this.headerParts = headerParts;
        }
    
public BindingEntry(javax.wsdl.Binding binding)
This is a minimal constructor. Everything will be set up with defaults. If the defaults aren't desired, then the appropriate setter method should be called. The defaults are: bindingType = TYPE_UNKNOWN bindingStyle = DOCUMENT hasLiteral = false operation inputBodyTypes = USE_ENCODED operation outputBodyTypes = USE_ENCODED operation faultBodyTypes = USE_ENCODED mimeTypes = null

The caller of this constructor should also call the various setter methods to fully fill out this object: setBindingType, setBindingStyle, setHasLiteral, setAttribute, setMIMEType.

param
binding


        super(binding.getQName());

        this.binding = binding;
        this.bindingType = TYPE_UNKNOWN;
        this.bindingStyle = Style.DOCUMENT;
        this.hasLiteral = false;
        this.attributes = new HashMap();
        this.mimeTypes = new HashMap();
        this.headerParts = new HashMap();
    
Methods Summary
public javax.wsdl.BindinggetBinding()
Get this entry's WSDL4J Binding object.

return

        return binding;
    
public org.apache.axis.constants.StylegetBindingStyle()
Get this entry's binding style.

return

        return bindingStyle;
    
public intgetBindingType()
Get this entry's binding type. One of BindingEntry.TYPE_SOAP, BindingEntry.TYPE_HTTP_GET, BindingEntry.TYPE_HTTP_POST.

return

        return bindingType;
    
public org.apache.axis.constants.UsegetFaultBodyType(javax.wsdl.Operation operation, java.lang.String faultName)
Get the fault body type for the given fault of the given operation.

param
operation
param
faultName
return
Use.ENCODED or Use.LITERAL


        OperationAttr attr = (OperationAttr) attributes.get(operation);

        if (attr == null) {
            return Use.ENCODED;    // should really create an exception for this.
        } else {
            HashMap m = attr.getFaultBodyTypeMap();
            SOAPFault soapFault = (SOAPFault) m.get(faultName);

            // This should never happen (error thrown in SymbolTable)
            if (soapFault == null) {
                return Use.ENCODED;
            }

            String use = soapFault.getUse();

            if ("literal".equals(use)) {
                return Use.LITERAL;
            }

            return Use.ENCODED;
        }
    
public java.util.HashMapgetFaults()
Return the map of BindingOperations to ArraList of FaultBodyType

return

        return faults;
    
public java.util.MapgetHeaderParts()
Get the header parameter map.

return

        return headerParts;
    
public org.apache.axis.constants.UsegetInputBodyType(javax.wsdl.Operation operation)
Get the input body type for the given operation.

param
operation
return


        OperationAttr attr = (OperationAttr) attributes.get(operation);

        if (attr == null) {
            return Use.ENCODED;    // should really create an exception for this.
        } else {
            return attr.getInputBodyType();
        }
    
public MimeInfogetMIMEInfo(java.lang.String operationName, java.lang.String parameterName)
Get the mime mapping for the given parameter name. If there is none, this returns null.

param
operationName
param
parameterName
return


        Map opMap = (Map) mimeTypes.get(operationName);

        if (opMap == null) {
            return null;
        } else {
            return (MimeInfo) opMap.get(parameterName);
        }
    
public java.util.MapgetMIMETypes()
Get the MIME types map.

return

        return mimeTypes;
    
public java.util.SetgetOperations()
Get a {@link Set} of comprised {@link Operation} objects.

return

        return attributes.keySet();
    
public org.apache.axis.constants.UsegetOutputBodyType(javax.wsdl.Operation operation)
Get the output body type for the given operation.

param
operation
return


        OperationAttr attr = (OperationAttr) attributes.get(operation);

        if (attr == null) {
            return Use.ENCODED;    // should really create an exception for this.
        } else {
            return attr.getOutputBodyType();
        }
    
public ParametersgetParameters(javax.wsdl.Operation operation)
Get the Parameters object for the given operation.

param
operation
return

        return (Parameters) parameters.get(operation);
    
public java.util.HashMapgetParameters()
Get all of the parameters for all operations.

return

        return parameters;
    
public booleanhasLiteral()
Do any of the message stanzas contain a soap:body which uses literal?

return

        return hasLiteral;
    
private intheaderPart(java.lang.String operationName, java.lang.String partName)
Get the mime mapping for the given part name. If there is none, this returns null.

param
operationName
param
partName
return
flag indicating kind of header


                                           
          

        Map opMap = (Map) headerParts.get(operationName);

        if (opMap == null) {
            return NO_HEADER;
        } else {
            Integer I = (Integer) opMap.get(partName);

            return (I == null)
                    ? NO_HEADER
                    : I.intValue();
        }
    
public booleanisInHeaderPart(java.lang.String operationName, java.lang.String partName)
Is this part an input header part?.

param
operationName
param
partName
return

        return (headerPart(operationName, partName) & IN_HEADER) > 0;
    
public booleanisOperationDIME(java.lang.String operationName)
Check if this operation should use DIME

param
operationName
return

        return (dimeOps.indexOf(operationName) >= 0);
    
public booleanisOutHeaderPart(java.lang.String operationName, java.lang.String partName)
Is this part an output header part?.

param
operationName
param
partName
return

        return (headerPart(operationName, partName) & OUT_HEADER) > 0;
    
protected voidsetBindingStyle(org.apache.axis.constants.Style bindingStyle)
Set this entry's binding style.

param
bindingStyle

        this.bindingStyle = bindingStyle;
    
protected voidsetBindingType(int bindingType)
Set this entry's binding type.

param
bindingType


        if ((bindingType >= TYPE_SOAP) && (bindingType <= TYPE_UNKNOWN)) {
        }

        this.bindingType = bindingType;
    
protected voidsetBodyType(javax.wsdl.Operation operation, org.apache.axis.constants.Use bodyType, boolean input)
Set the body type for the given operation. If input is true, then this is the inputBodyType, otherwise it's the outputBodyType. (NOTE: this method exists to enable reusing some SymbolTable code.

param
operation
param
bodyType
param
input


        if (input) {
            setInputBodyType(operation, bodyType);
        } else {
            setOutputBodyType(operation, bodyType);
        }
    
protected voidsetFaultBodyTypeMap(javax.wsdl.Operation operation, java.util.HashMap faultBodyTypeMap)
Set the fault body type map for the given operation.

param
operation
param
faultBodyTypeMap


        OperationAttr attr = (OperationAttr) attributes.get(operation);

        if (attr == null) {
            attr = new OperationAttr();

            attributes.put(operation, attr);
        }

        attr.setFaultBodyTypeMap(faultBodyTypeMap);
    
public voidsetFaults(java.util.HashMap faults)
Method setFaults

param
faults

        this.faults = faults;
    
protected voidsetHasLiteral(boolean hasLiteral)
Set the literal flag.

param
hasLiteral

        this.hasLiteral = hasLiteral;
    
public voidsetHeaderPart(java.lang.String operationName, java.lang.String partName, int headerFlags)
Set the header part mapping for the given part name.

param
operationName
param
partName
param
headerFlags


        Map opMap = (Map) headerParts.get(operationName);

        if (opMap == null) {
            opMap = new HashMap();

            headerParts.put(operationName, opMap);
        }

        Integer I = (Integer) opMap.get(partName);
        int i = (I == null)
                ? headerFlags
                : (I.intValue() | headerFlags);

        opMap.put(partName, new Integer(i));
    
protected voidsetInputBodyType(javax.wsdl.Operation operation, org.apache.axis.constants.Use inputBodyType)
Set the input body type for the given operation.

param
operation
param
inputBodyType


        OperationAttr attr = (OperationAttr) attributes.get(operation);

        if (attr == null) {
            attr = new OperationAttr();

            attributes.put(operation, attr);
        }

        attr.setInputBodyType(inputBodyType);

        if (inputBodyType == Use.LITERAL) {
            setHasLiteral(true);
        }
    
public voidsetMIMEInfo(java.lang.String operationName, java.lang.String parameterName, java.lang.String type, java.lang.String dims)
Set the mime mapping for the given parameter name.

param
operationName
param
parameterName
param
type
param
dims


        Map opMap = (Map) mimeTypes.get(operationName);

        if (opMap == null) {
            opMap = new HashMap();

            mimeTypes.put(operationName, opMap);
        }

        opMap.put(parameterName, new MimeInfo(type, dims));
    
public voidsetOperationDIME(java.lang.String operationName)
Mark the operation as a DIME operation

param
operationName


        if (dimeOps.indexOf(operationName) == -1) {
            dimeOps.add(operationName);
        }
    
protected voidsetOutputBodyType(javax.wsdl.Operation operation, org.apache.axis.constants.Use outputBodyType)
Set the output body type for the given operation.

param
operation
param
outputBodyType


        OperationAttr attr = (OperationAttr) attributes.get(operation);

        if (attr == null) {
            attr = new OperationAttr();

            attributes.put(operation, attr);
        }

        attr.setOutputBodyType(outputBodyType);

        if (outputBodyType == Use.LITERAL) {
            setHasLiteral(true);
        }
    
public voidsetParameters(java.util.HashMap parameters)
Set the parameters for all operations

param
parameters

        this.parameters = parameters;