public class ServiceConfigurationProperty
extends java.lang.Object
implements java.lang.Cloneable
Title: Open Service Framework
Description: This is the base descriptor class for a Service Configuration Property
.
This class serves as the base mechanism for defining service configuration properties. It has several types that inherit from the
base model, specifically a List and a Table. The base model only supports configuration primitives which may be simple strings,
numeric values or decorated strings (ie. SQL, XML and so forth). Factory types are described in ServicePropertyType
.
Two extended parameters (List and Table)
are also provided as part of the factory types. These collections may hold
a list of ServiceConfigurationProperty
instances. Hence users may create their own property descriptors and store them in
a list or table.
Configuration Property classes have the following hierarchy and functionality:
ServiceConfigurationProperty - Primitive Types | +-- STRING - String Type +-- PASSWORD - String Type presented in binary to avoid clear text XML +-- XML - XML Type that supports validation +-- TEXT - Text Area that supports markup +-- NUMERIC - Numeric Type (represented by Long Java type) +-- DECIMAL - Decimal Type (represented by Double Java type) +-- BOOLEAN - Boolean Type +-- SQL - SQL Type that supports syntax highlighting +-- URL - URL Type that supports validation (represented by URI Java type) * +-- ENUMERATION - Enumerated Type driven bysetRange(String)
+-- TRANSPORT_FACTORY - Name and Type of Transport Factory that supports type lookup +-- OBJECT - Name, Type and Reference Context of arbitrary object stored in repository +-- JDBC_FACTORY - Name and Type of a JDBC Factory that supports type lookup +-- CLIENT_FACTORY - Name and Type of an arbitrary Client Factory that supports type lookup +-- LIST List ofServiceConfigurationProperty
instances (represented by List<ServiceConfigurationProperty> Java type). +-- TABLETable ofKey, ServiceConfigurationProperty
instances (represented by Hashtable<String, ServiceConfigurationProperty> Java type).
Java Objects
these parameters will be serialized as part of the
Service Configuration Object
by the IServiceRepository
implementation
during a save operation. The collection will be marshaled back into a Java Object
when the configuration is
recalled back from the repository during a load operation. Service configuration properties, and all aspects of the SCO
are serialized to XML. If a given repository implementation supports Exportable Property Annotations and the specific property
isExportable
then its name, description, value and type (Semantic Type) should be made available to the repository's query engine.
For instance these values may be persisted to a table and later accessed using SQL.
Copyright: Copyright (c) 2009
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
void |
applyDefault()
This method copies default values from the specified defaults to actual property value, thereby initializing
the property value to those specified in the defaults and overlaying any values that may be currently set.
|
ServiceConfigurationProperty |
clone() |
java.lang.Object |
getDefault() |
java.lang.String |
getDescription() |
java.lang.String |
getGroup() |
java.lang.String |
getLabel() |
java.lang.String |
getName() |
java.lang.String |
getRange() |
java.util.Vector |
getRangeList()
Returns the range as a Vector of Strings.
|
java.lang.Object |
getRawValue()
Returns value of the property 'as is'.
|
ServicePropertyType |
getType() |
java.lang.Object |
getValue() |
boolean |
isExportable() |
boolean |
isRequired() |
java.lang.Object |
resolveValue(MacroProcessor processor)
Returns the value of the property.
|
void |
setDefault(java.lang.Object dflt)
Sets the default value of the property.
|
void |
setDescription(java.lang.String desc)
Sets a description of the property typically used by Tool Tip of a visual editor.
|
void |
setExportable(boolean export)
Indicates whether this property and its values should be exported into the Property Annotation Table of the
repository during the storage operation
|
void |
setGroup(java.lang.String group)
Sets the logical group of a particular property.
|
void |
setLabel(java.lang.String label)
Sets the property label for use by visual editors.
|
void |
setName(java.lang.String name)
Sets the name of the property to be used for internal parameter reference.
|
void |
setRange(java.lang.String range)
Sets the range of a property based on a comma separated list.
|
void |
setRequired(boolean required)
Specified whether this parameter is a required parameter.
|
void |
setValue(java.lang.Object value)
The value of the property.
|
void |
setValue(java.lang.String valueWithMacro)
Sets the value based on its String representation.
|
java.lang.Object |
toObject() |
java.lang.String |
toString()
Returns a string value of this property.
|
public void setName(java.lang.String name)
name
- Stringpublic java.lang.String getName()
public void setLabel(java.lang.String label)
label
- Stringpublic java.lang.String getLabel()
public void setDescription(java.lang.String desc)
desc
- Stringpublic java.lang.String getDescription()
public void setGroup(java.lang.String group)
main.group
. The main.group
group is also
present in the Service Configuration Object
by default as the first group. Users may
remove this group and add their own. When a property is added to the Service Configuration Object
its group is checked against existing groups in the list and if no match is found a ServiceConfigurationException
is thrown.group
- Stringpublic java.lang.String getGroup()
public ServicePropertyType getType()
public void setRequired(boolean required)
required
- booleanpublic boolean isRequired()
public void setRange(java.lang.String range)
ServicePropertyType.ENUMERATION
as a data type, the list should represent a list of possible values.
However, user defined Types may find other uses for this field.
Range may be a comma delimited list of possible value ranges or limits. It is evaluated based on the associate
Data Type and should be processed by Validators and Editors
accordingly. For example, an INTEGER with a
range of (1,10) should validate that a value is between 1 and 10. The Editor may present a spinner. A value
of (1,10,100) should throw an error. An ENUMERATION with a range of (A,B,C) should present a choice of the 3
elements. LIST of (1,3,5) should present these as default list elements that may be edited by the user.
This value may be used by Validators
to verify that the artifact exists in a given
repository. Alternatively, if a repository implementation supports Type Resolution this field may be
used as Type Name
allowing the type to be resolved. This approach allows implementation substitutions
wherein a given Type Name
may resolve to different classes in different environments.
range
- Stringpublic java.lang.String getRange()
public java.util.Vector getRangeList()
public void setDefault(java.lang.Object dflt) throws ServiceConfigurationException
setType(com.streamscape.service.osf.config.ServicePropertyType)
allowing UI and services to deal with casting issues.dflt
- ObjectServiceConfigurationException
public java.lang.Object getDefault()
public void applyDefault()
public void setValue(java.lang.Object value) throws ServiceConfigurationException
The goal of the StreamScape platform, however is to provide a rich, platform-independent data serialization mechanism. As such complex objects may be set as service configuration propery value.
value
- Object java.lang.String
for STRING
property type.java.lang.Boolean
for BOOLEAN
property type.java.lang.Long
for NUMERIC
property type.java.lang.Double
for DECIMAL
property type.java.net.URI
for URL
property type.com.streamscape.service.osf.config.PasswordPropertyValue
for PASSWORD
property type.com.streamscape.service.osf.config.ObjectPropertyValue
for OBJECT
property type.com.streamscape.service.osf.config.JdbcFactoryPropertyValue
for JDBC_FACTORY
property type.com.streamscape.service.osf.config.ClientFactoryPropertyValue
for CLIENT_FACTORY
property type.com.streamscape.service.osf.config.TransportFactoryPropertyValue
for TRANSPORT_FACTORY
property type.java.util.List<ServiceConfigurationProperty>
for LIST
property type.java.util.Hashtable<String,ServiceConfigurationProperty>
for TABLE
property type.OTHER
property type.ServiceConfigurationException
- if value of incorrect type is passed as parameter actual parameter
or if any constraints/ranges are violated.public void setValue(java.lang.String valueWithMacro) throws ServiceConfigurationException
OBJECT
JDBC_FACTORY
CLIENT_FACTORY
TRANSPORT_FACTORY
PASSWORD
valueWithMacro
- String - representation of the value or macro definition.ServiceConfigurationException
- if passed value has incorrect format.public java.lang.Object getRawValue()
public java.lang.Object resolveValue(MacroProcessor processor)
ServicePropertyType
)
returned value will be:
java.lang.String
for STRING
property type.java.lang.Boolean
for BOOLEAN
property type.java.lang.Long
for NUMERIC
property type.java.lang.Double
for DECIMAL
property type.java.net.URI
for URL
property type.com.streamscape.service.osf.config.PasswordPropertyValue
for PASSWORD
property type.com.streamscape.service.osf.config.ObjectPropertyValue
for OBJECT
property type.com.streamscape.service.osf.config.JdbcFactoryPropertyValue
for JDBC_FACTORY
property type.com.streamscape.service.osf.config.ClientFactoryPropertyValue
for CLIENT_FACTORY
property type.com.streamscape.service.osf.config.TransportFactoryPropertyValue
for TRANSPORT_FACTORY
property type.java.util.List<ServiceConfigurationProperty>
for LIST
property type.java.util.Hashtable<String,ServiceConfigurationProperty>
for TABLE
property type.OTHER
property type.public java.lang.Object getValue()
public void setExportable(boolean export)
export
- booleanpublic boolean isExportable()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object toObject()
public ServiceConfigurationProperty clone()
clone
in class java.lang.Object
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.