@@ -388,16 +388,15 @@ private String queueCommand(BaseCmd cmdObj, Map<String, String> params) throws E
388388 Long callerUserId = ctx .getCallerUserId ();
389389 Account caller = ctx .getCaller ();
390390
391- BaseCmd realCmdObj = ComponentContext .getTargetObject (cmdObj );
392391
393392 // Queue command based on Cmd super class:
394393 // BaseCmd: cmd is dispatched to ApiDispatcher, executed, serialized and returned.
395394 // BaseAsyncCreateCmd: cmd params are processed and create() is called, then same workflow as BaseAsyncCmd.
396395 // BaseAsyncCmd: cmd is processed and submitted as an AsyncJob, job related info is serialized and returned.
397- if (realCmdObj instanceof BaseAsyncCmd ) {
396+ if (cmdObj instanceof BaseAsyncCmd ) {
398397 Long objectId = null ;
399398 String objectUuid = null ;
400- if (realCmdObj instanceof BaseAsyncCreateCmd ) {
399+ if (cmdObj instanceof BaseAsyncCreateCmd ) {
401400 BaseAsyncCreateCmd createCmd = (BaseAsyncCreateCmd ) cmdObj ;
402401 _dispatcher .dispatchCreateCmd (createCmd , params );
403402 objectId = createCmd .getEntityId ();
@@ -433,7 +432,7 @@ private String queueCommand(BaseCmd cmdObj, Map<String, String> params) throws E
433432 ctx .setAccountId (asyncCmd .getEntityOwnerId ());
434433
435434 Long instanceId = (objectId == null ) ? asyncCmd .getInstanceId () : objectId ;
436- AsyncJobVO job = new AsyncJobVO (callerUserId , caller .getId (), realCmdObj .getClass ().getName (),
435+ AsyncJobVO job = new AsyncJobVO (callerUserId , caller .getId (), cmdObj .getClass ().getName (),
437436 ApiGsonHelper .getBuilder ().create ().toJson (params ), instanceId , asyncCmd .getInstanceType ());
438437
439438 long jobId = _asyncMgr .submitAsyncJob (job );
@@ -457,22 +456,22 @@ private String queueCommand(BaseCmd cmdObj, Map<String, String> params) throws E
457456 // if the command is of the listXXXCommand, we will need to also return the
458457 // the job id and status if possible
459458 // For those listXXXCommand which we have already created DB views, this step is not needed since async job is joined in their db views.
460- if (realCmdObj instanceof BaseListCmd && !(realCmdObj instanceof ListVMsCmd ) && !(realCmdObj instanceof ListRoutersCmd )
461- && !(realCmdObj instanceof ListSecurityGroupsCmd )
462- && !(realCmdObj instanceof ListTagsCmd )
463- && !(realCmdObj instanceof ListEventsCmd )
464- && !(realCmdObj instanceof ListVMGroupsCmd )
465- && !(realCmdObj instanceof ListProjectsCmd )
466- && !(realCmdObj instanceof ListProjectAccountsCmd )
467- && !(realCmdObj instanceof ListProjectInvitationsCmd )
468- && !(realCmdObj instanceof ListHostsCmd )
469- && !(realCmdObj instanceof ListVolumesCmd )
470- && !(realCmdObj instanceof ListUsersCmd )
471- && !(realCmdObj instanceof ListAccountsCmd )
472- && !(realCmdObj instanceof ListStoragePoolsCmd )
473- && !(realCmdObj instanceof ListDiskOfferingsCmd )
474- && !(realCmdObj instanceof ListServiceOfferingsCmd )
475- && !(realCmdObj instanceof ListZonesByCmd )
459+ if (cmdObj instanceof BaseListCmd && !(cmdObj instanceof ListVMsCmd ) && !(cmdObj instanceof ListRoutersCmd )
460+ && !(cmdObj instanceof ListSecurityGroupsCmd )
461+ && !(cmdObj instanceof ListTagsCmd )
462+ && !(cmdObj instanceof ListEventsCmd )
463+ && !(cmdObj instanceof ListVMGroupsCmd )
464+ && !(cmdObj instanceof ListProjectsCmd )
465+ && !(cmdObj instanceof ListProjectAccountsCmd )
466+ && !(cmdObj instanceof ListProjectInvitationsCmd )
467+ && !(cmdObj instanceof ListHostsCmd )
468+ && !(cmdObj instanceof ListVolumesCmd )
469+ && !(cmdObj instanceof ListUsersCmd )
470+ && !(cmdObj instanceof ListAccountsCmd )
471+ && !(cmdObj instanceof ListStoragePoolsCmd )
472+ && !(cmdObj instanceof ListDiskOfferingsCmd )
473+ && !(cmdObj instanceof ListServiceOfferingsCmd )
474+ && !(cmdObj instanceof ListZonesByCmd )
476475 ) {
477476 buildAsyncListResponse ((BaseListCmd ) cmdObj , caller );
478477 }
0 commit comments