bea.jolt.pool
Class ServiceInfo

java.lang.Object
  bea.jolt.pool.ServiceInfo

public class ServiceInfo
extends java.lang.Object

This class provides the meta-information about a service and the parameters in the service. It can be used to generate HTML for a service with its input parameters.

Author:
Copyright (c) 1999 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
ServiceInfo()
           
 
Method Summary
 DataSet getDataSet(SessionPool spool)
          Gets an empty data set from the input parameters of this service.
 int getDefinition(SessionPool spool)
          Gets the service definition from a repository.
 int getDisplayLength(java.lang.String name)
          Gets the display length for the value of an attribute defined in the service definition.
 java.lang.String getFieldName(java.lang.String name, int index)
          Maps a multi-occurrence attribute name from the BEA Jolt repository to a unique field name that can be used in a HTML Form.
 java.lang.String getLabel(java.lang.String name, int index)
          Gets a presentable label for a multi-occurrence attribute.
 int getMaxCount(java.lang.String name)
          Gets the maximum occurrence count for an attribute defined in the service definition.
 java.lang.String getType(java.lang.String name)
          Gets a data type presented in string for an attribute.
 void setName(java.lang.String svcname)
          Sets the service name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceInfo

public ServiceInfo()
Method Detail

setName

public void setName(java.lang.String svcname)
Sets the service name.

Parameters:
svcname - The service name

getDataSet

public DataSet getDataSet(SessionPool spool)
Gets an empty data set from the input parameters of this service.

Parameters:
spool - A session pool
Returns:
A web-server specific DataSet object

getDefinition

public int getDefinition(SessionPool spool)
Gets the service definition from a repository.

Parameters:
spool - A session pool object
Returns:
0 if successful; -1 otherwise

getLabel

public java.lang.String getLabel(java.lang.String name,
                                 int index)
Gets a presentable label for a multi-occurrence attribute. The return string may look like name[0], but it is subject to change. This method is primarily for the generic HTML service.

Parameters:
name - The name of the attribute
index - An instance number
Returns:
name or the name with an index.

getFieldName

public java.lang.String getFieldName(java.lang.String name,
                                     int index)
Maps a multi-occurrence attribute name from the BEA Jolt repository to a unique field name that can be used in a HTML Form. The field name has a trailing "_" and an index number (for example, ACCOUNT_ID_2). This method is primarily used by the generic HTML service.

Parameters:
name - The name of the attribute
index - An instance number
Returns:
A unique field name

getMaxCount

public int getMaxCount(java.lang.String name)
Gets the maximum occurrence count for an attribute defined in the service definition. This method is primarily used by the generic HTML service.

Parameters:
name - The name of the attribute
Returns:
The maximum occurrence count

getDisplayLength

public int getDisplayLength(java.lang.String name)
Gets the display length for the value of an attribute defined in the service definition. If the data type of the attribute is string or CARRAY and the maximum length is undefined, the defaults are 32 and 80 respectively. This method is primarily used by the generic HTML service.

Parameters:
name - The name of the attribute
Returns:
The display field length

getType

public java.lang.String getType(java.lang.String name)
Gets a data type presented in string for an attribute. The return value is subject to change. This method is primarily used by the generic HTML service.

Parameters:
name - The name of the attribute
Returns:
The data type string