Registers multiple devices for message-based synchronization (MBS) with Unwired Server by specifying a template name and a collection of device property settings.
Device registration and activation is required in a message-based synchronization environment. These two steps are dependent actions that make the device and its associated user part of the Unwired Platform mobility system.
Device registration begins with a registration notice and device template you create once and then reuse in Sybase Control Center. The registration notifies users that they must identify themselves by pairing their identity with that of their devices. The device template then sets up the device and makes it compatible for Unwired Platform messaging use. You can use as many templates as you require.
Once the registration notification is received, the user submits appropriate information to Unwired Server. This creates a registration slot that is occupied by the device upon device activation. For message-based environments, the device is the primary identity and only a user name is associated with it.
DeviceInfoVO SUPDeviceUser.registerMBSDevicesByTemplate(templateName, RegistrationRequestVOregistrationRequests, PropertyItemVO settings)
If successful, returns an object of the specified type (can be null). If unsuccessful, returns SUPAdminException.
//Register MBS devices using "Default" template. Also set the "server name" property //(identified by property ID "1") to "test" List<RegistrationRequestVO> registrationRequests = new ArrayList<RegistrationRequestVO>(); RegistrationRequestVO request = new RegistrationRequestVO(); request.setUserName("test5"); registrationRequests.add(request); List<PropertyItemVO> propertyItems = new ArrayList<PropertyItemVO>(); PropertyItemVO item = new PropertyItemVO(); // User can update device settings by pass on a list of ProperItemVO // objects. Each PropertyItemVO are identified by its property ID. A // property ID is a predefined unique ID. For example, ID 1 means // "server name" property of a MBS device. To view all predefined // property IDs, use // com.sybase.sup.admin.scc.client.SUPDeviceUser#getPropertyDefinitions()to // view property metadata, which contains property metadata including // unique predefined property ID. item.setPropertyID(1); item.setPropertyValue("test"); propertyItems.add(item); //The returned List<DeviceInfoVO> will contains only one DeviceInfoVO since the //registrationRequests contains one RegistrationRequestVO. //The returned DeviceInfoVO’s logicalId property will greater than zero and //userDeviceVO property will not be null, which means this device is MBS property, //while for RBS device, logicalId property is zero and userDevcieVO property is null. List<DeviceInfoVO> devices = deviceUser.registerMBSDevicesByTemplate( "Default", registrationRequests, propertyItems); //"Default" is existing template assertEquals(devices.size(), 1); assertTrue(devices.get(0).getLogicId()>0); assertNotNull(devices.get(0).getMbsPropertiesVO());