| | |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.api.plugin; |
| | | |
| | | import org.opends.messages.Message; |
| | | import org.opends.messages.MessageDescriptor; |
| | | |
| | | |
| | | /** |
| | |
| | | // process. |
| | | private final boolean continueStartup; |
| | | |
| | | // The unique identifier for any error message generated by the |
| | | // startup plugin. |
| | | private final int errorID; |
| | | |
| | | // A human-readable message that explains any error that might have |
| | | // A message that explains any error that might have |
| | | // occurred. |
| | | private final String errorMessage; |
| | | private final Message errorMessage; |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | private StartupPluginResult() |
| | | { |
| | | this(true, true, 0, null); |
| | | this(true, true, null); |
| | | } |
| | | |
| | | |
| | |
| | | * @param continueStartup Indicates whether the Directory |
| | | * Server should continue with its |
| | | * startup process. |
| | | * @param errorID The unique ID assigned to any |
| | | * error message that might have been |
| | | * generated by the startup plugin. |
| | | * @param errorMessage A human-readable error message |
| | | * that explains any error that might |
| | | * have occurred. |
| | | * @param errorMessage An error message that explains any |
| | | * error that might have occurred. |
| | | */ |
| | | public StartupPluginResult(boolean completedSuccessfully, |
| | | boolean continueStartup, int errorID, |
| | | String errorMessage) |
| | | boolean continueStartup, |
| | | Message errorMessage) |
| | | { |
| | | this.completedSuccessfully = completedSuccessfully; |
| | | this.continueStartup = continueStartup; |
| | | this.errorID = errorID; |
| | | this.errorMessage = errorMessage; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the unique ID for the error message generated by the |
| | | * startup plugin. |
| | | * |
| | | * @return The unique ID for the error message generated by the |
| | | * startup plugin, or 0 if there is no error message. |
| | | */ |
| | | public int getErrorID() |
| | | { |
| | | return errorID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the human-readable error message generated by the |
| | | * startup plugin. |
| | | * |
| | |
| | | * startup plugin, or {@code null} if there is no error |
| | | * message. |
| | | */ |
| | | public String getErrorMessage() |
| | | public Message getErrorMessage() |
| | | { |
| | | return errorMessage; |
| | | } |
| | |
| | | buffer.append(", continueStartup="); |
| | | buffer.append(continueStartup); |
| | | buffer.append(", errorID="); |
| | | buffer.append(errorID); |
| | | if (errorMessage != null) { |
| | | buffer.append(errorMessage.getDescriptor().getId()); |
| | | } else { |
| | | buffer.append(MessageDescriptor.NULL_ID); |
| | | } |
| | | buffer.append(", errorMessage=\""); |
| | | buffer.append(errorMessage); |
| | | buffer.append("\")"); |