Riferimenti per la classe org.jaebi.server.service.XRequestCommand

Diagramma delle classi per org.jaebi.server.service.XRequestCommand

Inheritance graph
[legenda]
Diagramma di collaborazione per org.jaebi.server.service.XRequestCommand:

Collaboration graph
[legenda]
Lista di tutti i membri.

Descrizione Dettagliata

Autore:
detro
Classe astratta per Command Xrequest. Questa Abstract Class raccoglie le caratteristiche comuni a tutte le classi XRequestCommand, evitando inutili ridondanze di codice.

Per creare un XRequestCommand particolare, e' necessario implementare solo 2 metodi:

Le classi cosi' create hanno a disposizione tutto quello di cui necessitano, ereditandolo come campi "protected".

Inoltre, la Classe prevede un sistema di Caching che evita di ricalcolare i risultati dell'analisi dell'XML ad ogni richiesta. Questo, nel caso di un uso massiccio dei Command, migliora sostanzialmente le prestazioni. Questo approccio e' favorito dal fatto che tutti gli XRequestCommand si basano sullo stesso XML.

In alcuni casi, si e' usata una notazione "XPath" per indicare i Nodi.

Definizione alla linea 51 del file XRequestCommand.java.

Membri pubblici

 XRequestCommand (Xrequest newXrequestObj, BackEndHandlerImpl newBackEndHandlerImpl) throws XRequestCommandInitException
 Costruttore.
abstract Object execute () throws CommandExecException
 Esegue Command sul BackEnd.
String getType ()
 Ritorna il valore dell'attributo "<code>/xrequest/@type</code>".
String getAffectedTable ()
 Table si cui viene eseguita l'XRequestCommand.
ArrayList getColumnsName ()
 Recupero valori di "<code>//Columns/Column/Name</code>".
HashMap getColumnsValue ()
 Recupero valori di "<code>//Columns/Column/Value</code>".
ArrayList getWhereColumnsName ()
 Recupero valori di "<code>//Where/Column/Name</code>".
HashMap getWhereColumnsValue ()
 Recupero valori di "<code>//Where/Column/Value</code>".
String toString ()
 Descrizione del Command.
boolean isExecuted ()
 Verifica se una Command e' stata gia' eseguita.

Attributi protetti

final BackEndHandlerImpl backEndHandler
 BackEndHandler su cui viene eseguito Command.
final Xrequest xrequestObj
 Oggetto Xrequest da Wrappare, che descrive il Command che lo User ha richiesto di eseguire.
boolean executed = false
 Variabile booleana per verificare se un Command e' stato eseguito o meno.

Attributi protetti statici

static final JAXBXResponseFactory xresponseFactory
 JAXBXResponseFactory utile a tutti gli XRequestCommand per produrre oggetti XResponse.
static String exceptionPrefix = "[XRequestCommand Exception]: "

Membri privati

ArrayList getNameFromColumnList (List columns)
 Costruisce un ArrayList con i valori dei TAG "Name" dentro i TAG "Column" contenuti in "Columns" o "Where".
HashMap getValueFromColumnList (List columns)
 Costruisce un HashMap con i valori dei TAG "Value", con chiavi i valori dei rispettivi TAG "Name", dentro i TAG "Column" contenuti in "Columns" o "Where".

Attributi privati

ArrayList columnsName = null
 Variabile "cache" che memorizza i valori contenuti in "<code>//Columns/Column/Name</code>".
HashMap columnsValue = null
 Variabile "cache" che memorizza i valori contenuti in "<code>//Columns/Column/Value</code>" utilizzando come chiave il valore del relativo "//Columns/Column/Value/.
ArrayList whereColumnsName = null
 Variabile "cache" che memorizza i valori contenuti in "<code>//Where/Column/Name</code>".
HashMap whereColumnsValue = null
 Variabile "cache" che memorizza i valori contenuti in "<code>//Where/Column/Value</code>" utilizzando come chiave il valore del relativo "//Where/Column/Value/.


Documentazione dei costruttori e dei distruttori

org.jaebi.server.service.XRequestCommand.XRequestCommand Xrequest  newXrequestObj,
BackEndHandlerImpl  newBackEndHandlerImpl
throws XRequestCommandInitException
 

Costruttore.

Parametri:
newXrequestObj Oggetto di tipo Xrequest che sara' "wrappato" dal Command

Definizione alla linea 89 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.backEndHandler, org.jaebi.server.service.XRequestCommand.exceptionPrefix, e org.jaebi.server.service.XRequestCommand.xrequestObj.

