org.pentaho.platform.repository.runtime
Class RuntimeElement

java.lang.Object
  extended by org.pentaho.platform.engine.core.system.PentahoBase
      extended by org.pentaho.platform.repository.runtime.RuntimeElement
All Implemented Interfaces:
Serializable, ILogger, IRuntimeElement

public class RuntimeElement
extends PentahoBase
implements IRuntimeElement

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase
EMPTYLOGID, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
 
Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
 
Constructor Summary
RuntimeElement(String instId)
          Constructor
RuntimeElement(String instId, String parId, String parType)
          Constructor
RuntimeElement(String instId, String parId, String parType, String solnId)
          Constructor
 
Method Summary
 boolean equals(Object other)
          Uses the instanceId to distinguish equality.
 void forceSave()
          Causes an immediate call to the underlying persistence mechanism's write-now method.
 BigDecimal getBigDecimalProperty(String key)
          Gets a BigDecimal property from the paramMap.
 BigDecimal getBigDecimalProperty(String key, BigDecimal defaultValue)
          Gets a property from the paramMap as a BigDecimal, using a default value if it doesn't exist in the map.
 Date getCreateDate()
           
 Date getDateProperty(String key)
          Gets a property from the paramMap as a Date, with no default value.
 Date getDateProperty(String key, Date defaultValue)
          Gets a property from the paramMap as a Date using a default value if it doesn't exist in the map
 String getInstanceId()
           
 List getListProperty(String key)
          Gets a list property from the paramMap.
 boolean getLoaded()
           
 org.apache.commons.logging.Log getLogger()
           
 long getLongProperty(String key, long defaultValue)
          Gets a property from the paramMap as a long using a default value if it doesn't exist in the map
 Long getLongProperty(String key, Long defaultValue)
          Gets a property from the paramMap as a Long using a default value if it doesn't exist in the map
 Map getMapProperty(String key)
          Gets a map property from the paramMap.
 List getMessages()
           
 Set getParameterNames()
           
 String getParameterType(String parameterName)
          Gets the type of the parameter
 String getParentId()
           
 String getParentType()
           
 boolean getReadOnly()
           
 int getRevision()
          Auto-handled revision mechanism.
 String getSolutionId()
           
 String getStringProperty(String key)
          Gets a property from the paramMap as a string with no default value.
 String getStringProperty(String key, String defaultValue)
          Gets a property from the paramMap as a string, using a default value if it doesn't exist in the map.
 int hashCode()
           
 void setAllowableAttributeNames(Collection allowedReadNames)
           
 void setBigDecimalProperty(String key, BigDecimal value)
          Sets the BigDecimal property in the paramMap.
 void setCreateDate(Date value)
           
 void setDateProperty(String key, Date value)
          Sets a date property in the paramMap.
 void setInstanceId(String instId)
           
 void setListProperty(String key, List value)
          Sets a list property in the paramMap.
 void setLoaded(boolean value)
           
 void setLongProperty(String key, long value)
          Sets a long property in the paramMap.
 void setLongProperty(String key, Long value)
          Sets a long property in the paramMap.
 void setMapProperty(String key, Map value)
          Sets a map property in the paramMap.
 void setParentId(String parentId)
           
 void setParentType(String parentType)
           
 void setReadOnly(boolean value)
           
 void setSolutionId(String solutionId)
           
 void setStringProperty(String key, String value)
          Sets a property into the paramMap.
 String toXML()
          Returns an XML representation of the RuntimeElement.
 
Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase
debug, debug, error, error, fatal, fatal, genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, getLogId, getObjectName, info, info, setLoggingLevel, setLogId, trace, trace, warn, warn
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pentaho.platform.api.repository.IRuntimeElement
getLoggingLevel
 

Constructor Detail

RuntimeElement

public RuntimeElement(String instId)
Constructor

Parameters:
instId - The Instance Id

RuntimeElement

public RuntimeElement(String instId,
                      String parId,
                      String parType)
Constructor

Parameters:
instId - The Instance Id
parId - The Parent Id
parType - The Parent Type

RuntimeElement

public RuntimeElement(String instId,
                      String parId,
                      String parType,
                      String solnId)
