Package cu.ftpd.user.userbases.local

Examples of cu.ftpd.user.userbases.local.LocalUserbase


        final File dataDirectory = new File(cuftpdDataDirectory);
        dataDirectory.mkdirs();
        new File(dataDirectory, "/users").mkdirs();
        final File statisticsDir = new File(dataDirectory, "/logs/userstatistics");
        statisticsDir.mkdirs();
        userbase = new LocalUserbase(dataDirectory, false, null);
        statistics = new LocalUserStatistics(statisticsDir);
        this.glftpdRoot = new File(glftpdRoot);
    }
View Full Code Here


            // http://www.nabble.com/java.rmi.NoSuchObjectException:-no-such-object-in-table-td729138.html
            // http://www.nabble.com/What-causes-an-object-to-be-removed-from-the-ObjectTable--td1982425.html

            // USERBASE
            // this is done to appease the statistics engine so that it can do group-related statistics
            rmidus = new RmiDelegateUserbaseServer(new LocalUserbase(new File(dataDirectory), true, null)); // todo: we have to do something here to avoid passing null. more on this later

            RmiDelegateUserbase userbaseStub = (RmiDelegateUserbase) UnicastRemoteObject.exportObject(rmidus, Integer.parseInt(p.getProperty("userbase.port", "0")), csf, ssf);
            //registry.rebind("userbase", userbaseStub);
            // maybe binding the rmidus instead of the stub keeps it from being GCed (http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=4&t=002159)
            // changed to export the right object to prevent it from being garbage collected (i.e. don't export the stub)
View Full Code Here

    // todo: make a standalone server that does only this... (like the existing RMI server)

    public static void main(String[] args) {
        try {
            final AsynchronousMessageQueueChangeTracker changeTracker = new AsynchronousMessageQueueChangeTracker(URI.create("tcp://localhost:1800"), "master");
            final LocalUserbase userbase = new LocalUserbase(new File("c:/users/captain/desktop/receiver-data"), false, changeTracker);
            ChangeApplicator changeApplicator = new ChangeApplicator(userbase);
            changeTracker.addPeer("cuftpd", URI.create("failover:tcp://localhost:1700"), changeApplicator);
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

                    String name = settings.get("/user/authentication/asynchronous/name");
                    String uri = settings.get("/user/authentication/asynchronous/uri");

                    AsynchronousMessageQueueChangeTracker changeTracker = new AsynchronousMessageQueueChangeTracker(URI.create(uri), name);
                    this.changeTracker = changeTracker;
                    userbase = new LocalUserbase(settings.getDataDirectory(), true, changeTracker);
                    ChangeApplicator changeApplicator = new ChangeApplicator((LocalUserbase)userbase);

                    int i = 1;
                    String peerName;
                    String peerUri;
                    while(true) {
                        // loop over the sections in the file
                        peerName = settings.get("/user/authentication/asynchronous/peers/peer[" + i + "]/name");
                        if (peerName == null || "".equals(peerName)) {
                            break;
                        }
                        peerUri = settings.get("/user/authentication/asynchronous/peers/peer[" + i + "]/uri");
                        i++;
                        if (!peerUri.startsWith("failover:")) {
                            peerUri = "failover:" + peerUri;
                        }
                        changeTracker.addPeer(peerName, URI.create(peerUri), changeApplicator);
                        // todo: log each peer we connect to

                    }
                    initializeCuftpdUserbaseActions();
                    break;
                } catch (Exception e) {
                    shutdown();
                    throw new ConfigurationException("Asynchronous userbase failure", e);
                }
            case Userbase.DEFAULT:
            default:
                System.out.println("Initializing LOCAL userbase");
                userbase = new LocalUserbase(settings.getDataDirectory(), true, new ChangeTracker() {
                    @Override
                    public void addChange(Change change) {
                        // do nothing...
                    }
                });
View Full Code Here

TOP

Related Classes of cu.ftpd.user.userbases.local.LocalUserbase

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.