flex.data
Class DataDestination

java.lang.Object
  extended by flex.management.ManageableComponent
      extended by flex.messaging.Destination
          extended by flex.messaging.FactoryDestination
              extended by flex.messaging.MessageDestination
                  extended by flex.data.DataDestination
All Implemented Interfaces:
Manageable, FlexComponent, FlexConfigurable, Serializable

public class DataDestination
extends MessageDestination

Subclass of MessageDestination which provides DataService-specific destination functionality, such as data item paging.

See Also:
Serialized Form

Field Summary
static String LOG_CATEGORY
          Log category for messages logged out by the DataDestination.
static String USE_TRANSACTIONS
           
 
Constructor Summary
DataDestination()
          Constructs an unmanaged DataDestination instance.
DataDestination(boolean enableManagement)
          Constructs a DataDestination with the indicated management.
 
Method Summary
 void addAssociation(AssociationSetting setting)
          Adds a new association to the configuration programmatically.
 boolean equalItemIdentities(Object item1, Object item2)
          Returns true if the two items supplied have the same id properties.
 AssociationSetting getAssociation(String propertyName)
          Given the name of an association property for this destination, return the related destination.
 List getAssociations()
          Returns the list of associations for this destination.
 boolean getCacheItems()
          Returns the cache-items property.
static DataDestination getDataDestination(String destinationName)
          Returns the DataDestination for the specified destination name using the currently registered MessageBroker.
static DataDestination getDataDestination(String serverId, String destinationName)
          Retrieves the DataDestination for the supplied server id.
 Class getItemClass()
          Returns the item-class property.
 Object getItemFromAdapter(Map identity)
          Need to fetch the item by cobbling together a data message which goes to the adapter to retrieve it.
 List getLazyAssociations()
          Returns the list of AssociationSetting instances we have which are lazy associations
 MetadataSettings getMetadataSettings()
          Returns the MetadataSettings.
 int getNumNonLazyAssociations()
           
 int getNumSequencedAssociations()
           
 List getReadOnlyProperties()
           
 flex.data.SequenceManager getSequenceManager()
           
 Object getTypedItem(Object item, flex.messaging.io.TypeMarshaller marshaller)
          Given the item if it is an ASObject and the destination has an item class attempt to convert it into the strongly typed instance.
 boolean hasSelfAssociations()
           
 void initialize(String id, ConfigMap properties)
          Initializes the DataDestination with the properties.
 boolean isAutoSyncEnabled()
          Returns the auto-sync-enabled property.
 boolean isUseTransactions()
          Returns use-transactions property.
 void setAutoSyncEnabled(boolean autoSyncEnabled)
          Sets the default value for the autoSyncEnabled property on the client-side DataService which determines whether we should track changes for items returned from fills, gets and creates.
 void setCacheItems(boolean cacheItems)
          Determines whether DataService should cache the last version of each item.
 void setItemClass(String itemClassName)
          Sets the item-class property.
 void setMetadataSettings(MetadataSettings metadataSettings)
          Sets the MetadataSettings.
 void setNetworkSettings(NetworkSettings networkSettings)
          Casts the NetworkSettings into DataNetworkSettings and calls super.setNetworkSettings.
 void setService(Service service)
          Casts the Service into DataService and calls super.setService
 void setUseTransactions(boolean useTransactions)
          Sets use-transactions property.
 String toString()
           
static Object unwrapItem(Object item)
           
 Object wrapItem(Object item)
           
 
Methods inherited from class flex.messaging.MessageDestination
getServerSettings, setServerSettings
 
Methods inherited from class flex.messaging.FactoryDestination
getFactory, getFactoryInstance, getScope, getSource, setFactory, setFactory, setScope, setSource
 
Methods inherited from class flex.messaging.Destination
addChannel, createAdapter, describeDestination, getAdapter, getChannels, getNetworkSettings, getSecurityConstraint, getService, getServiceType, isBackendShared, isClustered, removeChannel, setAdapter, setChannels, setId, setSecurityConstraint, setSecurityConstraint, start, stop
 
Methods inherited from class flex.management.ManageableComponent
getControl, getId, getParent, isManaged, isStarted, isValid, setControl, setManaged, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG_CATEGORY

public static final String LOG_CATEGORY
Log category for messages logged out by the DataDestination.

See Also:
Constant Field Values

USE_TRANSACTIONS

public static final String USE_TRANSACTIONS
See Also:
Constant Field Values
Constructor Detail

DataDestination

public DataDestination()
Constructs an unmanaged DataDestination instance.


DataDestination

public DataDestination(boolean enableManagement)
Constructs a DataDestination with the indicated management.

Parameters:
enableManagement - true if the DataDestination is manageable; otherwise false.
Method Detail

getDataDestination

public static DataDestination getDataDestination(String serverId,
                                                 String destinationName)
