622f7470bd9cb91b84ae1333870af824507c302c
[groupbasedpolicy.git] / sxp-mapper / src / main / java / org / opendaylight / groupbasedpolicy / sxp / mapper / impl / util / L3EPServiceUtil.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.groupbasedpolicy.sxp.mapper.impl.util;
9
10 import com.google.common.util.concurrent.FutureCallback;
11 import javax.annotation.Nullable;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
14
15 /**
16  * Purpose: TODO!
17  */
18 public final class L3EPServiceUtil {
19
20     private static final Logger LOG = LoggerFactory.getLogger(L3EPServiceUtil.class);
21
22     private L3EPServiceUtil() {
23         throw new IllegalAccessError("constructing util class");
24     }
25
26     public static <O> FutureCallback<O> createFailureLoggingCallback(final String failMessage) {
27         return new FutureCallback<O>() {
28             @Override
29             public void onSuccess(@Nullable final O result) {
30                 // NOOP
31             }
32
33             @Override
34             public void onFailure(final Throwable t) {
35                 LOG.warn(failMessage, t);
36             }
37         };
38     }
39
40 }