com.sas.iquery.metadata.business
Class Export

com.sas.iquery.metadata.business.Export
All Implemented Interfaces:
Base, ModelItem, UsabilityInterface, PropertyChangeListenee, java.beans.PropertyChangeListener, java.util.EventListener

public class Export


Field Summary
 
Fields inherited from interface com.sas.iquery.metadata.business.ModelItem
EVENT_OBJECT_PROPERTY_CHANGED
 
Fields inherited from interface com.sas.iquery.metadata.business.Base
EVENT_OBJECT_DEFINITION_CHANGED
 
Constructor Summary
Export(BusinessModel businessModel, com.sas.iquery.metadata.business.ExportType usage, com.sas.iquery.metadata.business.ExportProperties... properties)
           
 
Method Summary
protected  void accumulateDirectlyReferencedItemsInDownwardDefinition(java.util.List<? super ModelItem> intoList)
          Accumulates the AbstractModelItem items that this object directly references that make up it's "downward definition" into the given list.
 com.sas.iquery.metadata.business.CreateTableDataSelection createTableDataSelection(DataSelection selection, com.sas.iquery.strategies.sas.oma.AbstractStrategy strategy)
           
 Export engine(java.lang.String engine)
          Engine name specified when exporting to SAS library
 java.lang.String generate()
          This method generates the ResultSet/Export code and returns a String containing the generated code.
 java.lang.String generate(java.lang.String tableName)
          This method generates the ResultSet/Export code based on a caller-defined tableName and returns a String containing the generated code.
 java.lang.StringBuffer generateExportStatementForCSV(java.lang.String inputTable)
           
 java.lang.StringBuffer generateJSONStatement(java.lang.String inputTable)
           
 java.lang.StringBuffer generateLasrStatement()
           
 java.lang.StringBuffer generateLasrStatement(java.lang.String inputTable)
           
 java.lang.StringBuffer generateProcMetalib(java.lang.String inputTable)
           
 int getColumnLimit()
           
protected  java.lang.String getDefinitionElementName()
          Every non-abstract object type that is persistable must be able to surface it's unique element name used for holding the object's definition.
 ExportMetadata getExportMetadata()
          This method returns the ExportMetadata object which is a high-level "container" for all metadata associated with this Information Map (or DataSelection).
 com.sas.iquery.metadata.business.ExportProperties[] getExportProperties()
           
 com.sas.iquery.metadata.business.DataSourceTable getlasrDataSourceTable()
           
 java.lang.String getResultSetTableName()
           
 com.sas.iquery.metadata.physical.SASLibrary getSASLibrary()
           
 int getTableLimit()
           
 com.sas.iquery.metadata.business.ExportType getUsage()
           
 boolean isAllDetail()
           
 boolean isCreateTableRequiredForExport()
           
 boolean isDetailWithFilters()
           
 boolean isMetalibInEffect()
           
 boolean isTableOnly()
           
 boolean isTooManyTablesOrColumns()
           
 boolean isViewOnly()
           
 Export JSONExportOptions(java.lang.String JSONExportOptions, java.lang.String JSONExportTablename)
          JSON Export options
 Export JSONOptions(java.lang.String JSONOptions)
          JSON options
 Export JSONout(java.lang.String JSONout)
          Filename for JSON when exporting to JSON file
 Export lasrAdd()
          For adding a table to LASR using an existing server
 Export lasrCreate()
          proc lasr Create option without a table
 Export lasrCreate(java.lang.String createFile)
          File used on Create for proc lasr
 Export lasrData(java.lang.String data)
          Used when exporting a single Table based on a String
 Export lasrData(com.sas.iquery.metadata.physical.Table table)
          Used when exporting a single table from a Table object
 Export lasrHost(java.lang.String host)
          Lasr host
 Export lasrInstall(java.lang.String install)
          Lasr Install option
 Export lasrNodes(int nodes)
          Number of Lasr nodes
 Export lasrNthreads(int nthreads)
          Number of Lasr threads
 Export lasrPath(java.lang.String path)
          Lasr path name
 Export lasrPort(int port)
          Lasr port number
 Export lasrSigner(java.lang.String signer)
          Lasr signer
 Export libref(java.lang.String libref)
          SAS libref specified when exporting to SAS library
 Export metaLibref(java.lang.String metaLibref)
          proc metalib libref to register the table
 Export metaPort(java.lang.String metaPort)
          proc metalib port number
 Export metaPswd(java.lang.String metaPswd)
          proc metalib password
 Export metaRepname(java.lang.String metaRepname)
          proc metalib repository name
 Export metaServer(java.lang.String metaServer)
          proc metalib server
 Export metaUser(java.lang.String metaUser)
          proc metalib username
 Export options(java.lang.String options)
          Engine options specified when exporting to SAS library
 Export outfile(java.lang.String outfile)
          Filename for proc export target when generating CSV files
 Export path(java.lang.String path)
          Libname path when exporting to SAS library
