Евгения Шульгин
📎 1 file 21,868 chars
📄
pasted-code-1790446430722.txt
txt 955 lines
▶
# ProfileManager v1.0.0 — Full Technical Specification

Create a complete Minecraft server plugin called ProfileManager.

Target platform:
- Paper 26.2
- Java version compatible with Paper 26.2
- SQLite for persistent player data
- MiniMessage support
- PlaceholderAPI support
- Configurable GUI system
- GUI files must be stored in a dedicated "guis" folder

The plugin is a player profile system. Players can create and view profiles containing personal information, statistics, social media links, and reputation.

The architecture must be modular, clean, maintainable, and designed for future expansion and integration with other plugins.

Do not create unnecessary functionality that is not specified in this document.


==================================================
1. COMMANDS
==================================================

Main command:

/profile

Opens the player's own profile.

Command:

/profile 

Opens another player's profile.

Profile editing:

/profile add  

Supported types:

/profile add age 
/profile add gender 
/profile add name 
/profile add info 

Examples:

/profile add age 18
/profile add gender Male
/profile add name Alex
/profile add info I like building and playing with friends

If a value already exists, the new value must replace the old value.

Players can only edit their own profile.


==================================================
2. PROFILE IDENTIFICATION
==================================================

Every profile must be identified by the player's UUID.

Never use the player's username as the primary database identifier.

If a player changes their Minecraft username, their existing profile must remain intact.

The displayed username should update automatically to the current username.


==================================================
3. PROFILE DATA
==================================================

Each player profile must support the following data.

Basic information:
- UUID
- Current Minecraft username
- Age
- Gender
- Name
- Info

Social networks:
- Telegram
- Discord
- TikTok

The social network system must be designed so additional social networks can be added later without rewriting the core system.

Possible future networks:
- YouTube
- VK
- Twitch
- Instagram
- etc.

Reputation:
- Positive reputation count
- Negative reputation count
- A persistent record of which UUIDs have already voted for which target UUIDs


==================================================
4. DATABASE
==================================================

Use SQLite.

Database location:

plugins/ProfileManager/data.db

Do not store player data in YAML files.

YAML files are only for:
- configuration
- messages
- GUI configuration

Database logic must be separated from commands and GUI logic.

Use a dedicated database/repository layer.

The database must preserve all player data across:
- player disconnects
- server restarts
- plugin restarts
- plugin updates


==================================================
5. MAIN PROFILE GUI
==================================================

The main profile GUI must be exactly:

5 rows x 9 columns

Total:
45 slots

The GUI must be fully configurable through YAML.

Main GUI file:

plugins/ProfileManager/guis/profile.yml

Do not hardcode GUI slot positions inside Java code.


==================================================
6. PLAYER HEAD AND SKIN
==================================================

At the top center of the profile GUI there must be a player head displaying the player's Minecraft skin.

Use PLAYER_HEAD.

When opening the player's own profile:
- display the player's own current skin.

When opening another player's profile:
- display the target player's skin.

Use the standard Paper/Bukkit player profile APIs where possible.

Do not use NMS unless absolutely necessary.

The player head slot must be configurable in:

guis/profile.yml

Default position should be the center slot of the top row.

Example:

[ ][ ][ ][HEAD][ ][ ][ ][ ][ ]

For offline players:
- load the profile using stored UUID/profile information where possible
- use cached/saved skin information where possible
- if the skin cannot be retrieved, use a configurable fallback head

Skin/profile retrieval must not unnecessarily block the main server thread.


==================================================
7. MAIN PROFILE GUI CONTENT
==================================================

The profile GUI should contain the following sections.

Top:
- Player head with the player's skin

Main information:
- Name
- Age
- Gender
- Info

Statistics:
- General player statistics

Social networks:
- A button that opens the social networks GUI

Bottom:
- Close button in the center
- -REP button on the left when viewing another player's profile
- +REP button on the right when viewing another player's profile

When viewing your own profile, the reputation buttons must not exist.

All slots must be configurable through YAML.


==================================================
8. OWN PROFILE
==================================================

When using:

/profile

the player opens their own profile.

The player can:
- view their profile
- edit their own age
- edit their own gender
- edit their own name
- edit their own info
- edit their own social links
- view their statistics