Constructor

Parameters:
instId - The Instance Id
parId - The Parent Id
parType - The Parent Type
solnId - The Solution Id
Method Detail

getMessages

public List getMessages()

getParentId

public String getParentId()
Specified by:
getParentId in interface IRuntimeElement
Returns:
Returns the parentId.

setParentId

public void setParentId(String parentId)
Specified by:
setParentId in interface IRuntimeElement
Parameters:
parentId - The parentId to set.

getParentType

public String getParentType()
Specified by:
getParentType in interface IRuntimeElement
Returns:
Returns the parentType.

setParentType

public void setParentType(String parentType)
Specified by:
setParentType in interface IRuntimeElement
Parameters:
parentType - The parentType to set.

getInstanceId

public String getInstanceId()
Specified by:
getInstanceId in interface IRuntimeElement
Returns:
Returns the instanceId.

setInstanceId

public void setInstanceId(String instId)
Specified by:
setInstanceId in interface IRuntimeElement
Parameters:
instId - The instanceId to set.

getSolutionId

public String getSolutionId()
Specified by:
getSolutionId in interface IRuntimeElement
Returns:
Returns the solutionId.

setSolutionId

public void setSolutionId(String solutionId)
Specified by:
setSolutionId in interface IRuntimeElement
Parameters:
solutionId - The solutionId to set.

getRevision

public int getRevision()
Auto-handled revision mechanism.

Specified by:
getRevision in interface IRuntimeElement
Returns:
The current revision

equals

public boolean equals(Object other)
Uses the instanceId to distinguish equality. The instanceId will never be null, won't change, and is the primary key. Therefore, it's the perfect candidate for equals() and hashcode.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getCreateDate

public Date getCreateDate()

setCreateDate

public void setCreateDate(Date value)

getStringProperty

public String getStringProperty(String key)
Gets a property from the paramMap as a string with no default value.

Specified by:
getStringProperty in interface IRuntimeElement
Parameters:
key - The key into the map.
Returns:
The property.

getStringProperty

public String getStringProperty(String key,
                                String defaultValue)
Gets a property from the paramMap as a string, using a default value if it doesn't exist in the map.

Specified by:
getStringProperty in interface IRuntimeElement
Parameters:
key - The key into the map.
defaultValue - Default value returned if the key isn't already in the map.
Returns:
The property.

setStringProperty

public void setStringProperty(String key,
                              String value)
Sets a property into the paramMap. Special implementation note - Null values aren't supported in the Map. So, if a null value is passed in, this implementation will remove the entry from the map.

Specified by:
setStringProperty in interface IRuntimeElement
Parameters:
key - The key into the map.
value - The value to set.

getBigDecimalProperty

public BigDecimal getBigDecimalProperty(String key)
Gets a BigDecimal property from the paramMap.

Specified by:
getBigDecimalProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap.
Returns:
BigDecimal property

getBigDecimalProperty

public BigDecimal getBigDecimalProperty(String key,
                                        BigDecimal defaultValue)
Gets a property from the paramMap as a BigDecimal, using a default value if it doesn't exist in the map.

Specified by:
getBigDecimalProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap.
defaultValue - Detault value if the property doesn't exist in the paramMap.
Returns:
Returns the property from the paramMap.

setBigDecimalProperty

public void setBigDecimalProperty(String key,
                                  BigDecimal value)
Sets the BigDecimal property in the paramMap. Special implementation note - Null values aren't supported in the Map. So, if a null value is passed in, this implementation will remove the entry from the map.

Specified by:
setBigDecimalProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap.
value - The property value to set.

getDateProperty

public Date getDateProperty(String key)
Gets a property from the paramMap as a Date, with no default value.

Specified by:
getDateProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap
Returns:
The property in the map.

getDateProperty

public Date getDateProperty(String key,
                            Date defaultValue)
Gets a property from the paramMap as a Date using a default value if it doesn't exist in the map

Specified by:
getDateProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap
defaultValue - The default value if the property doesn't exist in the paramMap.
Returns:
The property in the map.

setDateProperty

