Package com.sap.cds.services
Interface CoreFactory
public interface CoreFactory
Factory to create various objects for API interfaces.
This class should never be used directly by application code and is only intended for internal usage in cds-services-api.
Applications rather should use the specific
create methods on the target interfaces.
The implementation of the factory is loaded via ExtendedServiceLoader and is therefore pluggable.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CoreFactoryThe instance loaded viaExtendedServiceLoader. -
Method Summary
Modifier and TypeMethodDescriptioncreateCdsRuntimeConfigurer(PropertiesProvider propertiesProvider) The factory method to create a newCdsRuntimeConfigurerwith the given properties.The factory method to create a newChangeSetContextAccessor.The factory method to create a newChangeSetContextSPI.createEventContext(String event, String entityName) The factory method to create a newEventContext.createFeatureTogglesInfo(List<FeatureToggle> featureToggles) Creates aFeatureTogglesInfoobject.createFeatureTogglesInfo(Map<String, Boolean> featureToggles) Creates aFeatureTogglesInfoobject.createMessage(Message.Severity severity, String text) Creates aMessageobject.createMessage(Message.Severity severity, String text, Message message) Creates aMessageobject.createMessage(String text, ServiceException exception) Creates aMessageobject.createParameterInfo(ParameterInfo parameterInfo) Creates aModifiableParameterInfobased on the passedParameterInfo.The factory method to create a newRequestContextAccessor.createService(String name) The factory method to create a newService.createService(String name, Service delegator) The factory method to create a newServiceExceptionUtils.createUserInfo(UserInfo userInfo) Creates aModifiableUserInfobased on the passedUserInfo.<S extends Service>
Sunboxed(S service) Removes an outbox wrapper from the given service.
-
Field Details
-
INSTANCE
The instance loaded viaExtendedServiceLoader.
-
-
Method Details
-
createEventContext
The factory method to create a newEventContext. Application code should useEventContext.create(String, String)instead.- Parameters:
event- the name of the evententityName- the name of the entity- Returns:
- the
EventContext
-
createService
The factory method to create a newService. Application code should useEventContext.create(String, String)instead.- Parameters:
name- the name of the service- Returns:
- the
Service
-
createService
The factory method to create a newServicewith a given delegatorService. This method is intended to be used only byServiceDelegator. -
createCdsRuntimeConfigurer
The factory method to create a newCdsRuntimeConfigurerwith the given properties. Application code should useCdsRuntimeConfigurer.create()orCdsRuntimeConfigurer.create(PropertiesProvider)instead.- Parameters:
propertiesProvider- thePropertiesProvider, may benull, which means a simplePropertiesProviderproviding defaultCdsPropertiesis used- Returns:
- the
CdsRuntimeConfigurer
-
createRequestContextAccessor
RequestContextAccessor createRequestContextAccessor()The factory method to create a newRequestContextAccessor. This method is intended to be used only byRequestContext.- Returns:
- the
RequestContextAccessor
-
createChangeSetContextAccessor
ChangeSetContextAccessor createChangeSetContextAccessor()The factory method to create a newChangeSetContextAccessor. This method is intended to be used only byChangeSetContext.- Returns:
- the
ChangeSetContextAccessor
-
createChangeSetContextSPI
ChangeSetContextSPI createChangeSetContextSPI()The factory method to create a newChangeSetContextSPI. Application code should useChangeSetContextSPI.open()instead.- Returns:
- the
ChangeSetContextSPI
-
createParameterInfo
Creates aModifiableParameterInfobased on the passedParameterInfo. IfparameterInfoisnull, aModifiableParameterInfobased on default values of a clearParameterInfois returned. Application code should useParameterInfo.create()orParameterInfo.copy()instead.- Parameters:
parameterInfo- TheParameterInfoas basis.- Returns:
- The created
ModifiableParameterInfoinstance.
-
createUserInfo
Creates aModifiableUserInfobased on the passedUserInfo. IfuserInfoisnull, aModifiableUserInfobased on default values of a clearUserInfois returned. Application code should useUserInfo.create()orUserInfo.copy()instead.- Parameters:
userInfo- TheUserInfoas basis.- Returns:
- The created
ModifiableUserInfoinstance.
-
createFeatureTogglesInfo
Creates aFeatureTogglesInfoobject. Application code should useFeatureTogglesInfo.create(List)instead.- Parameters:
featureToggles- AListof feature toggles- Returns:
- A
FeatureTogglesInfoobject containing all provided feature toggles in the stream
-
createFeatureTogglesInfo
Creates aFeatureTogglesInfoobject. Application code should useFeatureTogglesInfo.create(Map)instead.- Parameters:
featureToggles- AMapwhere the key is the feature name and the value indicates if the feature is enable or not- Returns:
- A
FeatureTogglesInfoobject containing the feature toggles created from the map entries
-
createServiceExceptionUtils
ServiceExceptionUtils createServiceExceptionUtils()The factory method to create a newServiceExceptionUtils. This method is intended to be used only byServiceException.- Returns:
- the
ServiceExceptionUtils
-
createMessage
Creates aMessageobject. Application code should useMessage.create(Severity, String)instead.- Parameters:
severity- theMessage.Severityof theMessagetext- the final text of the message- Returns:
- the
Message
-
createMessage
Creates aMessageobject. Application code should useMessage.create(String, ServiceException)instead.- Parameters:
text- the final text of the messageexception- theServiceExceptionto copy optional arguments from- Returns:
- the
Message
-
createMessage
Creates aMessageobject. Application code should useMessage.create(Severity, String, Message)instead.- Parameters:
severity- theMessage.Severityof theMessagetext- the final text of the messagemessage- theMessage- Returns:
- the
Message
-
unboxed
Removes an outbox wrapper from the given service. Application code should useOutboxService.unboxed(Service)instead.- Type Parameters:
S- the type of service- Parameters:
service- the service to unwrap from outbox wrapping- Returns:
- the underlying service of the outbox wrapped service.
-