01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.messaging;
18:
19: import org.kuali.rice.config.ConfigurationException;
20:
21: /**
22: *
23: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
24: * @version $Revision: 1.2.24.1 $ $Date: 2007/10/17 20:32:04 $
25: * @since 0.9
26: */
27: public class SOAPServiceDefinition extends ServiceDefinition {
28:
29: private static final long serialVersionUID = 5892163789061959602L;
30:
31: private String serviceInterface;
32:
33: /**
34: * Constructor that sets the bus security (i.e. digital signing) to FALSE by default.
35: */
36: public SOAPServiceDefinition() {
37: super (Boolean.FALSE);
38: }
39:
40: public String getServiceInterface() {
41: return this .serviceInterface;
42: }
43:
44: public void setServiceInterface(final String serviceInterface) {
45: this .serviceInterface = serviceInterface;
46: }
47:
48: @Override
49: public void validate() {
50: super .validate();
51: // if interface is null grab the first one and use it
52: if (getServiceInterface() == null) {
53: if (this .getService().getClass().getInterfaces().length == 0) {
54: throw new ConfigurationException(
55: "Service needs to implement interface to be exported as SOAP service");
56: }
57: setServiceInterface(this .getService().getClass()
58: .getInterfaces()[0].getName());
59: }
60: if (getBusSecurity() == null) {
61: setBusSecurity(false);
62: }
63: }
64:
65: @Override
66: public boolean isSame(final ServiceDefinition serviceDefinition) {
67: boolean same = super .isSame(serviceDefinition)
68: && serviceDefinition instanceof SOAPServiceDefinition;
69: if (!same) {
70: return same;
71: }
72: return ((SOAPServiceDefinition) serviceDefinition)
73: .getServiceInterface().equals(
74: this.getServiceInterface());
75: }
76: }
|