@Test public void createOperationalRouteDefinition() throws Exception { final RoutingDefinition routingDefinition = new RoutingDefinitionBuilder().setInterface(DUMMY_IFACE) .setIpAddress(IpAddressBuilder.getDefaultInstance(DUMMY_ADDRESS_IPV4)) .setNetmask(IpAddressBuilder.getDefaultInstance(DUMMY_NETMASK_IPV4)) .build(); final long beforeCreated = (System.currentTimeMillis() / 1000) * 1000; final RoutingDefinition actual = RouteUtil.createOperationalRouteDefinition(routingDefinition, true, "dummy explanation"); Assert.assertEquals(DUMMY_ADDRESS_IPV4, String.valueOf(actual.getIpAddress().stringValue())); Assert.assertEquals(DUMMY_NETMASK_IPV4, String.valueOf(actual.getNetmask().stringValue())); Assert.assertEquals(DUMMY_IFACE, actual.getInterface()); Assert.assertTrue(actual.isConsistent()); Assert.assertEquals("dummy explanation", actual.getInfo()); Assert.assertTrue(TimeConv.toLong(actual.getTimestamp()) >= beforeCreated); }
public static RoutingDefinition createOperationalRouteDefinition( @Nonnull final RoutingDefinition originalDefinition, final boolean consistent, final String info) { return new RoutingDefinitionBuilder(originalDefinition).setTimestamp(TimeConv.toDt(System.currentTimeMillis())) .setConsistent(consistent) .setInfo(info) .build(); }
RouteUtil { public static RoutingDefinition createOperationalRouteDefinition( @Nonnull final RoutingDefinition originalDefinition, final boolean consistent, final String info) { return new RoutingDefinitionBuilder(originalDefinition).setTimestamp(TimeConv.toDt(System.currentTimeMillis())) .setConsistent(consistent) .setInfo(info) .build(); } }
RouteUtil { public static RoutingDefinition createOperationalRouteDefinition( @Nonnull final RoutingDefinition originalDefinition, final boolean consistent, final String info) { return new RoutingDefinitionBuilder(originalDefinition).setTimestamp(TimeConv.toDt(System.currentTimeMillis())) .setConsistent(consistent) .setInfo(info) .build(); }  }
RouteUtil { public static RoutingDefinition createOperationalRouteDefinition( @Nonnull final RoutingDefinition originalDefinition, final boolean consistent, final String info) { return new RoutingDefinitionBuilder(originalDefinition).setTimestamp(TimeConv.toDt(System.currentTimeMillis())) .setConsistent(consistent) .setInfo(info) .build(); }  static String addressToString(IpAddress address); static Collection<SxpNode> findSxpNodesOnVirtualIp(final IpAddress virtualIp,
            final Collection<SxpNode> sxpNodes); static RoutingDefinition createOperationalRouteDefinition(
            @Nonnull final RoutingDefinition originalDefinition, final boolean consistent, final String info); static RoutingDefinition extractRoutingDefinition(final Routing existingRouting); }
RouteUtil { public static RoutingDefinition createOperationalRouteDefinition( @Nonnull final RoutingDefinition originalDefinition, final boolean consistent, final String info) { return new RoutingDefinitionBuilder(originalDefinition).setTimestamp(TimeConv.toDt(System.currentTimeMillis())) .setConsistent(consistent) .setInfo(info) .build(); }  static String addressToString(IpAddress address); static Collection<SxpNode> findSxpNodesOnVirtualIp(final IpAddress virtualIp,
            final Collection<SxpNode> sxpNodes); static RoutingDefinition createOperationalRouteDefinition(
            @Nonnull final RoutingDefinition originalDefinition, final boolean consistent, final String info); static RoutingDefinition extractRoutingDefinition(final Routing existingRouting);  }