Oracle Fusion Middleware Java API Reference for Oracle Mobile Application Framework
2.0.0.0.0

E36392-01

oracle.adfmf.config.client
Class ConfigurationService

Object
  extended by oracle.adfmf.config.client.ConfigurationService
All Implemented Interfaces:
oracle.adfmf.config.client.ProgressListener

public class ConfigurationService
extends Object
implements oracle.adfmf.config.client.ProgressListener

The ConfigurationService provides the ability to obtain dynamic configuration from a variety of delivery mechanism. The goal of this embedded service is to 'refresh' local configurations like connections, pages, ... from an enterprise or configuration server.


Field Summary
static String SANDBOX_NAME
           
static String VERSION_PATTERN
           
 
Constructor Summary
ConfigurationService()
           
 
Method Summary
 boolean activateVersion(String versionToActivate)
          Activate a version.
 void addProgressListener(oracle.adfmf.config.client.ProgressListener listener)
          Add a new progress listener to monitor the performance.
 void deleteVersion(String version)
          Deletes an existing application version on the device.
 String getActiveVersion()
          Get the active version on the device.
 String[] getAvailableVersions()
          Get the available version on the device.
 String getDeliveryMechanism()
          Get a specific delivery mechanism's configuration item.
 String getDeliveryMechanismConfiguration(String property)
          Get a specific delivery mechanism's configuration item for the current delivery mechanism.
 String getDeliveryMechanismConfiguration(String mechanism, String property)
          Get a specific delivery mechanism's configuration item.
 String getLatestVersion()
          Get the latest version published on the server for the current application
 java.util.List getProgressListeners()
          Get the registered progress listeners.
 String[] getPublishedVersions()
          Get a list of published versions on the server for the current application
 String[] getSandboxes()
          Get the list of sandboxes available on the server.
 boolean isAvailableVersion(String version)
          Determines if the passed in version is available on the device.
 boolean isThereAnyNewConfigurationChanges(String appID, String version)
          Given the application ID and version number determine if there are any new configuration changes.
 void removeProgressListener(oracle.adfmf.config.client.ProgressListener listener)
          Remove a given progress listener.
 void setDeliveryMechanism(String mechanism)
          Set a specific delivery mechanism to a registered mechanism name.
 void setDeliveryMechanismConfiguration(String property, String value)
          Set a specific delivery mechanism's configuration item for the current delivery mechanism.
 void setDeliveryMechanismConfiguration(String mechanism, String property, String value)
          Set a specific delivery mechanism's configuration item.
static void setOverrides()
           
 boolean stageAndActivateVersion(String version)
          Stage and activate a version.
 boolean stageVersion(String versionToStage)
          Get or stage the configuration associated with the passed in version from the server.
 void updateProgress(String name, String message, float percentage)
          ProgressListener update progress handler.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SANDBOX_NAME

public static final String SANDBOX_NAME
See Also:
Constant Field Values

VERSION_PATTERN

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

ConfigurationService

public ConfigurationService()
Method Detail

setOverrides

public static void setOverrides()

activateVersion

public boolean activateVersion(String versionToActivate)
Activate a version. The version must reside in the available versions registry and have been successfully staged on the device. The application information will be updated provided a restart is _not_ required.

Parameters:
versionToActivate -
Returns:
true if able to activate the version

getPublishedVersions

public String[] getPublishedVersions()
                              throws AdfException
Get a list of published versions on the server for the current application

Returns:
array of strings containing published application versions
Throws:
AdfException

getLatestVersion

public String getLatestVersion()
                        throws AdfException
Get the latest version published on the server for the current application

Returns:
string containing the latest version published on the server
Throws:
AdfException

getSandboxes

public String[] getSandboxes()
                      throws AdfException
Get the list of sandboxes available on the server. A sandbox can be used by calling the following API setDeliveryMechanismConfiguration(ConfigurationService.SANDBOX_NAME, );

Returns:
string array of available sandboxes
Throws:
AdfException

