Bump cds-access-api ABIVersion
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / concepts / AbstractResponseProxy.java
1 /*
2  * Copyright (c) 2016 Cisco 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.cluster.access.concepts;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.concepts.WritableIdentifier;
12
13 /**
14  * Abstract Externalizable proxy class to use with {@link Response} subclasses.
15  *
16  * @author Robert Varga
17  *
18  * @param <T> Target identifier type
19  * @param <C> Message class
20  */
21 abstract class AbstractResponseProxy<T extends WritableIdentifier, C extends Response<T, C>>
22         extends AbstractMessageProxy<T, C> {
23     private static final long serialVersionUID = 1L;
24
25     protected AbstractResponseProxy() {
26         // for Externalizable
27     }
28
29     AbstractResponseProxy(final @NonNull C response) {
30         super(response);
31     }
32
33     @Override
34     final C createMessage(final T target, final long sequence) {
35         return createResponse(target, sequence);
36     }
37
38     abstract @NonNull C createResponse(@NonNull T target, long sequence);
39 }