Class CampaignsServiceEndPoint

java.lang.Object
org.apache.unomi.rest.endpoints.CampaignsServiceEndPoint

@Produces("application/json") @Consumes("application/json") @Path("/campaigns") public class CampaignsServiceEndPoint extends Object
A JAX-RS endpoint to manage Campaigns and related information.
  • Constructor Details

    • CampaignsServiceEndPoint

      public CampaignsServiceEndPoint()
  • Method Details

    • 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 associated Rules 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 specified Query
      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 the CampaignDetail 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)
      Retrieves CampaignEvents matching the specified query.
      Parameters:
      query - the Query specifying which CampaignEvents to retrieve
      Returns:
      a PartialList of campaign events matching the specified query