2284N/A/*
2284N/A * CDDL HEADER START
2284N/A *
2284N/A * The contents of this file are subject to the terms of the
2284N/A * Common Development and Distribution License, Version 1.0 only
2284N/A * (the "License"). You may not use this file except in compliance
2284N/A * with the License.
2284N/A *
2284N/A * You can obtain a copy of the license at
2284N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
2284N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2284N/A * See the License for the specific language governing permissions
2284N/A * and limitations under the License.
2284N/A *
2284N/A * When distributing Covered Code, include this CDDL HEADER in each
2284N/A * file and include the License file at
2284N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2284N/A * add the following below this CDDL HEADER, with the fields enclosed
2284N/A * by brackets "[]" replaced with your own identifying information:
2284N/A * Portions Copyright [yyyy] [name of copyright owner]
2284N/A *
2284N/A * CDDL HEADER END
2284N/A *
2284N/A *
3231N/A * Copyright 2008 Sun Microsystems, Inc.
2284N/A */
2284N/Apackage org.opends.server.util.cli;
2284N/A
2284N/A
2284N/A
2284N/A/**
2284N/A * A console application decorator which redirects all output to the
2284N/A * underlying application's output stream.
2284N/A */
2284N/Apublic class OutputStreamConsoleApplication extends ConsoleApplication {
2284N/A
2284N/A // The underlying console application.
2284N/A private final ConsoleApplication app;
2284N/A
2284N/A
2284N/A
2284N/A /**
2284N/A * Creates a new console application instance which redirects all
2284N/A * output to the underlying application's output stream.
2284N/A *
2284N/A * @param app
2284N/A * The underlying application console.
2284N/A */
2284N/A public OutputStreamConsoleApplication(ConsoleApplication app) {
2284N/A super(app.getInputStream(), app.getOutputStream(), app.getOutputStream());
2284N/A
2284N/A this.app = app;
2284N/A }
2284N/A
2284N/A
2284N/A
2284N/A /**
2284N/A * {@inheritDoc}
2284N/A */
2284N/A @Override
2305N/A public boolean isAdvancedMode() {
2305N/A return app.isAdvancedMode();
2305N/A }
2305N/A
2305N/A
2305N/A
2305N/A /**
2305N/A * {@inheritDoc}
2305N/A */
2305N/A @Override
2284N/A public boolean isInteractive() {
2284N/A return app.isInteractive();
2284N/A }
2284N/A
2284N/A
2284N/A
2284N/A /**
2284N/A * {@inheritDoc}
2284N/A */
2284N/A @Override
2284N/A public boolean isMenuDrivenMode() {
2284N/A return app.isMenuDrivenMode();
2284N/A }
2284N/A
2284N/A
2284N/A
2284N/A /**
2284N/A * {@inheritDoc}
2284N/A */
2284N/A @Override
2284N/A public boolean isQuiet() {
2284N/A return app.isQuiet();
2284N/A }
2284N/A
2284N/A
2284N/A
2284N/A /**
2284N/A * {@inheritDoc}
2284N/A */
2284N/A @Override
2284N/A public boolean isScriptFriendly() {
2284N/A return app.isScriptFriendly();
2284N/A }
2284N/A
2284N/A
2284N/A
2284N/A /**
2284N/A * {@inheritDoc}
2284N/A */
2284N/A @Override
2284N/A public boolean isVerbose() {
2284N/A return app.isVerbose();
2284N/A }
2284N/A
2284N/A}