00090                                             {
00091         
00092         if ( newXrequestObj == null || newBackEndHandlerImpl == null ) {
00093             throw new XRequestCommandInitException(exceptionPrefix + 
00094                     "Init parameter error\n");
00095         }
00096         xrequestObj = newXrequestObj;
00097         backEndHandler = newBackEndHandlerImpl;
00098         
00099     }


Documentazione delle funzioni membro

abstract Object org.jaebi.server.service.XRequestCommand.execute  )  throws CommandExecException [pure virtual]
 

Esegue Command sul BackEnd.

Restituisce:
Rappresenta il risultato prodotto dalla Command
Eccezioni:
Errore durante l'exec del Command

Implementa org.jaebi.server.service.Command.

Implementato in org.jaebi.server.service.XRequestCommandDelete, org.jaebi.server.service.XRequestCommandInsert, org.jaebi.server.service.XRequestCommandSelect, e org.jaebi.server.service.XRequestCommandUpdate.

Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), e org.jaebi.test.server.service.MainTestServicePackage.main().

String org.jaebi.server.service.XRequestCommand.getAffectedTable  ) 
 

Table si cui viene eseguita l'XRequestCommand.

Restituisce:
Nome Tabella coinvolta dal Command

Definizione alla linea 116 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), org.jaebi.server.service.XRequestCommandInsert.execute(), e org.jaebi.server.service.XRequestCommandDelete.execute().

00116                                      {
00117         return xrequestObj.getTable();
00118     }

ArrayList org.jaebi.server.service.XRequestCommand.getColumnsName  ) 
 

Recupero valori di "<code>//Columns/Column/Name</code>".

Restituisce:
ArrayList dei valori contenuti nei nodi "Name", contenuti in "Column"

Definizione alla linea 176 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.columnsName, org.jaebi.server.service.XRequestCommand.getNameFromColumnList(), e org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandSelect.execute().

00176                                       {
00177         if ( columnsName == null ) {
00178             if ( xrequestObj.getColumns() != null ) {
00179                 columnsName = getNameFromColumnList( 
00180                         xrequestObj.getColumns().getColumn() ); // Caching...
00181             } else
00182                 columnsName = new ArrayList();
00183         }
00184         return columnsName; // Using Cache...
00185     }

Questo è il grafo delle chiamate per questa funzione:

HashMap org.jaebi.server.service.XRequestCommand.getColumnsValue  ) 
 

Recupero valori di "<code>//Columns/Column/Value</code>".

Indicizzati in base ai rispettivi "<code>//Columns/Column/Value/../Name</code>"

Restituisce:
HashMap dei valori contenuti nei nodi "Value", contenuti in "Column"

Definizione alla linea 196 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.columnsValue, org.jaebi.server.service.XRequestCommand.getValueFromColumnList(), e org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), e org.jaebi.server.service.XRequestCommandInsert.execute().

00196                                      {
00197         if ( columnsValue == null ) {
00198             if ( xrequestObj.getColumns() != null ) {
00199                 columnsValue = getValueFromColumnList( 
00200                         xrequestObj.getColumns().getColumn() ); // Caching...
00201             } else
00202                 columnsValue = new HashMap();
00203         }
00204         return columnsValue; // Using Cache...
00205     }

Questo è il grafo delle chiamate per questa funzione:

ArrayList org.jaebi.server.service.XRequestCommand.getNameFromColumnList List  columns  )  [private]
 

Costruisce un ArrayList con i valori dei TAG "Name" dentro i TAG "Column" contenuti in "Columns" o "Where".

Il metodo e' privato e generico, cosi' da poter semplificare e snellire la stesura del codice.

Parametri:
columns Lista di Column da analizzare
Restituisce:
ArrayList di Stringhe di "Name"

Definizione alla linea 130 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommand.getColumnsName(), e org.jaebi.server.service.XRequestCommand.getWhereColumnsName().

00130                                                           {
00131         ArrayList result = new ArrayList();
00132         if ( columns != null ) {
00133             Iterator iter = columns.iterator();
00134             Column column = null;
00135 
00136             while ( iter.hasNext() ) {
00137                 column = (Column)iter.next();
00138                 result.add( column.getName() );
00139             }
00140         }
00141 
00142         return result;
00143     }

String org.jaebi.server.service.XRequestCommand.getType  )  [virtual]
 

Ritorna il valore dell'attributo "<code>/xrequest/@type</code>".

Implementa org.jaebi.server.service.Command.

Definizione alla linea 107 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.xrequestObj.

00107                             {
00108         return xrequestObj.getType();
00109     }

HashMap org.jaebi.server.service.XRequestCommand.getValueFromColumnList List  columns  )  [private]
 

Costruisce un HashMap con i valori dei TAG "Value", con chiavi i valori dei rispettivi TAG "Name", dentro i TAG "Column" contenuti in "Columns" o "Where".

