net.kalio.empweb.engine
Class WSBroker

java.lang.Object
  extended by net.kalio.empweb.engine.WSBroker

public class WSBroker
extends java.lang.Object

Title: WSBroker

Description: This class has two purposes: It is the configuration initializer for the engine, providing the implementation for the EngineInit web service. It also resolves TransactionPipelines and Web Services identified by a logic name.

Copyright: Copyright (c) 2004

Company: Kalio

Version:
1.0
Author:
Barzilai Spinak
To Do:
BBB En el futuro ver si podemos separar esta clase en una clase de config, y en otra de DB/WS Broker/Resolver, BBB Fijarse si hacemos un variable de estado de EngineException de config a ser checkada por un handler

Field Summary
static java.lang.String[] ENGINE_STATE_MESSAGE
           
static int ENGINE_STATE_READY
           
static int ENGINE_STATE_TRANS_OFF
           
 
Constructor Summary
WSBroker()
           
 
Method Summary
static int checkEngineState()
           
static java.util.Map getAllLimits()
          It returns a union of all the limits used in all the current pipelines.
static java.lang.String getDatabaseType(java.lang.String db)
          Returns the type of the database represented by the logic name "db".
static DBConfig getDBConfig(java.lang.String db)
           
static java.lang.String[] getDBLogicNames(java.lang.String type)
          Returns an array of String with the logic names of all the databases of the given type
static EmpwebDB getEwdb()
           
static org.w3c.dom.Element getMockupResponse(java.lang.String wsName)
           
static TransactionPipeline getTransactionPipeline(java.lang.String type)
           
static java.util.Map getTransactionPipelines()
          Returns a clone copy of the Transaction Pipelines map.
 void init()
           
static java.lang.Object invokeService(java.lang.String logicName, java.lang.String method, java.lang.Object[] params)
          Convenience method to invoke a "method" of the web service that is represented by this "logicName"
static void main(java.lang.String[] a)
           
static void setEngineState(int state)
           
static void setEngineState(java.lang.String state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENGINE_STATE_READY

public static final int ENGINE_STATE_READY
See Also:
Constant Field Values

ENGINE_STATE_TRANS_OFF

public static final int ENGINE_STATE_TRANS_OFF
See Also:
Constant Field Values

ENGINE_STATE_MESSAGE

public static final java.lang.String[] ENGINE_STATE_MESSAGE
Constructor Detail

WSBroker

public WSBroker()
Method Detail

init

public void init()
          throws XMLConfigurationException,
                 ConfigurationException
Throws:
XMLConfigurationException
ConfigurationException
To Do:
BBB Imponer que el init pueda ser llamado solo desde localhost

getTransactionPipeline

public static TransactionPipeline getTransactionPipeline(java.lang.String type)

getTransactionPipelines

public static java.util.Map getTransactionPipelines()
Returns a clone copy of the Transaction Pipelines map.


getAllLimits

public static java.util.Map getAllLimits()
It returns a union of all the limits used in all the current pipelines. The collection is a Map, where the keys are the limit names, and the values are ArrayList's with the names of all the pipelines where this limit is used.


invokeService

public static java.lang.Object invokeService(java.lang.String logicName,
                                             java.lang.String method,
                                             java.lang.Object[] params)
                                      throws EngineException
Convenience method to invoke a "method" of the web service that is represented by this "logicName"

Parameters:
logicName - Logic name of a certain database accessed by a web service
method - Name of the method or operation on the web service
params - Array of objects for the parameters of the method
Returns:
An Object. The return of the web service invokation. Normally this is an org.w3c.dom.Element because the web services should be document/literal.
Throws:
EngineException

getDBLogicNames

public static java.lang.String[] getDBLogicNames(java.lang.String type)
Returns an array of String with the logic names of all the databases of the given type


getDBConfig

public static DBConfig getDBConfig(java.lang.String db)

getDatabaseType

public static java.lang.String getDatabaseType(java.lang.String db)
Returns the type of the database represented by the logic name "db".


getEwdb

public static EmpwebDB getEwdb()

checkEngineState

public static int checkEngineState()
                            throws EngineException
Throws:
EngineException

setEngineState

public static void setEngineState(int state)

setEngineState

public static void setEngineState(java.lang.String state)
                           throws EngineException
Throws:
EngineException

getMockupResponse

public static org.w3c.dom.Element getMockupResponse(java.lang.String wsName)
                                             throws EngineException
Throws:
EngineException

main

public static void main(java.lang.String[] a)
                 throws java.lang.Exception
Throws:
java.lang.Exception