Interface IDataSet
-
- All Superinterfaces:
IHostResource
- All Known Subinterfaces:
IMigratedDataSet
,IPartitionedDataSet
,ISequentialDataSet
,IVSAMCluster
public interface IDataSet extends IHostResource
A dataset that resides on a z/OS host.For details on the state of an IDataSet and the function of its methods, see
IHostResource
.Examples:
To retrieve a dataset:IDataSetCommandProvider commandProvider = ... String dataSetName = ... // dataSet will be null if it cannot be found IDataSet dataSet = commandProvider.findDataSet(dataSetName);
To retrieve a list of datasets matching a filter:IDataSetCommandProvider commandProvider = ... String dataSetFilter = ... // dataSets will be empty if no datasets match the dataset filter List<IDataSet> dataSets = commandProvider.findDataSets(dataSetFilter);
To retrieve a specific generation dataset of a generation data group from anIDataSetCommandProvider
:IDataSetCommandProvider commandProvider = ... String generationDataGroupName = ... int relativeGenerationNumber = ... // generationDataSet will be
To retrieve a specific generation dataset of a generation data group from annull
if the generation data // group does not exist or a generation dataset does not exist for the // specified relative generation number IDataSet generationDataSet = commandProvider.findGenerationDataSet( generationDataGroupName, relativeGenerationNumber);IGenerationDataGroup
:IGenerationDataGroup generationDataGroup = ... int relativeGenerationNumber = ... // generationDataSet will be
To retrieve a list of all generation datasets of a generation data group from annull
if a generation dataset // does not exist for the specified relative generation number IDataSet generationDataSet = generationDataGroup .findGenerationDataSet(relativeGenerationNumber);IDataSetCommandProvider
:IDataSetCommandProvider commandProvider = ... String generationDataGroupName = ... // generationDataSets will be empty if the generation data group does // not haven any generation datasets List<IDataSet> generationDataSets = commandProvider .fetchGenerationDataSets(generationDataGroupName);
To retrieve a list of all generation datasets of a generation data group from anIGenerationDataGroup
:IGenerationDataGroup generationDataGroup = ... // generationDataSets will be empty if the generation data group does // not haven any generation datasets List<IDataSet> generationDataSets = generationDataGroup .fetchGenerationDataSets();
To delete a dataset using anIDataSetCommandProvider
:IDataSetCommandProvider commandProvider = ... String datasetName = ... try { commandProvider.deleteDataSet(datasetName); } catch (IllegalArgumentException e) { // invalid dataset name ... } catch (DataSetAccessException e) { // the user does not have access to this dataset ... } catch (DataSetInUseException e) { // the dataset is enqueued by another user or job ... } catch (DataSetNotFoundException e) { // the dataset could not be found ... }
To delete a dataset using anIDataSet
:IDataSet dataset = ... try { dataset.delete(); } catch (DataSetAccessException e) { // the user does not have access to this dataset ... } catch (DataSetInUseException e) { // the dataset is enqueued by another user or job ... }
For examples on how to obtain anIDataSetCommandProvider
, seeIDataSetCommandProvider
.
For examples on how to retrieve specific subclasses ofIDataSet
, seeIPartitionedDataSet
,ISequentialDataSet
,IVSAMCluster
, andIMigratedDataSet
.
For examples on how to retrieve a specific generation dataset, typed as anISequentialDataSet
, seeISequentialDataSet
.- Since:
- 1.0.0
- Version:
- 2.0.0
- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
delete()
Deletes this dataset.IDataSetCharacteristics
fetchCharacteristics()
Fetches the characteristics of this dataset from the z/OS host on which it resides.IZOSHostConnection
getHostConnection()
Returns the host connection used to obtained this host resource.DataSetType
getType()
Returns the type of this host resource.boolean
isAlias()
Returns whether this dataset is an alias.-
Methods inherited from interface com.compuware.api.topaz.hostresources.IHostResource
getName
-
-
-
-
Method Detail
-
fetchCharacteristics
IDataSetCharacteristics fetchCharacteristics() throws DataSetAccessException, DataSetInUseException, DataSetMigratedException, DataSetNotFoundException
Fetches the characteristics of this dataset from the z/OS host on which it resides.The state of the dataset characteristics returned from this method is a snapshot of these characteristics from the time this method is called. Any changes made to these characteristics after this method is called will not be reflected in any previously returned dataset characteristics. This method may be called again to retrieve a current snapshot of the data set characteristics.
- Returns:
- the dataset characteristics
- Throws:
ZOSSystemException
- if a z/OS system error occursZOSAbendException
- if a z/OS ABEND occursDataSetAccessException
- if the user's credentials do not grant access authority for this datasetDataSetInUseException
- if an exclusive enqueue exists on this datasetDataSetMigratedException
- if this dataset is migrated (this may occur if the dataset is migrated after it is retrieved from the z/OS host)DataSetNotFoundException
- if this dataset no longer exists (this may occur if the dataset is deleted after it is retrieved from the z/OS host)- Since:
- 1.0.0
-
getHostConnection
IZOSHostConnection getHostConnection()
Returns the host connection used to obtained this host resource.- Specified by:
getHostConnection
in interfaceIHostResource
- Returns:
- the z/OS host connection
- Since:
- 1.0.0
-
getType
DataSetType getType()
Returns the type of this host resource.Note: the value returned from this method represents the state of this host resource from the time it was retrieved from the host. Any changes made to this host resource since it was retrieved will not be reflected in this method.
- Specified by:
getType
in interfaceIHostResource
- Returns:
- the dataset type
- Since:
- 1.0.0
-
isAlias
boolean isAlias()
Returns whether this dataset is an alias.- Returns:
true
if this dataset is an alias,false
otherwise- Since:
- 1.1.0
-
delete
void delete() throws DataSetAccessException, DataSetInUseException
Deletes this dataset.- Throws:
DataSetAccessException
- if the user's credentials do not grant access authority for this datasetDataSetInUseException
- if an exclusive enqueue exists on this dataset- Since:
- 2.2.0
-
-