The player's own profile must NOT show:
- +REP
- -REP

The player cannot give reputation to themselves.


==================================================
9. OTHER PLAYER PROFILE
==================================================

When using:

/profile 

the player opens another player's profile.

The viewer can:
- view the target player's profile
- view the target player's skin
- view the target player's information
- view the target player's statistics
- view the target player's social networks
- give reputation

The viewer cannot modify another player's:
- age
- gender
- name
- info
- social links


==================================================
10. CLOSE BUTTON
==================================================

The bottom center of the profile GUI must contain a Close button.

When viewing another player's profile, the default layout should be:

[-REP] [CLOSE] [+REP]

When viewing your own profile:

[CLOSE]

The Close button must close the current GUI.

Its:
- slot
- material
- name
- lore

must all be configurable through the GUI YAML.


==================================================
11. REPUTATION SYSTEM
==================================================

When viewing another player's profile, display:

- +REP
- -REP

A player may vote for another player only once.

After a player has voted:
- the vote cannot be changed
- the vote cannot be cancelled
- the player cannot vote for the same target again

Example:

Player A -> Player B = +REP

After that, Player A cannot:
- vote again for Player B
- change the vote to -REP
- remove the vote

Other players can still vote for Player B.

A player cannot vote for themselves.

Votes must be uniquely identified using:

voter UUID + target UUID

This restriction must persist after server restarts.


==================================================
12. REPUTATION DISPLAY
==================================================

The player's reputation must be displayed inside the information section of the profile.

For example:

Reputation:
+125
-14

or:

Reputation: +111

The exact visual format must be configurable through GUI/message configuration.

The positive and negative reputation counts must be stored separately.


==================================================
13. SOCIAL NETWORK GUI
==================================================

Clicking the Social Networks button opens a separate GUI.

GUI file:

plugins/ProfileManager/guis/socials.yml

The social GUI must support at minimum:
- Telegram
- Discord
- TikTok

Each social network must have configurable:
- material
- display name
- lore
- slot
- enabled/disabled state
- behavior

The system must be extensible so additional social networks can be added later through configuration/code without rewriting the core profile system.


==================================================
14. EDITING SOCIAL LINKS
==================================================

When the player opens their own Social Networks GUI and clicks a social network, the plugin enters chat input mode.

Example:

"Please enter your Telegram profile link in chat."
"Type cancel to cancel."

The plugin waits for the next chat message from that specific player.

If the player enters:

https://t.me/example

the link is saved to their profile.

If the player enters:

cancel

the operation is cancelled and the previous value remains unchanged.

After successful saving, send a configurable success message.

The player must be able to replace an existing social link using the same system.


==================================================
15. SOCIAL INPUT STATE
==================================================

The input state must be tracked per player UUID.

Do NOT use one global input state.

Multiple players must be able to edit social networks simultaneously.

Example:

Player A -> entering Telegram
Player B -> entering Discord
Player C -> entering TikTok

All three operations must work independently.


==================================================
16. SOCIAL INPUT TIMEOUT
==================================================

If a player enters social-link input mode but does not respond within the configured time, cancel the operation automatically.

Configuration example:

social-input-timeout: 60

The timeout must be configurable through config.yml.


==================================================
17. VIEWING ANOTHER PLAYER'S SOCIAL LINKS
==================================================

When viewing another player's profile and opening the Social Networks GUI, the GUI must be in view-only mode.

The viewer cannot edit the target player's social links.

If the target has a Telegram link and the viewer clicks Telegram, send the target's Telegram link to the viewer in chat.

Example:

Telegram: https://t.me/example

If the target has no Telegram link:

"This player has not added a Telegram link."

The same behavior applies to:
- Discord
- TikTok
- future social networks


==================================================
18. STATISTICS SYSTEM
==================================================

The statistics system must be modular and extensible.

Create an API/provider system such as:

ProfileStatisticProvider

Other plugins must be able to register custom statistics.

Examples:

PvPPlugin -> kills
EconomyPlugin -> balance
JobsPlugin -> jobs-earned

ProfileManager must not directly depend on these plugins.

If an external plugin is not installed, its statistics simply should not appear.

