Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.perspective.model
Class IBMiPropertiesModelAdapter

java.lang.Object
  extended by com.ibm.etools.iseries.perspective.model.IBMiPropertiesModelAdapter
All Implemented Interfaces:
IISeriesPropertiesModel

public class IBMiPropertiesModelAdapter
extends Object
implements IISeriesPropertiesModel


Field Summary
 
Fields inherited from interface com.ibm.etools.iseries.perspective.model.IISeriesPropertiesModel
Copyright
 
Constructor Summary
IBMiPropertiesModelAdapter(IBMiProperties target)
           
 
Method Summary
 void clearCache()
          Remove any cached values so that the next read, will read from the persisted store
 void generatePropertyModel(Hashtable<String,String> properties, IProgressMonitor monitor)
          Save the specified properties into the metadata model
 Boolean getBooleanProperty(String key)
          Returns the boolean value of an iSeries property, whether it is Local or shared.
Returns null if the property value is not a boolean value, or if the model is corrupt, or any error restoring the model occur.
 Integer getIntProperty(String key)
          Returns the int value of an iSeries property, whether it is Local or shared.
Returns null if the property value is not a long value, or if the model is corrupt, or any error restoring the model occur.
 Long getLongProperty(String key)
          Returns the long value of an iSeries property, whether it is Local or shared.
Returns null if the property value is not a long value, or if the model is corrupt, or any error restoring the model occur.
 Long getLongProperty(String key, long defaultValue)
          Returns the long value of an iSeries property.
 String getProperty(String key)
          Returns the value of an iSeries property, whether it is Local or shared, and wether it is a predefined property, or an ISV supplied property.
Returns null if the propetry is a predefined or an ISV property that has not been set, or the key is not a recognized ISV or predefined property key.
 String getProperty(String key, String defaultValue)
          Returns the value of an iSeries property, whether it is Local or shared, and wether it is a predefined property, or an ISV supplied property.
Returns the default value argument if the property is not found.
 boolean isDirty()
          Tests whether this properties model needs to be saved or not.
returns true only if any of the predefined properties or ISV defined properties have changed.
 boolean isPredefinedProperty(String key)
           
 boolean isTeamShared(String key)
          Tests whether this property is team shared on not.
Properties can be either team shared, or local.
 void load(IProgressMonitor monitor)
          Loads all local and shared properties, wether they are predefined properties or ISV contributed ones.
Also loads the list of modified properties.
 void mergeProperties(Hashtable newProperties)
          Merges the argument properties with an existing model.
Preserves properties that are not passed in the argument table.
 void save(IProgressMonitor monitor)
          Saves local and shared properties.
Also saved the current list of modified properties.
 void setBooleanProperty(String key, boolean value)
          Sets a long property.
If the new value of the property is different than the old value, then the key/value pair for the old value is stored in the list of modified properties, as returned by getModifiedProperties().
 void setIntProperty(String key, int value)
          Sets a int property.
If the new value of the property is different than the old value, then the key/value pair for the old value is stored in the list of modified properties, as returned by getModifiedProperties().
 void setLongProperty(String key, long value)
          Sets a long property.
If the new value of the property is different than the old value, then the key/value pair for the old value is stored in the list of modified properties, as returned by getModifiedProperties().
 void setProperty(String key, String value)
          Sets the property.
If the value is null, the method does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IBMiPropertiesModelAdapter

public IBMiPropertiesModelAdapter(IBMiProperties target)
Method Detail

getProperty

public String getProperty(String key)
Description copied from interface: IISeriesPropertiesModel
Returns the value of an iSeries property, whether it is Local or shared, and wether it is a predefined property, or an ISV supplied property.
Returns null if the propetry is a predefined or an ISV property that has not been set, or the key is not a recognized ISV or predefined property key.

Specified by:
getProperty in interface IISeriesPropertiesModel
See Also:
IISeriesPropertiesModel.getProperty(java.lang.String)

getProperty

public String getProperty(String key,
                          String defaultValue)
Description copied from interface: IISeriesPropertiesModel
Returns the value of an iSeries property, whether it is Local or shared, and wether it is a predefined property, or an ISV supplied property.
Returns the default value argument if the property is not found.

Specified by:
getProperty in interface IISeriesPropertiesModel
See Also:
IISeriesPropertiesModel.getProperty(java.lang.String, java.lang.String)

getBooleanProperty

public Boolean getBooleanProperty(String key)
Description copied from interface: IISeriesPropertiesModel
Returns the boolean value of an iSeries property, whether it is Local or shared.
Returns null if the property value is not a boolean value, or if the model is corrupt, or any error restoring the model occur. Valid boolean strings are "true" or "false", with case ignored.

Specified by:
getBooleanProperty in interface IISeriesPropertiesModel

getLongProperty

