Class SymbolRegistryService
java.lang.Object
com.bluebell.greenhouse.radicle.services.symbol.SymbolRegistryService
Service-layer abstraction for reading and writing symbol registry data on disk.
- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
ConstructorsConstructorDescriptionSymbolRegistryService(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Path symbolRegistryPath) Creates a service backed by the configured on-disk symbol registry. -
Method Summary
Modifier and TypeMethodDescriptionaddAliasToEntry(String ticker, String exchangeMic, SymbolType type, SymbolRegistryAliasEntry alias) Adds an alias to the existingSymbolRegistryEntrymatching the given symbol identity.createEntry(SymbolRegistryEntry entry) Creates a newSymbolRegistryEntryin the symbol registry.deleteAliasFromEntry(String ticker, String exchangeMic, SymbolType type, SymbolRegistryAliasEntry alias) Deletes an alias from the existingSymbolRegistryEntrymatching the given symbol identity.Deletes the existingSymbolRegistryEntryfor the given UUID.deleteEntryByTicker(String ticker) Deletes the existingSymbolRegistryEntryfor the given ticker.byte[]Exports the raw symbol registry JSON file as stored on disk.getAliasesForEntry(String ticker, String exchangeMic, SymbolType type) Returns the aliases for the existingSymbolRegistryEntrymatching the given symbol identity.getEntriesForCategory(String category) Returns aListofSymbolRegistryEntrys for the given category.getEntryById(String id) Returns aSymbolRegistryEntryfor the given UUID.getEntryByTicker(String ticker) Returns aSymbolRegistryEntryfor the given ticker.getEntryByTicker(String ticker, String exchangeMic, SymbolType type) Returns aSymbolRegistryEntryfor the given composite symbol identity.replaceAliasesForEntry(String ticker, String exchangeMic, SymbolType type, List<SymbolRegistryAliasEntry> aliases) Replaces the aliases for the existingSymbolRegistryEntrymatching the given symbol identity.replaceEntriesForCategory(String category, List<SymbolRegistryEntry> entries) Replaces all entries for the given category.final voidresolveDuplicates(List<SymbolRegistryEntry> entries) Resolves duplicate registry entries using curated cleanup rules.searchEntries(SymbolRegistryEntryFilter filter, SymbolRegistryEntrySortField sortField, org.springframework.data.domain.Sort.Direction direction) Returns a filtered and sortedListofSymbolRegistryEntrys.updateAliasForEntry(String ticker, String exchangeMic, SymbolType type, SymbolRegistryAliasEntry existingAlias, SymbolRegistryAliasEntry replacementAlias) Updates an alias on the existingSymbolRegistryEntrymatching the given symbol identity.updateEntry(String ticker, SymbolRegistryEntry entry) Updates the existingSymbolRegistryEntryfor the given ticker.updateEntryById(String id, SymbolRegistryEntry entry) Updates the existingSymbolRegistryEntryfor the given UUID.
-
Constructor Details
-
SymbolRegistryService
@Autowired public SymbolRegistryService(com.fasterxml.jackson.databind.ObjectMapper objectMapper, @Qualifier("symbolRegistryPath") Path symbolRegistryPath) Creates a service backed by the configured on-disk symbol registry.- Parameters:
objectMapper- sharedObjectMappersymbolRegistryPath- symbol registryPath
-
-
Method Details
-
getEntriesForCategory
Returns aListofSymbolRegistryEntrys for the given category.- Parameters:
category- category- Returns:
ListofSymbolRegistryEntrys
-
getEntryByTicker
Returns aSymbolRegistryEntryfor the given ticker.- Parameters:
ticker- ticker- Returns:
SymbolRegistryEntry
-
getEntryByTicker
Returns aSymbolRegistryEntryfor the given composite symbol identity.- Parameters:
ticker- tickerexchangeMic- exchange MICtype-SymbolType- Returns:
SymbolRegistryEntry
-
getEntryById
Returns aSymbolRegistryEntryfor the given UUID.- Parameters:
id- registry UUID- Returns:
SymbolRegistryEntry
-
createEntry
Creates a newSymbolRegistryEntryin the symbol registry.- Parameters:
entry-SymbolRegistryEntry- Returns:
- created
SymbolRegistryEntry
-
updateEntry
Updates the existingSymbolRegistryEntryfor the given ticker.- Parameters:
ticker- ticker to updateentry- replacementSymbolRegistryEntry- Returns:
- updated
SymbolRegistryEntry
-
updateEntryById
Updates the existingSymbolRegistryEntryfor the given UUID.- Parameters:
id- registry UUID to updateentry- replacementSymbolRegistryEntry- Returns:
- updated
SymbolRegistryEntry
-
deleteEntryByTicker
Deletes the existingSymbolRegistryEntryfor the given ticker.- Parameters:
ticker- ticker to delete- Returns:
- deleted
SymbolRegistryEntry
-
deleteEntryById
Deletes the existingSymbolRegistryEntryfor the given UUID.- Parameters:
id- registry UUID to delete- Returns:
- deleted
SymbolRegistryEntry
-
getAliasesForEntry
public List<SymbolRegistryAliasEntry> getAliasesForEntry(String ticker, String exchangeMic, SymbolType type) Returns the aliases for the existingSymbolRegistryEntrymatching the given symbol identity.- Parameters:
ticker- tickerexchangeMic- exchange MICtype-SymbolType- Returns:
ListofSymbolRegistryAliasEntry
-
addAliasToEntry
public SymbolRegistryAliasEntry addAliasToEntry(String ticker, String exchangeMic, SymbolType type, SymbolRegistryAliasEntry alias) Adds an alias to the existingSymbolRegistryEntrymatching the given symbol identity.- Parameters:
ticker- tickerexchangeMic- exchange MICtype-SymbolTypealias-SymbolRegistryAliasEntry- Returns:
- added
SymbolRegistryAliasEntry
-
updateAliasForEntry
public SymbolRegistryAliasEntry updateAliasForEntry(String ticker, String exchangeMic, SymbolType type, SymbolRegistryAliasEntry existingAlias, SymbolRegistryAliasEntry replacementAlias) Updates an alias on the existingSymbolRegistryEntrymatching the given symbol identity.- Parameters:
ticker- tickerexchangeMic- exchange MICtype-SymbolTypeexistingAlias- alias to replacereplacementAlias- replacement alias- Returns:
- updated
SymbolRegistryAliasEntry
-
deleteAliasFromEntry
public SymbolRegistryAliasEntry deleteAliasFromEntry(String ticker, String exchangeMic, SymbolType type, SymbolRegistryAliasEntry alias) Deletes an alias from the existingSymbolRegistryEntrymatching the given symbol identity.- Parameters:
ticker- tickerexchangeMic- exchange MICtype-SymbolTypealias-SymbolRegistryAliasEntry- Returns:
- deleted
SymbolRegistryAliasEntry
-
replaceAliasesForEntry
public List<SymbolRegistryAliasEntry> replaceAliasesForEntry(String ticker, String exchangeMic, SymbolType type, List<SymbolRegistryAliasEntry> aliases) Replaces the aliases for the existingSymbolRegistryEntrymatching the given symbol identity.- Parameters:
ticker- tickerexchangeMic- exchange MICtype-SymbolTypealiases- replacement aliases- Returns:
- normalized
ListofSymbolRegistryAliasEntry
-
replaceEntriesForCategory
public List<SymbolRegistryEntry> replaceEntriesForCategory(String category, List<SymbolRegistryEntry> entries) Replaces all entries for the given category.- Parameters:
category- categoryentries- replacementListofSymbolRegistryEntry- Returns:
- normalized
ListofSymbolRegistryEntry
-
searchEntries
public List<SymbolRegistryEntry> searchEntries(SymbolRegistryEntryFilter filter, SymbolRegistryEntrySortField sortField, org.springframework.data.domain.Sort.Direction direction) Returns a filtered and sortedListofSymbolRegistryEntrys.- Parameters:
filter- optionalSymbolRegistryEntryFiltersortField- optionalSymbolRegistryEntrySortFielddirection- optionalSort.Direction- Returns:
ListofSymbolRegistryEntry
-
resolveDuplicates
Resolves duplicate registry entries using curated cleanup rules.- Parameters:
entries- duplicate entries
-
exportSymbolRegistry
public byte[] exportSymbolRegistry()Exports the raw symbol registry JSON file as stored on disk.- Returns:
- raw symbol registry bytes
-