At minimum, the built-in profile statistics should support:
- playtime
- first join date
- last join date


==================================================
19. PROFILE API
==================================================

Create a public ProfileManager API for other plugins.

The API should allow other plugins to:
- retrieve a player's profile
- check whether a profile exists
- retrieve profile data
- update profile data where appropriate
- retrieve social links
- retrieve reputation
- retrieve statistics
- register custom statistics
- register future profile components

Example concept:

ProfileAPI.getProfile(UUID uuid);
ProfileAPI.getStatistic(UUID uuid, String key);
ProfileAPI.registerStatistic(...);

The exact implementation can be adapted to the final architecture.

The API must be separated from GUI and command logic.

The API should be designed so future plugins can integrate with ProfileManager without modifying the ProfileManager core.


==================================================
20. PLACEHOLDERAPI
==================================================

Provide full PlaceholderAPI support.

At minimum support:

%profile_name%
%profile_age%
%profile_gender%
%profile_info%
%profile_reputation_positive%
%profile_reputation_negative%
%profile_reputation%
%profile_username%
%profile_first_join%
%profile_last_join%

Placeholders should work in:
- GUI item names
- GUI lore
- GUI titles
- messages
- configurable profile elements

The system should support placeholders referring to the profile currently being viewed.

PlaceholderAPI should preferably be an optional dependency.

If PlaceholderAPI is not installed, ProfileManager must still function normally.


==================================================
21. MINIMESSAGE
==================================================

All player-facing text must support MiniMessage.

Use MiniMessage for:
- chat messages
- GUI titles
- item names
- item lore
- success messages
- error messages
- informational messages

Do not hardcode legacy § color codes.

All configurable messages must be stored in messages.yml.


==================================================
22. GUI CONFIGURATION
==================================================

All GUI files must be stored inside:

plugins/ProfileManager/guis/

Minimum files:

guis/profile.yml
guis/socials.yml

GUI configuration should support:
- title
- size
- slot
- material
- display name
- lore
- custom model data
- actions
- enabled/disabled elements
- sounds
- layout

The GUI appearance and layout must be controlled by YAML.

Java code should control behavior and logic, not hardcoded visual layout.


==================================================
23. CONFIG.YML
==================================================

General plugin configuration must be stored in:

config.yml

Possible configuration:

database:
  file: data.db

social-input-timeout: 60

sounds:
  enabled: true

Additional reasonable configuration options may be added if required.


==================================================
24. MESSAGES.YML
==================================================

All player-facing messages must be stored in:

messages.yml

Example:

profile:
  opened: "Profile opened."
  updated: "Profile updated."

social:
  enter-link: "Please enter your social media link."
  cancelled: "Input cancelled."
  saved: "Link saved successfully."

reputation:
  positive: "You gave positive reputation."
  negative: "You gave negative reputation."
  already-voted: "You have already voted for this player."
  self: "You cannot vote for yourself."

All messages must support MiniMessage.


==================================================
25. GUI PROTECTION
==================================================

Players must not be able to manipulate GUI items.

Prevent:
- normal item pickup
- shift-click
- number-key hotbar swapping
- double-click item collection
- inventory dragging
- offhand swapping
- other inventory manipulation methods

GUI items must never be obtainable or duplicable through the profile GUI.


==================================================
26. PERFORMANCE
==================================================

Do not perform blocking operations on the main server thread.

Pay special attention to:
- SQLite queries
- player profile/skin retrieval
- potentially slow operations

Use asynchronous operations where appropriate.

When an asynchronous operation finishes, switch back to the main server thread before interacting with Bukkit/Paper APIs that require the main thread.

Use caching where appropriate, especially for player skin/profile data.

Do not repeatedly request the same skin/profile data unnecessarily.


==================================================
27. OFFLINE PLAYERS
==================================================

Support:

/profile 

even when the target player is offline, as long as their profile exists.

Profile data must be loaded from SQLite using the saved UUID/profile information.

The target player does not need to be online to view:
- profile information
- reputation
- social links
- stored statistics

For offline players, use cached/saved skin information where possible.

If the skin cannot be retrieved, use the configured fallback head.


==================================================
28. ERROR HANDLING
==================================================

