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     */
017    package org.apache.servicemix.common.packaging;
018    
019    import javax.xml.namespace.QName;
020    
021    /**
022     * Provides a value object for gathering information on a consumes element from
023     * a ServiceUnitAnalyzer
024     * 
025     * @author Philip Dodds
026     * @version $Revision: 426415 $
027     * @since 3.0
028     * @see ServiceUnitAnalyzer
029     */
030    public class Consumes {
031    
032            public static final int LINKTYPE_STANDARD = 1;
033    
034            public static final int LINKTYPE_HARD = 2;
035    
036            public static final int LINKTYPE_SOFT = 3;
037    
038            private QName interfaceName;
039    
040            private QName serviceName;
041    
042            private String endpointName;
043    
044            private int linkType;
045    
046            public String getEndpointName() {
047                    return endpointName;
048            }
049    
050            public void setEndpointName(String endpointName) {
051                    this.endpointName = endpointName;
052            }
053    
054            public QName getInterfaceName() {
055                    return interfaceName;
056            }
057    
058            public void setInterfaceName(QName interfaceName) {
059                    this.interfaceName = interfaceName;
060            }
061    
062            public int getLinkType() {
063                    return linkType;
064            }
065    
066            public void setLinkType(int linkType) {
067                    this.linkType = linkType;
068            }
069    
070            public QName getServiceName() {
071                    return serviceName;
072            }
073    
074            public void setServiceName(QName serviceName) {
075                    this.serviceName = serviceName;
076            }
077    
078            public boolean isValid() {
079                    return (getServiceName() != null || getInterfaceName() != null);
080            }
081    }