Tabnine Logo
BatfishLogger.info
Code IndexAdd Tabnine to your IDE (free)

How to use
info
method
in
org.batfish.common.BatfishLogger

Best Java code snippets using org.batfish.common.BatfishLogger.info (Showing top 20 results out of 315)

origin: batfish/batfish

private void unsetTestrig(boolean doDelta) {
 if (doDelta) {
  _currDeltaTestrig = null;
  _logger.info("Reference snapshot is now unset\n");
 } else {
  _currTestrig = null;
  _logger.info("Current snapshot is now unset\n");
 }
}
origin: batfish/batfish

public void infof(String format, Object... args) {
 info(String.format(format, args));
}
origin: batfish/batfish

/** Redirect to /networks if the user does not supply a network ID. */
@GET
@Path(CoordConstsV2.RSC_NETWORK)
public Response redirectNetwork() {
 _logger.info("WMS2:redirect network\n");
 return Response.status(Status.MOVED_PERMANENTLY)
   .location(_uriInfo.getRequestUri().resolve(CoordConstsV2.RSC_NETWORKS))
   .build();
}
origin: batfish/batfish

public void printElapsedTime() {
 double seconds = getElapsedTime(_timerCount);
 info("Time taken for this task: " + seconds + " seconds\n");
}
origin: batfish/batfish

/** Returns the list of {@link Container networks} that the given API key may access. */
@GET
@Path(CoordConstsV2.RSC_NETWORKS)
public Response getNetworks() {
 _logger.info("WMS2:getNetworks\n");
 List<Container> containers = Main.getWorkMgr().getContainers(_apiKey);
 return Response.ok(containers).build();
}
origin: batfish/batfish

@GET
@Produces(MediaType.APPLICATION_JSON)
public JSONArray getInfo() {
 _logger.info("PMS:getInfo\n");
 return new JSONArray(
   Arrays.asList(
     CoordConsts.SVC_KEY_SUCCESS,
     "Batfish coordinator v"
       + Version.getVersion()
       + ". Enter ../application.wadl (relative to your URL) to see supported methods"));
}
origin: batfish/batfish

public Set<Flow> computeCompositeNodOutput(
  List<CompositeNodJob> jobs, NodAnswerElement answerElement) {
 _logger.info("\n*** EXECUTING COMPOSITE NOD JOBS ***\n");
 _logger.resetTimer();
 Set<Flow> flows = new TreeSet<>();
 BatfishJobExecutor.runJobsInExecutor(
   _settings, _logger, jobs, flows, answerElement, true, "Composite NOD");
 _logger.printElapsedTime();
 return flows;
}
origin: batfish/batfish

private SortedMap<String, BgpAdvertisementsByVrf> deserializeEnvironmentBgpTables(
  Path serializeEnvironmentBgpTablesPath) {
 _logger.info("\n*** DESERIALIZING ENVIRONMENT BGP TABLES ***\n");
 _logger.resetTimer();
 Map<Path, String> namesByPath = new TreeMap<>();
 try (DirectoryStream<Path> serializedBgpTables =
   Files.newDirectoryStream(serializeEnvironmentBgpTablesPath)) {
  for (Path serializedBgpTable : serializedBgpTables) {
   String name = serializedBgpTable.getFileName().toString();
   namesByPath.put(serializedBgpTable, name);
  }
 } catch (IOException e) {
  throw new BatfishException("Error reading serialized BGP tables directory", e);
 }
 SortedMap<String, BgpAdvertisementsByVrf> bgpTables =
   deserializeObjects(namesByPath, BgpAdvertisementsByVrf.class);
 _logger.printElapsedTime();
 return bgpTables;
}
origin: batfish/batfish