The plugin must handle gracefully:
- missing profiles
- missing social links
- unavailable player skin
- unavailable PlaceholderAPI
- invalid profile values
- missing GUI configuration
- database errors
- missing optional dependencies

The plugin must not crash because of a single invalid profile, GUI item, or missing optional dependency.

Errors should be logged clearly to the console.

Player-facing errors should use messages.yml and MiniMessage.


==================================================
29. PERMISSIONS
==================================================

Basic profile functionality must be available to all players.

No permission is required for:

/profile
/profile 
/profile add ...

Do not add unnecessary administrative functionality in v1.0.0.

If administrative functionality is added in the future, use:

profilemanager.admin


==================================================
30. PROJECT ARCHITECTURE
==================================================

Use a modular architecture.

Recommended structure:

src/main/java/
└── .../profilemanager/
    ├── ProfileManager.java
    │
    ├── command/
    │   └── ProfileCommand.java
    │
    ├── profile/
    │   ├── PlayerProfileData.java
    │   ├── ProfileService.java
    │   └── ProfileAPI.java
    │
    ├── database/
    │   ├── DatabaseManager.java
    │   └── ProfileRepository.java
    │
    ├── gui/
    │   ├── ProfileGUI.java
    │   ├── SocialsGUI.java
    │   └── GUIManager.java
    │
    ├── reputation/
    │   └── ReputationManager.java
    │
    ├── social/
    │   └── SocialManager.java
    │
    ├── statistics/
    │   ├── ProfileStatisticProvider.java
    │   └── StatisticsManager.java
    │
    ├── placeholder/
    │   └── ProfilePlaceholderExpansion.java
    │
    └── util/
        └── MessageUtil.java

This is a recommended structure, not a strict requirement.

Class names may be changed if a better architecture is appropriate.

Do not put the entire plugin into one giant Java class.


==================================================
31. DEPENDENCIES
==================================================

Target platform:

Paper 26.2

Use the Paper 26.2 API.

PlaceholderAPI should be supported as an optional integration.

Do not add unnecessary dependencies.

Do not use NMS unless there is no suitable Paper/Bukkit API alternative.

Use standard Paper/Bukkit APIs whenever possible.


==================================================
32. README
==================================================

Create a complete README.md containing:
- installation instructions
- commands
- permissions
- configuration information
- GUI configuration
- messages.yml documentation
- PlaceholderAPI placeholders
- MiniMessage support
- SQLite information
- ProfileAPI documentation
- statistics API documentation
- social network configuration


==================================================
33. PLUGIN METADATA
==================================================

Plugin name:

ProfileManager

Version:

1.0.0

Target:

Paper 26.2

The project must include all required build files and plugin metadata.

The generated project must be a complete buildable project, not just isolated Java files.


==================================================
34. FINAL V1.0.0 FUNCTIONALITY
==================================================

The completed plugin must allow players to:

1. Use /profile.
2. Open their own profile.
3. Use /profile .
4. View another player's profile.
5. See the player's Minecraft skin/head.
6. Set their age.
7. Set their gender.
8. Set their name.
9. Set their info.
10. View their statistics.
11. View another player's statistics.
12. Open the Social Networks GUI.
13. Add a Telegram link.
14. Add a Discord link.
15. Add a TikTok link.
16. Edit existing social links.
17. Cancel social-link input using "cancel".
18. View another player's social links.
19. Receive another player's social link in chat when clicking it.
20. Give +REP.
21. Give -REP.
22. Vote only once per target player.
23. Never change or cancel an existing reputation vote.
24. Never give reputation to themselves.
25. View positive and negative reputation.
26. Persist all data in SQLite.
27. Keep data after server restarts.
28. View offline players' stored profiles.
29. Use MiniMessage.
30. Use PlaceholderAPI.
31. Configure GUI layouts through YAML.
32. Use configurable messages.
33. Support future statistics through ProfileStatisticProvider.
34. Support future integrations through ProfileAPI.


==================================================
35. IMPORTANT IMPLEMENTATION RULES
==================================================

The plugin must be implemented as a complete, production-quality project.

Do not create a simplified prototype.

Do not put all logic into one class.

Do not hardcode GUI slot positions.

Do not hardcode player-facing messages.

Do not store player data in YAML.

