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.TransportSender;
027:
028: import java.util.ArrayList;
029:
030: /**
031: * Represents a transport deployed in AXis2
032: */
033: public class TransportOutDescription implements ParameterInclude {
034:
035: /**
036: * Field flowInclude
037: */
038: private Flow faultFlow;
039: private Phase faultPhase;
040:
041: /**
042: * Field name
043: */
044: protected String name;
045:
046: /**
047: * Field outFlow
048: */
049: private Flow outFlow;
050: private Phase outPhase;
051:
052: /**
053: * Field paramInclude
054: */
055: protected final ParameterInclude paramInclude;
056: protected TransportSender sender;
057:
058: /**
059: * Constructor AxisTransport.
060: *
061: * @param name
062: */
063: public TransportOutDescription(String name) {
064: paramInclude = new ParameterIncludeImpl();
065: this .name = name;
066: outPhase = 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: /**
097: * @return Returns QName.
098: */
099: public String getName() {
100: return name;
101: }
102:
103: public Flow getOutFlow() {
104: return outFlow;
105: }
106:
107: public Phase getOutPhase() {
108: return outPhase;
109: }
110:
111: /**
112: * Method getParameter.
113: *
114: * @param name
115: * @return Returns Parameter.
116: */
117: public Parameter getParameter(String name) {
118: return paramInclude.getParameter(name);
119: }
120:
121: public ArrayList getParameters() {
122: return paramInclude.getParameters();
123: }
124:
125: /**
126: * @return Returns TransportSender.
127: */
128: public TransportSender getSender() {
129: return sender;
130: }
131:
132: // to check whether the parameter is locked at any level
133: public boolean isParameterLocked(String parameterName) {
134: return paramInclude.isParameterLocked(parameterName);
135: }
136:
137: public void setFaultFlow(Flow faultFlow) {
138: this .faultFlow = faultFlow;
139: }
140:
141: public void setFaultPhase(Phase faultPhase) {
142: this .faultPhase = faultPhase;
143: }
144:
145: /**
146: * @param name
147: */
148: public void setName(String name) {
149: this .name = name;
150: }
151:
152: public void setOutFlow(Flow outFlow) {
153: this .outFlow = outFlow;
154: }
155:
156: public void setOutPhase(Phase outPhase) {
157: this .outPhase = outPhase;
158: }
159:
160: /**
161: * @param sender
162: */
163: public void setSender(TransportSender sender) {
164: this.sender = sender;
165: }
166: }
|