1 package org.enhydra.shark.corba; 2 3 import org.omg.WfBase.*; 4 import org.enhydra.shark.corba.WorkflowService.*; 5 6 7 12 public class AdminMiscCORBA extends _AdminMiscImplBase { 13 private SharkCORBAServer myServer; 14 15 private String userId; 16 private boolean connected=false; 17 18 org.enhydra.shark.api.client.wfservice.AdminMisc myAdminMisc; 19 20 AdminMiscCORBA (SharkCORBAServer server,org.enhydra.shark.api.client.wfservice.AdminMisc am) { 21 this.myServer=server; 22 this.myAdminMisc=am; 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 myAdminMisc.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._orb().disconnect(this); 47 } 48 49 public NameValue[] getPackageExtendedAttributeNameValuePairs (String pkgId) throws BaseException, NotConnected { 50 if (!connected) { 51 throw new NotConnected("The connection is not established..."); 52 } 53 try { 54 return SharkCORBAUtilities 55 .makeCORBANameValueArray(myServer.getBoundORB(), 56 myAdminMisc.getPackageExtendedAttributeNameValuePairs(pkgId)); 57 } catch (Exception e) { 58 throw new BaseException(); 59 } 60 } 61 62 public String [] getPackageExtendedAttributeNames(String pkgId) throws BaseException, NotConnected { 63 if (!connected) { 64 throw new NotConnected("The connection is not established..."); 65 } 66 try { 67 return myAdminMisc.getPackageExtendedAttributeNames(pkgId); 68 } catch (Exception e) { 69 throw new BaseException(); 70 } 71 } 72 73 public String getPackageExtendedAttributeValue(String pkgId,String extAttrName) throws BaseException, NotConnected { 74 if (!connected) { 75 throw new NotConnected("The connection is not established..."); 76 } 77 try { 78 return myAdminMisc.getPackageExtendedAttributeValue(pkgId,extAttrName); 79 } catch (Exception e) { 80 throw new BaseException(); 81 } 82 } 83 84 public NameValue[] getProcessDefinitionExtendedAttributeNameValuePairs (String mgrName) throws BaseException, NotConnected { 85 if (!connected) { 86 throw new NotConnected("The connection is not established..."); 87 } 88 try { 89 return SharkCORBAUtilities 90 .makeCORBANameValueArray(myServer.getBoundORB(), 91 myAdminMisc.getProcessDefinitionExtendedAttributeNameValuePairs(mgrName)); 92 } catch (Exception e) { 93 throw new BaseException(); 94 } 95 } 96 97 public String [] getProcessDefinitionExtendedAttributeNames(String mgrName) throws BaseException, NotConnected { 98 if (!connected) { 99 throw new NotConnected("The connection is not established..."); 100 } 101 try { 102 return myAdminMisc.getProcessDefinitionExtendedAttributeNames(mgrName); 103 } catch (Exception e) { 104 throw new BaseException(); 105 } 106 } 107 108 public String getProcessDefinitionExtendedAttributeValue(String mgrName,String extAttrName) throws BaseException, NotConnected { 109 if (!connected) { 110 throw new NotConnected("The connection is not established..."); 111 } 112 try { 113 return myAdminMisc.getProcessDefinitionExtendedAttributeValue(mgrName,extAttrName); 114 } catch (Exception e) { 115 throw new BaseException(); 116 } 117 } 118 119 public NameValue[] getProcessExtendedAttributeNameValuePairs (String procId) throws BaseException, NotConnected { 120 if (!connected) { 121 throw new NotConnected("The connection is not established..."); 122 } 123 try { 124 return SharkCORBAUtilities 125 .makeCORBANameValueArray(myServer.getBoundORB(), 126 myAdminMisc.getProcessExtendedAttributeNameValuePairs(procId)); 127 } catch (Exception e) { 128 throw new BaseException(); 129 } 130 } 131 132 public String [] getProcessExtendedAttributeNames(String procId) throws BaseException, NotConnected { 133 if (!connected) { 134 throw new NotConnected("The connection is not established..."); 135 } 136 try { 137 return myAdminMisc.getProcessExtendedAttributeNames(procId); 138 } catch (Exception e) { 139 throw new BaseException(); 140 } 141 } 142 143 public String getProcessExtendedAttributeValue(String procId,String extAttrName) throws BaseException, NotConnected { 144 if (!connected) { 145 throw new NotConnected("The connection is not established..."); 146 } 147 try { 148 return myAdminMisc.getProcessExtendedAttributeValue(procId,extAttrName); 149 } catch (Exception e) { 150 throw new BaseException(); 151 } 152 } 153 154 public String getActivitiesExtendedAttributes (String procId,String actId) throws BaseException, NotConnected { 155 if (!connected) { 156 throw new NotConnected("The connection is not established..."); 157 } 158 try { 159 return myAdminMisc.getActivitiesExtendedAttributes(procId,actId); 160 } catch (Exception e) { 161 throw new BaseException(); 162 } 163 } 164 165 public NameValue[] getActivitiesExtendedAttributeNameValuePairs (String procId,String actId) throws BaseException, NotConnected { 166 if (!connected) { 167 throw new NotConnected("The connection is not established..."); 168 } 169 try { 170 return SharkCORBAUtilities 171 .makeCORBANameValueArray(myServer.getBoundORB(), 172 myAdminMisc.getActivitiesExtendedAttributeNameValuePairs(procId,actId)); 173 } catch (Exception e) { 174 throw new BaseException(); 175 } 176 } 177 178 public String [] getActivitiesExtendedAttributeNames(String procId,String actId) throws BaseException, NotConnected { 179 if (!connected) { 180 throw new NotConnected("The connection is not established..."); 181 } 182 try { 183 return myAdminMisc.getActivitiesExtendedAttributeNames(procId,actId); 184 } catch (Exception e) { 185 throw new BaseException(); 186 } 187 } 188 189 public String getActivitiesExtendedAttributeValue(String procId,String actId,String extAttrName) throws BaseException, NotConnected { 190 if (!connected) { 191 throw new NotConnected("The connection is not established..."); 192 } 193 try { 194 return myAdminMisc.getActivitiesExtendedAttributeValue(procId,actId,extAttrName); 195 } catch (Exception e) { 196 throw new BaseException(); 197 } 198 } 199 200 public NameValue[] getDefVariableExtendedAttributeNameValuePairs (String mgrName,String variableId) throws BaseException, NotConnected { 201 if (!connected) { 202 throw new NotConnected("The connection is not established..."); 203 } 204 try { 205 return SharkCORBAUtilities 206 .makeCORBANameValueArray(myServer.getBoundORB(), 207 myAdminMisc.getDefVariableExtendedAttributeNameValuePairs(mgrName,variableId)); 208 } catch (Exception e) { 209 throw new BaseException(); 210 } 211 } 212 213 public String [] getDefVariableExtendedAttributeNames(String mgrName,String variableId) throws BaseException, NotConnected { 214 if (!connected) { 215 throw new NotConnected("The connection is not established..."); 216 } 217 try { 218 return myAdminMisc.getDefVariableExtendedAttributeNames(mgrName,variableId); 219 } catch (Exception e) { 220 throw new BaseException(); 221 } 222 } 223 224 public String getDefVariableExtendedAttributeValue(String mgrName,String variableId,String extAttrName) throws BaseException, NotConnected { 225 if (!connected) { 226 throw new NotConnected("The connection is not established..."); 227 } 228 try { 229 return myAdminMisc.getDefVariableExtendedAttributeValue(mgrName,variableId,extAttrName); 230 } catch (Exception e) { 231 throw new BaseException(); 232 } 233 } 234 235 public NameValue[] getVariableExtendedAttributeNameValuePairs (String procId,String variableId) throws BaseException, NotConnected { 236 if (!connected) { 237 throw new NotConnected("The connection is not established..."); 238 } 239 try { 240 return SharkCORBAUtilities 241 .makeCORBANameValueArray(myServer.getBoundORB(), 242 myAdminMisc.getVariableExtendedAttributeNameValuePairs(procId,variableId)); 243 } catch (Exception e) { 244 throw new BaseException(); 245 } 246 } 247 248 public String [] getVariableExtendedAttributeNames(String procId,String variableId) throws BaseException, NotConnected { 249 if (!connected) { 250 throw new NotConnected("The connection is not established..."); 251 } 252 try { 253 return myAdminMisc.getVariableExtendedAttributeNames(procId,variableId); 254 } catch (Exception e) { 255 throw new BaseException(); 256 } 257 } 258 259 public String getVariableExtendedAttributeValue(String procId,String variableId,String extAttrName) throws BaseException, NotConnected { 260 if (!connected) { 261 throw new NotConnected("The connection is not established..."); 262 } 263 try { 264 return myAdminMisc.getVariableExtendedAttributeValue(procId,variableId,extAttrName); 265 } catch (Exception e) { 266 throw new BaseException(); 267 } 268 } 269 270 public NameValue[] getParticipantExtendedAttributeNameValuePairs (String pkgId,String pDefId,String participantId) throws BaseException, NotConnected { 271 if (!connected) { 272 throw new NotConnected("The connection is not established..."); 273 } 274 try { 275 return SharkCORBAUtilities 276 .makeCORBANameValueArray(myServer.getBoundORB(), 277 myAdminMisc.getParticipantExtendedAttributeNameValuePairs(pkgId,pDefId,participantId)); 278 } catch (Exception e) { 279 throw new BaseException(); 280 } 281 } 282 283 public String [] getParticipantExtendedAttributeNames(String pkgId,String pDefId,String participantId) throws BaseException, NotConnected { 284 if (!connected) { 285 throw new NotConnected("The connection is not established..."); 286 } 287 try { 288 return myAdminMisc.getParticipantExtendedAttributeNames(pkgId,pDefId,participantId); 289 } catch (Exception e) { 290 throw new BaseException(); 291 } 292 } 293 294 public String getParticipantExtendedAttributeValue(String pkgId,String pDefId,String participantId,String extAttrName) throws BaseException, NotConnected { 295 if (!connected) { 296 throw new NotConnected("The connection is not established..."); 297 } 298 try { 299 return myAdminMisc.getParticipantExtendedAttributeValue(pkgId,pDefId,participantId,extAttrName); 300 } catch (Exception e) { 301 throw new BaseException(); 302 } 303 } 304 305 public NameValue[] getApplicationExtendedAttributeNameValuePairs (String pkgId,String pDefId,String applicationId) throws BaseException, NotConnected { 306 if (!connected) { 307 throw new NotConnected("The connection is not established..."); 308 } 309 try { 310 return SharkCORBAUtilities 311 .makeCORBANameValueArray(myServer.getBoundORB(), 312 myAdminMisc.getApplicationExtendedAttributeNameValuePairs(pkgId,pDefId,applicationId)); 313 } catch (Exception e) { 314 throw new BaseException(); 315 } 316 } 317 318 public String [] getApplicationExtendedAttributeNames(String pkgId,String pDefId,String applicationId) throws BaseException, NotConnected { 319 if (!connected) { 320 throw new NotConnected("The connection is not established..."); 321 } 322 try { 323 return myAdminMisc.getApplicationExtendedAttributeNames(pkgId,pDefId,applicationId); 324 } catch (Exception e) { 325 throw new BaseException(); 326 } 327 } 328 329 public String getApplicationExtendedAttributeValue(String pkgId,String pDefId,String applicationId,String extAttrName) throws BaseException, NotConnected { 330 if (!connected) { 331 throw new NotConnected("The connection is not established..."); 332 } 333 try { 334 return myAdminMisc.getApplicationExtendedAttributeValue(pkgId,pDefId,applicationId,extAttrName); 335 } catch (Exception e) { 336 throw new BaseException(); 337 } 338 } 339 340 public String getBlockActivityId (String procId,String actId) throws BaseException, NotConnected { 341 if (!connected) { 342 throw new NotConnected("The connection is not established..."); 343 } 344 try { 345 return myAdminMisc.getBlockActivityId(procId,actId); 346 } catch (Exception e) { 347 throw new BaseException(); 348 } 349 } 350 351 public String getActivityDefinitionId (String procId,String actId) throws BaseException, NotConnected { 352 if (!connected) { 353 throw new NotConnected("The connection is not established..."); 354 } 355 try { 356 return myAdminMisc.getActivityDefinitionId(procId,actId); 357 } catch (Exception ex) { 358 throw new BaseException(); 359 } 360 } 361 362 public String getProcessDefinitionId (String procId) throws BaseException, NotConnected { 363 if (!connected) { 364 throw new NotConnected("The connection is not established..."); 365 } 366 try { 367 return myAdminMisc.getProcessDefinitionId(procId); 368 } catch (Exception e) { 369 throw new BaseException(); 370 } 371 } 372 373 public String getDefVariableName (String mgrName,String variableId) throws BaseException, NotConnected { 374 if (!connected) { 375 throw new NotConnected("The connection is not established..."); 376 } 377 try { 378 return myAdminMisc.getDefVariableName(mgrName,variableId); 379 } catch (Exception e) { 380 throw new BaseException(); 381 } 382 } 383 384 public String getDefVariableDescription (String mgrName,String variableId) throws BaseException, NotConnected { 385 if (!connected) { 386 throw new NotConnected("The connection is not established..."); 387 } 388 try { 389 return myAdminMisc.getDefVariableDescription(mgrName,variableId); 390 } catch (Exception e) { 391 throw new BaseException(); 392 } 393 } 394 395 public String getDefVariableJavaClassName (String mgrName,String variableId) throws BaseException, NotConnected { 396 if (!connected) { 397 throw new NotConnected("The connection is not established..."); 398 } 399 try { 400 return myAdminMisc.getDefVariableJavaClassName(mgrName,variableId); 401 } catch (Exception e) { 402 throw new BaseException(); 403 } 404 } 405 406 public String getVariableName (String procId,String variableId) throws BaseException, NotConnected { 407 if (!connected) { 408 throw new NotConnected("The connection is not established..."); 409 } 410 try { 411 return myAdminMisc.getVariableName(procId,variableId); 412 } catch (Exception e) { 413 throw new BaseException(); 414 } 415 } 416 417 public String getVariableDescription (String procId,String variableId) throws BaseException, NotConnected { 418 if (!connected) { 419 throw new NotConnected("The connection is not established..."); 420 } 421 try { 422 return myAdminMisc.getVariableDescription(procId,variableId); 423 } catch (Exception e) { 424 throw new BaseException(); 425 } 426 } 427 428 public String getVariableJavaClassName (String procId,String variableId) throws BaseException, NotConnected { 429 if (!connected) { 430 throw new NotConnected("The connection is not established..."); 431 } 432 try { 433 return myAdminMisc.getVariableJavaClassName(procId,variableId); 434 } catch (Exception e) { 435 throw new BaseException(); 436 } 437 } 438 439 public String getParticipantName (String pkgId, String pDefId, String participantId) throws BaseException, NotConnected { 440 if (!connected) { 441 throw new NotConnected("The connection is not established..."); 442 } 443 try { 444 if (pDefId!=null && pDefId.equals("")) { 445 pDefId=null; 446 } 447 return myAdminMisc.getParticipantName(pkgId,pDefId,participantId); 448 } catch (Exception e) { 449 throw new BaseException(); 450 } 451 } 452 453 public String getApplicationName (String pkgId, String pDefId, String applicationId) throws BaseException, NotConnected { 454 if (!connected) { 455 throw new NotConnected("The connection is not established..."); 456 } 457 try { 458 if (pDefId!=null && pDefId.equals("")) { 459 pDefId=null; 460 } 461 return myAdminMisc.getParticipantName(pkgId,pDefId,applicationId); 462 } catch (Exception e) { 463 throw new BaseException(); 464 } 465 } 466 467 public String getProcessMgrPkgId (String name) throws BaseException, NotConnected { 468 if (!connected) { 469 throw new NotConnected("The connection is not established..."); 470 } 471 try { 472 return myAdminMisc.getProcessMgrPkgId(name); 473 } catch (Exception e) { 474 throw new BaseException(); 475 } 476 } 477 478 public String getProcessMgrProcDefId (String name) throws BaseException, NotConnected { 479 if (!connected) { 480 throw new NotConnected("The connection is not established..."); 481 } 482 try { 483 return myAdminMisc.getProcessMgrProcDefId(name); 484 } catch (Exception e) { 485 throw new BaseException(); 486 } 487 } 488 489 public String getProcessMgrProcDefName (String name) throws BaseException, NotConnected { 490 if (!connected) { 491 throw new NotConnected("The connection is not established..."); 492 } 493 try { 494 return myAdminMisc.getProcessMgrProcDefName(name); 495 } catch (Exception e) { 496 throw new BaseException(); 497 } 498 } 499 500 public String getProcessRequesterUsername (String procId) throws BaseException, NotConnected { 501 if (!connected) { 502 throw new NotConnected("The connection is not established..."); 503 } 504 try { 505 return myAdminMisc.getProcessRequesterUsername(procId); 506 } catch (Exception e) { 507 throw new BaseException(); 508 } 509 } 510 511 public String getActivityResourceUsername(String procId,String actId) throws BaseException, NotConnected { 512 if (!connected) { 513 throw new NotConnected("The connection is not established..."); 514 } 515 try { 516 return myAdminMisc.getActivityResourceUsername(procId,actId); 517 } catch (Exception e) { 518 throw new BaseException(); 519 } 520 } 521 522 public long getProcessCreatedTime (String procId) throws BaseException, NotConnected { 523 if (!connected) { 524 throw new NotConnected("The connection is not established..."); 525 } 526 try { 527 return myAdminMisc.getProcessCreatedTime(procId); 528 } catch (Exception e) { 529 throw new BaseException(); 530 } 531 } 532 533 public long getProcessStartedTime (String procId) throws BaseException, NotConnected { 534 if (!connected) { 535 throw new NotConnected("The connection is not established..."); 536 } 537 try { 538 return myAdminMisc.getProcessStartedTime(procId); 539 } catch (Exception e) { 540 throw new BaseException(); 541 } 542 } 543 544 public long getProcessFinishTime (String procId) throws BaseException, NotConnected { 545 if (!connected) { 546 throw new NotConnected("The connection is not established..."); 547 } 548 try { 549 return myAdminMisc.getProcessFinishTime(procId); 550 } catch (Exception e) { 551 throw new BaseException(); 552 } 553 } 554 555 public long getActivityCreatedTime (String procId,String actId) throws BaseException, NotConnected { 556 if (!connected) { 557 throw new NotConnected("The connection is not established..."); 558 } 559 try { 560 return myAdminMisc.getActivityCreatedTime(procId,actId); 561 } catch (Exception e) { 562 throw new BaseException(); 563 } 564 } 565 566 public long getActivityStartedTime (String procId,String actId) throws BaseException, NotConnected { 567 if (!connected) { 568 throw new NotConnected("The connection is not established..."); 569 } 570 try { 571 return myAdminMisc.getActivityStartedTime(procId,actId); 572 } catch (Exception e) { 573 throw new BaseException(); 574 } 575 } 576 577 public long getActivityFinishTime (String procId,String actId) throws BaseException, NotConnected { 578 if (!connected) { 579 throw new NotConnected("The connection is not established..."); 580 } 581 try { 582 return myAdminMisc.getActivityFinishTime(procId,actId); 583 } catch (Exception e) { 584 throw new BaseException(); 585 } 586 } 587 } 588 | Popular Tags |