com.axeda.esrs.portal.ha
Class HASyncManager

java.lang.Object
  extended by com.axeda.esrs.portal.ha.HASyncManager

public class HASyncManager
extends java.lang.Object

Created by IntelliJ IDEA. User: kholbrook Date: Sep 15, 2009 Time: 9:56:50 AM To change this template use File | Settings | File Templates.


Method Summary
 Identifier createSyncPackage(java.lang.String modelNumber, java.lang.String type, java.lang.String targetIdentifier, java.lang.String syncFileXML, boolean isFromUser)
          Create a Sync XML package to be deployed to a target list of devices.
 void deploySyncPackage(Identifier packageId, java.util.List<DeviceIdentification> deviceIds, boolean isFromUser)
          Deploy the Sync XML package which was created using the createSyncPackage method
static HASyncManager getInstance()
          Get an instance of the HASyncManager.
static HASyncManager getInstance(java.lang.String username)
          Get an instance of the HASyncManager.
static java.lang.String getPackageName()
          Convenience method to look up the name of the Software Package.
protected  int getPackageSequenceValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static HASyncManager getInstance(java.lang.String username)
                                 throws AxedaSDKManagerException
Get an instance of the HASyncManager. This method will create the Context you need to run within. If you are running this from a unit test, use the constructor that allows you to pass in the Context.

Parameters:
username - The name of the user which will be used to create a context for this user
Returns:
An instance of the AxedaSDKManager that will operate within the user constraints implied in the context
Throws:
AxedaSDKManagerException - if the User cannot be found in the DB

getInstance

public static HASyncManager getInstance()
Get an instance of the HASyncManager. This method will create the Context you need to run within. If you are running this from a unit test, use the constructor that allows you to pass in the Context.

Returns:
An instance of the AxedaSDKManager that will operate within the user constraints implied in the context

createSyncPackage

public Identifier createSyncPackage(java.lang.String modelNumber,
                                    java.lang.String type,
                                    java.lang.String targetIdentifier,
                                    java.lang.String syncFileXML,
                                    boolean isFromUser)
                             throws PackageCreationException
Create a Sync XML package to be deployed to a target list of devices. This method will create the desired software package, including the XML file and a download instruction for the same. This method will create the package in a folder whose name is composed from the "type" and "targetIdentifier" strings.

Parameters:
modelNumber - The name of the model to bind this package to
type - The first part of the package folder identifier
targetIdentifier - The second part of the package folder identifier
syncFileXML - The String representing the contents of the XML file to be deployed
isFromUser - True if the request comes from a User's logged in session Context, false if run from a process
Returns:
The ID of the stored Named Package
Throws:
PackageCreationException - If there is a problem creating the package for Deployment (File I/O issues, bad ModelNumber, etc.)

getPackageName

public static java.lang.String getPackageName()
Convenience method to look up the name of the Software Package. This is exposed publicly to allow other classes to retrieve this value

Returns:
The name of the Gateway Sync Software Package

deploySyncPackage

public void deploySyncPackage(Identifier packageId,
                              java.util.List<DeviceIdentification> deviceIds,
                              boolean isFromUser)
Deploy the Sync XML package which was created using the createSyncPackage method

Parameters:
packageId - The ID of the package returned from the createSyncPackage method
deviceIds - The List of DeviceIdentification objects which represent the ids of the Devices to which we are deploying the package
isFromUser - True if the request comes from a User's session, false if called from a process

getPackageSequenceValue

protected int getPackageSequenceValue()