Package org.apache.unomi.rest.endpoints
Class CampaignsServiceEndPoint
- java.lang.Object
-
- org.apache.unomi.rest.endpoints.CampaignsServiceEndPoint
-
-
Constructor Summary
Constructors Constructor Description CampaignsServiceEndPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Campaign
getCampaignDefinition(String campaignID)
Retrieves the campaign identified by the specified identifierCampaignDetail
getCampaignDetail(String campaignID)
Retrieves theCampaignDetail
associated with the campaign identified with the specified identifierPartialList<CampaignDetail>
getCampaignDetails(Query query)
Retrieves campaign details for campaigns matching the specified query.PartialList<CampaignEvent>
getCampaignEvents(Query query)
RetrievesCampaignEvent
s matching the specified query.Set<Metadata>
getCampaignMetadatas()
Retrieves the set of Metadata associated with existing campaigns.Set<Metadata>
getCampaignMetadatas(Query query)
Retrieves the set of Metadata associated with existing campaign matching the specifiedQuery
void
removeCampaignDefinition(String campaignID)
Removes the campaign associated with the specified identifier, also removing associated rules if needed.void
removeCampaignEventDefinition(String campaignEventID)
Removes the campaign event associated with the specified identifier.void
setCampaignDefinition(Campaign campaign)
Saves the specified campaign in the context server and creates associatedRule
s if the campaign is enabled.void
setCampaignEventDefinition(CampaignEvent campaignEvent)
Saves the specified campaign event in the context server.void
setGoalsService(GoalsService goalsService)
-
-
-
Method Detail
-
setGoalsService
public void setGoalsService(GoalsService goalsService)
-
getCampaignMetadatas
@GET @Path("/") public Set<Metadata> getCampaignMetadatas()
Retrieves the set of Metadata associated with existing campaigns.- Returns:
- the set of Metadata associated with existing campaigns
-
setCampaignDefinition
@POST @Path("/") public void setCampaignDefinition(Campaign campaign)
Saves the specified campaign in the context server and creates associatedRule
s if the campaign is enabled.- Parameters:
campaign
- the Campaign to be saved
-
getCampaignMetadatas
@POST @Path("/query") public Set<Metadata> getCampaignMetadatas(Query query)
Retrieves the set of Metadata associated with existing campaign matching the specifiedQuery
- Parameters:
query
- the Query used to filter the campagins which metadata we want to retrieve- Returns:
- the set of Metadata associated with existing campaigns matching the specified
Query
-
getCampaignDetails
@POST @Path("/query/detailed") public PartialList<CampaignDetail> getCampaignDetails(Query query)
Retrieves campaign details for campaigns matching the specified query.- Parameters:
query
- the query specifying which campaigns to retrieve- Returns:
- a
PartialList
of campaign details for the campaigns matching the specified query
-
getCampaignDetail
@GET @Path("/{campaignID}/detailed") public CampaignDetail getCampaignDetail(@PathParam("campaignID") String campaignID)
Retrieves theCampaignDetail
associated with the campaign identified with the specified identifier- Parameters:
campaignID
- the identifier of the campaign for which we want to retrieve the details- Returns:
- the CampaignDetail for the campaign identified by the specified identifier or
null
if no such campaign exists
-
getCampaignDefinition
@GET @Path("/{campaignID}") public Campaign getCampaignDefinition(@PathParam("campaignID") String campaignID)
Retrieves the campaign identified by the specified identifier- Parameters:
campaignID
- the identifier of the campaign we want to retrieve- Returns:
- the campaign associated with the specified identifier or
null
if no such campaign exists
-
removeCampaignDefinition
@DELETE @Path("/{campaignID}") public void removeCampaignDefinition(@PathParam("campaignID") String campaignID)
Removes the campaign associated with the specified identifier, also removing associated rules if needed.- Parameters:
campaignID
- the identifier of the campaign to be removed
-
setCampaignEventDefinition
@POST @Path("/event") public void setCampaignEventDefinition(CampaignEvent campaignEvent)
Saves the specified campaign event in the context server.- Parameters:
campaignEvent
- the CampaignEvent to be saved
-
removeCampaignEventDefinition
@DELETE @Path("/event/{eventId}") public void removeCampaignEventDefinition(@PathParam("eventId") String campaignEventID)
Removes the campaign event associated with the specified identifier.- Parameters:
campaignEventID
- the identifier of the campaign event to be removed
-
getCampaignEvents
@POST @Path("/events/query") public PartialList<CampaignEvent> getCampaignEvents(Query query)
RetrievesCampaignEvent
s matching the specified query.- Parameters:
query
- the Query specifying which CampaignEvents to retrieve- Returns:
- a
PartialList
of campaign events matching the specified query
-
-