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