public class SampleServiceActivityDataUsage extends Object
import com.avaya.collaboration.service.activity.ServiceActivityData; import com.avaya.collaboration.service.activity.ServiceActivityDataFactory;
public class SampleServiceActivityDataUsage {
public void doServicActivityDataOperations() throws IllegalArgumentException {
//Get ServiceActivityData object from ServiceActivityDataFactory ServiceActivityData myServiceActivityData = ServiceActivityDataFactory.createServicActivityData();
//Increment current activity count value - If value is not posted earlier default value is 0 myServiceActivityData.increment();
//Fetch current activity count value - Following statement will print 1 System.out.println(myServiceActivityData.get());
//Set current activity count value to specific value - 100 myServiceActivityData.set(100);
//Fetch current activity count value - Following statement will print 100 System.out.println(myServiceActivityData.get());
//Decrement current activity count value myServiceActivityData.decrement();
//Fetch current activity count value - Following statement will print 99 System.out.println(myServiceActivityData.get());
//Another way to directly fetch decremented value //Following statement will print 98 System.out.println(myServiceActivityData.decrement());
//Following statement will print 99 System.out.println(myServiceActivityData.increment());
//Set current activity count value to custom value - 0 myServiceActivityData.set(0);
//Try to decrement activity count value so that it becomes negative //Below statement will make not affect current value and it will remain 0 System.out.println(myServiceActivityData.decrement());
//Try to set activity count value to negative number //Following statement will throw IllegalArgumentException - set method does not accept negative value myServiceActivityData.set(-100);
} }
Copyright © 2016 Avaya. All Rights Reserved.