if( all.getAsset() instanceof org.cougaar.domain.glm.asset.PhysicalAsset )
if( all.getAsset() instanceof org.cougaar.domain.glm.ldm.asset.PhysicalAsset )
   private Vector parseAllocation(Task tsk, Vector returnVec, Allocation all,                         String verb, String annotation, PlanServiceContext psc)   {         Enumeration en;         Enumeration en2;         TraceRef er = new TraceRef();         er.UID = new String(tsk.getUID().getUID() );         String annote = annotation + "->PE(alloc)";         //         //         // TRANSPORTATION MISSION TASK, ALLOCATED TO PHYSICAL ASSET         // -- GRAB ITINERARY.         //         if( all.getAsset() instanceof org.cougaar.domain.glm.asset.PhysicalAsset )         {              annote += "->getAsset(PhysicalAsset)";              if( tsk.getVerb().equals(Constants.Verb.TransportationMission) )              {                    UIItinerary uiit = getItinerary(tsk, all);                    uiit.setAllocOID(all.hashCode()); // We'll identify this UIItinerary with the allocation object                    uiit.setClusterID(thisClusterID);                    uiit.setInputTaskUID(getUIDOfInputTask(tsk));                    uiit.setAllocTaskUID(tsk.getUID().getUID());                    //uiit.setAssetUID(all.getAsset().getUID().getUID());                    er.setData(uiit);                    annote += "->[obtaining itinerary of TransporationMission Task whose Allocation is to Physical Asset]";              }         }         //         // ALLOCATION TO REMOTE or LOCAL ORGANIZATION ASSET         else if( all.getAsset() instanceof Organization)         {             annote += "->getAsset(Organization)";                                       //             // DEFAULT SETTINGS FOR ALLOCATIONS             //System.out.println("ac.getAllocationTask() => null [" + all.toString() + "]");             er.InputTaskUID = getUIDOfInputTask(tsk);             //             // make sure instance implements the getAllocTask() accessor?             if( all instanceof AllocationforCollections )             {                          AllocationforCollections ac = (AllocationforCollections)all;                          Task at = (Task)ac.getAllocationTask();                          if( at != null ) {                              er.RemoteClusterID =                                 new String(                                    verifyClusterName(                                        getClusterIDAsString(                                            at.getDestination().toString() ),                                        psc));                                                                      er.AllocTaskUID = new String( at.getUID().toString()  );                              annote += "->RemoteAllocation("                                 + "/$"+er.RemoteClusterID                                 + "/...RemoteTaskUID="                                 + er.AllocTaskUID + ")";                              // ############ ANSWER                              er.answer = new String(                                 "URL:"                                 + "/$"+er.RemoteClusterID                                 +"/alpine/demo/QUERYTRANSPORT.PSP"                                  + "?TASK="                                 + er.AllocTaskUID                                 + ";"                                 );                          }             } // end instanceof AllocationsForCollections             else {                           er.RemoteClusterID =                               new String(                                   verifyClusterName(                                       getClusterIDAsString(                                             tsk.getDestination().toString() ),                                       psc));                                                                   // er.AllocTaskUID = STRING_NULL;                            er.AllocAssetUID =  all.getAsset().getUID().getUID();                            annote += "->LocalOrganization("                                 + all.getAsset().getUID() +")";                            er.answer = new String(                                 "URL:"                                 + "/$"+er.RemoteClusterID                                 +"/alpine/demo/QUERYTRANSPORT.PSP?ORGANIZATION="                                 + all.getAsset().getUID().getUID()                                 + ";"                                 );              }         }         //!Organization --         //    LOCAL ASSET ALLOCATION         else if( all.getAsset() != null) {                 annote += "->getAsset(Local Asset)";                 er.RemoteClusterID =                     new String(                          verifyClusterName(                                   getClusterIDAsString(                                         tsk.getDestination().toString() ),                                   psc));                 Asset ass = all.getAsset();                 String id = null;                 String type = null;                 type = ass.getClass().getName();                 if( ass.getUID() != null) {                      id = ass.getUID().getUID();                 } else {                      /**                              id = "ASSET_WITH_NULL_UID(" + type + ")";                              throw new RuntimeException( annote + "=>" + id);                              $$$$$$$$$$$$$ HACK FOLLOWS!!!!!!!!!!!                              SUBSTITUTE HASHCODE FOR UID....!                      **/                      id = new String("HASHCODE_ID" + ass.hashCode());                 }                 er.AllocAssetUID =  id;                 annote += annotation + "->LocalAsset("                                        + id  + ")";                 //                 // ############ ANSWER                 // URL: REFERENCE TO ASSET                 // getAllocationResults(): ALLOCATION RESULTS DETAILS                 //                 er.answer = new String(                                 "URL:"                                 + "/$"+er.RemoteClusterID                                 +"/alpine/demo/QUERYTRANSPORT.PSP?ASSET="                                 + id                                 + ";"                                 //////////////////+ getAllocationResults(all)                                 );         }         else{               throw new RuntimeException(annote + "=>Allocation with NULL asset");         }         er.annotation += annote;         returnVec.addElement(er);       return returnVec;   }