soap tutorial

adriani.jws.template.service
Class ServiceData

java.lang.Object
  extended by adriani.jws.template.service.ServiceData

public class ServiceData
extends java.lang.Object

The container for all STATIC settings used by the business service logic (string values etc.).
Instantiation of this class should not be necessary since these methods are called only once, within a static code block of the ServiceMacro class, in order to retrieve all the static settings used by the business logic. All these settings are stored into static attributes of this class, hence these parameters are available without the need to instantiate this class.


Field Summary
protected static java.lang.StringBuffer[] data_keys
          List of the keywords used by this service (loaded from the property file).
static int DELAY
          Time (in milliseconds) used to sleep the HTTP-request thread when testing concurrent call.
static boolean FAKE
          If true the ServiceMacro will append two fake records to each call.
protected static java.util.Hashtable<java.lang.String,java.lang.String> hash
          List of the keywords used by this service (loaded from the property file).
static boolean[] HEADER_CHECK
          If true the ServiceLogic requires the some authentication check.
static java.lang.String HEADER_VALUE
          The value of the authentication parameter used to check the client request
protected static java.lang.String leadingName
          Beginning of each logging message for this class.
 
Constructor Summary
ServiceData()
           
 
Method Summary
static boolean checkAuthentication(int method)
          Accessor method.
static boolean createKeywords(java.lang.String source)
          Create a keywords.properties data file containing the list of all the necessary keywords.
static boolean[] getBooleanTokens(java.lang.String string, java.lang.String sep)
          Tokenize the input string into an array of boolean, using the separator passed as input.
static java.lang.StringBuffer[] getHardCodedValues()
          Return an hard-coded list of all the necessary keywords.
static java.util.Hashtable getHashtable()
          Accessor method.
static int[] getIntegerTokens(java.lang.String string, java.lang.String sep)
          Tokenize the input string into an array of integer, using the separator passed as input.
static java.lang.StringBuffer[] getKeywords()
          Deprecated.  
static boolean loadKeywords(java.lang.String source)
          Load all the keywords from the keywords.properties file and store them into the data_keys class attribute.
static boolean loadLogicFlags()
          Load the logical settings for the business logic from the template_config.properties file and store them into this class attributes.
static void printHashtable(java.util.Hashtable<java.lang.String,java.lang.String> hash)
          Prints on the STDOUT the list of all the keywords loaded by this class.
static boolean printKeywords()
          Prints on the STDOUT the list of all the keywords loaded by this class.
static boolean produceJavaFile()
          Create a keywords.java data file containing the Java source definition of all the keywords.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hash

protected static java.util.Hashtable<java.lang.String,java.lang.String> hash
List of the keywords used by this service (loaded from the property file).


data_keys

protected static java.lang.StringBuffer[] data_keys
List of the keywords used by this service (loaded from the property file).


FAKE

public static boolean FAKE
If true the ServiceMacro will append two fake records to each call.


DELAY

public static int DELAY
Time (in milliseconds) used to sleep the HTTP-request thread when testing concurrent call.


HEADER_CHECK

public static boolean[] HEADER_CHECK
If true the ServiceLogic requires the some authentication check.


HEADER_VALUE

public static java.lang.String HEADER_VALUE
The value of the authentication parameter used to check the client request


leadingName

protected static java.lang.String leadingName
Beginning of each logging message for this class.

Constructor Detail

ServiceData

public ServiceData()
Method Detail

loadLogicFlags

public static boolean loadLogicFlags()
Load the logical settings for the business logic from the template_config.properties file and store them into this class attributes. This method search such file in two different ways:

First the configuration file is found in the CLASSPATH, i.e. "externally" with respect of the AAR file. To easy file naming and location, such "external" configuration file is not qualified, but it's named simply template_config.properties.
If such research fails, the configuration file is searched "internally", i.e. witht the AAR file. For legacy reason, such "internal" file is fully qualified, i.e. it's named as adriani.jws.template.resources.template_config.properties.

Since such configuration is redundant, detailed error message are printed only if the last search fails (in this case the search for the internal file).

Returns:
true if all the logic flags have been loaded successfully

loadKeywords

public static boolean loadKeywords(java.lang.String source)
Load all the keywords from the keywords.properties file and store them into the data_keys class attribute. The actual name of the configuration file is defined by the Settings.KEYWORDS parameter.

Parameters:
source - the name of the properties file (usually is "keywords.properties")
Returns:
true if the keywords have been successfully loaded from the properties file

getHashtable

public static java.util.Hashtable getHashtable()
Accessor method.


checkAuthentication

public static boolean checkAuthentication(int method)
Accessor method.


getKeywords

public static java.lang.StringBuffer[] getKeywords()
Deprecated. 

Accessor method.


createKeywords

public static boolean createKeywords(java.lang.String source)
Create a keywords.properties data file containing the list of all the necessary keywords. The input source file can be specified running the SimpleClient from the command line, using the option -c file name. If no path it's specified, the source file will be searched in the current directory. Eventually it's possible to specify an absolute path, for example: C:/Develop/name_list.txt.

Parameters:
source - the source file name
Returns:
true if the keywords.properties has been produced successfully

produceJavaFile

public static boolean produceJavaFile()
Create a keywords.java data file containing the Java source definition of all the keywords. This method should be used only during development, when the properties file should be always available, to produce the hard-coded list that will be retrieved by the getHardCodedValues() method.

Returns:
true if the keywords.java has been produced successfully
See Also:
getHardCodedValues()

printKeywords

public static boolean printKeywords()
Prints on the STDOUT the list of all the keywords loaded by this class. This method should be used only during development, for testing or debug.

Returns:
true if the keywords list has been printed successfully

getBooleanTokens

public static boolean[] getBooleanTokens(java.lang.String string,
                                         java.lang.String sep)
Tokenize the input string into an array of boolean, using the separator passed as input. The size of the boolean array will match the maximum value contained in the input string.

Parameters:
string - the string containing all the tokens (e.g. "1, 2, 3")
sep - the tokens separator (e.g ",")
Returns:
the boolean array containing all parsed tokens

getIntegerTokens

public static int[] getIntegerTokens(java.lang.String string,
                                     java.lang.String sep)
Tokenize the input string into an array of integer, using the separator passed as input.

Parameters:
string - the string containing all the tokens (e.g. "1, 2, 3")
sep - the tokens separator (e.g ",")
Returns:
the int array containing all parsed tokens

getHardCodedValues

public static java.lang.StringBuffer[] getHardCodedValues()
Return an hard-coded list of all the necessary keywords.

Returns:
the StringBuffer array containing all the required keywords
See Also:
produceJavaFile()

printHashtable

public static void printHashtable(java.util.Hashtable<java.lang.String,java.lang.String> hash)
Prints on the STDOUT the list of all the keywords loaded by this class. This method should be used only during development, for testing or debug.

Parameters:
hash - an hash table, usually one of those produced by the loadKeywords() method

Build 19/03/2014

Morpheus Technologies - making the Zion software
Copyright © 2009-2014 Morpheus Technologies. All Rights Reserved