Package com.moesif.api.controllers
Class APIController
java.lang.Object
com.moesif.api.controllers.BaseController
com.moesif.api.controllers.APIController
- All Implemented Interfaces:
IAPIController
-
Field Summary
Fields inherited from class com.moesif.api.controllers.BaseController
httpCallBack -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildEventModel(EventRequestModel eventRequestModel, EventResponseModel eventResponseModel, String userId, String companyId, String sessionToken, String apiVersion, Object metadata, String direction) intcalculateWeight(int sampleRate) voidcreateAction(ActionModel body) Send a single custom action to the API.voidcreateActionAsync(ActionModel body, APICallBack<HttpResponse> callBack) Send a single custom action to the API asynchronously.voidcreateActionsBatch(List<ActionModel> body) Send multiple custom actions to the API in a single batch.voidcreateActionsBatchAsync(List<ActionModel> body, APICallBack<HttpResponse> callBack) Send multiple custom actions to the API in a single batch asynchronously.createEvent(EventModel body) Add Single API Event CallvoidcreateEventAsync(EventModel body, APICallBack<HttpResponse> callBack) Add Single API Event CallcreateEventsBatch(List<EventModel> body) Add multiple API Events in a single batchvoidcreateEventsBatchAsync(List<EventModel> body, APICallBack<HttpResponse> callBack) Add multiple API Events in a single batchvoidcreateEventsBatchAsync(List<EventModel> body, APICallBack<HttpResponse> callBack, boolean useGzip) Add multiple API Events in a single batchGet the Application configvoidgetAppConfigAsync(APICallBack<HttpResponse> callBack) Get the Application config asyncgetBlockedByGovernanceRulesResponse(EventModel eventModel) getBlockedByGovernanceRulesResponse(EventModel eventModel, List<GovernanceRulesModel> rules, AppConfigModel appConfig) Get the Governance rulesvoidgetGovernanceRulesAsync(APICallBack<HttpResponse> callBack) Get the Governance rulesintgetSampleRateToUse(EventModel eventModel) intgetSampleRateToUse(EventModel eventModel, AppConfigModel appConfigModel) booleanisBlockedByGovernanceRules(EventModel eventModel) Deprecated.booleanisBlockedByGovernanceRules(EventModel eventModel, List<GovernanceRulesModel> rules, AppConfigModel appConfig) Deprecated.parseAppConfigModel(InputStream jsonTxt) parseGovernanceRulesModel(InputStream jsonTxt) voidsetHttpRequestRetryHandler(org.apache.http.client.HttpRequestRetryHandler httpRequestRetryHandler) booleanshouldSendSampledEvent(EventModel eventModel) voidupdateCompaniesBatch(List<CompanyModel> body) Update multiple Companies in a single batchvoidupdateCompaniesBatchAsync(List<CompanyModel> body, APICallBack<HttpResponse> callBack) Update multiple Companies in a single batch asyncvoidupdateCompany(CompanyModel body) Update a Single CompanyvoidupdateCompanyAsync(CompanyModel body, APICallBack<HttpResponse> callBack) Update a Single Company asyncvoidUpdate a Single SubscriptionvoidupdateSubscriptionAsync(SubscriptionModel body, APICallBack<HttpResponse> callBack) Update a Single Subscription asyncvoidUpdate multiple Subscriptions in a single batchvoidupdateSubscriptionsBatchAsync(List<SubscriptionModel> body, APICallBack<HttpResponse> callBack) Update multiple Subscriptions in a single batch asyncvoidupdateUser(UserModel body) Update a Single UservoidupdateUserAsync(UserModel body, APICallBack<HttpResponse> callBack) Update a Single User asyncvoidupdateUsersBatch(List<UserModel> body) Update multiple Users in a single batchvoidupdateUsersBatchAsync(List<UserModel> body, APICallBack<HttpResponse> callBack) Update multiple Users in a single batch asyncMethods inherited from class com.moesif.api.controllers.BaseController
getClientInstance, getHttpCallBack, setClientInstance, setHttpCallBack, validateResponse
-
Constructor Details
-
APIController
-
-
Method Details
-
setHttpRequestRetryHandler
public void setHttpRequestRetryHandler(org.apache.http.client.HttpRequestRetryHandler httpRequestRetryHandler) -
createEvent
Add Single API Event Call- Specified by:
createEventin interfaceIAPIController- Parameters:
body- The event to create- Throws:
Throwable- on error creating event
-
createEventAsync
public void createEventAsync(EventModel body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Add Single API Event Call- Specified by:
createEventAsyncin interfaceIAPIController- Parameters:
body- The event to createcallBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error creating event
-
createEventsBatch
Add multiple API Events in a single batch- Specified by:
createEventsBatchin interfaceIAPIController- Parameters:
body- The events to create- Throws:
Throwable- on error creating event
-
createEventsBatchAsync
public void createEventsBatchAsync(List<EventModel> body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Description copied from interface:IAPIControllerAdd multiple API Events in a single batch- Specified by:
createEventsBatchAsyncin interfaceIAPIController- Parameters:
body- The events to createcallBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error creating event
-
createEventsBatchAsync
public void createEventsBatchAsync(List<EventModel> body, APICallBack<HttpResponse> callBack, boolean useGzip) throws com.fasterxml.jackson.core.JsonProcessingException Add multiple API Events in a single batch- Specified by:
createEventsBatchAsyncin interfaceIAPIController- Parameters:
body- The events to createcallBack- Called after the HTTP response is receiveduseGzip- Option to convert body to gzip type- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error creating event
-
createAction
Send a single custom action to the API.- Parameters:
body- The ActionModel object to send.- Throws:
Throwable- if an error occurs during the API call.
-
createActionAsync
public void createActionAsync(ActionModel body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Send a single custom action to the API asynchronously.- Parameters:
body- The ActionModel object to send.callBack- Called after the HTTP response is received.- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if an error occurs during serialization.
-
createActionsBatch
Send multiple custom actions to the API in a single batch.- Parameters:
body- The list of ActionModel objects to send.- Throws:
Throwable- if an error occurs during the API call.
-
createActionsBatchAsync
public void createActionsBatchAsync(List<ActionModel> body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Send multiple custom actions to the API in a single batch asynchronously.- Parameters:
body- The list of ActionModel objects to send.callBack- Called after the HTTP response is received.- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if an error occurs during serialization.
-
updateUser
Update a Single User- Specified by:
updateUserin interfaceIAPIController- Parameters:
body- The user to update- Throws:
Throwable- on error updating user
-
updateUserAsync
public void updateUserAsync(UserModel body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Update a Single User async- Specified by:
updateUserAsyncin interfaceIAPIController- Parameters:
body- The user to updatecallBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error updating user
-
updateUsersBatch
Update multiple Users in a single batch- Specified by:
updateUsersBatchin interfaceIAPIController- Parameters:
body- The list of users to update- Throws:
Throwable- on error updating users
-
updateUsersBatchAsync
public void updateUsersBatchAsync(List<UserModel> body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Update multiple Users in a single batch async- Specified by:
updateUsersBatchAsyncin interfaceIAPIController- Parameters:
body- The list of users to updatecallBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error updating users
-
updateCompany
Update a Single Company- Specified by:
updateCompanyin interfaceIAPIController- Parameters:
body- The company to update- Throws:
Throwable- on error updating a company
-
updateCompanyAsync
public void updateCompanyAsync(CompanyModel body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Update a Single Company async- Specified by:
updateCompanyAsyncin interfaceIAPIController- Parameters:
body- The company to updatecallBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error updating a company
-
updateCompaniesBatch
Update multiple Companies in a single batch- Specified by:
updateCompaniesBatchin interfaceIAPIController- Parameters:
body- The list of companies to update- Throws:
Throwable- on error updating companies
-
updateCompaniesBatchAsync
public void updateCompaniesBatchAsync(List<CompanyModel> body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Update multiple Companies in a single batch async- Specified by:
updateCompaniesBatchAsyncin interfaceIAPIController- Parameters:
body- The list of companies to updatecallBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error updating companies
-
updateSubscription
Update a Single Subscription- Specified by:
updateSubscriptionin interfaceIAPIController- Parameters:
body- The subscriptuon to update- Throws:
Throwable- on error creating event
-
updateSubscriptionAsync
public void updateSubscriptionAsync(SubscriptionModel body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Update a Single Subscription async- Specified by:
updateSubscriptionAsyncin interfaceIAPIController- Parameters:
body- The subscription to updatecallBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error creating event
-
updateSubscriptionsBatch
Update multiple Subscriptions in a single batch- Specified by:
updateSubscriptionsBatchin interfaceIAPIController- Parameters:
body- The list of subscriptions to update- Throws:
Throwable- on error creating event
-
updateSubscriptionsBatchAsync
public void updateSubscriptionsBatchAsync(List<SubscriptionModel> body, APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Update multiple Subscriptions in a single batch async- Specified by:
updateSubscriptionsBatchAsyncin interfaceIAPIController- Parameters:
body- The list of subscriptions to updatecallBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error creating event
-
getAppConfig
Get the Application config- Specified by:
getAppConfigin interfaceIAPIController- Throws:
Throwable- on error getting app config
-
getAppConfigAsync
public void getAppConfigAsync(APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Get the Application config async- Specified by:
getAppConfigAsyncin interfaceIAPIController- Parameters:
callBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error getting app config
-
getGovernanceRules
Get the Governance rules- Specified by:
getGovernanceRulesin interfaceIAPIController- Throws:
Throwable- on error getting app config
-
getGovernanceRulesAsync
public void getGovernanceRulesAsync(APICallBack<HttpResponse> callBack) throws com.fasterxml.jackson.core.JsonProcessingException Get the Governance rules- Specified by:
getGovernanceRulesAsyncin interfaceIAPIController- Parameters:
callBack- Called after the HTTP response is received- Throws:
com.fasterxml.jackson.core.JsonProcessingException- on error getting app config
-
parseGovernanceRulesModel
- Throws:
IOException
-
parseAppConfigModel
- Throws:
IOException
-
getDefaultAppConfig
-
calculateWeight
public int calculateWeight(int sampleRate) -
buildEventModel
public EventModel buildEventModel(EventRequestModel eventRequestModel, EventResponseModel eventResponseModel, String userId, String companyId, String sessionToken, String apiVersion, Object metadata, String direction) -
isBlockedByGovernanceRules
Deprecated. -
getBlockedByGovernanceRulesResponse
-
getBlockedByGovernanceRulesResponse
public BlockedByGovernanceRulesResponse getBlockedByGovernanceRulesResponse(EventModel eventModel, List<GovernanceRulesModel> rules, AppConfigModel appConfig) -
isBlockedByGovernanceRules
@Deprecated public boolean isBlockedByGovernanceRules(EventModel eventModel, List<GovernanceRulesModel> rules, AppConfigModel appConfig) Deprecated. -
shouldSendSampledEvent
-
getSampleRateToUse
-
getSampleRateToUse
-