com.sas.dataselectors.filters
Class FilterBaseModelData

com.sas.dataselectors.filters.FilterBaseModelData
All Implemented Interfaces:
MetadataProviderInterface

public class FilterBaseModelData
implements MetadataProviderInterface


Field Summary
protected  boolean localMetadata
          A flag to indicate whether this object was responsible for instantiating the MetadataInterface stored here (if non-null).
protected  MetadataInterface metadata
          The MetadataInterface instance associated with the base model.
protected  java.lang.Object model
          The base model itself - most likely a BusinessModel or BusinessQuery from IQ.
 
Constructor Summary
FilterBaseModelData(java.lang.Object model)
          Create a new data object with only the base model known.
FilterBaseModelData(java.lang.Object model, MetadataInterface metadata)
          Creates a new data object holding the given model and metadata.
 
Method Summary
 MetadataInterface createMetadata()
          Attempts to create a MetadataInterface from the base model if one is not already available.
 MetadataInterface getMetadata()
           
 java.lang.Object getModel()
           
 boolean isLocalMetadata()
           
 boolean releaseResources()
          Releases any held resources if they were locally created.
 void setMetadata(MetadataInterface newMetadata)
          Assigns a new metadata to this container.
 void setModel(java.lang.Object newModel)
          Assigns a new base model to this data holder.
 

Field Detail

model

protected java.lang.Object model
The base model itself - most likely a BusinessModel or BusinessQuery from IQ. OLAPDataSetInterface objects can also be assigned at this time.


metadata

protected MetadataInterface metadata
The MetadataInterface instance associated with the base model. May be null.


localMetadata

protected boolean localMetadata
A flag to indicate whether this object was responsible for instantiating the MetadataInterface stored here (if non-null).

Constructor Detail

FilterBaseModelData

public FilterBaseModelData(java.lang.Object model)
Create a new data object with only the base model known.

Parameters:
model -

FilterBaseModelData

public FilterBaseModelData(java.lang.Object model,
                           MetadataInterface metadata)
Creates a new data object holding the given model and metadata. The metadata may be null, but this object will not be very useful with a null model.

Parameters:
model -
metadata -
Method Detail

getModel

public java.lang.Object getModel()
Returns:
the base model object

setModel

public void setModel(java.lang.Object newModel)
Assigns a new base model to this data holder. Any existing metadata connection will be released if locally created.

Parameters:
newModel -

getMetadata

public MetadataInterface getMetadata()
Specified by:
getMetadata in interface MetadataProviderInterface
Returns:
the current metadata held by this data container.

setMetadata

public void setMetadata(MetadataInterface newMetadata)
Assigns a new metadata to this container. Any existing metadata connection will be released if locally created.

Parameters:
newMetadata -

isLocalMetadata

public boolean isLocalMetadata()
Returns:
the flag indicating whether this object took the action that created the current metadata instance.

createMetadata

public MetadataInterface createMetadata()
                                 throws FilterException
Attempts to create a MetadataInterface from the base model if one is not already available. If a connection is already available, then that is returned. If a connection was created by this call, then the status of the 'local metadata' flag will be set to true and the connection can be released by calling 'releaseResources'.

Returns:
the MetadataInterface for the base model
Throws:
FilterException - in the event of any failure to create the connection

releaseResources

public boolean releaseResources()
Releases any held resources if they were locally created.

Returns:
true if any resources were released, false otherwise.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.