public void setDateProperty(String key,
                            Date value)
Sets a date property in the paramMap. If null comes in, it removes the value from the map. Special implementation note - Null values aren't supported in the Map. So, if a null value is passed in, this implementation will remove the entry from the map.

Specified by:
setDateProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap
value - The property value to set.

getLongProperty

public Long getLongProperty(String key,
                            Long defaultValue)
Gets a property from the paramMap as a Long using a default value if it doesn't exist in the map

Specified by:
getLongProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap
defaultValue - The default value if the property doesn't exist in the paramMap.
Returns:
The property in the map.

getLongProperty

public long getLongProperty(String key,
                            long defaultValue)
Gets a property from the paramMap as a long using a default value if it doesn't exist in the map

Specified by:
getLongProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap
defaultValue - The default value if the property doesn't exist in the paramMap.
Returns:
The property in the map.

setLongProperty

public void setLongProperty(String key,
                            Long value)
Sets a long property in the paramMap. If null comes in, it removes the value from the map. Special implementation note - Null values aren't supported in the Map. So, if a null value is passed in, this implementation will remove the entry from the map.

Specified by:
setLongProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap
value - The property value to set.

setLongProperty

public void setLongProperty(String key,
                            long value)
Sets a long property in the paramMap.

Specified by:
setLongProperty in interface IRuntimeElement
Parameters:
key - Key in the paramMap
value - The property value to set.

getListProperty

public List getListProperty(String key)
Gets a list property from the paramMap.

Specified by:
getListProperty in interface IRuntimeElement
Parameters:
key - Key in the map
Returns:
The list property in the paramMap.

getMapProperty

public Map getMapProperty(String key)
Gets a map property from the paramMap.

Specified by:
getMapProperty in interface IRuntimeElement
Parameters:
key - The key in the map
Returns:
The map value in the paramMap.

setListProperty

public void setListProperty(String key,
                            List value)
Sets a list property in the paramMap. Special implementation note - Null values aren't supported in the Map. So, if a null value is passed in, this implementation will remove the entry from the map.

Specified by:
setListProperty in interface IRuntimeElement
Parameters:
key - The key in the map.
value - The list property to set.

setMapProperty

public void setMapProperty(String key,
                           Map value)
Sets a map property in the paramMap. Special implementation note - Null values aren't supported in the Map. So, if a null value is passed in, this implementation will remove the entry from the map.

Specified by:
setMapProperty in interface IRuntimeElement
Parameters:
key - The key in the map.
value - The map property to set.

toXML

public String toXML()
Returns an XML representation of the RuntimeElement. Mainly for Debug/Test Cases to make sure that what goes in is what comes out during tests.

Specified by:
toXML in interface IRuntimeElement
Returns:
Returns an XML representation of the RuntimeElement

getLogger

public org.apache.commons.logging.Log getLogger()
Specified by:
getLogger in class PentahoBase

setAllowableAttributeNames

public void setAllowableAttributeNames(Collection allowedReadNames)
Specified by:
setAllowableAttributeNames in interface IRuntimeElement
Parameters:
allowedReadNames - The names of the attributes that this process is allowed to read.

getParameterNames

public Set getParameterNames()
Specified by:
getParameterNames in interface IRuntimeElement
Returns:
The set of currently defined parameter names

getParameterType

public String getParameterType(String parameterName)
Description copied from interface: IRuntimeElement
Gets the type of the parameter

Specified by:
getParameterType in interface IRuntimeElement
Parameters:
parameterName - Parameter name
Returns:
String type of the parameter

setLoaded

public void setLoaded(boolean value)
Specified by:
setLoaded in interface IRuntimeElement

getLoaded

public boolean getLoaded()
Specified by:
getLoaded in interface IRuntimeElement

getReadOnly

public boolean getReadOnly()

setReadOnly

public void setReadOnly(boolean value)

forceSave

public void forceSave()
Description copied from interface: IRuntimeElement
Causes an immediate call to the underlying persistence mechanism's write-now method. For Hibernate, this results in a call to HibernateUtil.flush().

Specified by:
forceSave in interface IRuntimeElement