LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.peer.info
Class LyInfoRequestEncoder

java.lang.Object
  extended by leon.peer.LyRequestEncoder
      extended by leon.peer.info.LyInfoRequestEncoder
All Implemented Interfaces:
LyGetDataSourceListenersInterface, LyResponseListener

public class LyInfoRequestEncoder
extends LyRequestEncoder
implements LyResponseListener, LyGetDataSourceListenersInterface

This class is used to send requests to a data provider and to receive its answers. It is used by LyObjectSource to send requests. All the objects in the parameter methods are LyObject. It gets the peer of this objects and sends the request to the good LyDataSource. It waits for the response and updates the response for the LyObjectSource.

See Also:
LyObjectSource

Field Summary
static java.lang.String __VERSION
           
static boolean CONTROL_OBJECTS_ON_LOADING
          Resource for activating controls on objects when loading.
 
Constructor Summary
LyInfoRequestEncoder(LyDataProvider provider, LyDataSource dataSource)
          Default constructor Initialization is done with the init method.
 
Method Summary
 boolean createObject(java.lang.Object object)
          To create a new object.
 boolean deleteObject(java.lang.Object object)
          To delete an object.
 boolean deleteObjects(java.util.Vector<java.lang.Object> objects)
          To delete an object.
 void endResponse(LyResponse response)
          Method for end of response.
 java.util.Vector<LyDataSourceListener> getDataSourceListeners()
          Indicates which listeners have been notified of the Response.
 boolean getObject(LyObjectId objectId, java.util.Vector<LyField> fields)
          Get an object.
 boolean getObjects(java.util.Vector<LyField> fields, LySort sort, LyFilter filter, int n)
          Get a set of objects.
 boolean getSize(LyFilter filter)
          Return the number of objects from the data provider .
 boolean loadObject(LyObjectId objectId, java.util.Vector<LyField> fields)
          Load an object from the physical layer.
 void newResponse(LyResponse response, java.lang.Object object, LyValueSet values)
          Method for response changes.
 boolean setObject(java.lang.Object object)
          To set an object.
 boolean setObjects(java.util.Vector<java.lang.Object> objects)
          To set a set of objects.
 
Methods inherited from class leon.peer.LyRequestEncoder
getClassBinding, getDataClass, getProvider, getResponse, isSynchronous, setClassBinding, setDataClass, setResponse, toString, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

CONTROL_OBJECTS_ON_LOADING

public static boolean CONTROL_OBJECTS_ON_LOADING
Resource for activating controls on objects when loading.

Constructor Detail

LyInfoRequestEncoder

public LyInfoRequestEncoder(LyDataProvider provider,
                            LyDataSource dataSource)
Default constructor Initialization is done with the init method.

Method Detail

loadObject

public boolean loadObject(LyObjectId objectId,
                          java.util.Vector<LyField> fields)
Load an object from the physical layer. This method is overriden to force the loading of the requested object.

Overrides:
loadObject in class LyRequestEncoder
Parameters:
objectId - object identifier
fields - the fields to load (if null, load all)
Returns:
true if the request was correctly sent to the external data provider.

getObject

public boolean getObject(LyObjectId objectId,
                         java.util.Vector<LyField> fields)
Get an object.

Specified by:
getObject in class LyRequestEncoder
Parameters:
objectId - object identifier
fields - the fields to load (if null, load all)
Returns:
true if the request was correctly sent to the external data provider.

getObjects

public boolean getObjects(java.util.Vector<LyField> fields,
                          LySort sort,
                          LyFilter filter,
                          int n)
Get a set of objects.

Specified by:
getObjects in class LyRequestEncoder
Parameters:
fields - the fields to load (if null, load all)
sort - indicates sorting criterion, or null if default sort is used.
filter - indicates filtering criterion, or null if there is no filter.
n - maximum number of objects to get.
Returns:
true if the request was correctly sent to the external data provider.

getSize

public boolean getSize(LyFilter filter)
Return the number of objects from the data provider .

Specified by:
getSize in class LyRequestEncoder
Parameters:
filter - indicates filtering criterion, or null if there is no filter.
Returns:
true if the request was correctly sent to the external data provider.

deleteObject

public boolean deleteObject(java.lang.Object object)
To delete an object.

Specified by:
deleteObject in class LyRequestEncoder
Parameters:
object - the object to delete
Returns:
true if the request was correctly sent to the external data provider.

deleteObjects

public boolean deleteObjects(java.util.Vector<java.lang.Object> objects)
To delete an object.

Overrides:
deleteObjects in class LyRequestEncoder
Parameters:
object - the object to delete
Returns:
true if the request was correctly sent to the external data provider.

createObject

public boolean createObject(java.lang.Object object)
To create a new object.

Specified by:
createObject in class LyRequestEncoder
Parameters:
object - the new object to create
Returns:
true if the request was correctly sent to the external data provider.

setObject

public boolean setObject(java.lang.Object object)
To set an object.

Specified by:
setObject in class LyRequestEncoder
Parameters:
object - the object to set
Returns:
true if the request was correctly sent to the external data provider.

setObjects

public boolean setObjects(java.util.Vector<java.lang.Object> objects)
To set a set of objects.

Overrides:
setObjects in class LyRequestEncoder
Parameters:
objects - the objects to set
Returns:
true if the request was correctly sent to the external data provider.

newResponse

public void newResponse(LyResponse response,
                        java.lang.Object object,
                        LyValueSet values)
Method for response changes.

Specified by:
newResponse in interface LyResponseListener
Parameters:
response - the response
object - The new object returned in the response.
values - When the demand was a modification of an object, this parameter may contains the list of values that were changed. In other cases, this parameter is null.

endResponse

public void endResponse(LyResponse response)
Method for end of response.

Specified by:
endResponse in interface LyResponseListener
Parameters:
response - the response

getDataSourceListeners

public java.util.Vector<LyDataSourceListener> getDataSourceListeners()
Indicates which listeners have been notified of the Response.

Specified by:
getDataSourceListeners in interface LyGetDataSourceListenersInterface
Returns:
List of notified listeners (may be null).
See Also:
LyGetDataSourceListenersInterface

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com