Package org.glassfish.grizzly.config.dom

Examples of org.glassfish.grizzly.config.dom.Protocol$Duck


                    final String protocolName) throws TransactionFailure {
                final Protocols ps_w = writableProtocols();
                if (ps_w == null) {
                    return;
                }
                final Protocol doomedProtocol = ps_w.findProtocol(protocolName);
                if (doomedProtocol != null) {
                    ps_w.getProtocol().remove(doomedProtocol);
                }
            }
View Full Code Here


        if (newConfig!=null) {
            config = newConfig;
        }
        report = context.getActionReport();
        final Protocols protocols = config.getNetworkConfig().getProtocols();
        final Protocol protocol = protocols.findProtocol(protocolName);
        final Protocol target = protocols.findProtocol(targetName);
        try {
            validate(protocol, "create.http.fail.protocolnotfound",
                "The specified protocol {0} is not yet configured", protocolName);
            validate(target, "create.http.fail.protocolnotfound",
                "The specified protocol {0} is not yet configured", targetName);
View Full Code Here

        Config newConfig = targetUtil.getConfig(target);
        if (newConfig!=null) {
            config = newConfig;
        }
        final ActionReport report = context.getActionReport();
        Protocol protocol = config.getNetworkConfig().getProtocols().findProtocol(protocolName);
        if (protocol!=null) {
            final PortUnification pu = protocol.getPortUnification();
            if (pu!=null) {
                for (ProtocolFinder finder : pu.getProtocolFinder()) {
                    report.getTopMessagePart().addChild().setMessage(finder.getName());
                }
            }
View Full Code Here

            config = newConfig;
        }
        report = context.getActionReport();
        try {
            final Protocols protocols = config.getNetworkConfig().getProtocols();
            final Protocol protocol = protocols.findProtocol(protocolName);
            validate(protocol, "create.http.fail.protocolnotfound",
                "The specified protocol {0} is not yet configured", protocolName);
            ProtocolChainInstanceHandler handler = getHandler(protocol);
            ProtocolChain chain = getChain(handler);
            ConfigSupport.apply(new SingleConfigCode<ProtocolChain>() {
View Full Code Here

        Target targetUtil = services.getService(Target.class);
        Config newConfig = targetUtil.getConfig(target);
        if (newConfig != null) {
            config = newConfig;
        }
        Protocol protocolToBeRemoved = null;
        ActionReport report = context.getActionReport();
        NetworkConfig networkConfig = config.getNetworkConfig();
        Protocols protocols = networkConfig.getProtocols();
        try {
            for (Protocol protocol : protocols.getProtocol()) {
                if (protocolName.equalsIgnoreCase(protocol.getName())) {
                    protocolToBeRemoved = protocol;
                }
            }
            if (protocolToBeRemoved == null) {
                report.setMessage(localStrings.getLocalString(
                        "delete.http.notexists", "{0} http doesn't exist",
                        protocolName));
                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                return;
            }
            // check if the protocol whose http to be deleted is being used by
            // any network listener, then do not delete it.
            List<NetworkListener> nwlsnrList =
                    protocolToBeRemoved.findNetworkListeners();
            for (NetworkListener nwlsnr : nwlsnrList) {
                if (protocolToBeRemoved.getName().equals(nwlsnr.getProtocol())) {
                    report.setMessage(localStrings.getLocalString(
                            "delete.protocol.beingused",
                            "{0} protocol is being used in the network listener {1}",
                            protocolName, nwlsnr.getName()));
                    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
View Full Code Here

    public static void create(final Protocols protocols, final String name, final Boolean securityEnabled)
        throws TransactionFailure {
        ConfigSupport.apply(new SingleConfigCode<Protocols>() {
            public Object run(Protocols param) throws TransactionFailure {
                Protocol newProtocol = param.createChild(Protocol.class);
                newProtocol.setName(name);
                newProtocol.setSecurityEnabled(securityEnabled == null ? null : securityEnabled.toString());
                param.getProtocol().add(newProtocol);
                return newProtocol;
            }
        }, protocols);
    }
View Full Code Here

        Config newConfig = targetUtil.getConfig(target);
        if (newConfig!=null) {
            config = newConfig;
        }
        final ActionReport report = context.getActionReport();
        Protocol protocol = config.getNetworkConfig().getProtocols().findProtocol(protocolName);
        if (protocol!=null) {
            final ProtocolChain chain = protocol.getProtocolChainInstanceHandler().getProtocolChain();
            if (chain!=null) {
                for (ProtocolFilter filter : chain.getProtocolFilter()) {
                    report.getTopMessagePart().addChild().setMessage(filter.getName());
                }
            }
View Full Code Here

        }
        ActionReport report = context.getActionReport();
        NetworkListeners networkListeners = config.getNetworkConfig().getNetworkListeners();
        try {
            if (findListener(networkListeners, report)) {
                final Protocol httpProtocol = listenerToBeRemoved.findHttpProtocol();
                final VirtualServer virtualServer = config.getHttpService().getVirtualServerByName(
                        httpProtocol.getHttp().getDefaultVirtualServer());

                ConfigSupport.apply(new ConfigCode() {
                    public Object run(ConfigBeanProxy... params) throws PropertyVetoException {
                        final NetworkListeners listeners = (NetworkListeners) params[0];
                        final VirtualServer server = (VirtualServer) params[1];
View Full Code Here

    public void create(final CreateSsl command, ActionReport report) {

        NetworkConfig netConfig = command.config.getNetworkConfig();
        // ensure we have the specified listener
        NetworkListener listener = netConfig.getNetworkListener(command.listenerId);
        Protocol httpProtocol;
        try {
            if (listener == null) {
                report.setMessage(
                        localStrings.getLocalString("create.ssl.http.notfound",
                                "Network Listener named {0} does not exist.  Creating or using the named protocol element instead.",
                                command.listenerId));
                httpProtocol = command.findOrCreateProtocol(command.listenerId);
            } else {
                httpProtocol = listener.findHttpProtocol();
                Ssl ssl = httpProtocol.getSsl();
                if (ssl != null) {
                    report.setMessage(localStrings.getLocalString("create.ssl.http.alreadyExists",
                        "Network Listener named {0} to which this ssl element is being added already has an ssl element.",
                        command.listenerId));
                    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
View Full Code Here

                "HTTP Listener named {0} not found", command.listenerId));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;
        }

        Protocol protocol = networkListener.findHttpProtocol();
        if (protocol.getSsl() == null) {
            report.setMessage(localStrings.getLocalString(
                "delete.ssl.element.doesnotexist", "Ssl element does " +
                "not exist for Listener named {0}", command.listenerId));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;
View Full Code Here

TOP

Related Classes of org.glassfish.grizzly.config.dom.Protocol$Duck

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.