Il metodo e' privato e generico, cosi' da poter semplificare e snellire la stesura del codice.

Parametri:
columns List di Column da Analizzare
Restituisce:
HashMap di Stringhe di "Value" con chiave "Name"

Definizione alla linea 156 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommand.getColumnsValue(), e org.jaebi.server.service.XRequestCommand.getWhereColumnsValue().

00156                                                          {
00157         HashMap result = new HashMap();
00158         if ( columns != null ) {
00159             Iterator iter = columns.iterator();
00160             Column column = null;
00161 
00162             while ( iter.hasNext() ) {
00163                 column = (Column)iter.next();
00164                 result.put(column.getName(), column.getValue());
00165             }
00166         }
00167         
00168         return result;
00169     }

ArrayList org.jaebi.server.service.XRequestCommand.getWhereColumnsName  ) 
 

Recupero valori di "<code>//Where/Column/Name</code>".

Restituisce:
ArrayList dei valori contenuti nei nodi "Name", contenuti in "Column"

Definizione alla linea 212 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.getNameFromColumnList(), org.jaebi.server.service.XRequestCommand.whereColumnsName, e org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), e org.jaebi.server.service.XRequestCommandDelete.execute().

00212                                            {
00213         if ( whereColumnsName == null ) {
00214             if ( xrequestObj.getWhere() != null ) {
00215                 whereColumnsName = getNameFromColumnList( 
00216                         xrequestObj.getWhere().getColumn() ); // Caching...
00217             } else
00218                 whereColumnsName = new ArrayList();
00219         }
00220         return whereColumnsName; // Using Cache...
00221     }

Questo è il grafo delle chiamate per questa funzione:

HashMap org.jaebi.server.service.XRequestCommand.getWhereColumnsValue  ) 
 

Recupero valori di "<code>//Where/Column/Value</code>".

Indicizzati in base ai rispettivi "<code>//Where/Column/Value/../Name</code>"

Restituisce:
HashMap dei valori contenuti nei nodi "Value", contenuti in "Column"

Definizione alla linea 231 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.XRequestCommand.getValueFromColumnList(), org.jaebi.server.service.XRequestCommand.whereColumnsValue, e org.jaebi.server.service.XRequestCommand.xrequestObj.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), e org.jaebi.server.service.XRequestCommandDelete.execute().

00231                                           {
00232         if ( whereColumnsValue == null ) {
00233             if ( xrequestObj.getWhere() != null ) {
00234                 whereColumnsValue = getValueFromColumnList( 
00235                         xrequestObj.getWhere().getColumn() ); // Caching...
00236             } else
00237                 whereColumnsValue = new HashMap();
00238         }
00239         return whereColumnsValue; // Using Cache...
00240     }

Questo è il grafo delle chiamate per questa funzione:

boolean org.jaebi.server.service.Command.isExecuted  )  [inherited]
 

Verifica se una Command e' stata gia' eseguita.

Restituisce:
"true" in caso affermativo

Definizione alla linea 32 del file Command.java.

Riferimenti org.jaebi.server.service.Command.executed.

00032 { return executed; }

String org.jaebi.server.service.XRequestCommand.toString  )  [virtual]
 

Descrizione del Command.

Restituisce:
Una Stringa che descrive il Command

Implementa org.jaebi.server.service.Command.

Definizione alla linea 242 del file XRequestCommand.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapper.marshall(), org.jaebi.server.service.xml.JAXBMarshallerWrapper.setFormattedMarshalling(), e org.jaebi.server.service.XRequestCommand.xrequestObj.

00242                              {
00243         JAXBMarshallerWrapper marshWrap = null;
00244         String result = null;
00245         
00246         try {
00247             marshWrap = new JAXBMarshallerWrapperImpl("org.jaebi.server.service.xml.xrequest");
00248             marshWrap.setFormattedMarshalling(true);
00249             result = marshWrap.marshall( xrequestObj );
00250         } catch ( JAXBMarshallerWrapperMarshallException e ) {
00251             return "<XRequestCommand> toString conversion (marshalling) exception:\n" + e;
00252         } catch ( JAXBMarshallerWrapperInitException e ) {
00253             return "<XRequestCommand> toString conversion (Marshall Wrapper Init) exception:\n" + e;
00254         }
00255         
00256         return result;
00257     }

Questo è il grafo delle chiamate per questa funzione:


Documentazione dei dati membri

final BackEndHandlerImpl org.jaebi.server.service.XRequestCommand.backEndHandler [protected]
 

BackEndHandler su cui viene eseguito Command.