protected  void replaceDirectReferences(java.lang.Object oldObject, java.lang.Object newObject)
          IQ internal use only -- API users should not use.
 void run()
           
 ResultSetInterface run(QueryConnector queryConnector)
          This method executes the Export statement and returns a ResultSetInterface.
 Export SASLibrary(com.sas.iquery.metadata.physical.SASLibrary library)
          SAS Library object specified when exporting to SAS library
 Export server(com.sas.iquery.metadata.physical.SASWorkspaceServer server)
           
 void setColumnLimit(int columnLimit)
           
 void setResultSetTableName(java.lang.String resultSetTableName)
           
 void setTableLimit(int tableLimit)
           
 Export tableName(java.lang.String tableName)
          Tablename to create when exporting to SAS library
 
Methods inherited from interface com.sas.iquery.metadata.PropertyChangeListenee
addListener, getListeners, removeListener
 

Constructor Detail

Export

public Export(BusinessModel businessModel,
              com.sas.iquery.metadata.business.ExportType usage,
              com.sas.iquery.metadata.business.ExportProperties... properties)
       throws MetadataException
Throws:
MetadataException
Method Detail

SASLibrary

public Export SASLibrary(com.sas.iquery.metadata.physical.SASLibrary library)
SAS Library object specified when exporting to SAS library


libref

public Export libref(java.lang.String libref)
SAS libref specified when exporting to SAS library


path

public Export path(java.lang.String path)
Libname path when exporting to SAS library


engine

public Export engine(java.lang.String engine)
Engine name specified when exporting to SAS library


options

public Export options(java.lang.String options)
Engine options specified when exporting to SAS library


tableName

public Export tableName(java.lang.String tableName)
Tablename to create when exporting to SAS library


outfile

public Export outfile(java.lang.String outfile)
Filename for proc export target when generating CSV files


JSONout

public Export JSONout(java.lang.String JSONout)
Filename for JSON when exporting to JSON file


JSONExportOptions

public Export JSONExportOptions(java.lang.String JSONExportOptions,
                                java.lang.String JSONExportTablename)
JSON Export options


JSONOptions

public Export JSONOptions(java.lang.String JSONOptions)
JSON options


lasrData

public Export lasrData(java.lang.String data)
                throws GenerationException,
                       DataRetrievalException
Used when exporting a single Table based on a String

Throws:
GenerationException
DataRetrievalException

lasrData

public Export lasrData(com.sas.iquery.metadata.physical.Table table)
                throws GenerationException,
                       DataRetrievalException
Used when exporting a single table from a Table object

Throws:
GenerationException
DataRetrievalException

lasrCreate

public Export lasrCreate(java.lang.String createFile)
File used on Create for proc lasr


lasrCreate

public Export lasrCreate()
proc lasr Create option without a table


lasrAdd

public Export lasrAdd()
For adding a table to LASR using an existing server


lasrPath

public Export lasrPath(java.lang.String path)
Lasr path name


lasrHost

public Export lasrHost(java.lang.String host)
Lasr host


lasrPort

public Export lasrPort(int port)
Lasr port number


lasrSigner

public Export lasrSigner(java.lang.String signer)
Lasr signer


lasrInstall

public Export lasrInstall(java.lang.String install)
Lasr Install option


