Examples of identifyGoal()


Examples of org.springframework.hateoas.client.Agent.identifyGoal()

  private static void transferMoney(Browser browser, String fromAccount, String toAccount, BigInteger amount) throws GoalNotFoundException {
    Agent agent = new Agent(browser);
    // collect follow rel actions from describedBy URL
    // for json-ld, would that be the context?
    // could we construct schema.org actions for this?
    agent.identifyGoal("http://localhost:8080/banking/ns/transfer", browser.getCurrentContext());

    // enable client to submit forms
    // TODO: look into schema.org actions to see if they say something about required data for an action.
    agent.addSubmitFormAction(new SubmitFormAction("bankAccountForm", Args.of("accountNumber", fromAccount)));
    agent.addSubmitFormAction(new SubmitFormAction("moneyTransferForm", Args.of("amount", amount, "to", toAccount)));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.