001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019:
020: package org.apache.axis2.description;
021:
022: import org.apache.axiom.om.OMElement;
023: import org.apache.axis2.AxisFault;
024: import org.apache.axis2.engine.Phase;
025: import org.apache.axis2.phaseresolver.PhaseMetadata;
026: import org.apache.axis2.transport.TransportListener;
027:
028: import javax.xml.namespace.QName;
029: import java.util.ArrayList;
030:
031: /**
032: * Represents an incoming transport deployed in Axis2.
033: */
034: public class TransportInDescription implements ParameterInclude {
035:
036: /**
037: * Field flowInclude
038: */
039: private Flow faultFlow;
040:
041: // Stores handler Fault in inFlow
042: private Phase faultPhase;
043:
044: /**
045: * Field flowInclude
046: */
047: private Flow inFlow;
048:
049: // to store handler in inFlow
050: private Phase inPhase;
051:
052: /**
053: * Field name
054: */
055: protected String name;
056:
057: /**
058: * Field paramInclude
059: */
060: protected final ParameterInclude paramInclude;
061: protected TransportListener receiver;
062:
063: public TransportInDescription(String name) {
064: paramInclude = new ParameterIncludeImpl();
065: this .name = name;
066: inPhase = new Phase(PhaseMetadata.TRANSPORT_PHASE);
067: faultPhase = new Phase(PhaseMetadata.TRANSPORT_PHASE);
068: }
069:
070: /**
071: * Method addParameter.
072: *
073: * @param param
074: */
075: public void addParameter(Parameter param) throws AxisFault {
076: paramInclude.addParameter(param);
077: }
078:
079: public void removeParameter(Parameter param) throws AxisFault {
080: paramInclude.removeParameter(param);
081: }
082:
083: public void deserializeParameters(OMElement parameterElement)
084: throws AxisFault {
085: this .paramInclude.deserializeParameters(parameterElement);
086: }
087:
088: public Flow getFaultFlow() {
089: return faultFlow;
090: }
091:
092: public Phase getFaultPhase() {
093: return faultPhase;
094: }
095:
096: public Flow getInFlow() {
097: return inFlow;
098: }
099:
100: public Phase getInPhase() {
101: return inPhase;
102: }
103:
104: /**
105: * Get Transport name as a QName
106: * @return Returns QName.
107: */
108: public String getName() {
109: return name;
110: }
111:
112: /**
113: * Method getParameter.
114: *
115: * @param name
116: * @return Returns Parameter.
117: */
118: public Parameter getParameter(String name) {
119: return paramInclude.getParameter(name);
120: }
121:
122: public ArrayList getParameters() {
123: return paramInclude.getParameters();
124: }
125:
126: /**
127: * @return Returns TransportListener.
128: */
129: public TransportListener getReceiver() {
130: return receiver;
131: }
132:
133: // to check whether the parameter is locked at any level
134: public boolean isParameterLocked(String parameterName) {
135: return paramInclude.isParameterLocked(parameterName);
136: }
137:
138: public void setFaultFlow(Flow faultFlow) {
139: this .faultFlow = faultFlow;
140: }
141:
142: public void setFaultPhase(Phase faultPhase) {
143: this .faultPhase = faultPhase;
144: }
145:
146: public void setInFlow(Flow inFlow) {
147: this .inFlow = inFlow;
148: }
149:
150: public void setInPhase(Phase inPhase) {
151: this .inPhase = inPhase;
152: }
153:
154: /**
155: * @param name
156: */
157: public void setName(String name) {
158: this .name = name;
159: }
160:
161: /**
162: * @param receiver
163: */
164: public void setReceiver(TransportListener receiver) {
165: this.receiver = receiver;
166: }
167: }
|