Migrate entity ownership to JDT annotations
[mdsal.git] / entityownership / mdsal-eos-common-api / src / main / java / org / opendaylight / mdsal / eos / common / api / GenericEntityOwnershipListenerRegistration.java
1 /*
2  * Copyright (c) 2015 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.mdsal.eos.common.api;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.concepts.ObjectRegistration;
12 import org.opendaylight.yangtools.concepts.Path;
13
14 /**
15  * An interface that records a request to register a ownership status change listener for a given Entity.
16  * Calling close on the registration will unregister listeners and future ownership changes will not
17  * be delivered to the listener.
18  *
19  * @author Thomas Pantelis
20  *
21  * @param <P> the instance identifier path type
22  */
23 public interface GenericEntityOwnershipListenerRegistration<P extends Path<P>,
24         L extends GenericEntityOwnershipListener<P, ?
25                 extends GenericEntityOwnershipChange<P, ? extends GenericEntity<P>>>>
26                     extends ObjectRegistration<L> {
27
28     /**
29      * getEntityType method returns not null entity type.
30      *
31      * @return the entity type that the listener was registered for
32      */
33     @NonNull String getEntityType();
34
35     /**
36      * Unregister the listener.
37      */
38     @Override
39     void close();
40 }