Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package it.foo;
- import com.scms.api.sce.*;
- import com.scms.api.sce.prpc.PRPC_SCESubscriberApi;
- import com.scms.common.Quota;
- import com.scms.common.SCAS_BB_Quota;
- public class SceGw {
- private static PRPC_SCESubscriberApi sceApi;
- private static String sceIP = "123.123.123.123";
- private static int scePort = 14374;
- public static void main(String[] args) {
- try {
- sceApi = new PRPC_SCESubscriberApi("sceGw", sceIP, scePort);
- java.util.Properties p = new java.util.Properties();
- p.setProperty("com.scms.api.sce.prpc.regularInvocationTimeout", 10000+""); // 10 seconds
- p.setProperty("com.scms.api.sce.prpc.listenerInvocationTimeout", 5000+""); // 5 seconds
- sceApi.init(p);
- sceApi.connect();
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- SceResultHandler rh = new SceResultHandler();
- SceQuotaListener ql = new SceQuotaListener();
- sceApi.registerQuotaListener(ql);
- String[] bucketIDs = {"1"};
- SCAS_BB_Quota q = new SCAS_BB_Quota(bucketIDs, null);
- try {
- sceApi.getQuotaStatus("subscriberName", q, rh);
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- ql.waitForResult();
- try {
- sceApi.disconnect();
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement