/** * Decide about the request. * @param request The request. * @param initiator The requesting agent. * @return True, if should send agree. False for sending refuse. Exception/null for sending nothing. */ public Boolean decideRequest(Object request, IComponentIdentifier initiator) { IGoal decide_request = createGoal("rp_decide_request"); decide_request.getParameter("action").setValue(request); decide_request.getParameter("initiator").setValue(initiator); dispatchSubgoalAndWait(decide_request); return (Boolean)decide_request.getParameter("accept").getValue(); }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSSearchComponents sa = (CMSSearchComponents)getParameter("action").getValue(); IGoal sag = createGoal("cms_search_components"); sag.getParameter("description").setValue(sa.getComponentDescription()); sag.getParameter("constraints").setValue(sa.getSearchConstraints()); sag.getParameter("remote").setValue(sa.isRemote()? Boolean.TRUE: Boolean.FALSE); dispatchSubgoalAndWait(sag); sa.setComponentDescriptions((IComponentDescription[])sag.getParameterSet("result").getValues()); getParameter("result").setValue(new Done(sa)); } }
/** * Make a proposal based on the task description. * @param cfp The cfp including the task to execute. * @return The proposal for executing the task. */ public Object[] makeProposal(Object cfp, IComponentIdentifier initiator) { IGoal make_proposal = createGoal(getShortProtocolName()+"_make_proposal"); make_proposal.getParameter("cfp").setValue(cfp); make_proposal.getParameter("initiator").setValue(initiator); dispatchSubgoalAndWait(make_proposal); return new Object[]{make_proposal.getParameter("proposal").getValue(), make_proposal.getParameter("proposal_info").getValue()}; }
/** * Execute the request. * @param request The request. * @param initiator The requesting agent. * @return The result. */ public Object executeRequest(Object request, IComponentIdentifier initiator) { IGoal execute_request = createGoal("rp_execute_request"); execute_request.getParameter("action").setValue(request); execute_request.getParameter("initiator").setValue(initiator); dispatchSubgoalAndWait(execute_request); return execute_request.getParameter("result").getValue(); } }
/** * Execute the task. * @param proposal The proposal. * @param proposal_info The proposal info. * @return The result of the task. */ public Object executeTask(Object proposal, Object proposal_info, IComponentIdentifier initiator) { IGoal execute_task = createGoal(getShortProtocolName()+"_execute_task"); execute_task.getParameter("proposal").setValue(proposal); execute_task.getParameter("proposal_info").setValue(proposal_info); execute_task.getParameter("initiator").setValue(initiator); dispatchSubgoalAndWait(execute_task); return execute_task.getParameter("result").getValue(); } }
/** * Execute the request. * @param request The request. * @param initiator The requesting agent. * @return The result. */ public Object executeRequest(Object request, IComponentIdentifier initiator) { IGoal execute_request = createGoal(getShortProtocolName()+"_execute_request"); execute_request.getParameter("action").setValue(request); execute_request.getParameter("initiator").setValue(initiator); dispatchSubgoalAndWait(execute_request); return execute_request.getParameter("result").getValue(); }
/** * Decide about the request. * @param request The request. * @param initiator The requesting agent. * @return True, if should send agree. False for sending refuse. Exception/null for sending nothing. */ public Boolean decideRequest(Object request, IComponentIdentifier initiator) { IGoal decide_request = createGoal(getShortProtocolName()+"_decide_request"); decide_request.getParameter("action").setValue(request); decide_request.getParameter("initiator").setValue(initiator); dispatchSubgoalAndWait(decide_request); return (Boolean)decide_request.getParameter("accept").getValue(); }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSShutdownPlatform sp = new CMSShutdownPlatform(); IGoal req = createGoal("rp_initiate"); req.getParameter("receiver").setValue(getParameter("cms").getValue()); req.getParameter("action").setValue(sp); req.getParameter("ontology").setValue(SFipa.COMPONENT_MANAGEMENT_ONTOLOGY_NAME); dispatchSubgoalAndWait(req); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSDestroyComponent da = new CMSDestroyComponent(); da.setComponentIdentifier((IComponentIdentifier)getParameter("componentidentifier").getValue()); IGoal req = createGoal("rp_initiate"); req.getParameter("receiver").setValue(getParameter("cms").getValue()); req.getParameter("action").setValue(da); req.getParameter("ontology").setValue(SFipa.COMPONENT_MANAGEMENT_ONTOLOGY_NAME); dispatchSubgoalAndWait(req); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSResumeComponent ra = new CMSResumeComponent(); ra.setComponentIdentifier((IComponentIdentifier)getParameter("componentidentifier").getValue()); IGoal req = createGoal("rp_initiate"); req.getParameter("receiver").setValue(getParameter("cms").getValue()); req.getParameter("action").setValue(ra); req.getParameter("ontology").setValue(SFipa.COMPONENT_MANAGEMENT_ONTOLOGY_NAME); dispatchSubgoalAndWait(req); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSSuspendComponent sa = new CMSSuspendComponent(); sa.setComponentIdentifier((IComponentIdentifier)getParameter("componentidentifier").getValue()); IGoal req = createGoal("rp_initiate"); req.getParameter("receiver").setValue(getParameter("cms").getValue()); req.getParameter("action").setValue(sa); req.getParameter("ontology").setValue(SFipa.COMPONENT_MANAGEMENT_ONTOLOGY_NAME); dispatchSubgoalAndWait(req); } }
public void body() { IMessageEvent updateMsg = (IMessageEvent) getReason(); IGoal handleUpdate = createGoal("sp_handle_update"); handleUpdate.getParameter("subscription_id").setValue(updateMsg.getParameter(SFipa.CONVERSATION_ID).getValue()); handleUpdate.getParameter("update").setValue(updateMsg.getParameter(SFipa.CONTENT).getValue()); dispatchTopLevelGoal(handleUpdate); } }
public void body() { IMessageEvent msg = (IMessageEvent) getReason(); IMessageEvent reply = getEventbase().createReply(msg, "sp_agree"); sendMessage(reply); IGoal startSub = createGoal("sp_start_subscription"); startSub.getParameter("initiator").setValue(msg.getParameter(SFipa.SENDER).getValue()); startSub.getParameter("subscription_id").setValue(msg); startSub.getParameter("subscription").setValue(msg.getParameter(SFipa.CONTENT).getValue()); dispatchSubgoalAndWait(startSub); } }
/** * The plan body. */ public void body() { IGoal igoal = createGoal((String)getParameter("goaltype").getValue()); igoal.getParameter("message").setValue(getReason()); dispatchTopLevelGoal(igoal); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { DFRegister re = (DFRegister)getParameter("action").getValue(); IGoal reg = createGoal("df_register"); reg.getParameter("description").setValue(re.getComponentDescription()); dispatchSubgoalAndWait(reg); re.setResult((IDFComponentDescription)reg.getParameter("result").getValue()); getParameter("result").setValue(new Done(re)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { DFModify mo = (DFModify)getParameter("action").getValue(); IGoal reg = createGoal("df_modify"); reg.getParameter("description").setValue(mo.getComponentDescription()); dispatchSubgoalAndWait(reg); mo.setResult((IDFComponentDescription)reg.getParameter("result").getValue()); getParameter("result").setValue(new Done(mo)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSSuspendComponent sa = (CMSSuspendComponent)getParameter("action").getValue(); IGoal sag = createGoal("cms_suspend_component"); sag.getParameter("componentidentifier").setValue(sa.getComponentIdentifier()); dispatchSubgoalAndWait(sag); getParameter("result").setValue(new Done(sa)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSDestroyComponent da = (CMSDestroyComponent)getParameter("action").getValue(); IGoal dag = createGoal("cms_destroy_component"); dag.getParameter("componentidentifier").setValue(da.getComponentIdentifier()); dispatchSubgoalAndWait(dag); getParameter("result").setValue(new Done(da)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { DFDeregister de = (DFDeregister)getParameter("action").getValue(); IGoal dreg = createGoal("df_deregister"); dreg.getParameter("description").setValue(de.getComponentDescription()); dispatchSubgoalAndWait(dreg); getParameter("result").setValue(new Done(de)); } }
/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSResumeComponent ra = (CMSResumeComponent)getParameter("action").getValue(); IGoal rag = createGoal("cms_suspend_component"); rag.getParameter("componentidentifier").setValue(ra.getComponentIdentifier()); dispatchSubgoalAndWait(rag); getParameter("result").setValue(new Done(ra)); } }