Coverage Report - org.kuali.rice.ksb.api.registry.RemoveAndPublishResult
 
Classes in this File Line Coverage Branch Coverage Complexity
RemoveAndPublishResult
0%
0/12
N/A
1
RemoveAndPublishResult$Constants
0%
0/1
N/A
1
RemoveAndPublishResult$Elements
0%
0/1
N/A
1
 
 1  
 package org.kuali.rice.ksb.api.registry;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 import java.util.Collection;
 5  
 import java.util.Collections;
 6  
 import java.util.List;
 7  
 
 8  
 import javax.xml.bind.annotation.XmlAccessType;
 9  
 import javax.xml.bind.annotation.XmlAccessorType;
 10  
 import javax.xml.bind.annotation.XmlAnyElement;
 11  
 import javax.xml.bind.annotation.XmlElement;
 12  
 import javax.xml.bind.annotation.XmlElementWrapper;
 13  
 import javax.xml.bind.annotation.XmlRootElement;
 14  
 import javax.xml.bind.annotation.XmlType;
 15  
 
 16  
 import org.kuali.rice.core.api.CoreConstants;
 17  
 import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
 18  
 import org.w3c.dom.Element;
 19  
 
 20  
 /**
 21  
  * Wraps information resulting from a "removeAndPublish" operation on the
 22  
  * registry.  Effectively contains a list of {@link ServiceEndpoint} instances
 23  
  * for services that were published and those that were removed
 24  
  * 
 25  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 26  
  *
 27  
  */
 28  
 @XmlRootElement(name = RemoveAndPublishResult.Constants.ROOT_ELEMENT_NAME)
 29  
 @XmlAccessorType(XmlAccessType.NONE)
 30  
 @XmlType(name = RemoveAndPublishResult.Constants.TYPE_NAME, propOrder = {
 31  
                 RemoveAndPublishResult.Elements.SERVICES_REMOVED,
 32  
                 RemoveAndPublishResult.Elements.SERVICES_PUBLISHED,
 33  
                 CoreConstants.CommonElements.FUTURE_ELEMENTS
 34  
 })
 35  
 public class RemoveAndPublishResult extends AbstractDataTransferObject {
 36  
 
 37  
         private static final long serialVersionUID = 4279564869510247725L;
 38  
 
 39  
         @XmlElementWrapper(name = Elements.SERVICES_REMOVED, required = false)
 40  
         @XmlElement(name = Elements.SERVICE_REMOVED, required = false)
 41  
         private final List<ServiceEndpoint> servicesRemoved;
 42  
         
 43  
         @XmlElementWrapper(name = Elements.SERVICES_PUBLISHED, required = false)
 44  
         @XmlElement(name = Elements.SERVICE_PUBLISHED, required = false)
 45  
         private final List<ServiceEndpoint> servicesPublished;
 46  
         
 47  0
     @SuppressWarnings("unused")
 48  
     @XmlAnyElement
 49  
     private final Collection<Element> _futureElements = null;
 50  
 
 51  0
         private RemoveAndPublishResult() {
 52  0
                 this.servicesRemoved = null;
 53  0
                 this.servicesPublished = null;
 54  0
         }
 55  
         
 56  0
         private RemoveAndPublishResult(List<ServiceEndpoint> servicesRemoved, List<ServiceEndpoint> servicesPublished) {
 57  0
                 this.servicesRemoved = servicesRemoved;
 58  0
                 this.servicesPublished = servicesPublished;
 59  0
         }
 60  
         
 61  
         /**
 62  
          * Creates a new {@code RemoveAndPublishResult} from the given lists of services removed and published.
 63  
          * 
 64  
          * @param servicesRemoved the list of services removed by the operation, can be a null or empty list
 65  
          * @param servicesPublished the list of services published by the operation, can be a null or empty list
 66  
          * 
 67  
          * @return the constructed {@code RemoveAndPublishResult}, should never return null
 68  
          */
 69  
         public static RemoveAndPublishResult create(List<ServiceEndpoint> servicesRemoved, List<ServiceEndpoint> servicesPublished) {
 70  0
                 return new RemoveAndPublishResult(new ArrayList<ServiceEndpoint>(servicesRemoved),
 71  
                                 new ArrayList<ServiceEndpoint>(servicesPublished));
 72  
         }
 73  
 
 74  
         /**
 75  
          * Returns an unmodifiable list of services that were removed as the result
 76  
          * of a remove-and-publish operation.
 77  
          * 
 78  
          * @return an unmodifiable list of removed services, will never be null but
 79  
          * may be empty if no services were removed
 80  
          */
 81  
         public List<ServiceEndpoint> getServicesRemoved() {
 82  0
                 return Collections.unmodifiableList(servicesRemoved);
 83  
         }
 84  
 
 85  
         /**
 86  
          * Returns an unmodifiable list of services that were published as the result
 87  
          * of a remove-and-publish operation.
 88  
          * 
 89  
          * @return an unmodifiable list of published services, will never be null but
 90  
          * may be empty if no services were published
 91  
          */
 92  
         public List<ServiceEndpoint> getServicesPublished() {
 93  0
                 return Collections.unmodifiableList(servicesPublished);
 94  
         }
 95  
         
 96  
         /**
 97  
      * Defines some internal constants used on this class.
 98  
      */
 99  0
     static class Constants {
 100  
 
 101  
             final static String ROOT_ELEMENT_NAME = "removeAndPublishResult";
 102  
         final static String TYPE_NAME = "RemoveAndPublishResultType";
 103  
     }
 104  
         
 105  
         /**
 106  
      * Exposes constants which define the XML element names to use when this object is marshalled to XML.
 107  
      */
 108  0
     static class Elements {
 109  
 
 110  
         final static String SERVICES_REMOVED = "servicesRemoved";
 111  
         final static String SERVICE_REMOVED = "serviceRemoved";
 112  
         final static String SERVICES_PUBLISHED = "servicesPublished";
 113  
         final static String SERVICE_PUBLISHED = "servicePublished";
 114  
 
 115  
     }
 116  
     
 117  
 }