Package com.smell.application.structure
Class CharacterDataService
java.lang.Object
com.smell.application.structure.CharacterDataService
- Since:
- 24/04/24
- Version:
- ${version}
- Author:
- FlynnDynamics
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CharactergetCharacterData(long characterId, EveService eveService) Retrieves the full hierarchical data for a character based on the provided character ID.
-
Constructor Details
-
CharacterDataService
public CharacterDataService()
-
-
Method Details
-
getCharacterData
public static Character getCharacterData(long characterId, EveService eveService) throws IOException, InterruptedException Retrieves the full hierarchical data for a character based on the provided character ID. This method processes and combines various pieces of data such as character details, corporation history, and alliance history to construct a comprehensive Character object. It uses an external EveService instance for all data fetch operations, making the method flexible in different contexts where different implementations or instances of EveService might be used.- Parameters:
characterId- The unique identifier for the character whose data is to be fetched. This ID is used to retrieve character-specific details and histories.eveService- The EveService instance through which all API requests are made. This dependency is passed in to facilitate easier testing and modification of service behavior.- Returns:
- A fully populated Character object containing all relevant nested data structures (corporations and alliances included). The character data includes comprehensive details about the character's corporations and their respective alliances, with specific attention to special cases flagged in the 'snowflakes' dataset.
- Throws:
IOException- If there is a problem in network communication or interaction with the API endpoints provided by the EveService.InterruptedException- If the thread running the operation is interrupted, typically during asynchronous operations or waiting periods. The method iterates through each corporation and alliance history record, fetching additional details as required and constructing a rich object graph that reflects the character's history in the EVE Online universe. Special care is taken to handle non-player corporations and empty alliance records gracefully, skipping these to focus on significant historical records. Each corporation and alliance is checked against a special 'snowflakes' list to determine if it should be marked as special, which can affect how these entities are displayed or processed in the consuming application.
-