Cisco Systems, Inc.

com.cisco.scabb.servconf.mgmt
Class ImportExportApi

java.lang.Object
  extended by com.cisco.scabb.servconf.mgmt.ImportExportApi

public class ImportExportApi
extends java.lang.Object

An API for import/export actions. Import/Export of Service Configuration Elements is in CSV format. Import/Export of a Service Configuration is in XML format.


Constructor Summary
ImportExportApi()
           
 
Method Summary
static void exportFlavors(java.util.List flavors, FlavorType flavorType, java.io.File file)
          Exports flavors of a specified type to a specified file in a CSV format
static void exportFlavors(java.util.List flavors, FlavorType flavorType, java.io.OutputStream outStream)
          Exports flavors of a specified type to a given output-stream in a CSV format
static void exportFlavorsToEasyFormat(java.util.List flavors, java.io.File file)
          Exports flavors of a specified type to a specified file in a Easy CSV format
static void exportProtocols(java.util.List protocols, java.io.File file)
          Exports protocols to a specified file in a CSV format
static void exportProtocols(java.util.List protocols, java.io.OutputStream outStream)
          Exports protocols to a given output-stream in a CSV format
static void exportServiceConfiguration(ServiceConfig servConf, java.io.File f)
          exports the specified Service Configuration to the specified file.
static void exportServices(ServiceConfig servConf, java.io.File file)
          Exports services from a given Service Configuration to a specified file in a CSV format
static void exportServices(ServiceConfig servConf, java.io.OutputStream outStream)
          Exports services from a given Service Configuration to a given output-stream in a CSV format
static void exportZones(java.util.List zones, java.io.File file)
          Exports zones to a specified file in a CSV format
static void exportZones(java.util.List zones, java.io.OutputStream outStream)
          Exports zones to a given output-stream in a CSV format
static void exportZonesToEasyFormat(java.util.List zones, java.io.File file)
          Exports zones to a specified file in a Easy CSV format
static void importFlavors(ServiceConfig servConf, FlavorType flavorType, java.io.File file)
          Imports flavors of a specified type from a specified CSV file
static void importFlavors(ServiceConfig servConf, FlavorType flavorType, java.io.InputStream inStream)
          Imports flavors of a specified type from a given input-stream
static void importFlavorsFromEasyFormat(ServiceConfig servConf, java.io.File file)
          Imports flavors of a specified type from a specified CSV file in Easy Format
static void importHttpRefererFlavorsFromEasyFormat(ServiceConfig servConf, java.io.File file)
          Imports flavors of a HTTP Referer from a specified CSV file in Easy Format
static void importProtocols(ServiceConfig servConf, java.io.File file)
          Imports protocols from a specified CSV file
static void importProtocols(ServiceConfig servConf, java.io.InputStream inStream)
          Imports protocols from a given input-stream
static ServiceConfig importServiceConfiguration(java.io.File f)
          Imports a Service Configuration from the specified file.
static void importServices(ServiceConfig servConf, java.io.File file)
          Imports services from a specified CSV file
static void importServices(ServiceConfig servConf, java.io.InputStream inStream)
          Imports services from a specified CSV file
static void importZones(ServiceConfig servConf, java.io.File file)
          Imports zones from a specified CSV file
static void importZones(ServiceConfig servConf, java.io.InputStream inStream)
          Imports zones from a given input-stream
static void importZonesFromEasyFormat(ServiceConfig servConf, java.io.File file)
          Imports zones from a specified CSV file in Easy Format
static void loadListArray(ServiceConfig servConf, java.io.InputStream inStream)
          Deprecated. This function is deprecated - only used for 2.57 host list and ip list It converts the 2.57 csv file of lists into 3.0 HTTP URL flavor for the 2.57 host lists and zone list for the 2.57 ip lists. For loading 3.0 csv files please use the functions #importFlavors and #importZones
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportExportApi

public ImportExportApi()
Method Detail

exportServiceConfiguration

public static void exportServiceConfiguration(ServiceConfig servConf,
                                              java.io.File f)
                                       throws java.io.FileNotFoundException,
                                              ImportExportException