Retrieves the DataDestination for the supplied server id. If serverId is null, the default MessageBroker instance is returned. You use this version of this method to retrieve a DataDestination if you are not in the context of processing a current FDS message when you need the DataDestination.


getDataDestination

public static DataDestination getDataDestination(String destinationName)
Returns the DataDestination for the specified destination name using the currently registered MessageBroker. As long as you are in the context of an existing operation in your current message broker, you can use this version of the method to get the proper DataDestination in the rare case in which your web application contains more than one MessageBroker instance.


initialize

public void initialize(String id,
                       ConfigMap properties)
Initializes the DataDestination with the properties.

Specified by:
initialize in interface FlexConfigurable
Overrides:
initialize in class MessageDestination
Parameters:
properties - Properties for the DataDestination.
id - Id of the ManageableComponent.

isAutoSyncEnabled

public boolean isAutoSyncEnabled()
Returns the auto-sync-enabled property.

Returns:
true if auto-sync is enabled; otherwise false.

setAutoSyncEnabled

public void setAutoSyncEnabled(boolean autoSyncEnabled)
Sets the default value for the autoSyncEnabled property on the client-side DataService which determines whether we should track changes for items returned from fills, gets and creates. Optional. Default value true.

Parameters:
autoSyncEnabled -

getCacheItems

public boolean getCacheItems()
Returns the cache-items property.

Returns:
true if cacheItems is enabled; otherwise false.

setCacheItems

public void setCacheItems(boolean cacheItems)
Determines whether DataService should cache the last version of each item. Optional. Default value true.

Parameters:
cacheItems -

getItemClass

public Class getItemClass()
Returns the item-class property.

Returns:

setItemClass

public void setItemClass(String itemClassName)
Sets the item-class property. The item-class is used when you want to use untyped objects in your Flex client but have typed objects on the server. The adapter will attempt to create typed objects of your specified type before they get to your assembler and will error out if it can not. This is only supported for non-nested scenarios and only for exact class matches. Recommended practice is to used typed objects on both the client and server whenever possible. Optional.

Parameters:
itemClassName -

getMetadataSettings

public MetadataSettings getMetadataSettings()
Returns the MetadataSettings.

Returns:

setMetadataSettings

public void setMetadataSettings(MetadataSettings metadataSettings)
Sets the MetadataSettings.

Parameters:
metadataSettings -

setNetworkSettings

public void setNetworkSettings(NetworkSettings networkSettings)
Casts the NetworkSettings into DataNetworkSettings and calls super.setNetworkSettings.

Overrides:
setNetworkSettings in class MessageDestination
Parameters:
networkSettings - The NetworkSettings of the Destination.

setService

public void setService(Service service)
Casts the Service into DataService and calls super.setService

Overrides:
setService in class MessageDestination
Parameters:
service -

isUseTransactions

public boolean isUseTransactions()
Returns use-transactions property.

Returns:

setUseTransactions

public void setUseTransactions(boolean useTransactions)
Sets use-transactions property. By default, Flex encapsulates client-committed operations in a single J2EE distributed transaction. All client data changes are handles as a unit. If one value cannot be changed, then changes to all other values are rolled back. Distributed transactions are supported as long as your J2EE server supports J2EE transactions (JTA). Optional. Default value is true.

Parameters:
useTransactions -

getAssociation

public AssociationSetting getAssociation(String propertyName)
Given the name of an association property for this destination, return the related destination.


getAssociations

public List getAssociations()
Returns the list of associations for this destination.


addAssociation

public void addAssociation(AssociationSetting setting)
Adds a new association to the configuration programmatically.


getLazyAssociations

public List getLazyAssociations()
Returns the list of AssociationSetting instances we have which are lazy associations


getNumSequencedAssociations

public int getNumSequencedAssociations()

getNumNonLazyAssociations

public int getNumNonLazyAssociations()

getReadOnlyProperties

public List getReadOnlyProperties()

hasSelfAssociations

public boolean hasSelfAssociations()

getItemFromAdapter

public Object getItemFromAdapter(Map identity)
Need to fetch the item by cobbling together a data message which goes to the adapter to retrieve it.


getTypedItem

public Object getTypedItem(Object item,
                           flex.messaging.io.TypeMarshaller marshaller)
Given the item if it is an ASObject and the destination has an item class attempt to convert it into the strongly typed instance.

Parameters:
item -
Returns:

equalItemIdentities

public boolean equalItemIdentities(Object item1,
                                   Object item2)
Returns true if the two items supplied have the same id properties. Iterates through the id properties for the item and calls equals on each value.


unwrapItem

public static Object unwrapItem(Object item)

wrapItem

public Object wrapItem(Object item)

getSequenceManager

public flex.data.SequenceManager getSequenceManager()

toString

public String toString()
Overrides:
toString in class MessageDestination


Copyright © 2007 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/data/DataDestination.html