Package com.sun.enterprise.registration

Examples of com.sun.enterprise.registration.RegistrationException


    }

    public void setStatus(ServiceTag serviceTag, ServiceTag.Status status) throws RegistrationException {
        Element st = findServiceTag(serviceTag);
        if (st == null) {
            throw new RegistrationException(StringManager.getString("rpmgr.noSuchSrvTag"));
        }
        setSubElementValue(st, ServiceTag.STATUS, status.toString());
        writeToFile();
    }
View Full Code Here


    }

    public ServiceTag.Status getStatus(ServiceTag serviceTag) throws RegistrationException {
        Element st = findServiceTag(serviceTag);
        if (st == null) {
            throw new RegistrationException(StringManager.getString("rpmgr.noSuchSrvTag"));
        }
        return ServiceTag.Status.valueOf(getSubElementValue(st, ServiceTag.STATUS));
    }
View Full Code Here

     */
    void write(Node node, OutputStream stream) throws RegistrationException {
        try {
            transformer.transform(new DOMSource(node), new StreamResult(stream));
        } catch (Exception e) {
            throw new RegistrationException(e);
        }
    }
View Full Code Here

                Element element = document.createElement(subElementName);
                element.setTextContent(value);
                rootElement.appendChild(element);       
            }
            else {           
                throw new RegistrationException(StringManager.getString("rpmgr.noSuchElement"));
            }
        }
    }
View Full Code Here

            if (registrationFile.exists()) {
                try {
                    document = documentBuilder.parse(registrationFile);
                    registryElement = findRegistryElement();
                } catch (Exception e) {
                    throw new RegistrationException(e);
                }
            }
            else {
                document = documentBuilder.newDocument();
                registryElement = document.createElement(REGISTRY_TAG);
View Full Code Here

        OutputStream os = null;
        try {
            os = new FileOutputStream(registrationFile);
            write(os);
        } catch (Exception e) {
            throw new RegistrationException(e);
        } finally {
            if (os != null) {
                try {
                    os.close();
                } catch (IOException ex) {
                    throw new RegistrationException(StringManager.getString("rpmgr.errClosingRepos"), ex);
                }
            }
        }
    }
View Full Code Here

   
    public void generateRegistrationPage(String outputFile, Locale locale) throws Exception {
        bundle = getResourceBundle(locale);
        InputStream is = getClass().getClassLoader().getResourceAsStream(TEMPLATE_FILE);
        if (is == null)
            throw new RegistrationException("Template file [" + TEMPLATE_FILE + "] not found");

        List<ServiceTag> serviceTags = rm.getServiceTags();
        StringBuilder productName = new StringBuilder();
        for (ServiceTag tag : serviceTags) {
            if (productName.length() > 0)
View Full Code Here

   
    public void generateRegistrationPage(String outputFile, Locale locale) throws Exception {
        bundle = getResourceBundle(locale);
        InputStream is = getClass().getClassLoader().getResourceAsStream(TEMPLATE_FILE);
        if (is == null)
            throw new RegistrationException("Template file [" + TEMPLATE_FILE + "] not found");

        List<ServiceTag> serviceTags = rm.getServiceTags();
        String productName = "";
        for (ServiceTag tag : serviceTags) {
            if (productName.length() > 0)
View Full Code Here

                    GLASSFISH_REGISTRY_PROPERTIES);
            Properties props = new Properties();
            props.load(is);
            return props.getProperty("product_urn");
        } catch (Exception ex) {
            throw new RegistrationException(ex);
        }
    }
View Full Code Here

    public static String getGFInstanceURN() throws RegistrationException {
        SysnetRegistrationService srs = new SysnetRegistrationService(getServiceTagRegistry());

        List<ServiceTag> st = srs.getRegistrationDescriptors(getGFProductURN());
        if (st.isEmpty()) {
            throw new RegistrationException("Instance URN for " +
                    getGFProductURN() + " not found"); // i18n

        }
        return st.get(0).getInstanceURN();
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.registration.RegistrationException

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.