Use UUIDs as the primary player identifier.

Use SQLite for persistent player data.

Use Paper 26.2 APIs.

Use MiniMessage.

Support PlaceholderAPI.

Keep GUI configuration inside the "guis" directory.

Keep database logic separate from GUI and command logic.

Keep reputation logic separate from GUI logic.

Keep social network logic separate from GUI logic.

Keep statistics logic modular.

Provide a ProfileAPI for future plugins.

Avoid NMS unless absolutely necessary.

Do not add unrelated features that are not specified in this document.

The final result must compile successfully and produce a usable ProfileManager v1.0.0 JAR for Paper 26.2.
Kodari AI
KodariSep 26 at 6:17 pm 2
ProfileManager
A comprehensive player profile plugin for Paper 26.2 that lets players create and view detailed profiles with personal information, social media links, and reputation. Features a fully YAML-configurable GUI system with player head skins, SQLite persistence using UUIDs, MiniMessage formatting, PlaceholderAPI integration, and a modular statistics API. Players can edit their own age, gender, name, and info, manage Telegram/Discord/TikTok links through chat input mode, and give one-time +REP/-REP votes to other players. Includes offline player profile viewing, asynchronous database operations, and an extensible ProfileAPI for future plugin integration.
  1. Create the Gradle project, plugin metadata, and default configuration files.

  2. Build the SQLite repository, profile service/API, and extensible statistics foundation.

  3. Add commands, configurable GUIs, social input, reputation, integrations, and documentation.

Created the ProfileManager 1.0.0 Gradle project for Paper 26.2 and Java 25. It includes UUID-based SQLite profiles, /profile commands, configurable MiniMessage GUIs, social-link editing and viewing, one-vote reputation, built-in statistics, an extensible profile API, optional PlaceholderAPI integration, and a README with setup and configuration guidance.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
README.md
settings.gradle
Code
27 1,729
src/main/java/com/kodari/profilemanager/ProfileManagerPlugin.java
package com.kodari.profilemanager;

import com.kodari.profilemanager.command.ProfileCommand;
import com.kodari.profilemanager.database.DatabaseManager;
import com.kodari.profilemanager.database.ProfileRepository;
import com.kodari.profilemanager.gui.ProfileGUIListener;
import com.kodari.profilemanager.gui.ProfileGUIManager;
import com.kodari.profilemanager.profile.ProfileAPI;
import com.kodari.profilemanager.profile.ProfileComponentRegistry;
import com.kodari.profilemanager.profile.ProfileListener;
import com.kodari.profilemanager.profile.ProfileService;
import com.kodari.profilemanager.reputation.ReputationManager;
import com.kodari.profilemanager.social.SocialInputManager;
import com.kodari.profilemanager.statistics.StatisticsManager;
import com.kodari.profilemanager.util.MessageUtil;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.sql.SQLException;
import java.util.concurrent.CompletionException;

public final class ProfileManagerPlugin extends JavaPlugin {
    private YamlConfiguration messages;
    private YamlConfiguration profileGuiConfig;
    private YamlConfiguration socialGuiConfig;
    private DatabaseManager database;
    private ProfileService profileService;
    private ProfileAPI api;
    private StatisticsManager statistics;
    private ProfileComponentRegistry components;
    private ProfileGUIManager guis;
    private SocialInputManager socialInput;
    private ReputationManager reputation;
    private ProfileListener profileListener;
    private MessageUtil messageUtil;
    private Object placeholderExpansion;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResourceIfMissing("messages.yml");
        saveResourceIfMissing("guis/profile.yml");
        saveResourceIfMissing("guis/socials.yml");
        loadConfigurationFiles();
        messageUtil = new MessageUtil(this);