Definizione alla linea 58 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), org.jaebi.server.service.XRequestCommandInsert.execute(), org.jaebi.server.service.XRequestCommandDelete.execute(), org.jaebi.server.service.XRequestCommand.XRequestCommand(), org.jaebi.server.service.XRequestCommandDelete.XRequestCommandDelete(), org.jaebi.server.service.XRequestCommandInsert.XRequestCommandInsert(), org.jaebi.server.service.XRequestCommandSelect.XRequestCommandSelect(), e org.jaebi.server.service.XRequestCommandUpdate.XRequestCommandUpdate().

ArrayList org.jaebi.server.service.XRequestCommand.columnsName = null [private]
 

Variabile "cache" che memorizza i valori contenuti in "<code>//Columns/Column/Name</code>".

Definizione alla linea 66 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommandSelect.execute(), e org.jaebi.server.service.XRequestCommand.getColumnsName().

HashMap org.jaebi.server.service.XRequestCommand.columnsValue = null [private]
 

Variabile "cache" che memorizza i valori contenuti in "<code>//Columns/Column/Value</code>" utilizzando come chiave il valore del relativo "//Columns/Column/Value/.

./Name"

Definizione alla linea 71 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommand.getColumnsValue().

String org.jaebi.server.service.XRequestCommand.exceptionPrefix = "[XRequestCommand Exception]: " [static, protected]
 

Definizione alla linea 82 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), org.jaebi.server.service.XRequestCommandInsert.execute(), org.jaebi.server.service.XRequestCommandDelete.execute(), org.jaebi.server.service.XRequestCommand.XRequestCommand(), org.jaebi.server.service.XRequestCommandDelete.XRequestCommandDelete(), org.jaebi.server.service.XRequestCommandInsert.XRequestCommandInsert(), org.jaebi.server.service.XRequestCommandSelect.XRequestCommandSelect(), e org.jaebi.server.service.XRequestCommandUpdate.XRequestCommandUpdate().

boolean org.jaebi.server.service.Command.executed = false [protected, inherited]
 

Variabile booleana per verificare se un Command e' stato eseguito o meno.

Definizione alla linea 25 del file Command.java.

Referenziato da org.jaebi.server.service.Command.isExecuted().

ArrayList org.jaebi.server.service.XRequestCommand.whereColumnsName = null [private]
 

Variabile "cache" che memorizza i valori contenuti in "<code>//Where/Column/Name</code>".

Definizione alla linea 75 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommand.getWhereColumnsName().

HashMap org.jaebi.server.service.XRequestCommand.whereColumnsValue = null [private]
 

Variabile "cache" che memorizza i valori contenuti in "<code>//Where/Column/Value</code>" utilizzando come chiave il valore del relativo "//Where/Column/Value/.

./Name"

Definizione alla linea 80 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommand.getWhereColumnsValue().

final Xrequest org.jaebi.server.service.XRequestCommand.xrequestObj [protected]
 

Oggetto Xrequest da Wrappare, che descrive il Command che lo User ha richiesto di eseguire.

Definizione alla linea 62 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommand.getAffectedTable(), org.jaebi.server.service.XRequestCommand.getColumnsName(), org.jaebi.server.service.XRequestCommand.getColumnsValue(), org.jaebi.server.service.XRequestCommand.getType(), org.jaebi.server.service.XRequestCommand.getWhereColumnsName(), org.jaebi.server.service.XRequestCommand.getWhereColumnsValue(), org.jaebi.server.service.XRequestCommand.toString(), org.jaebi.server.service.XRequestCommand.XRequestCommand(), org.jaebi.server.service.XRequestCommandDelete.XRequestCommandDelete(), org.jaebi.server.service.XRequestCommandInsert.XRequestCommandInsert(), org.jaebi.server.service.XRequestCommandSelect.XRequestCommandSelect(), e org.jaebi.server.service.XRequestCommandUpdate.XRequestCommandUpdate().

final JAXBXResponseFactory org.jaebi.server.service.XRequestCommand.xresponseFactory [static, protected]
 

Valore iniziale:

 
            new JAXBXResponseFactory()
JAXBXResponseFactory utile a tutti gli XRequestCommand per produrre oggetti XResponse.

Definizione alla linea 54 del file XRequestCommand.java.

Referenziato da org.jaebi.server.service.XRequestCommandUpdate.execute(), org.jaebi.server.service.XRequestCommandSelect.execute(), org.jaebi.server.service.XRequestCommandInsert.execute(), e org.jaebi.server.service.XRequestCommandDelete.execute().


La documentazione per questa classe è stata generata a partire dal seguente file:
Generato il Mon Jun 27 22:50:46 2005 per JAEBI - JAva Enterprice BackEnd Interfacement da  doxygen 1.4.3