use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.SetPolicyClassifier in project netvirt by opendaylight.
the class PolicyServiceUtil method getAcePolicyClassifier.
public Optional<String> getAcePolicyClassifier(Ace ace) {
Actions actions = ace.getActions();
SetPolicyClassifier setPolicyClassifier = actions.getAugmentation(SetPolicyClassifier.class);
if (setPolicyClassifier == null) {
LOG.warn("No valid policy action found for ACE rule {}", ace.getRuleName());
return Optional.absent();
}
Class<? extends DirectionBase> direction;
try {
direction = setPolicyClassifier.getDirection();
} catch (IllegalArgumentException e) {
LOG.warn("Failed to parse policy classifier direction");
return Optional.absent();
}
if (direction == null || !direction.isAssignableFrom(DirectionEgress.class)) {
LOG.trace("Ignoring non egress policy ACE rule {}", ace.getRuleName());
return Optional.absent();
}
return Optional.of(setPolicyClassifier.getPolicyClassifier());
}
Aggregations