Coverage Report - org.kuali.rice.ksb.api.bus.support.SoapServiceConfiguration
 
Classes in this File Line Coverage Branch Coverage Complexity
SoapServiceConfiguration
83%
10/12
N/A
1
SoapServiceConfiguration$1
N/A
N/A
1
SoapServiceConfiguration$Builder
100%
16/16
N/A
1
SoapServiceConfiguration$Constants
0%
0/1
N/A
1
SoapServiceConfiguration$Elements
0%
0/1
N/A
1
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.ksb.api.bus.support;
 17  
 
 18  
 import javax.xml.bind.annotation.XmlAccessType;
 19  
 import javax.xml.bind.annotation.XmlAccessorType;
 20  
 import javax.xml.bind.annotation.XmlElement;
 21  
 import javax.xml.bind.annotation.XmlRootElement;
 22  
 import javax.xml.bind.annotation.XmlType;
 23  
 
 24  
 @XmlRootElement(name = SoapServiceConfiguration.Constants.ROOT_ELEMENT_NAME)
 25  
 @XmlAccessorType(XmlAccessType.NONE)
 26  
 @XmlType(name = SoapServiceConfiguration.Constants.TYPE_NAME, propOrder = {
 27  
                 SoapServiceConfiguration.Elements.SERVICE_INTERFACE,
 28  
                 SoapServiceConfiguration.Elements.JAX_WS_SERVICE
 29  
 })
 30  3
 public class SoapServiceConfiguration extends AbstractServiceConfiguration {
 31  
 
 32  
         private static final long serialVersionUID = -4226512121638441108L;
 33  
 
 34  
         @XmlElement(name = Elements.SERVICE_INTERFACE, required = true)
 35  
         private final String serviceInterface;
 36  
         
 37  
         @XmlElement(name = Elements.JAX_WS_SERVICE, required = true)
 38  
         private final boolean jaxWsService;
 39  
         
 40  
         /**
 41  
      * Private constructor used only by JAXB.
 42  
      */
 43  
         private SoapServiceConfiguration() {
 44  7
                 super();
 45  7
                 this.serviceInterface = null;
 46  7
                 this.jaxWsService = false;
 47  7
         }
 48  
         
 49  
         private SoapServiceConfiguration(Builder builder) {
 50  3
                 super(builder);
 51  3
                 this.serviceInterface = builder.getServiceInterface();
 52  3
                 this.jaxWsService = builder.isJaxWsService();
 53  3
         }
 54  
         
 55  
         public static SoapServiceConfiguration fromServiceDefinition(SoapServiceDefinition soapServiceDefinition) {
 56  3
                 return Builder.create(soapServiceDefinition).build();
 57  
         }
 58  
         
 59  
         public String getServiceInterface() {
 60  0
                 return serviceInterface;
 61  
         }
 62  
 
 63  
         public boolean isJaxWsService() {
 64  0
                 return jaxWsService;
 65  
         }
 66  
         
 67  84
         public static final class Builder extends AbstractServiceConfiguration.Builder<SoapServiceConfiguration> {
 68  
 
 69  
                 private static final long serialVersionUID = 722267174667364588L;
 70  
 
 71  
                 private String serviceInterface;
 72  3
                 private boolean jaxWsService = false;                
 73  
                                 
 74  
                 public String getServiceInterface() {
 75  3
                         return serviceInterface;
 76  
                 }
 77  
 
 78  
                 public void setServiceInterface(String serviceInterface) {
 79  3
                         this.serviceInterface = serviceInterface;
 80  3
                 }
 81  
 
 82  
                 public boolean isJaxWsService() {
 83  3
                         return jaxWsService;
 84  
                 }
 85  
 
 86  
                 public void setJaxWsService(boolean jaxWsService) {
 87  3
                         this.jaxWsService = jaxWsService;
 88  3
                 }
 89  
 
 90  6
                 private Builder() {}
 91  
                 
 92  
                 public static Builder create() {
 93  3
                         return new Builder();
 94  
                 }
 95  
                 
 96  
                 public static Builder create(SoapServiceDefinition soapServiceDefinition) {
 97  3
                         Builder builder = create();
 98  3
                         builder.copyServiceDefinitionProperties(soapServiceDefinition);
 99  3
                         builder.setServiceInterface(soapServiceDefinition.getServiceInterface());
 100  3
                         builder.setJaxWsService(soapServiceDefinition.isJaxWsService());
 101  3
                         return builder;
 102  
                 }
 103  
 
 104  
                 @Override
 105  
                 public SoapServiceConfiguration build() {
 106  3
                         return new SoapServiceConfiguration(this);
 107  
                 }
 108  
                 
 109  
         }
 110  
         
 111  
         /**
 112  
      * Defines some internal constants used on this class.
 113  
      */
 114  0
     static class Constants {
 115  
             final static String ROOT_ELEMENT_NAME = "soapServiceConfiguration";
 116  
         final static String TYPE_NAME = "SoapServiceConfigurationType";
 117  
     }
 118  
 
 119  
     /**
 120  
      * A private class which exposes constants which define the XML element names to use
 121  
      * when this object is marshalled to XML.
 122  
      */
 123  0
      static class Elements {
 124  
             protected final static String SERVICE_INTERFACE = "serviceInterface";
 125  
             protected final static String JAX_WS_SERVICE = "jaxWsService";
 126  
     }
 127  
         
 128  
 }