Package org.marian.core

Examples of org.marian.core.Marian


       
    public static synchronized void main(String args[])
    {
        try {
//prova();
            Marian m1 = new Marian(1);
            Marian m2 = new Marian(2);
            m1.runCommand("help");           
            m1.runCommand("htmlhelp");
/*           
           
            m1.runCommand(". add share file1 C:\\SourceForge\\Marian\\trunk\\Marian\\m1\\s1\\f1.txt");
            m1.runCommand(". add share dir1 C:\\SourceForge\\Marian\\trunk\\Marian\\m1\\s1\\" );
            m1.runCommand(". add contact contact2 marian.test.2");
            m1.runCommand(". grant request dir1 to contact2");
            m1.runCommand(". empty mailbox");
            m1.runCommand(". show contacts");
            m1.runCommand(". show shares");
*/
            // Set m1 parameters
            m1.runCommand("set mail.address to marian.test.1");
//            m1.runCommand(new String[]{ "", "set", "mail.address", "to", "marian.test.1" });
            m1.runCommand(new String[]{ "", "set", "pop3.user", "to", "marian.test.1" });
            m1.runCommand(new String[]{ "", "set", "pop3.password", "to", "margaret" });
            m1.runCommand(new String[]{ "", "set", "smtp.user", "to", "marian.test.1" });
            m1.runCommand(new String[]{ "", "set", "smtp.password", "to", "margaret" });
            m1.runCommand(new String[]{ "", "set", "dir.temp_download", "to", "C:\\Marian\\m1\\temp_download\\" });
            m1.runCommand(new String[]{ "", "set", "dir.temp_upload", "to", "C:\\Marian\\m1\\temp_upload\\" });
            m1.runCommand(new String[]{ "", "set", "dir.download", "to", "C:\\Marian\\m1\\download\\" });
            // Set m2 parameters
            m2.runCommand(new String[]{ "", "set", "mail.address", "to", "marian.test.2" });
            m2.runCommand(new String[]{ "", "set", "pop3.user", "to", "marian.test.2" });
            m2.runCommand(new String[]{ "", "set", "pop3.password", "to", "margaret" });
            m2.runCommand(new String[]{ "", "set", "smtp.user", "to", "marian.test.2" });
            m2.runCommand(new String[]{ "", "set", "smtp.password", "to", "margaret" });
            m2.runCommand(new String[]{ "", "set", "dir.temp_download", "to", "C:\\Marian\\m2\\temp_download\\" });
            m2.runCommand(new String[]{ "", "set", "dir.temp_upload", "to", "C:\\Marian\\m2\\temp_upload\\" });
            m2.runCommand(new String[]{ "", "set", "dir.download", "to", "C:\\Marian\\m2\\download\\" });           
            // Prepare m1           
            m1.runCommand(new String[]{ "", "add", "share", "file1", "C:\\Marian\\m1\\share1\\f1.txt" });
            m1.runCommand(new String[]{ "", "add", "share", "dir1", "C:\\Marian\\m1\\share1\\" });
            m1.runCommand(new String[]{ "", "add", "contact", "contact2", "marian.test.2" });
            m1.runCommand(new String[]{ "", "grant", "request", "dir1", "to", "contact2" });
            m1.runCommand(new String[]{ "", "empty", "mailbox" });
            m1.runCommand(new String[]{ "", "show", "contacts" });
            m1.runCommand(new String[]{ "", "show", "shares" });
            // Prepare m2
            m2.runCommand(new String[]{ "", "add", "share", "file2", "C:\\Marian\\m2\\share2\\f2a.txt" });
            m2.runCommand(new String[]{ "", "add", "share", "dir2", "C:\\Marian\\m2\\share2\\" });
            m2.runCommand(new String[]{ "", "add", "contact", "contact1", "marian.test.1" });
            m2.runCommand(new String[]{ "", "grant", "request", "dir2", "to", "contact1" });
            m2.runCommand(new String[]{ "", "empty", "mailbox" });
            m2.runCommand(new String[]{ "", "show", "contacts" });
            m2.runCommand(new String[]{ "", "show", "shares" });
            // m1 request
            m1.runCommand(new String[]{ "", "request", "dir2", "from", "contact2" });
            m1.runCommand(new String[]{ "", "process" });
            m1.runCommand(new String[]{ "", "send" });
            m1.runCommand(new String[]{ "", "remove", "unused", "messages" });
            m1.runCommand(new String[]{ "", "sleep", "1000" });
            // m2 process request
            m2.runCommand(new String[]{ "", "get" });
            m2.runCommand(new String[]{ "", "process" });
            m2.runCommand(new String[]{ "", "send" });
            m2.runCommand(new String[]{ "", "remove", "unused", "messages" });
            m2.runCommand(new String[]{ "", "sleep", "1000" });
            // m1 receive send
            m1.runCommand(new String[]{ "", "get" });
            m1.runCommand(new String[]{ "", "process" });
            m1.runCommand(new String[]{ "", "remove", "unused", "messages" });
        } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.marian.core.Marian

Copyright © 2018 www.massapicom. 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.