001/*
002 * Trident - A Multithreaded Server Alternative
003 * Copyright 2014 The TridentSDK Team
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package net.tridentsdk.registry;
018
019import javax.annotation.concurrent.ThreadSafe;
020import java.net.InetSocketAddress;
021import java.util.UUID;
022
023/**
024 * Represents players with a special status, such as banned, ip-banned, operator, or whitelisted
025 *
026 * @author The TridentSDK Team
027 * @since 0.4-alpha
028 */
029@ThreadSafe
030public interface PlayerStatus {
031    /**
032     * Checks the ban status of the player with the given UUID
033     *
034     * @param uuid the uuid to check
035     * @return {@code true} if the player is banned
036     */
037    boolean isBanned(UUID uuid);
038
039    /**
040     * Checks if the IP has been banned from the server
041     *
042     * @param address the IP to check
043     * @return {@code true} if the IP has been banned
044     */
045    boolean isIpBanned(InetSocketAddress address);
046
047    /**
048     * Checks if the player owning the UUID has been given operator status
049     *
050     * @param uuid the uuid to check
051     * @return {@code true} if the UUID is opped
052     */
053    boolean isOpped(UUID uuid);
054
055    /**
056     * Checks if the player owning the UUID is whitelisted
057     *
058     * @param uuid the uuid to check
059     * @return {@code true} if the player is whitelisted
060     */
061    boolean isWhitelisted(UUID uuid);
062
063    /**
064     * Bans the player given the UUID
065     *
066     * @param uuid the uuid of the player to ban
067     */
068    void ban(UUID uuid);
069
070    /**
071     * IP bans the given address
072     *
073     * @param address the IP to ban
074     */
075    void ipBan(InetSocketAddress address);
076
077    /**
078     * Ops the given UUID
079     *
080     * @param uuid the UUID to give op to
081     */
082    void op(UUID uuid);
083
084    /**
085     * Whitelists the UUID provided
086     *
087     * @param uuid the to give operator status
088     */
089    void whitelist(UUID uuid);
090}