BUG-2383 : wired cluster id with effective RIB
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / AbstractImportPolicy.java
index d917450cd5e80d938a78f85070b272ce67378c5b..9544893a935d1755b907a50c7e32916bd24d7a5c 100644 (file)
@@ -7,63 +7,18 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
-import java.util.EnumMap;
-import java.util.Map;
 import javax.annotation.Nullable;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerRole;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 
 /**
  * Defines the internal hooks invoked when a new route appears.
  */
 abstract class AbstractImportPolicy {
-    // Invoked on routes which we get from outside of our home AS
-    private static final class FromExternalImportPolicy extends AbstractImportPolicy {
-        @Override
-        ContainerNode effectiveAttributes(final ContainerNode attributes) {
-            // FIXME: filter all non-transitive attributes
-            // FIXME: but that may end up hurting our informedness
-            return attributes;
-        }
-    }
-
-    // Invoked on routes which we get from our normal home AS peers.
-    private static class FromInternalImportPolicy extends AbstractImportPolicy {
-        @Override
-        ContainerNode effectiveAttributes(final ContainerNode attributes) {
-            // FIXME: Implement filtering according to <a href="http://tools.ietf.org/html/rfc4456#section-8"/>.
-            return attributes;
-        }
-    }
-
-    /**
-     * Invoked on routes which we get from our reflector peers. This is a special-case of
-     * FromInternalImportPolicy.
-     *
-     */
-    private static final class FromReflectorClientImportPolicy extends FromInternalImportPolicy {
-        // FIXME: override if necessary
-    }
-
-    private static final Map<PeerRole, AbstractImportPolicy> POLICIES;
-
-    static {
-        final Map<PeerRole, AbstractImportPolicy> p = new EnumMap<PeerRole, AbstractImportPolicy>(PeerRole.class);
-        p.put(PeerRole.Ebgp, new FromExternalImportPolicy());
-        p.put(PeerRole.Ibgp, new FromInternalImportPolicy());
-        p.put(PeerRole.RrClient, new FromReflectorClientImportPolicy());
-        POLICIES = p;
-    }
-
-    static AbstractImportPolicy forRole(final PeerRole peerRole) {
-        return POLICIES.get(peerRole);
-    }
-
     /**
      * Transform incoming attributes according to policy.
      *
      * @param attributes received attributes
      * @return Filtered attributes, or null if the advertisement should be ignored.
      */
-    abstract @Nullable ContainerNode effectiveAttributes(@Nullable ContainerNode attributes);
+    @Nullable abstract ContainerNode effectiveAttributes(@Nullable ContainerNode attributes);
 }
\ No newline at end of file