|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.axeda.esrs.sdk.AxedaSDKManager
public class AxedaSDKManager
AxedaSDKManager: Provides access to Axeda functionality for which there is no standard SDK implementation. User: kholbrook Date: Apr 16, 2009 Time: 3:36:17 PM
| Nested Class Summary | |
|---|---|
class |
AxedaSDKManager.SDKEndRemoteSessionAuditMessage
|
| Method Summary | |
|---|---|
void |
acknowledgeAlarm(long alarm_id)
Acknowledge the specified alarm |
void |
acknowledgeAlarms(long[] ids)
Acknowledge the list of Alarm IDs which are passed in |
void |
addDevicesToWatchList(long[] device_ids)
Add the specified dveice ID to the device watchlist of the User within whose context this call is made |
void |
addDeviceToWatchList(long device_id)
Add the specified device ID to the device watchlist of the User within whose context this call is made |
void |
associateGASServersWithDevice(Identifier deviceId,
java.util.List<java.lang.String> selectedServers,
boolean useExternalGASHostname)
Iterate through the host value of the servers passed in, and associate the supplied device with each server |
static Identifier[] |
convertToIdentifierArray(long[] ids)
Convert the list of longs to an array of Axeda Identifier objects which can be used with the underlying Axeda APIs. |
protected void |
createAlarm(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName,
int severity)
Overload for backwards compatibility, defaults "isFromUser" to true |
protected void |
createAlarm(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName,
java.lang.String description,
int severity,
boolean isFromUser)
Create the named alarm for the specified model |
void |
createAndSendNotification(java.lang.String notificationName,
java.util.List<java.lang.String> emails,
Identifier deviceId,
boolean isFromUser)
Sends the named notification to the supplied list of email addresses, within the scope of the specified device |
void |
createAuditMessage(java.lang.String message,
com.axeda.drm.sdk.device.Device device,
boolean isFromUser)
Creates a message in the Audit log with the specified text for the given device |
DecoratedRemoteSession |
createRemoteSession(com.axeda.drm.sdk.device.Device device,
java.lang.String interfaceName,
java.lang.String description)
Overload to support backward compatibility |
DecoratedRemoteSession |
createRemoteSession(com.axeda.drm.sdk.device.Device device,
java.lang.String interfaceName,
java.lang.String description,
boolean useDeviceAssociatedRemoteServers)
Creates a remote session without specifying the secure attribute |
DecoratedRemoteSession |
createRemoteSession(com.axeda.drm.sdk.device.Device device,
java.lang.String interfaceName,
java.lang.String description,
boolean useDeviceAssociatedRemoteServers,
boolean secure,
boolean useExternalGASHostname)
Create Remote Session for the specified device and remote interface |
protected boolean |
doesAlarmExist(com.axeda.drm.sdk.device.Model model,
java.lang.String alarmName)
Utility method to see if this alarm exists in the database |
protected com.axeda.drm.services.device.ModelAlarm |
findAlarm(com.axeda.drm.sdk.device.Model model,
java.lang.String alarmName)
Utility method to load the alarm if it alarm exists in the database |
com.axeda.drm.sdk.device.Device |
findDeviceById(long id)
Return the SDK Device object which in represetned by the String identifier which is passed in |
java.util.List<com.axeda.drm.sdk.device.Device> |
findDevicesById(java.util.List<java.lang.String> ids)
Return the SDK Device objects which are represetned by the String identifiers which are passed in |
java.lang.String |
getBandwidthTestURI()
Returns the URI which will be appended to the GAS server hostname to check for latency |
Context |
getContext()
Returns a copy of the context in use within this class |
java.util.HashMap<java.lang.String,java.lang.Boolean> |
getDeviceGatewayConnStatus(long deviceId)
Returns the online/offline status between the selected device and it's managing gateways |
long[] |
getDevicesInWatchList()
Return the list of device IDs from the user's watchlist |
boolean[] |
getGASConfigurationOptions()
Executes a callback to the ESRS codebase to determine the configuration for remote sessions The two configuration options which are determined are: - Whether or not to use the secure URL for a remote session - Whether to use the external or internal hostname for GAS servers |
java.util.Map |
getGatewayConnectivity(long deviceId,
boolean isFromUser)
Provides a Map of gateways which manage the specified Device ID, with the Identifier of the gateway as the key and a Boolean to indicate online / offline status |
java.util.List<com.axeda.drm.sdk.device.Device> |
getGateways(Identifier deviceId)
Returns the Map of gateways associated with the supplied device ID |
static AxedaSDKManager |
getInstance()
Get an instance of the AxedaSDKManager. |
static AxedaSDKManager |
getInstance(java.lang.String username)
Get an instance of the AxedaSDKManager. |
long |
getLastDeployedSyncPackage(long deviceId)
Retrieves the timestamp of the most recently deployed Sync Software package, or zero if no packages were found |
java.util.List<com.axeda.drm.sdk.device.Device> |
getManagedDevices(Identifier gatewayId)
Overload to default the isFromUser to true |
java.util.List<com.axeda.drm.sdk.device.Device> |
getManagedDevices(Identifier gatewayId,
boolean isFromUser)
Returns the List of devices associated with the with the supplied gateway ID |
java.util.List<com.axeda.drm.sdk.device.Device> |
getPeerGateways(Identifier gatewayId,
boolean isFromUser)
Returns the List of gateways associated with the same devices associated with the supplied gateway ID |
int[] |
getPortFromString(java.lang.String portString,
java.lang.String type)
Parses the port string supplied by the Enterprise to deterine what the particular ports necessary for the chosen application will be |
java.lang.String |
getRemoteInterfaceConnectPortString(RemoteInterface ri)
Returns the Connection String for a given remote application, in the format C1234C2345L3456L4567 |
java.lang.String |
getRemoteInterfacePort(RemoteInterface ri)
Get the port for a Remote Interface |
RemoteAccessSessionStatus |
getSessionStatus(java.lang.String sessionId)
Retrieve the current status for the specified remote session. |
boolean |
hasSyncPackagePending(long deviceId)
Returns true if this device has a pending deployed package |
boolean |
isAlarmAcknowledged(long id)
Determines if the specified alarm has been acknowledged |
java.util.List<java.lang.String> |
listRemoteServerNames()
Provides a list of all the remote access server host names available inn the system This list contains only the EXT hostname, which is the externally facing hostname that is used by agents |
void |
raiseAlarmForDevice(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName)
Raise an alarm of the specified name on the enterprise for the specified device. |
void |
raiseAlarmForDevice(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName,
boolean create,
boolean processTriggers,
int severity)
Overload for CreateAlarm for backwards compatibility, defaults isFromUser to true. |
void |
raiseAlarmForDevice(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName,
java.lang.String description,
boolean create,
boolean processTriggers,
int severity,
boolean isFromUser)
Raise an alarm of the specified name on the enterprise for the specified device. |
void |
removeDeviceFromWatchList(long device_id)
Remove a specific device from the user's watchlist |
void |
removeDevicesFromWatchList(long[] device_ids)
Removed the specified list of devices from the user's watchlist |
void |
setAgentDataItem(DataItem di,
java.lang.String dataItemValue,
com.axeda.drm.sdk.device.Device device)
Set a data item on the enterprise side, this will set a new DataItem value for the specified DataItem and device |
void |
setDataItem(DataItem di,
java.lang.String dataItemValue,
com.axeda.drm.sdk.device.Device device,
boolean sendToEnterprise)
Set a data item on the enterprise side, this will set a new DataItem value for the specified DataItem and device |
void |
setEnterpriseDataItem(DataItem di,
java.lang.String dataItemValue,
com.axeda.drm.sdk.device.Device device)
Set a data item on the enterprise side, this will set a new DataItem value for the specified DataItem and device |
void |
terminateSession(java.lang.String sessionId)
Terminates the specified session in a user context for the specified user |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static AxedaSDKManager getInstance()
public static AxedaSDKManager getInstance(java.lang.String username)
throws AxedaSDKManagerException
username - The name of the user which will be used to create a context for this user
AxedaSDKManagerException - if the User cannot be found in the DB
public void createAndSendNotification(java.lang.String notificationName,
java.util.List<java.lang.String> emails,
Identifier deviceId,
boolean isFromUser)
throws AxedaSDKManagerException
notificationName - The name of the notification. This MUST be a notification which already exists in the system.emails - The list of email addresses to send to.deviceId - The ID of the Device which the notification is related toisFromUser - If true, uses the User's context, if false uses the System context
AxedaSDKManagerException
public java.util.HashMap<java.lang.String,java.lang.Boolean> getDeviceGatewayConnStatus(long deviceId)
throws AxedaSDKManagerException
deviceId - The ID of the device for which to determine connectivity
AxedaSDKManagerException
public void addDeviceToWatchList(long device_id)
throws AxedaSDKManagerException
device_id - The ID of a valid device which is to be added to the current user's watch list
AxedaSDKManagerException - If the device cannot be added to the watchlist, or if the device_id is < 0, which indicates a non-persisted device
public void addDevicesToWatchList(long[] device_ids)
throws AxedaSDKManagerException
device_ids - The IDs of the valid devices which are to be added to the current user's watch list
AxedaSDKManagerException - If the list of device_ids is of zero length
public long[] getDevicesInWatchList()
throws AxedaSDKManagerException
AxedaSDKManagerException - If there is a null pointer or other exception thrown in the process of loading the devices
public void removeDeviceFromWatchList(long device_id)
throws AxedaSDKManagerException
device_id - The id of the device to remove
AxedaSDKManagerException - If the device_id was invalid, or if an exception was thrown in the remove method
public void removeDevicesFromWatchList(long[] device_ids)
throws AxedaSDKManagerException
device_ids - The list of ids to remove from the watchlist
AxedaSDKManagerException - If the device_ids list is not valid, or is the is a problem removing the devices from the watchlist
public void acknowledgeAlarm(long alarm_id)
throws AxedaSDKManagerException
alarm_id - The ID of the alarm to acknowledge
AxedaSDKManagerException - If the alarm id is invalid, or if an exception was thrown in the acknowledge alarms code
public void acknowledgeAlarms(long[] ids)
throws AxedaSDKManagerException
ids - The list of Alarm IDs to acknowledge
AxedaSDKManagerException - If the ids array is invalid, or if an exception is thrown in the underlying code
public boolean isAlarmAcknowledged(long id)
throws AxedaSDKManagerException
id - The id of the alarm to check
AxedaSDKManagerException - If the id is not valid, or if an exception occurred in the underlying code
public void raiseAlarmForDevice(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName)
throws AxedaSDKManagerException
device - The device for which the alarm is to be raisedalarmName - The name of the alarm to (optionally create and) raise
AxedaSDKManagerException - if the alarm does not exist and cannot be created
public void raiseAlarmForDevice(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName,
boolean create,
boolean processTriggers,
int severity)
throws AxedaSDKManagerException
device - The device for which the alarm is to be raisedalarmName - The name of the alarm to (optionally create and) raisecreate - If true, and the alarm does not exist for the specified device's model, create the alarmprocessTriggers - If True, any configured alarm rulees will be firedseverity - Integer representing the severity level of the alarm
AxedaSDKManagerException - if the alarm does not exist and cannot be created
public void raiseAlarmForDevice(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName,
java.lang.String description,
boolean create,
boolean processTriggers,
int severity,
boolean isFromUser)
throws AxedaSDKManagerException
device - The device for which the alarm is to be raisedalarmName - The name of the alarm to (optionally create and) raisedescription - The description for the alarm to (optionally create and) raisecreate - If true, and the alarm does not exist for the specified device's model, create the alarmprocessTriggers - If True, any configured alarm rulees will be firedseverity - Integer representing the severity level of the alarmisFromUser - If True the request is sources from a user and will use the
AxedaSDKManagerException - if the alarm does not exist and cannot be created
protected boolean doesAlarmExist(com.axeda.drm.sdk.device.Model model,
java.lang.String alarmName)
throws AxedaSDKManagerException
model - The model to search for this alarmalarmName - The name of the alarm to search for
AxedaSDKManagerException - If the model or alarmName are invalid, or an exception is raised in the code being called
protected com.axeda.drm.services.device.ModelAlarm findAlarm(com.axeda.drm.sdk.device.Model model,
java.lang.String alarmName)
throws AxedaSDKManagerException
model - The model to search for this alarmalarmName - The name of the alarm to search for
AxedaSDKManagerException - If the model or alarmname are invalid
protected void createAlarm(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName,
int severity)
throws AxedaSDKManagerException
device - The name of the Device to which to add this alarmalarmName - The name of the alarm to addseverity - The severity of the alarm
AxedaSDKManagerException - If the device or alarmName is invalid.
protected void createAlarm(com.axeda.drm.sdk.device.Device device,
java.lang.String alarmName,
java.lang.String description,
int severity,
boolean isFromUser)
throws AxedaSDKManagerException
device - The name of the Device to which to add this alarmalarmName - The name of the alarm to adddescription - The description for the alarm instance being createdseverity - The severity of the alarmisFromUser - True if the request is sourced from the user, false if it is from an agent
AxedaSDKManagerException - If the device or alarmName is invalid.public static Identifier[] convertToIdentifierArray(long[] ids)
ids - The list of long values which represent device IDs
public com.axeda.drm.sdk.device.Device findDeviceById(long id)
throws AxedaSDKManagerException
id - long representation of the Device identifier
AxedaSDKManagerException - If the device does not exist, or the list is invalid
public java.util.List<com.axeda.drm.sdk.device.Device> findDevicesById(java.util.List<java.lang.String> ids)
throws AxedaSDKManagerException
ids - String representations of Device identifiers
AxedaSDKManagerException - If the device does not exist, or the list is invalid
public void terminateSession(java.lang.String sessionId)
throws AxedaSDKManagerException
sessionId - The ID of the session to terminate
AxedaSDKManagerException - If the sessionId is invalid, or the session cannot be terminated for some reason
public DecoratedRemoteSession createRemoteSession(com.axeda.drm.sdk.device.Device device,
java.lang.String interfaceName,
java.lang.String description)
throws AxedaSDKManagerException
device - The Device to which to open a sessioninterfaceName - The name of the remote interface to which to bind the sessiondescription - The description to store for the session.
AxedaSDKManagerException
public DecoratedRemoteSession createRemoteSession(com.axeda.drm.sdk.device.Device device,
java.lang.String interfaceName,
java.lang.String description,
boolean useDeviceAssociatedRemoteServers)
throws AxedaSDKManagerException
device - The Device to which to open a sessioninterfaceName - The name of the remote interface to which to bind the sessiondescription - The description to store for the session.useDeviceAssociatedRemoteServers - Determines whether or not to use the GAS servers which are associated with the device
AxedaSDKManagerException
public DecoratedRemoteSession createRemoteSession(com.axeda.drm.sdk.device.Device device,
java.lang.String interfaceName,
java.lang.String description,
boolean useDeviceAssociatedRemoteServers,
boolean secure,
boolean useExternalGASHostname)
throws AxedaSDKManagerException
device - The Device to which to open a sessioninterfaceName - The name of the remote interface to which to bind the sessiondescription - The description to store for the session.useDeviceAssociatedRemoteServers - Determines whether or not to use the GAS servers which are associated with the devicesecure - If true the remote session will use the secure remote session URL. If false, the session will use the non-secure URLsuseExternalGASHostname - True if the remote session should use the GAS's external hostname to connect, false if it should use the internal hostname
AxedaSDKManagerException
public RemoteAccessSessionStatus getSessionStatus(java.lang.String sessionId)
throws AxedaSDKManagerException
sessionId -
AxedaSDKManagerException - If the sesison is inavlid, or if an exception is raised in the code being called
public java.lang.String getRemoteInterfacePort(RemoteInterface ri)
throws AxedaSDKManagerException
ri - The remote interface to report the port of
AxedaSDKManagerException - If the remote interface is invalid, or cannot be read
public java.lang.String getRemoteInterfaceConnectPortString(RemoteInterface ri)
throws AxedaSDKManagerException
ri - The Remote Interface from which to read the conneection String
AxedaSDKManagerException
public void setEnterpriseDataItem(DataItem di,
java.lang.String dataItemValue,
com.axeda.drm.sdk.device.Device device)
throws AxedaSDKManagerException
di - The DataItem to set a value fordataItemValue - The value to set for the DataItemdevice - The device to which the DataItemValue will be bound
AxedaSDKManagerException - If the dataitem, device or value is invalid
public int[] getPortFromString(java.lang.String portString,
java.lang.String type)
throws AxedaSDKManagerException
portString - The entire port string from Enterprise, i.e. C1234C2345L3456type - Either "C" for connect ports in the String, or "L" for listening ports
AxedaSDKManagerException
public void setAgentDataItem(DataItem di,
java.lang.String dataItemValue,
com.axeda.drm.sdk.device.Device device)
throws AxedaSDKManagerException
di - The DataItem to set a value fordataItemValue - The value to set for the DataItemdevice - The device to which the DataItemValue will be bound
AxedaSDKManagerException - If the dataitem, value of device is invalid
public void setDataItem(DataItem di,
java.lang.String dataItemValue,
com.axeda.drm.sdk.device.Device device,
boolean sendToEnterprise)
throws AxedaSDKManagerException
di - The DataItem to set a value fordataItemValue - The value to set for the DataItemdevice - The device to which the DataItemValue will be boundsendToEnterprise - If true the data item will go to the enterprise, if false to the agent
AxedaSDKManagerException - If the dataitem, value, or device is invalid
public long getLastDeployedSyncPackage(long deviceId)
throws AxedaSDKManagerException
deviceId - The ID of the device to check for package deployment
AxedaSDKManagerException
public boolean hasSyncPackagePending(long deviceId)
throws AxedaSDKManagerException
deviceId - The ID of the device to search for the Deployed Package on
AxedaSDKManagerException
public java.util.Map getGatewayConnectivity(long deviceId,
boolean isFromUser)
throws AxedaSDKManagerException
deviceId - The ID of the Device to checkisFromUser - If True, the context will be created as a User context, is False the context will be a System context
AxedaSDKManagerException
public java.util.List<com.axeda.drm.sdk.device.Device> getGateways(Identifier deviceId)
throws AxedaSDKManagerException
AxedaSDKManagerException
public java.util.List<com.axeda.drm.sdk.device.Device> getPeerGateways(Identifier gatewayId,
boolean isFromUser)
throws AxedaSDKManagerException
gatewayId - The ID of the Gateway of which to find the peersisFromUser - True if the request is coming from a user context, false is the request is coming from an SDK call outside of a User session
AxedaSDKManagerException
public java.util.List<com.axeda.drm.sdk.device.Device> getManagedDevices(Identifier gatewayId)
throws AxedaSDKManagerException
gatewayId -
AxedaSDKManagerException
public java.util.List<com.axeda.drm.sdk.device.Device> getManagedDevices(Identifier gatewayId,
boolean isFromUser)
throws AxedaSDKManagerException
AxedaSDKManagerException
public void associateGASServersWithDevice(Identifier deviceId,
java.util.List<java.lang.String> selectedServers,
boolean useExternalGASHostname)
throws AxedaSDKManagerException
deviceId - The ID of the device to which the selected GAS servers will be associatedselectedServers - The list of GAS host names which were selected by the agent
AxedaSDKManagerException - If the Id or List is sinvalid, or if an exception is raised deeper in the code
public java.util.List<java.lang.String> listRemoteServerNames()
throws AxedaSDKManagerException
AxedaSDKManagerException - If there is an error reading the list of server namespublic boolean[] getGASConfigurationOptions()
public java.lang.String getBandwidthTestURI()
public void createAuditMessage(java.lang.String message,
com.axeda.drm.sdk.device.Device device,
boolean isFromUser)
message - The text to output in the Audit logdevice - The Device to tie the audit message toisFromUser - If True, the user's context will be used, if False the System context will be usedpublic Context getContext()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||