/** * Copyright (C) 2008 by Sericon Technology Inc. * http://www.sericontech.com * All rights reserved. * * This software is supplied under the terms of a licence agreement or * non-disclosure agreement with Sericon Technology Inc. and may not be * copied nor disclosed except in accordance with the terms of that agreement. * * * Module Name: * * SampleStatusCheck.java * * Abstract: * * Example of how to subclass StatusCheck * */ package com.Sericon.ProductAgents.Sample; import com.Sericon.ProductAgents.AutoSSLAgent.*; import com.Sericon.Common.GUI.*; /** * An example of how to subclass StatusCheck. * * @author Sander Smith */ public class SampleStatusCheck extends StatusCheck { // This variable will determine whether the user interface of the application is a GUI or // a console application private boolean useWindows=false; public SampleStatusCheck() { } // Shows a problem to the user public void showInstallProblem(String message) { SericonMessageDialog.showWarning(useWindows, null, message, "AutoSSL Problem"); } // Shows a status message to the user public void showInstallStatus(int step, String message) { SericonMessageDialog.showPlain(useWindows, null, message, "AutoSSL Status"); } // Gets a string from the user private String getString(String question, String defaultValue) { return SericonMessageDialog.getString(useWindows, null, question, "Installation", defaultValue); } // Get the server identifier for this installation String getServerID() { return getString("Choose an identifier for this server", ""); } // Get the customer information that will be put into the SSL certificate BasicCustomerInfo getBasicCustomerInformation() { String name = getString("Please enter your name", "Sericon Technology"); String city = getString("Please enter your city", "Toronto"); String state = getString("Please enter your state", "Ontario"); String country = getString("Please enter your country (2 character abbreviation)", "CA"); String email = getString("Please enter your email address", "user@company.com"); BasicCustomerInfo customerInfo = new BasicCustomerInfo(name, city, state, country, email); return customerInfo; } // Get the autorization information. This must be done in conjunction with the AutoSSL Server. AuthorizationInfo getAuthorizationInformation() { return new AuthorizationInfo("Sample"); } }