deleteVersion

public void deleteVersion(String version)
                   throws AdfException
Deletes an existing application version on the device. The version should not be currently active.

Parameters:
version - to be deleted
Throws:
AdfException

addProgressListener

public void addProgressListener(oracle.adfmf.config.client.ProgressListener listener)
Add a new progress listener to monitor the performance.

Parameters:
listener -

getActiveVersion

public String getActiveVersion()
Get the active version on the device.

Returns:
active version

getAvailableVersions

public String[] getAvailableVersions()
Get the available version on the device.

Returns:
array of version names

isAvailableVersion

public boolean isAvailableVersion(String version)
Determines if the passed in version is available on the device.

Parameters:
version - to be verified
Returns:
true if the version is available, false otherwise

getDeliveryMechanism

public String getDeliveryMechanism()
Get a specific delivery mechanism's configuration item. This is import to determine something like the root location for the delivery mechanism.

Parameters:
property - name
Returns:
String

getDeliveryMechanismConfiguration

public String getDeliveryMechanismConfiguration(String property)
Get a specific delivery mechanism's configuration item for the current delivery mechanism.

Parameters:
property - name
Returns:
String

getDeliveryMechanismConfiguration

public String getDeliveryMechanismConfiguration(String mechanism,
                                                String property)
Get a specific delivery mechanism's configuration item. This is import to determine something like the root location for the delivery mechanism.

Parameters:
property - name
Returns:
String

getProgressListeners

public java.util.List getProgressListeners()
Get the registered progress listeners.


isThereAnyNewConfigurationChanges

public boolean isThereAnyNewConfigurationChanges(String appID,
                                                 String version)
                                          throws AdfException
Given the application ID and version number determine if there are any new configuration changes. This is done by first validating the manifest, and then going through all the manifest entries and validating if there is a newer version available

Parameters:
appID -
version -
Returns:
true if configuration change are available, false otherwise
Throws:
AdfException

setDeliveryMechanism

public void setDeliveryMechanism(String mechanism)
Set a specific delivery mechanism to a registered mechanism name.

Parameters:
property - name
value - value

setDeliveryMechanismConfiguration

public void setDeliveryMechanismConfiguration(String property,
                                              String value)
Set a specific delivery mechanism's configuration item for the current delivery mechanism.

Parameters:
property - name
value - value

setDeliveryMechanismConfiguration

public void setDeliveryMechanismConfiguration(String mechanism,
                                              String property,
                                              String value)
Set a specific delivery mechanism's configuration item. This is import to configure something like the root location for the delivery mechanism.

Parameters:
property - name
value - value

removeProgressListener

public void removeProgressListener(oracle.adfmf.config.client.ProgressListener listener)
Remove a given progress listener.

Parameters:
listener -

stageAndActivateVersion

public boolean stageAndActivateVersion(String version)
                                throws AdfException
Stage and activate a version. This is the same as calling stageVersion(version) + activateVersion(version).

Parameters:
version -
Returns:
true if a restart is required, false otherwise.
Throws:
AdfException - on any error (i.e. could not stage or active).
See Also:
stageVersion, activateVersion

stageVersion

public boolean stageVersion(String versionToStage)
                     throws AdfException
Get or stage the configuration associated with the passed in version from the server. This is similar to calling getConfiguration with the application id (obtained from the maf-application.xml file), the default transport mechanism for the application, and the version.

Parameters:
version -
Returns:
true if a restart is required to obtain the configuration.
Throws:
AdfException

updateProgress

public void updateProgress(String name,
                           String message,
                           float percentage)
ProgressListener update progress handler.

Specified by:
updateProgress in interface oracle.adfmf.config.client.ProgressListener
Parameters:
name - of the resource
message - associated with the resource
percentage - overall completion percentage

Oracle Fusion Middleware Java API Reference for Oracle Mobile Application Framework
2.0.0.0.0

E36392-01

Copyright © 2014 Oracle. All Rights Reserved.