public Map<String, GenericConfigObject> deserializeVendorConfigurations(
  Path serializedVendorConfigPath) {
 _logger.info("\n*** DESERIALIZING VENDOR CONFIGURATION STRUCTURES ***\n");
 _logger.resetTimer();
 Map<Path, String> namesByPath = new TreeMap<>();
 try (DirectoryStream<Path> serializedConfigs =
   Files.newDirectoryStream(serializedVendorConfigPath)) {
  for (Path serializedConfig : serializedConfigs) {
   String name = serializedConfig.getFileName().toString();
   namesByPath.put(serializedConfig, name);
  }
 } catch (IOException e) {
  throw new BatfishException("Error reading vendor configs directory", e);
 }
 Map<String, GenericConfigObject> vendorConfigurations =
   deserializeObjects(namesByPath, GenericConfigObject.class);
 _logger.printElapsedTime();
 return vendorConfigurations;
}
origin: batfish/batfish

@GET
@Path(CoordConsts.SVC_RSC_POOL_GETSTATUS)
@Produces(MediaType.APPLICATION_JSON)
public JSONArray getStatus() {
 try {
  _logger.info("PMS:getStatus\n");
  Map<String, String> poolStatus = Main.getPoolMgr().getPoolStatus();
  JSONObject obj = new JSONObject(poolStatus);
  return new JSONArray(Arrays.asList(CoordConsts.SVC_KEY_SUCCESS, obj.toString()));
 } catch (Exception e) {
  _logger.errorf("PMS:getStatus exception: %s\n", Throwables.getStackTraceAsString(e));
  return new JSONArray(Arrays.asList(CoordConsts.SVC_KEY_FAILURE, e.getMessage()));
 }
}
origin: batfish/batfish

private void serializeEnvironmentRoutingTables(
  SortedMap<String, RoutesByVrf> routingTables, Path outputPath) {
 if (routingTables == null) {
  throw new BatfishException("Exiting due to parsing error(s)");
 }
 _logger.info("\n*** SERIALIZING ENVIRONMENT ROUTING TABLES ***\n");
 _logger.resetTimer();
 outputPath.toFile().mkdirs();
 SortedMap<Path, RoutesByVrf> output = new TreeMap<>();
 routingTables.forEach(
   (name, rt) -> {
    Path currentOutputPath = outputPath.resolve(name);
    output.put(currentOutputPath, rt);
   });
 serializeObjects(output);
 _logger.printElapsedTime();
}
origin: batfish/batfish

private void serializeEnvironmentBgpTables(
  SortedMap<String, BgpAdvertisementsByVrf> bgpTables, Path outputPath) {
 if (bgpTables == null) {
  throw new BatfishException("Exiting due to parsing error(s)");
 }
 _logger.info("\n*** SERIALIZING ENVIRONMENT BGP TABLES ***\n");
 _logger.resetTimer();
 outputPath.toFile().mkdirs();
 SortedMap<Path, BgpAdvertisementsByVrf> output = new TreeMap<>();
 bgpTables.forEach(
   (name, rt) -> {
    Path currentOutputPath = outputPath.resolve(name);
    output.put(currentOutputPath, rt);
   });
 serializeObjects(output);
 _logger.printElapsedTime();
}
origin: batfish/batfish

public Set<Flow> computeNodOutput(List<NodJob> jobs) {
 _logger.info("\n*** EXECUTING NOD JOBS ***\n");
 _logger.resetTimer();
 Set<Flow> flows = new TreeSet<>();
 BatfishJobExecutor.runJobsInExecutor(
   _settings, _logger, jobs, flows, new NodAnswerElement(), true, "NOD");
 _logger.printElapsedTime();
 return flows;
}
origin: batfish/batfish

@Override
public InitInfoAnswerElement initInfoBgpAdvertisements(boolean summary, boolean verboseError) {
 ParseEnvironmentBgpTablesAnswerElement parseAnswer =
   loadParseEnvironmentBgpTablesAnswerElement();
 InitInfoAnswerElement answerElement = mergeParseAnswer(summary, verboseError, parseAnswer);
 _logger.info(answerElement.prettyPrint());
 return answerElement;
}
origin: batfish/batfish

@Override
public InitInfoAnswerElement initInfoRoutes(boolean summary, boolean verboseError) {
 ParseEnvironmentRoutingTablesAnswerElement parseAnswer =
   loadParseEnvironmentRoutingTablesAnswerElement();
 InitInfoAnswerElement answerElement = mergeParseAnswer(summary, verboseError, parseAnswer);
 _logger.info(answerElement.prettyPrint());
 return answerElement;
}
origin: batfish/batfish

