Bump odlparent to 6.0.0
[controller.git] / opendaylight / blueprint / src / main / java / org / opendaylight / controller / blueprint / ext / MandatoryServiceReferenceMetadata.java
1 /*
2  * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.blueprint.ext;
9
10 import static java.util.Objects.requireNonNull;
11
12 import java.util.Collection;
13 import java.util.Collections;
14 import java.util.List;
15 import org.osgi.service.blueprint.reflect.ReferenceListener;
16 import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
17
18 /**
19  * A ServiceReferenceMetadata implementation for a mandatory OSGi service.
20  *
21  * @author Thomas Pantelis
22  */
23 class MandatoryServiceReferenceMetadata implements ServiceReferenceMetadata {
24     private final String interfaceClass;
25     private final String id;
26
27     MandatoryServiceReferenceMetadata(final String id, final String interfaceClass) {
28         this.id = requireNonNull(id);
29         this.interfaceClass = interfaceClass;
30     }
31
32     @Override
33     public String getId() {
34         return id;
35     }
36
37     @Override
38     public int getActivation() {
39         return ACTIVATION_EAGER;
40     }
41
42     @Override
43     public List<String> getDependsOn() {
44         return Collections.emptyList();
45     }
46
47     @Override
48     public int getAvailability() {
49         return AVAILABILITY_MANDATORY;
50     }
51
52     @Override
53     public String getInterface() {
54         return interfaceClass;
55     }
56
57     @Override
58     public String getComponentName() {
59         return null;
60     }
61
62     @Override
63     public String getFilter() {
64         return ComponentProcessor.DEFAULT_TYPE_FILTER;
65     }
66
67     @Override
68     public Collection<ReferenceListener> getReferenceListeners() {
69         return Collections.emptyList();
70     }
71 }