1 package org.enhydra.shark.corba.poa; 2 3 import org.omg.WfBase.*; 4 import org.enhydra.shark.corba.WorkflowService.*; 5 6 7 11 public class LimitAdminCORBA extends LimitAdministrationPOA { 12 private SharkCORBAServer myServer; 13 14 private String userId; 15 private boolean connected=false; 16 17 org.enhydra.shark.api.client.wfservice.LimitAdministration myLimitAdmin; 18 19 LimitAdminCORBA (SharkCORBAServer server,org.enhydra.shark.api.client.wfservice.LimitAdministration la) { 20 this.myServer=server; 21 this.myLimitAdmin=la; 22 23 } 24 25 public void connect(String userId, String password, String engineName, String scope) throws BaseException, ConnectFailed { 26 this.userId=userId; 27 28 try { 29 if (!myServer.validateUser(userId,password)) { 30 throw new ConnectFailed("Connection failed, invalid username or password"); 31 } 32 connected=true; 33 myLimitAdmin.connect(userId); 34 } catch (ConnectFailed cf) { 35 throw cf; 36 } catch (Exception ex) { 37 throw new BaseException(); 38 } 39 } 40 41 public void disconnect() throws BaseException, NotConnected { 42 if (!connected) { 43 throw new NotConnected("The connection is not established..."); 44 } 45 connected=false; 46 _this()._release(); 47 } 48 49 50 51 public void checkLimits () throws BaseException, NotConnected { 52 if (!connected) { 53 throw new NotConnected("The connection is not established..."); 54 } 55 try { 56 myLimitAdmin.checkLimits(); 57 } catch (Exception e) { 58 throw new BaseException(); 59 } 60 } 61 62 public void checkLimitsForProcesses (String [] procIds) throws BaseException, NotConnected { 63 if (!connected) { 64 throw new NotConnected("The connection is not established..."); 65 } 66 try { 67 myLimitAdmin.checkLimits(procIds); 68 } catch (Exception e) { 69 throw new BaseException(); 70 } 71 } 72 73 public void checkLimitsForProcess (String procId) throws BaseException, NotConnected { 74 if (!connected) { 75 throw new NotConnected("The connection is not established..."); 76 } 77 try { 78 myLimitAdmin.checkLimits(procId); 79 } catch (Exception e) { 80 throw new BaseException(); 81 } 82 } 83 84 public void checkProcessLimit (String procId) throws BaseException, NotConnected { 85 if (!connected) { 86 throw new NotConnected("The connection is not established..."); 87 } 88 try { 89 myLimitAdmin.checkProcessLimit(procId); 90 } catch (Exception e) { 91 throw new BaseException(); 92 } 93 } 94 95 public void checkActivityLimit (String procId,String actId) throws BaseException, NotConnected { 96 if (!connected) { 97 throw new NotConnected("The connection is not established..."); 98 } 99 try { 100 myLimitAdmin.checkActivityLimit(procId,actId); 101 } catch (Exception e) { 102 throw new BaseException(); 103 } 104 } 105 106 } 107 | Popular Tags |