exports the specified Service Configuration to the specified file.

Parameters:
servConf - the Service Configuration to export
f - the file to export to
Throws:
java.io.FileNotFoundException
ImportExportException - if an error occurs during export

importServiceConfiguration

public static ServiceConfig importServiceConfiguration(java.io.File f)
                                                throws ImportExportException,
                                                       java.io.IOException
Imports a Service Configuration from the specified file.

Parameters:
f - the file containing the Service Configuration to import
Returns:
the imported ServiceConfig
Throws:
ImportExportException - if an error occurs during import
java.io.IOException

importFlavors

public static void importFlavors(ServiceConfig servConf,
                                 FlavorType flavorType,
                                 java.io.File file)
                          throws ImportExportException
Imports flavors of a specified type from a specified CSV file

Parameters:
servConf - the Service Configuration to import the flavors to
flavorType - the type of the imported flavors
file - the CSV file to import from
Throws:
ImportExportException - if an error occurs during import
See Also:
FlavorType

importFlavors

public static void importFlavors(ServiceConfig servConf,
                                 FlavorType flavorType,
                                 java.io.InputStream inStream)
                          throws ImportExportException
Imports flavors of a specified type from a given input-stream

Parameters:
servConf - the Service Configuration to import the flavors to
flavorType - the type of the imported flavors
inStream - the input-stream to import from
Throws:
ImportExportException - if an error occurs during import
See Also:
FlavorType

importFlavorsFromEasyFormat

public static void importFlavorsFromEasyFormat(ServiceConfig servConf,
                                               java.io.File file)
                                        throws ImportExportException
Imports flavors of a specified type from a specified CSV file in Easy Format

Parameters:
servConf - the Service Configuration to import the flavors to
file - the CSV file to import from
Throws:
ImportExportException - if an error occurs during import

importHttpRefererFlavorsFromEasyFormat

public static void importHttpRefererFlavorsFromEasyFormat(ServiceConfig servConf,
                                                          java.io.File file)
                                                   throws ImportExportException
Imports flavors of a HTTP Referer from a specified CSV file in Easy Format

Parameters:
servConf - the Service Configuration to import the flavors to
file - the CSV file to import from
Throws:
ImportExportException - if an error occurs during import

importZones

public static void importZones(ServiceConfig servConf,
                               java.io.File file)
                        throws ImportExportException
Imports zones from a specified CSV file

Parameters:
servConf - the Service Configuration to import the zones to
file - the CSV file to import from
Throws:
ImportExportException - if an error occurs during import

importZones

public static void importZones(ServiceConfig servConf,
                               java.io.InputStream inStream)
                        throws ImportExportException
Imports zones from a given input-stream

Parameters:
servConf - the Service Configuration to import the zones to
inStream - the input-stream to import from
Throws:
ImportExportException - if an error occurs during import

importZonesFromEasyFormat

public static void importZonesFromEasyFormat(ServiceConfig servConf,
                                             java.io.File file)
                                      throws ImportExportException
Imports zones from a specified CSV file in Easy Format

Parameters:
servConf - the Service Configuration to import the zones to
file - the CSV file to import from
Throws:
ImportExportException - if an error occurs during import

importProtocols

public static void importProtocols(ServiceConfig servConf,
                                   java.io.File file)
                            throws ImportExportException
Imports protocols from a specified CSV file

Parameters:
servConf - the Service Configuration to import the protocols to
file - the CSV file to import from
Throws:
ImportExportException - if an error occurs during import

importProtocols

public static void importProtocols(ServiceConfig servConf,
                                   java.io.InputStream inStream)
                            throws ImportExportException
Imports protocols from a given input-stream

Parameters:
servConf - the Service Configuration to import the protocols to
inStream - the input-stream to import from
Throws:
ImportExportException - if an error occurs during import

importServices

public static void importServices(ServiceConfig servConf,
                                  java.io.File file)
                           throws ImportExportException
Imports services from a specified CSV file

Parameters:
servConf - the Service Configuration to import the services to
file - the CSV file to import from
Throws:
ImportExportException - if an error occurs during import

importServices