lasrNodes

public Export lasrNodes(int nodes)
Number of Lasr nodes


lasrNthreads

public Export lasrNthreads(int nthreads)
Number of Lasr threads


metaUser

public Export metaUser(java.lang.String metaUser)
proc metalib username


metaPswd

public Export metaPswd(java.lang.String metaPswd)
proc metalib password


metaServer

public Export metaServer(java.lang.String metaServer)
proc metalib server


metaRepname

public Export metaRepname(java.lang.String metaRepname)
proc metalib repository name


metaPort

public Export metaPort(java.lang.String metaPort)
proc metalib port number


metaLibref

public Export metaLibref(java.lang.String metaLibref)
proc metalib libref to register the table


server

public Export server(com.sas.iquery.metadata.physical.SASWorkspaceServer server)

getExportProperties

public com.sas.iquery.metadata.business.ExportProperties[] getExportProperties()
Returns:
Returns the exportProperties.

isAllDetail

public boolean isAllDetail()

isDetailWithFilters

public boolean isDetailWithFilters()

isViewOnly

public boolean isViewOnly()

isTableOnly

public boolean isTableOnly()

isCreateTableRequiredForExport

public boolean isCreateTableRequiredForExport()

isMetalibInEffect

public boolean isMetalibInEffect()

getResultSetTableName

public java.lang.String getResultSetTableName()
Returns:
Returns the resultSetTableName.

setResultSetTableName

public void setResultSetTableName(java.lang.String resultSetTableName)
Parameters:
resultSetTableName - The resultSetTableName to set.

createTableDataSelection

public com.sas.iquery.metadata.business.CreateTableDataSelection createTableDataSelection(DataSelection selection,
                                                                                          com.sas.iquery.strategies.sas.oma.AbstractStrategy strategy)
                                                                                   throws MetadataException
Throws:
MetadataException

generateExportStatementForCSV

public java.lang.StringBuffer generateExportStatementForCSV(java.lang.String inputTable)
                                                     throws DataRetrievalException
Throws:
DataRetrievalException

generateJSONStatement

public java.lang.StringBuffer generateJSONStatement(java.lang.String inputTable)
                                             throws DataRetrievalException
Throws:
DataRetrievalException

generateLasrStatement

public java.lang.StringBuffer generateLasrStatement()
                                             throws DataRetrievalException
Throws:
DataRetrievalException

generateLasrStatement

public java.lang.StringBuffer generateLasrStatement(java.lang.String inputTable)
                                             throws DataRetrievalException
Throws:
DataRetrievalException

isTooManyTablesOrColumns

public boolean isTooManyTablesOrColumns()
                                 throws MetadataException
Throws:
MetadataException

getColumnLimit

public int getColumnLimit()

setColumnLimit

public void setColumnLimit(int columnLimit)

getTableLimit

public int getTableLimit()

setTableLimit

public void setTableLimit(int tableLimit)

generateProcMetalib

public java.lang.StringBuffer generateProcMetalib(java.lang.String inputTable)
                                           throws DataRetrievalException
Parameters:
tableName -
Returns:
Throws:
DataRetrievalException

generate

public java.lang.String generate(java.lang.String tableName)
                          throws ExecutionException,
                                 com.sas.iquery.intelligentquery.IntelligentQueryException,
                                 MetadataException
This method generates the ResultSet/Export code based on a caller-defined tableName and returns a String containing the generated code. The code is simply generated. If you want to execute the code, you need to call export.run(). If the caller specified the RESULT_SET_ONLY property, then just the ResultSet code will get generated.

Throws:
ExecutionException
com.sas.iquery.intelligentquery.IntelligentQueryException
MetadataException

generate

public java.lang.String generate()
                          throws ExecutionException,
                                 com.sas.iquery.intelligentquery.IntelligentQueryException,
                                 MetadataException
This method generates the ResultSet/Export code and returns a String containing the generated code. The code is simply generated. If you want to execute the code, you need to call export.run(). If the caller specified the RESULT_SET_ONLY property, then just the ResultSet code will get generated.

