001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.geronimo.webservices;
017:
018: import java.util.ArrayList;
019:
020: public class Handler {
021: private String handlerName;
022: private String handlerClass;
023: private ArrayList soapHeaderList = new ArrayList();
024: private ArrayList soapRoleList = new ArrayList();
025:
026: public String getHandlerName() {
027: return handlerName;
028: }
029:
030: public void setHandlerName(String handlerName) {
031: this .handlerName = handlerName;
032: }
033:
034: public String getHandlerClass() {
035: return handlerClass;
036: }
037:
038: public void setHandlerClass(String handlerClass) {
039: this .handlerClass = handlerClass;
040: }
041:
042: public void addSoapHeader(String soapHeader)
043: throws IndexOutOfBoundsException {
044: soapHeaderList.add(soapHeader);
045: }
046:
047: public void addSoapHeader(int index, String soapHeader)
048: throws IndexOutOfBoundsException {
049: soapHeaderList.add(index, soapHeader);
050: }
051:
052: public boolean removeSoapHeader(String soapHeader) {
053: return soapHeaderList.remove(soapHeader);
054: }
055:
056: public String getSoapHeader(int index)
057: throws IndexOutOfBoundsException {
058: if ((index < 0) || (index > soapHeaderList.size())) {
059: throw new IndexOutOfBoundsException();
060: }
061: return (String) soapHeaderList.get(index);
062: }
063:
064: public String[] getSoapHeader() {
065: int size = soapHeaderList.size();
066: String[] mArray = new String[size];
067: for (int index = 0; index < size; index++) {
068: mArray[index] = (String) soapHeaderList.get(index);
069: }
070: return mArray;
071: }
072:
073: public void setSoapHeader(int index, String soapHeader)
074: throws IndexOutOfBoundsException {
075: if ((index < 0) || (index > soapHeaderList.size())) {
076: throw new IndexOutOfBoundsException();
077: }
078: soapHeaderList.set(index, soapHeader);
079: }
080:
081: public void setSoapHeader(String[] soapHeaderArray) {
082: soapHeaderList.clear();
083: for (int i = 0; i < soapHeaderArray.length; i++) {
084: String soapHeader = soapHeaderArray[i];
085: soapHeaderList.add(soapHeader);
086: }
087: }
088:
089: public void clearSoapHeader() {
090: soapHeaderList.clear();
091: }
092:
093: public void addSoapRole(String soapRole)
094: throws IndexOutOfBoundsException {
095: soapRoleList.add(soapRole);
096: }
097:
098: public void addSoapRole(int index, String soapRole)
099: throws IndexOutOfBoundsException {
100: soapRoleList.add(index, soapRole);
101: }
102:
103: public boolean removeSoapRole(String soapRole) {
104: return soapRoleList.remove(soapRole);
105: }
106:
107: public String getSoapRole(int index)
108: throws IndexOutOfBoundsException {
109: if ((index < 0) || (index > soapRoleList.size())) {
110: throw new IndexOutOfBoundsException();
111: }
112: return (String) soapRoleList.get(index);
113: }
114:
115: public String[] getSoapRole() {
116: int size = soapRoleList.size();
117: String[] mArray = new String[size];
118: for (int index = 0; index < size; index++) {
119: mArray[index] = (String) soapRoleList.get(index);
120: }
121: return mArray;
122: }
123:
124: public void setSoapRole(int index, String soapRole)
125: throws IndexOutOfBoundsException {
126: if ((index < 0) || (index > soapRoleList.size())) {
127: throw new IndexOutOfBoundsException();
128: }
129: soapRoleList.set(index, soapRole);
130: }
131:
132: public void setSoapRole(String[] soapRoleArray) {
133: soapRoleList.clear();
134: for (int i = 0; i < soapRoleArray.length; i++) {
135: String soapRole = soapRoleArray[i];
136: soapRoleList.add(soapRole);
137: }
138: }
139:
140: public void clearSoapRole() {
141: soapRoleList.clear();
142: }
143:
144: }
|