javax.datamining.task
Interface ImportTask

All Superinterfaces:
MiningObject, Task

public interface ImportTask
extends Task

An ImportTask provides an abstraction of the metadata needed to convert an external object(s) to its corresponding JDM representation.

Importable objects may include any of the named objects.

The object(s) to be imported are located at the specified URI and are imported into the metadata repository associated with the connection where execute is invoked.

When creating an import task, the user may choose to populate the ImportSummary. If present, the import summary can be used to create a map between the objects at the URI in the summary array to desired names in the metadata repository. The mapping is made between the index of the object at the URI and the desired name. The user may specify a subset of the objects in the URI.

If there is no map, all objects are imported using the names of the objects in the URI.

If there is no summary, the map is specified with user knowledge. Name conflicts result in an error.

In the event of name conflicts, the execute fails atomically, i.e., none of the objects are imported.

Author:
JSR-73 Java Data Mining Expert Group
See Also:
MiningObject, Task

Method Summary
 java.util.Map getObjectNamesMap()
          Returns the map of the names between the object names found in ImportSummary and their new names.
 ImportSummary getSummary()
          Returns an ImportSummary for the import object.
 java.lang.String getURI()
          Returns the URI (location) of the object to be imported.
 boolean includeModelSettings()
          Returns true if the build settings is to be included in the model to be imported.
 void includeModelSettings(boolean includeModelSettings)
          Directs whether to include the build settings if models are imported.
 void populateSummary()
          Populates an ImportSummary given a URI of the object to be imported.
 void setObjectNamesMap(java.util.Map map)
          The provided map maps array indexes from the ImportSummary to user provided names, which may or may not be the same as the names of the objects in the ImportSummary.
 void setURI(java.lang.String uri)
          Sets the URI of the object to be imported.
 boolean useOriginalCreationDates()
          Returns true if the original creation date of the import object for the objects being imported.
 void useOriginalCreationDates(boolean useOriginalCreationDates)
          Directs whether to use the original creation date of the import object.
 VerificationReport verify()
          Determines whether the specification of the import task is correct.
 
Methods inherited from interface javax.datamining.base.Task
getExecutionHandle
 
Methods inherited from interface javax.datamining.MiningObject
getCreationDate, getCreatorInfo, getDescription, getName, getObjectIdentifier, getObjectType, setDescription
 

Method Detail

getObjectNamesMap

public java.util.Map getObjectNamesMap()
Returns the map of the names between the object names found in ImportSummary and their new names. Returns null if no such mapping has been provided.

Returns:
Map

getSummary

public ImportSummary getSummary()
Returns an ImportSummary for the import object. Returns null if no import summary has been populated.

Returns:
ImportSummary

getURI

public java.lang.String getURI()
Returns the URI (location) of the object to be imported. The URI specifies the location where the object can be found.

Returns:
String

includeModelSettings

public boolean includeModelSettings()
Returns true if the build settings is to be included in the model to be imported. Returns false otherwise. The default is true.

Returns:
boolean

includeModelSettings

public void includeModelSettings(boolean includeModelSettings)
Directs whether to include the build settings if models are imported. If true, the imported model(s) will include the build settings as well. Build settings are included by default. If there are no models to be imported, this setting is ignored.

Parameters:
includeModelSettings - A flag that directs build settings inclusion in the models to be imported.
Returns:
void

populateSummary

public void populateSummary()
                     throws JDMException
Populates an ImportSummary given a URI of the object to be imported. Throws an exception if the object format is not supported or no URI has been specified.

Returns:
void
Throws:
JDMException

setObjectNamesMap

public void setObjectNamesMap(java.util.Map map)
                       throws JDMException
The provided map maps array indexes from the ImportSummary to user provided names, which may or may not be the same as the names of the objects in the ImportSummary.

If null is provided, the object names from the import object are used by default.

Parameters:
map - A map for object names. The array index is used as the key.
Returns:
void
Throws:
JDMException

setURI

public void setURI(java.lang.String uri)
            throws JDMException
Sets the URI of the object to be imported. The URI specifies the location where the object can be found. The URI cannot be null and length must be less than the maximum description length.

Parameters:
uri - The URI of the object to be imported.
Returns:
void
Throws:
JDMException

useOriginalCreationDates

public boolean useOriginalCreationDates()
Returns true if the original creation date of the import object for the objects being imported. Returns false otherwise.

Returns:
boolean

useOriginalCreationDates

public void useOriginalCreationDates(boolean useOriginalCreationDates)
Directs whether to use the original creation date of the import object.

The default is false in which case the time of import is used for the object creation date. Otherwise, the orginal object creation date is used, if available.

If there is no original creation date, then the time of import is used.

Parameters:
useOriginalCreationDates -
Returns:
void

verify

public VerificationReport verify()
Determines whether the specification of the import task is correct. This includes a check if the URI is accessible, and the objects can be imported in the format present. This method does not scan the contents at the URI to determine if a full import can occur without error.

Returns null if the specification is correct. Returns a VerificationReport otherwise that contains the explanation.

Returns:
VerificationReport