Search in sources :

Example 1 with Operation

use of com.dexels.navajo.document.Operation in project navajo by Dexels.

the class TestOperation method testOperation.

@Test
public void testOperation() {
    NavajoFactory f = NavajoFactory.getInstance();
    Navajo n = f.createNavajo();
    Message msg = f.createMessage(n, "__Mongo__");
    Operation o = f.createOperation(n, "PUT", "vla/ProcessInsertPerson", null, "Person", null);
    n.addOperation(o);
    o.setExtraMessage(msg);
    Method m = f.createMethod(n, "vla/ProcessUpdatePerson", null);
    m.addRequired("Apenoot");
    n.addMethod(m);
    n.write(System.err);
}
Also used : NavajoFactory(com.dexels.navajo.document.NavajoFactory) Message(com.dexels.navajo.document.Message) Navajo(com.dexels.navajo.document.Navajo) Operation(com.dexels.navajo.document.Operation) Method(com.dexels.navajo.document.Method) Test(org.junit.Test)

Example 2 with Operation

use of com.dexels.navajo.document.Operation in project navajo by Dexels.

the class BaseOperationsImpl method getAllOperations.

public List<Operation> getAllOperations() {
    List<Operation> al = new ArrayList<>();
    for (int i = 0; i < myOperations.size(); i++) {
        Operation m = (Operation) myOperations.get(i);
        al.add(m);
    }
    return al;
}
Also used : ArrayList(java.util.ArrayList) Operation(com.dexels.navajo.document.Operation)

Example 3 with Operation

use of com.dexels.navajo.document.Operation in project navajo by Dexels.

the class BaseNavajoImpl method copy.

@Override
public Navajo copy() {
    Navajo ni = NavajoFactory.getInstance().createNavajo();
    BaseNavajoImpl n = (BaseNavajoImpl) ni;
    List<Message> al = getAllMessages();
    for (int i = 0; i < al.size(); i++) {
        Message m = al.get(i);
        Message m2 = copyMessage(m, n);
        n.addMessage(m2);
    }
    List<Method> mm = myMethods.getAllMethods();
    for (int i = 0; i < mm.size(); i++) {
        Method m = mm.get(i);
        Method m2 = m.copy(n);
        n.addMethod(m2);
    }
    List<Operation> oo = myOperations.getAllOperations();
    for (Operation o : oo) {
        Operation o2 = o.copy(n);
        n.addOperation(o2);
    }
    if (getHeader() != null) {
        ni.addHeader(getHeader().copy(ni));
    }
    return n;
}
Also used : Message(com.dexels.navajo.document.Message) Navajo(com.dexels.navajo.document.Navajo) Method(com.dexels.navajo.document.Method) Operation(com.dexels.navajo.document.Operation)

Aggregations

Operation (com.dexels.navajo.document.Operation)3 Message (com.dexels.navajo.document.Message)2 Method (com.dexels.navajo.document.Method)2 Navajo (com.dexels.navajo.document.Navajo)2 NavajoFactory (com.dexels.navajo.document.NavajoFactory)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1