@GET
@Path(CoordConsts.SVC_RSC_GETSTATUS)
@Produces(MediaType.APPLICATION_JSON)
public JSONArray getStatus() {
 try {
  _logger.info("WMS:getStatus\n");
  JSONObject retObject = Main.getWorkMgr().getStatusJson();
  retObject.put("service-version", Version.getVersion());
  return successResponse(retObject);
 } catch (Exception e) {
  String stackTrace = Throwables.getStackTraceAsString(e);
  _logger.errorf("WMS:getStatus exception: %s", stackTrace);
  return failureResponse(e.getMessage());
 }
}
origin: batfish/batfish

@GET
@Produces(MediaType.APPLICATION_JSON)
public JSONArray getInfo() {
 _logger.info("WMS:getInfo\n");
 try {
  JSONObject map = new JSONObject();
  map.put("Service name", "Batfish coordinator");
  map.put(CoordConsts.SVC_KEY_VERSION, Version.getVersion());
  map.put("APIs", "Enter ../application.wadl (relative to your URL) to see supported methods");
  return successResponse(map);
 } catch (Exception e) {
  String stackTrace = Throwables.getStackTraceAsString(e);
  _logger.errorf("WMS:getInfo exception: %s", stackTrace);
  return failureResponse(e.getMessage());
 }
}
origin: batfish/batfish

@Override
public InitInfoAnswerElement initInfo(boolean summary, boolean verboseError) {
 ParseVendorConfigurationAnswerElement parseAnswer = loadParseVendorConfigurationAnswerElement();
 InitInfoAnswerElement answerElement = mergeParseAnswer(summary, verboseError, parseAnswer);
 mergeConvertAnswer(summary, verboseError, answerElement);
 _logger.info(answerElement.prettyPrint());
 return answerElement;
}
origin: batfish/batfish

CompressDataPlaneResult computeCompressedDataPlane(HeaderSpace headerSpace) {
 // Since compression mutates the configurations, we must clone them before that happens.
 // A simple way to do this is to create a deep clone of each entry using Java serialization.
 _logger.info("Computing compressed dataplane\n");
 Map<String, Configuration> clonedConfigs =
   loadConfigurations()
     .entrySet()
     .parallelStream()
     .collect(toMap(Entry::getKey, entry -> SerializationUtils.clone(entry.getValue())));
 Map<String, Configuration> configs =
   new BatfishCompressor(new BDDPacket(), this, clonedConfigs).compress(headerSpace);
 Topology topo = TopologyUtil.synthesizeL3Topology(configs);
 DataPlanePlugin dataPlanePlugin = getDataPlanePlugin();
 ComputeDataPlaneResult result = dataPlanePlugin.computeDataPlane(configs, topo);
 _storage.storeCompressedConfigurations(
   configs, _settings.getContainer(), _testrigSettings.getName());
 return new CompressDataPlaneResult(configs, result._dataPlane, result._answerElement);
}
origin: batfish/batfish

public void handleSigInt() {
 _logger.info("Got SIGINT\n");
 WorkItem wItem = _polledWorkItem;
 if (wItem != null) {
  _logger.outputf("Killing %s\n", wItem.getId());
  boolean result = _workHelper.killWork(_polledWorkItem.getId());
  _logger.outputf("Result of killing %s: %s\n", wItem.getId(), result);
 } else {
  _logger.output("No work being polled\n");
 }
}
org.batfish.commonBatfishLoggerinfo

Popular methods of BatfishLogger

  • <init>
  • debugf
  • errorf
  • error
  • infof
  • warnf
  • debug
  • getLogLevel
  • getLogLevelStr
  • output
  • append
  • getHistory
  • append,
  • getHistory,
  • isActive,
  • setLogLevel,
  • warn,
  • close,
  • getElapsedTime,
  • getPrintStream,
  • getRotatedLogFilename

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now