Package org.jdesktop.wonderland.common.modules.ModuleRepository

Examples of org.jdesktop.wonderland.common.modules.ModuleRepository.Repository


        }

        // Next find the list of repositories for the module. For each, find
        // out the base URL and create a new ModuleAssetRepository class to
        // represent each.
        Repository repositories[] = getRepositories(cachedModule);
        if (repositories == null) {
            logger.warning("Unable to find repository list for " +
                    getAssetURI().toExternalForm());
            return new ModuleAssetRepository[] {};
        }
View Full Code Here


             * master.
             */
            logger.info("A repository.xml file does not exist for module: " + moduleName);
            logger.info("Sending this server as fallback: " + hostname);
            ModuleRepository newRepository = new ModuleRepository();
            Repository rep = new Repository();
            rep.url = hostname;
            rep.isServer = true;
            newRepository.setMaster(rep);
            /* Write the XML encoding to a writer and return it */
            StringWriter sw = new StringWriter();
            try {
                /* Formulate the HTTP response and send the string */
                newRepository.encode(sw);
                ResponseBuilder rb = Response.ok(sw.toString());
                return rb.build();
            } catch (javax.xml.bind.JAXBException excp) {
                /* Log an error and return an error response */
                logger.warning("ModuleManager: unable to serialize repository for " + moduleName);
                ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
                return rb.build();
            }
        }
       
        /* Since we potentially edit fields below, make a copy of the repository */
        ModuleRepository newRepository = new ModuleRepository(mr);
       
        /* Replace the master if its string is the special %WL_SERVER% */
        if (newRepository.getMaster() != null && newRepository.getMaster().url.compareTo(ModuleRepository.WL_SERVER) == 0) {
            Repository rep = new Repository();
            rep.url = hostname;
            rep.isServer = true;
            newRepository.setMaster(rep);
        }
       
        /* Replace the mirrors if its string is the special %WL_SERVER% */
        Repository mirrors[] = newRepository.getMirrors();
        if (mirrors != null) {
            for (int i = 0; i < mirrors.length; i++) {
                if (mirrors[i] != null && mirrors[i].url.compareTo(ModuleRepository.WL_SERVER) == 0) {
                    Repository rep = new Repository();
                    rep.url = hostname;
                    rep.isServer = true;
                    mirrors[i] = rep;
                }
            }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.common.modules.ModuleRepository.Repository

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.