public static void importServices(ServiceConfig servConf,
                                  java.io.InputStream inStream)
                           throws ImportExportException
Imports services from a specified CSV file

Parameters:
servConf - the Service Configuration to import the services to
inStream - the input-stream to import from
Throws:
ImportExportException - if an error occurs during import

exportProtocols

public static void exportProtocols(java.util.List protocols,
                                   java.io.File file)
                            throws ImportExportException
Exports protocols to a specified file in a CSV format

Parameters:
protocols - the list of protocols to export
file - the file to export to
Throws:
ImportExportException - if an error occurs during export

exportProtocols

public static void exportProtocols(java.util.List protocols,
                                   java.io.OutputStream outStream)
                            throws ImportExportException
Exports protocols to a given output-stream in a CSV format

Parameters:
protocols - the list of protocols to export
outStream - the output-stream to export to
Throws:
ImportExportException - if an error occurs during export

exportZones

public static void exportZones(java.util.List zones,
                               java.io.File file)
                        throws ImportExportException
Exports zones to a specified file in a CSV format

Parameters:
zones - the list of zones to export
file - the file to export to
Throws:
ImportExportException - if an error occurs during export

exportZones

public static void exportZones(java.util.List zones,
                               java.io.OutputStream outStream)
                        throws ImportExportException
Exports zones to a given output-stream in a CSV format

Parameters:
zones - the list of zones to export
outStream - the output-stream to export to
Throws:
ImportExportException - if an error occurs during export

exportZonesToEasyFormat

public static void exportZonesToEasyFormat(java.util.List zones,
                                           java.io.File file)
                                    throws ImportExportException
Exports zones to a specified file in a Easy CSV format

Parameters:
zones - the list of zones to export
file - the file to export to
Throws:
ImportExportException - if an error occurs during export

exportFlavors

public static void exportFlavors(java.util.List flavors,
                                 FlavorType flavorType,
                                 java.io.File file)
                          throws ImportExportException
Exports flavors of a specified type to a specified file in a CSV format

Parameters:
flavors - the list of flavors to export
flavorType - the type of the exported flavors
file - the file to export to
Throws:
ImportExportException - if an error occurs during export
See Also:
FlavorType

exportFlavors

public static void exportFlavors(java.util.List flavors,
                                 FlavorType flavorType,
                                 java.io.OutputStream outStream)
                          throws ImportExportException
Exports flavors of a specified type to a given output-stream in a CSV format

Parameters:
flavors - the list of flavors to export
flavorType - the type of the exported flavors
outStream - the output-stream to export to
Throws:
ImportExportException - if an error occurs during export
See Also:
FlavorType

exportFlavorsToEasyFormat

public static void exportFlavorsToEasyFormat(java.util.List flavors,
                                             java.io.File file)
                                      throws ImportExportException
Exports flavors of a specified type to a specified file in a Easy CSV format

Parameters:
flavors - the list of flavors to export
file - the file to export to
Throws:
ImportExportException - if an error occurs during export

exportServices

public static void exportServices(ServiceConfig servConf,
                                  java.io.File file)
                           throws ImportExportException
Exports services from a given Service Configuration to a specified file in a CSV format

Parameters:
servConf - the Service Configuration to export the services from
file - the file to export to
Throws:
ImportExportException - if an error occurs during export

exportServices

public static void exportServices(ServiceConfig servConf,
                                  java.io.OutputStream outStream)
                           throws ImportExportException
Exports services from a given Service Configuration to a given output-stream in a CSV format

Parameters:
servConf - the Service Configuration to export the services from
outStream - the output-stream to export to
Throws:
ImportExportException - if an error occurs during export

loadListArray

public static void loadListArray(ServiceConfig servConf,
                                 java.io.InputStream inStream)
                          throws ImportExportException
Deprecated. This function is deprecated - only used for 2.57 host list and ip list It converts the 2.57 csv file of lists into 3.0 HTTP URL flavor for the 2.57 host lists and zone list for the 2.57 ip lists. For loading 3.0 csv files please use the functions #importFlavors and #importZones

Throws:
ImportExportException

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.