//Sample code file: var/ndk/webBuildengine/tmp/viewable_samples/a4ad0b48-dd95-46b6-8289-721e99c8dc76/login_method/mgmt/consoleone/src/com/novell/admin/ndssnapins/loginMethods/CPassword/CPassword.java //Warning: This code has been marked up for HTML

/*=============================================================================
  CPassword.java
  
  Copyright (c) 1999-2002 Novell, Inc. All Rights Reserved.

  THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND TREATIES.
  USE AND REDISTRIBUTION OF THIS WORK IS SUBJECT TO THE LICENSE AGREEMENT
  ACCOMPANYING THE SOFTWARE DEVELOPMENT KIT (SDK) THAT CONTAINS THIS WORK.
  PURSUANT TO THE SDK LICENSE AGREEMENT, NOVELL HEREBY GRANTS TO DEVELOPER A
  ROYALTY-FREE, NON-EXCLUSIVE LICENSE TO INCLUDE NOVELL'S SAMPLE CODE IN ITS
  PRODUCT. NOVELL GRANTS DEVELOPER WORLDWIDE DISTRIBUTION RIGHTS TO MARKET,
  DISTRIBUTE, OR SELL NOVELL'S SAMPLE CODE AS A COMPONENT OF DEVELOPER'S
  PRODUCTS. NOVELL SHALL HAVE NO OBLIGATIONS TO DEVELOPER OR DEVELOPER'S
  CUSTOMERS WITH RESPECT TO THIS CODE.
==============================================================================*/
package com.novell.admin.ndssnapins.loginMethods.CPassword;

import java.util.*;
import com.novell.admin.common.exceptions.*;

public class CPassword
{
   public final static   String NAME   = new String("com.novell.admin.ndssnapins.loginMethods.CPassword.CPassword");
   final static ResourceBundle   res   = ResourceBundle.getBundle("com.novell.admin.ndssnapins.loginMethods.CPassword.CPasswordResourceBundle");

  // AdminError constants   - @internal
   private   static final int MISSING_RESOURCE =   1;
   
  // C Password Shared Constants
   public final static byte ClearTextByte[] = {1};
   public final static String ClearTextID = new String(ClearTextByte);
    public final static byte AllowData[] = {1};
   public final static byte DoNotAllowData[] = {0};
   public final static int AllowDataLen = 1;
   public final static int MethodID[] = {1};  // Method ID 1 is reserved for testing purposes
   public final static int MethodIDLen = 4;   // num bytes in method id
   public final static String AllowTag = "Clear Allowed";
   public final static String SecretTag = "Clear Password";
   
  // NOTE   that the String   variable name must match EXACTLY with its value   in
  // order to   gaurantee uniqueness
   public final static   String

  //Snapin names and descriptions
   CPassword_METHOD_TAB            = "CPassword_METHOD_TAB",
    CPassword_SNAPIN_NAME            = "CPassword_SNAPIN_NAME",
    CPassword_MENU_NAME                = "CPassword_MENU_NAME",
    CPassword_METHOD_SNAPIN_DESCRIPTION   = "CPassword_METHOD_SNAPIN_DESCRIPTION",
   CPassword_USER_SNAPIN_DESCRIPTION   = "CPassword_USER_SNAPIN_DESCRIPTION",
      
  // Message Box Titles and Messages
   CPassword_ENTRY_ERR_TITLE                = "CPassword_ENTRY_ERR_TITLE",
   CPassword_BOP_ERR_MSG                    = "CPassword_BOP_ERR_MSG",
   CPassword_PLC_ERR_MSG                    = "CPassword_PLC_ERR_MSG",
   CPassword_DLC_ERR_MSG                    = "CPassword_DLC_ERR_MSG",
   CPassword_UNEQUAL_ERR_MSG                = "CPassword_UNEQUAL_ERR_MSG",
   CPassword_LOAD_LIBRARY_FAILED_TITLE      = "CPassword_LOAD_LIBRARY_FAILED_TITLE",
   CPassword_LOAD_LIBRARY_FAILED_MESSAGE    = "CPassword_LOAD_LIBRARY_FAILED_MESSAGE",
   
  // Instructions
   CPassword_INSTRUCTIONS                   = "CPassword_INSTRUCTIONS",

  // Labels
   CPassword_LABEL                          = "CPassword_LABEL",
   CPassword_ENTRY_LABEL                    = "CPassword_ENTRY_LABEL",
   CPassword_CONFIRM_LABEL                  = "CPassword_CONFIRM_LABEL",
   CPassword_ALLOW_LABEL                    = "CPassword_ALLOW_LABEL",
   CPassword_NOT_SUPPORTED_LABEL            = "CPassword_NOT_SUPPORTED_LABEL",
   CPassword_NO_RIGHTS_LABEL                = "CPassword_NO_RIGHTS_LABEL",
   
  // put all new strings before this one
   LAST_STRING                                    = "LAST_STRING"
   ;
   
  // Given a Key,   returns   the   matching string   from the resourceBundle.
  // @param   I-key The key-pair match from the resourceBundle
  // @return   The   string that   corresponds   to the key-pair
   public static String getString(String key)
   {
      String str = new String();
      try
      {
         str   = res.getString(key);
      }
      catch (MissingResourceException   e)
      {
         throw new AdminError(MISSING_RESOURCE, "com.novell.admin.ndssnapins.classes.nmas.nmas is missing string resource with key = " + key );
      }

      return str;
   }

  // Given a Key,   returns   the   matching object   from the resourceBundle.
  // @param      I-objkey    The key-pair match   from the resourceBundle
  // @return    The object   that corresponds to   the   key-pair objkey
   public static Object getObject(String objKey)
   {
      Object obj = null;
      try
      {
         obj   = res.getObject(objKey);
      }
      catch (MissingResourceException   e)
      {
         throw new AdminError( MISSING_RESOURCE, "com.novell.admin.ndssnapins.classes.nmas.nmas" );
      }
      return obj;
   }
}