public Long getLongProperty(String key)
Description copied from interface: IISeriesPropertiesModel
Returns the long value of an iSeries property, whether it is Local or shared.
Returns null if the property value is not a long value, or if the model is corrupt, or any error restoring the model occur.

Specified by:
getLongProperty in interface IISeriesPropertiesModel

getLongProperty

public Long getLongProperty(String key,
                            long defaultValue)
Description copied from interface: IISeriesPropertiesModel
Returns the long value of an iSeries property. Returns the default value if the property value is not a long value, or if the model is corrupt, or any error restoring the model occur.

Specified by:
getLongProperty in interface IISeriesPropertiesModel

getIntProperty

public Integer getIntProperty(String key)
Description copied from interface: IISeriesPropertiesModel
Returns the int value of an iSeries property, whether it is Local or shared.
Returns null if the property value is not a long value, or if the model is corrupt, or any error restoring the model occur.

Specified by:
getIntProperty in interface IISeriesPropertiesModel

setProperty

public void setProperty(String key,
                        String value)
Description copied from interface: IISeriesPropertiesModel
Sets the property.
If the value is null, the method does nothing. If the value is an empty string, the property will be added to the list of incomplete properties. Also, if the new value of the property is different than the old value, then the key/value pair for the old value is stored in the list of modified properties, as returned by getModifiedProperties(). This method has no effect if the new value is equal to the old value.

Specified by:
setProperty in interface IISeriesPropertiesModel

setBooleanProperty

public void setBooleanProperty(String key,
                               boolean value)
Description copied from interface: IISeriesPropertiesModel
Sets a long property.
If the new value of the property is different than the old value, then the key/value pair for the old value is stored in the list of modified properties, as returned by getModifiedProperties(). This method has no effect if the new value is equal to the old value.

Specified by:
setBooleanProperty in interface IISeriesPropertiesModel

setLongProperty

public void setLongProperty(String key,
                            long value)
Description copied from interface: IISeriesPropertiesModel
Sets a long property.
If the new value of the property is different than the old value, then the key/value pair for the old value is stored in the list of modified properties, as returned by getModifiedProperties(). This method has no effect if the new value is equal to the old value.

Specified by:
setLongProperty in interface IISeriesPropertiesModel

setIntProperty

public void setIntProperty(String key,
                           int value)
Description copied from interface: IISeriesPropertiesModel
Sets a int property.
If the new value of the property is different than the old value, then the key/value pair for the old value is stored in the list of modified properties, as returned by getModifiedProperties(). This method has no effect if the new value is equal to the old value.

Specified by:
setIntProperty in interface IISeriesPropertiesModel

isDirty

public boolean isDirty()
Description copied from interface: IISeriesPropertiesModel
Tests whether this properties model needs to be saved or not.
returns true only if any of the predefined properties or ISV defined properties have changed.

Specified by:
isDirty in interface IISeriesPropertiesModel

isPredefinedProperty

public boolean isPredefinedProperty(String key)

isTeamShared

public boolean isTeamShared(String key)
Description copied from interface: IISeriesPropertiesModel
Tests whether this property is team shared on not.
Properties can be either team shared, or local. Local properties are only set (available) for the current Workbench install. If the user performs a reinstall, these properties are lost. They are implemented under the hood as Eclipse "persistent" properties. They are not team shared because they are not stored as part of the files that are checked into a team repository. Team shared properties on the other hand are stored in an xml file that is generated in the correspoding iSeries project. When a project is checked into a team repository, all team members that grab this project also have access to all these team shared properties.

Specified by:
isTeamShared in interface IISeriesPropertiesModel

load

public void load(IProgressMonitor monitor)
Description copied from interface: IISeriesPropertiesModel
Loads all local and shared properties, wether they are predefined properties or ISV contributed ones.
Also loads the list of modified properties.

Specified by:
load in interface IISeriesPropertiesModel

save

public void save(IProgressMonitor monitor)
Description copied from interface: IISeriesPropertiesModel
Saves local and shared properties.
Also saved the current list of modified properties.

Specified by:
save in interface IISeriesPropertiesModel

generatePropertyModel

public void generatePropertyModel(Hashtable<String,String> properties,
                                  IProgressMonitor monitor)
Save the specified properties into the metadata model

Parameters:
properties - - Hashtable of property name, values to set into the model
monitor - - allow the client to observe progress via this IProgressMonitor

mergeProperties

public void mergeProperties(Hashtable newProperties)
Description copied from interface: IISeriesPropertiesModel
Merges the argument properties with an existing model.
Preserves properties that are not passed in the argument table. If a new property matches an old one the model is not marked as dirty. If a new property is not present or its value supersedes the old one, the model is marked dirty.

Specified by:
mergeProperties in interface IISeriesPropertiesModel

clearCache

public void clearCache()
Remove any cached values so that the next read, will read from the persisted store

Specified by:
clearCache in interface IISeriesPropertiesModel

Rational Developer for Power Systems Software
V7.6

Copyright 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.