DhcpCliProgram.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
/**
* This class is the base class extended by the DHCP CLI program classes.
*/
public abstract class DhcpCliProgram {
/**
* Defines the functionality to be performed.
*/
/**
* Program arguments.
*/
/**
* Return codes.
*/
public static final int FAILURE = -1;
public static final int SUCCESS = 0;
public static final int EXISTS = 1;
public static final int ENOENT = 2;
public static final int WARNING = 3;
public static final int CRITICAL = 4;
/**
* Returns the manpage signature for the program.
* @return the manpage signature for the program.
*/
public abstract String getManPage();
/**
* Uninitializes the program function.
*/
protected void clearFunction() {
}
/**
* Sets the function that the user has requested.
* @param function user requested function.
*/
throws IllegalArgumentException {
this.function.getFunctionFlag());
}
}
/**
* Checks to see if the user has permission to run the program.
* @return true if the user has permission to execute, false otherwise.
*/
protected boolean isValidUser() {
// Must be root to run.
//
return false;
}
return true;
} // isValidUser
} // DhcpCliProgram