@Test public final void testGetDirection_directionIngress() { secRuleBuilder.setDirection(DirectionIngress.class); Assert.assertEquals(Direction.In, SecRuleEntityDecoder.getDirection(secRuleBuilder.build())); }
public static Direction getDirection(SecurityRule secRule) { Class<? extends DirectionBase> direction = secRule.getDirection(); if (direction == null) { throw new IllegalArgumentException("Direction cannot be null."); } if (direction.isAssignableFrom(DirectionIngress.class)) { return Direction.In; } if (direction.isAssignableFrom(DirectionEgress.class)) { return Direction.Out; } throw new IllegalArgumentException("Direction " + direction + " from security group rule " + secRule + " is not supported. Direction can be only 'ingress' or 'egress'."); }
SecRuleEntityDecoder { public static Direction getDirection(SecurityRule secRule) { Class<? extends DirectionBase> direction = secRule.getDirection(); if (direction == null) { throw new IllegalArgumentException("Direction cannot be null."); } if (direction.isAssignableFrom(DirectionIngress.class)) { return Direction.In; } if (direction.isAssignableFrom(DirectionEgress.class)) { return Direction.Out; } throw new IllegalArgumentException("Direction " + direction + " from security group rule " + secRule + " is not supported. Direction can be only 'ingress' or 'egress'."); } }
SecRuleEntityDecoder { public static Direction getDirection(SecurityRule secRule) { Class<? extends DirectionBase> direction = secRule.getDirection(); if (direction == null) { throw new IllegalArgumentException("Direction cannot be null."); } if (direction.isAssignableFrom(DirectionIngress.class)) { return Direction.In; } if (direction.isAssignableFrom(DirectionEgress.class)) { return Direction.Out; } throw new IllegalArgumentException("Direction " + direction + " from security group rule " + secRule + " is not supported. Direction can be only 'ingress' or 'egress'."); } private  SecRuleEntityDecoder(); }
SecRuleEntityDecoder { public static Direction getDirection(SecurityRule secRule) { Class<? extends DirectionBase> direction = secRule.getDirection(); if (direction == null) { throw new IllegalArgumentException("Direction cannot be null."); } if (direction.isAssignableFrom(DirectionIngress.class)) { return Direction.In; } if (direction.isAssignableFrom(DirectionEgress.class)) { return Direction.Out; } throw new IllegalArgumentException("Direction " + direction + " from security group rule " + secRule + " is not supported. Direction can be only 'ingress' or 'egress'."); } private  SecRuleEntityDecoder(); static ContractId getContractId(SecurityRule secRule); static ClassifierInstance getClassifierInstance(SecurityRule secRule); static ActionRef createActionRefFromActionChoice(ActionChoice action); static ClassifierRef getClassifierRef(SecurityRule secRule); static Direction getDirection(SecurityRule secRule); static Clause getClause(SecurityRule secRule); static boolean isEtherTypeOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isProtocolOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two); static Long getEtherType(SecurityRule secRule); static Long getProtocol(SecurityRule secRule); }
SecRuleEntityDecoder { public static Direction getDirection(SecurityRule secRule) { Class<? extends DirectionBase> direction = secRule.getDirection(); if (direction == null) { throw new IllegalArgumentException("Direction cannot be null."); } if (direction.isAssignableFrom(DirectionIngress.class)) { return Direction.In; } if (direction.isAssignableFrom(DirectionEgress.class)) { return Direction.Out; } throw new IllegalArgumentException("Direction " + direction + " from security group rule " + secRule + " is not supported. Direction can be only 'ingress' or 'egress'."); } private  SecRuleEntityDecoder(); static ContractId getContractId(SecurityRule secRule); static ClassifierInstance getClassifierInstance(SecurityRule secRule); static ActionRef createActionRefFromActionChoice(ActionChoice action); static ClassifierRef getClassifierRef(SecurityRule secRule); static Direction getDirection(SecurityRule secRule); static Clause getClause(SecurityRule secRule); static boolean isEtherTypeOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isProtocolOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two); static Long getEtherType(SecurityRule secRule); static Long getProtocol(SecurityRule secRule);  }