Throws:
ExecutionException
com.sas.iquery.intelligentquery.IntelligentQueryException
MetadataException

run

public void run()
         throws DataRetrievalException,
                ExecutionException,
                MetadataException
Throws:
DataRetrievalException
ExecutionException
MetadataException

run

public ResultSetInterface run(QueryConnector queryConnector)
                       throws DataRetrievalException,
                              MetadataException
This method executes the Export statement and returns a ResultSetInterface. Since Export is a one-way operation, only an empty result set is returned. However, other info (like the SASLog) is available off of the ResultSet.

Parameters:
queryConnector -
Returns:
Throws:
DataRetrievalException
MetadataException

getlasrDataSourceTable

public com.sas.iquery.metadata.business.DataSourceTable getlasrDataSourceTable()
Returns:
Returns the Table for stand-alone submission.

getUsage

public com.sas.iquery.metadata.business.ExportType getUsage()
Returns:
Returns the usage.

getSASLibrary

public com.sas.iquery.metadata.physical.SASLibrary getSASLibrary()
Returns:
Returns the SASLibrary.

getExportMetadata

public ExportMetadata getExportMetadata()
This method returns the ExportMetadata object which is a high-level "container" for all metadata associated with this Information Map (or DataSelection). Such metadata includes column info, filters, data sources, hierarchies, levels, etc...


accumulateDirectlyReferencedItemsInDownwardDefinition

protected void accumulateDirectlyReferencedItemsInDownwardDefinition(java.util.List<? super ModelItem> intoList)
Description copied from class: AbstractBase
Accumulates the AbstractModelItem items that this object directly references that make up it's "downward definition" into the given list. This method is a key method in recursing down an object's definition as done via the getResources() and getReasonsUnusable() methods among others.

For this method, no objects should be added that cause an "upward reference" ... such as a column adding it's owning table or any other reference that may cause the interpretation of cycles within an object's definition. Duplicate object references should be accumulated by implementors of this method. It is OK to accumulate null references. One should only accumulate objects of type AbstractModelItem.

See the class documentation above for a definition and discussion on what encompasses an object's downward definition.

Specified by:
accumulateDirectlyReferencedItemsInDownwardDefinition in class com.sas.iquery.metadata.business.impl.AbstractBase
See Also:
AbstractBase.accumulateDirectlyReferencedItemsInDownwardDefinition(java.util.List)

getDefinitionElementName

protected java.lang.String getDefinitionElementName()
Description copied from class: AbstractBase
Every non-abstract object type that is persistable must be able to surface it's unique element name used for holding the object's definition.

Specified by:
getDefinitionElementName in class com.sas.iquery.metadata.business.impl.AbstractBase
Returns:
the element name to hold the definition of an object of this type.
See Also:
AbstractBase.getDefinitionElementName()

replaceDirectReferences

protected void replaceDirectReferences(java.lang.Object oldObject,
                                       java.lang.Object newObject)
Description copied from class: AbstractBase
IQ internal use only -- API users should not use.

When called, this object replaces any direct references it has to oldItem with newItem. The oldItem object should be compared using the == operator with any instance variables the object has and if oldItem is directly referenced, it should replace that reference with a reference to newItem.

Generally speaking, both items should be of the same type of class, though the implementation of this method does not check that. Note that there are cases where resource replacement logic temporarily sets proxy objects with this method and sets the real intended object quickly after that.

Implementors of this method should provide replacement to all objects that it references.

This is considered somewhat of a "raw" method in that it does just as it's advertised. If special replacement logic is needed for certain scenarios (e.g. replacing only a portion of the objects referenced at model reading time or resource replacement time, etc.) it's typically best to implement logic around this raw method either calling it conditionally or defining a new method for objects like replaceWhenReading() that by default calls into this method and can be overridden for certain specific uses.

Subclasses are encouraged to use the utility methods replace, replaceInList and replaceInJavaMap for replacing direct references to their instance variables.

Specified by:
replaceDirectReferences in class com.sas.iquery.metadata.business.impl.AbstractBase
See Also:
AbstractBase.replaceDirectReferences(java.lang.Object, java.lang.Object)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.