Package com.helger.photon.api
Interface IAPIRegistry
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
APIRegistry
public interface IAPIRegistry extends Serializable
Base interface for an API registry. It has a set ofAPIDescriptorinstances that it can invoke.- Since:
- 8.1.4
- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description com.helger.commons.collection.impl.ICommonsList<IAPIDescriptor>getAllAPIDescriptors()default InvokableAPIDescriptorgetAPIByPath(APIPath aPath)Find anInvokableAPIDescriptorthat matches the provided path.InvokableAPIDescriptorgetAPIByPath(APIPath aPath, IAPIPathAmbiguityResolver aAmbiguityResolver)Find anInvokableAPIDescriptorthat matches the provided path.voidregisterAPI(APIDescriptor aDescriptor)Register a new API descriptor.
-
-
-
Method Detail
-
registerAPI
void registerAPI(@Nonnull APIDescriptor aDescriptor)
Register a new API descriptor. It is the callers responsibility to ensure each API is only registered once.- Parameters:
aDescriptor- The descriptor to be registered. May not benull.
-
getAllAPIDescriptors
@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<IAPIDescriptor> getAllAPIDescriptors()
- Returns:
- A mutable list of all registered descriptors. Never
nullbut maybe empty.
-
getAPIByPath
@Nullable default InvokableAPIDescriptor getAPIByPath(@Nonnull APIPath aPath)
Find anInvokableAPIDescriptorthat matches the provided path.- Parameters:
aPath- The path to search. May not benull.- Returns:
nullif no matching invoker is registered meaning the path cannot be handled by this invoker.
-
getAPIByPath
@Nullable InvokableAPIDescriptor getAPIByPath(@Nonnull APIPath aPath, @Nonnull IAPIPathAmbiguityResolver aAmbiguityResolver)
Find anInvokableAPIDescriptorthat matches the provided path.- Parameters:
aPath- The path to search. May not benull.aAmbiguityResolver- The ambiguity resolver to be used. May not benull.- Returns:
nullif no matching invoker is registered meaning the path cannot be handled by this invoker.- Since:
- 8.1.4
-
-