001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software GmbH & Co. KG, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.security;
029
030import org.opencms.main.CmsIllegalArgumentException;
031
032/**
033 * Defines general validation methods.<p>
034 *
035 * @since 6.3.0
036 */
037public interface I_CmsValidationHandler {
038
039    /**
040     * Checks if the provided email is a valid email address.<p>
041     *
042     * @param email the email address to validate
043     *
044     * @throws CmsIllegalArgumentException if the given email address is not valid
045     */
046    void checkEmail(String email) throws CmsIllegalArgumentException;
047
048    /**
049     * Checks if the provided first name is valid.<p>
050     *
051     * @param firstname the first name to validate
052     *
053     * @throws CmsIllegalArgumentException if the given email address is not valid
054     */
055    void checkFirstname(String firstname) throws CmsIllegalArgumentException;
056
057    /**
058     * Checks if the provided group name is a valid group name.<p>
059     *
060     * @param groupName the group name to check
061     *
062     * @throws CmsIllegalArgumentException if the given group name is not valid
063     */
064    void checkGroupName(String groupName) throws CmsIllegalArgumentException;
065
066    /**
067     * Checks if the provided last name is valid.<p>
068     *
069     * @param lastname the last name to validate
070     *
071     * @throws CmsIllegalArgumentException if the given email address is not valid
072     */
073    void checkLastname(String lastname) throws CmsIllegalArgumentException;
074
075    /**
076     * Checks if the provided user name is a valid user name.<p>
077     *
078     * @param userName the user name to check
079     *
080     * @throws CmsIllegalArgumentException if the given user name is not valid
081     */
082    void checkUserName(String userName) throws CmsIllegalArgumentException;
083
084    /**
085     * Checks if the provided string is a valid zip code.<p>
086     *
087     * @param zipcode the zip code to validate
088     *
089     * @throws CmsIllegalArgumentException if the given zip code is not valid
090     */
091    void checkZipCode(String zipcode) throws CmsIllegalArgumentException;
092}