        try {
            database = new DatabaseManager(this, getConfig().getString("database.file", "data.db"));
            ProfileRepository repository = new ProfileRepository(database);
            database.execute(() -> {
                repository.initialize();
                return null;
            }).exceptionally(error -> {
                getServer().getScheduler().runTask(this, () -> {
                    logDatabaseError("Could not initialize the SQLite schema", error);
                    getServer().getPluginManager().disablePlugin(this);
                });
                return null;
            });
            profileService = new ProfileService(database, repository);
        } catch (SQLException | CompletionException exception) {
            getLogger().severe("Could not initialize the SQLite database: " + exception.getMessage());
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        statistics = new StatisticsManager(this);
        components = new ProfileComponentRegistry();
        api = new ProfileAPI(profileService, statistics, components);
        guis = new ProfileGUIManager(this);
        socialInput = new SocialInputManager(this);
        reputation = new ReputationManager(this, profileService);
        profileListener = new ProfileListener(this);

        getServer().getPluginManager().registerEvents(new ProfileGUIListener(guis), this);
        getServer().getPluginManager().registerEvents(socialInput, this);
        getServer().getPluginManager().registerEvents(profileListener, this);
        registerPlaceholderExpansion();
        ProfileCommand profileCommand = new ProfileCommand(this);
        if (getCommand("profile") != null) {
            getCommand("profile").setExecutor(profileCommand);
            getCommand("profile").setTabCompleter(profileCommand);
        }
        profileListener.registerOnlinePlayers();
    }

    @Override
    public void onDisable() {
        unregisterPlaceholderExpansion();
        if (profileListener != null) {
            profileListener.persistActiveSessions();
        }
        if (database != null) {
            database.close();
        }
    }

    public void loadConfigurationFiles() {
        messages = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml"));
        profileGuiConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "guis/profile.yml"));
        socialGuiConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "guis/socials.yml"));
    }

    private void saveResourceIfMissing(String path) {
        File file = new File(getDataFolder(), path);
        if (!file.exists()) {
            saveResource(path, false);
        }
    }

    private void registerPlaceholderExpansion() {
        if (getServer().getPluginManager().getPlugin("PlaceholderAPI") == null) {
            return;
        }
        try {
            Class<?> expansionClass = Class.forName("com.kodari.profilemanager.placeholder.ProfilePlaceholderExpansion");
            Object expansion = expansionClass.getConstructor(ProfileManagerPlugin.class).newInstance(this);
            expansionClass.getMethod("register").invoke(expansion);
            getServer().getPluginManager().registerEvents((Listener) expansion, this);
            placeholderExpansion = expansion;
        } catch (ReflectiveOperationException | ClassCastException exception) {
            getLogger().warning("PlaceholderAPI integration could not be enabled: " + exception.getMessage());
        }
    }

    private void unregisterPlaceholderExpansion() {
        if (placeholderExpansion == null) {
            return;
        }
        try {
            placeholderExpansion.getClass().getMethod("unregister").invoke(placeholderExpansion);
        } catch (ReflectiveOperationException exception) {
            getLogger().warning("Could not unregister PlaceholderAPI expansion: " + exception.getMessage());
        }
    }

    public String applyPlaceholderAPI(Player viewer, String text) {
        if (getServer().getPluginManager().getPlugin("PlaceholderAPI") == null) {
            return text;
        }
        try {
            Class<?> placeholderApi = Class.forName("me.clip.placeholderapi.PlaceholderAPI");
            return (String) placeholderApi.getMethod("setPlaceholders", org.bukkit.OfflinePlayer.class, String.class)
                    .invoke(null, viewer, text);
        } catch (ReflectiveOperationException exception) {
            getLogger().warning("Could not parse PlaceholderAPI text: " + exception.getMessage());
            return text;
        }
    }

    public YamlConfiguration getMessages() {
        return messages;
    }

    public YamlConfiguration getProfileGuiConfig() {
        return profileGuiConfig;
    }

    public YamlConfiguration getSocialGuiConfig() {
        return socialGuiConfig;
    }

    public MessageUtil messages() {
        return messageUtil;
    }

    public ProfileService profileService() {
        return profileService;
    }

    public ProfileAPI api() {
        return api;
    }

    public StatisticsManager statistics() {
        return statistics;
    }

    public ProfileGUIManager guis() {
        return guis;
    }

    public SocialInputManager socialInput() {
        return socialInput;
    }

    public ReputationManager reputation() {
        return reputation;
    }

    public void logDatabaseError(String action, Throwable error) {
        Throwable cause = error instanceof CompletionException && error.getCause() != null ? error.getCause() : error;
        getLogger().severe(action + ": " + cause.getMessage());
    }
}