http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/Tag.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/Tag.java b/api/src/main/java/org/oasis_open/contextserver/api/Tag.java deleted file mode 100644 index 2a4b58a..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/Tag.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlTransient; -import java.util.Set; -import java.util.TreeSet; - -/** - * A tag to help categorize entities. A tag can have sub-tags. - */ -public class Tag implements PluginType, Comparable<Tag> { - - private Set<Tag> subTags = new TreeSet<>(); - private String id; - private String nameKey; - private String descriptionKey; - private String parentId; - private double rank = 0.0; - private long pluginId; - private boolean hidden = false; - - /** - * Instantiates a new Tag. - */ - public Tag() { - } - - /** - * Instantiates a new Tag. - * - * @param id the identifier - * @param nameKey the {@link java.util.ResourceBundle} key used to localize this Tag's name - * @param descriptionKey the {@link java.util.ResourceBundle} key used to localize this Tag's description - * @param parentId the identifier of this Tag's parent Tag - */ - public Tag(String id, String nameKey, String descriptionKey, String parentId) { - this.id = id; - this.nameKey = nameKey; - this.descriptionKey = descriptionKey; - this.parentId = parentId; - } - - /** - * Retrieves this Tag's identifier. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Retrieves the {@link java.util.ResourceBundle} key used to localize this Tag's name. - * - * @return the {@link java.util.ResourceBundle} key used to localize this Tag's name - */ - public String getNameKey() { - if (nameKey == null) { - nameKey = "tag." + id + ".name"; - } - return nameKey; - } - - /** - * Retrieves the {@link java.util.ResourceBundle} key used to localize this Tag's description. - * - * @return the {@link java.util.ResourceBundle} key used to localize this Tag's name - */ - public String getDescriptionKey() { - if (descriptionKey == null) { - descriptionKey = "tag." + id + ".description"; - } - return descriptionKey; - } - - /** - * Retrieves the identifier of this Tag's parent Tag. - * - * @return the identifier of this Tag's parent Tag - */ - @XmlElement(name = "parent") - public String getParentId() { - return parentId; - } - - /** - * Retrieves the sub tags. - * - * @return the sub tags - */ - public Set<Tag> getSubTags() { - return subTags; - } - - /** - * Sets the sub tags. - * - * @param subTags the sub tags - */ - public void setSubTags(Set<Tag> subTags) { - this.subTags = subTags; - } - - /** - * Retrieves the rank of this PropertyType for ordering purpose. - * - * @return the rank of this PropertyType for ordering purpose - */ - public double getRank() { - return rank; - } - - /** - * Specifies the rank of this PropertyType for ordering purpose. - * - * @param rank the rank of this PropertyType for ordering purpose - */ - public void setRank(double rank) { - this.rank = rank; - } - - /** - * Whether this Tag is considered for internal purposes only and should therefore be hidden to accessing UIs. - * - * @return {@code true} if the Tag needs to be hidden, {@code false} otherwise - */ - public boolean isHidden() { - return hidden; - } - - /** - * Specifies whether this Tag is hidden. - * - * @param hidden {@code true} if the Tag needs to be hidden, {@code false} otherwise - */ - public void setHidden(boolean hidden) { - this.hidden = hidden; - } - - @XmlTransient - public long getPluginId() { - return pluginId; - } - - public void setPluginId(long pluginId) { - this.pluginId = pluginId; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Tag that = (Tag) o; - - if (id != null ? !id.equals(that.id) : that.id != null) return false; - - return true; - } - - @Override - public int hashCode() { - int result = id != null ? id.hashCode() : 0; - return result; - } - - public int compareTo(Tag otherRank) { - int rankCompare = Double.compare(rank, otherRank.rank); - if (rankCompare != 0) { - return rankCompare; - } - return id.compareTo(otherRank.id); - } -}
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/TimestampedItem.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/TimestampedItem.java b/api/src/main/java/org/oasis_open/contextserver/api/TimestampedItem.java deleted file mode 100644 index 9c859d6..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/TimestampedItem.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api; - -import java.util.Date; - -/** - * A context-server entity that is timestamped. - */ -public interface TimestampedItem { - /** - * Retrieves the associated timestamp. - * - * @return the associated timestamp - */ - Date getTimeStamp(); -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/ValueType.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/ValueType.java b/api/src/main/java/org/oasis_open/contextserver/api/ValueType.java deleted file mode 100644 index 9bf0e72..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/ValueType.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import java.util.LinkedHashSet; -import java.util.Set; -import java.util.TreeSet; - -/** - * A value type to be used to constrain property values. - */ -@XmlRootElement -public class ValueType implements PluginType { - - private String id; - private String nameKey; - private String descriptionKey; - private long pluginId; - private Set<Tag> tags = new TreeSet<>(); - private Set<String> tagIds = new LinkedHashSet<>(); - - /** - * Instantiates a new Value type. - */ - public ValueType() { - } - - /** - * Instantiates a new Value type with the specified identifier. - * - * @param id the identifier - */ - public ValueType(String id) { - this.id = id; - } - - /** - * Retrieves this ValueType's identifier. - * - * @return this ValueType's identifier - */ - public String getId() { - return id; - } - - /** - * Sets this ValueType's identifier. - * - * @param id this ValueType's identifier - */ - public void setId(String id) { - this.id = id; - } - - /** - * Retrieves the {@link java.util.ResourceBundle} key used to localize this ValueType's name. - * - * @return the {@link java.util.ResourceBundle} key used to localize this ValueType's name - */ - public String getNameKey() { - if (nameKey == null) { - nameKey = "type." + id; - } - return nameKey; - } - - /** - * Sets the name key. - * - * @param nameKey the name key - */ - public void setNameKey(String nameKey) { - this.nameKey = nameKey; - } - - /** - * Retrieves the {@link java.util.ResourceBundle} key used to localize this ValueType's description. - * - * @return the {@link java.util.ResourceBundle} key used to localize this ValueType's name - */ - public String getDescriptionKey() { - if (descriptionKey == null) { - descriptionKey = "type." + id + ".description"; - } - return descriptionKey; - } - - /** - * Sets the description key. - * - * @param descriptionKey the description key - */ - public void setDescriptionKey(String descriptionKey) { - this.descriptionKey = descriptionKey; - } - - @XmlTransient - public long getPluginId() { - return pluginId; - } - - public void setPluginId(long pluginId) { - this.pluginId = pluginId; - } - - /** - * Retrieves the tags used by this ValueType. - * - * @return the tags used by this ValueType - */ - @XmlTransient - public Set<Tag> getTags() { - return tags; - } - - /** - * Sets the tags used by this ValueType. - * - * @param tags the tags used by this ValueType - */ - public void setTags(Set<Tag> tags) { - this.tags = tags; - } - - /** - * Retrieves the identifiers of the tags used by this ValueType. - * - * @return the identifiers of the tags used by this ValueType - */ - @XmlElement(name = "tags") - public Set<String> getTagIds() { - return tagIds; - } - - /** - * Sets the identifiers of the tags used by this ValueType. - * - * @param tagIds the identifiers of the tags used by this ValueType - */ - public void setTagIds(Set<String> tagIds) { - this.tagIds = tagIds; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ValueType valueType = (ValueType) o; - - if (!id.equals(valueType.id)) return false; - - return true; - } - - @Override - public int hashCode() { - return id.hashCode(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/actions/Action.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/actions/Action.java b/api/src/main/java/org/oasis_open/contextserver/api/actions/Action.java deleted file mode 100644 index 76c8fab..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/actions/Action.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.actions; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import java.util.HashMap; -import java.util.Map; - -/** - * An action that can be executed as a consequence of a {@link org.oasis_open.contextserver.api.rules.Rule} being triggered. An action is characterized by its associated {@link - * ActionType} and parameter values. - */ -@XmlRootElement -public class Action { - private ActionType actionType; - private String actionTypeId; - private Map<String, Object> parameterValues = new HashMap<>(); - - /** - * Instantiates a new Action. - */ - public Action() { - } - - /** - * Instantiates a new Action with the specified {@link ActionType} - * - * @param actionType the action's type - */ - public Action(ActionType actionType) { - setActionType(actionType); - } - - /** - * Retrieves the action's type. - * - * @return the action's type - */ - @XmlTransient - public ActionType getActionType() { - return actionType; - } - - /** - * Sets the action's type. - * - * @param actionType the action's type - */ - public void setActionType(ActionType actionType) { - this.actionType = actionType; - this.actionTypeId = actionType.getId(); - } - - /** - * Retrieves the identifier of the associated action type. - * - * @return the identifier of the associated action type - */ - @XmlElement(name = "type") - public String getActionTypeId() { - return actionTypeId; - } - - /** - * Sets the identifier of the associated action type. - * - * @param actionTypeId the identifier of the associated action type - */ - public void setActionTypeId(String actionTypeId) { - this.actionTypeId = actionTypeId; - } - - /** - * Retrieves the parameter values as a Map of parameter name - associated value pairs. - * - * @return a Map of parameter name - associated value pairs - */ - public Map<String, Object> getParameterValues() { - return parameterValues; - } - - /** - * Sets the parameter identified by the specified name to the specified value. If a parameter with that name already exists, replaces its value, otherwise adds the new - * parameter with the specified name and value. - * - * @param name the name of the parameter to set - * @param value the value of the parameter - */ - public void setParameter(String name, Object value) { - parameterValues.put(name, value); - } - - /** - * Sets the parameter values as a Map of parameter name - associated value pairs. - * - * @param parameterValues the parameter values as a Map of parameter name - associated value pairs - */ - public void setParameterValues(Map<String, Object> parameterValues) { - this.parameterValues = parameterValues; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionExecutor.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionExecutor.java b/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionExecutor.java deleted file mode 100644 index de5209d..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionExecutor.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.actions; - -import org.oasis_open.contextserver.api.Event; - -/** - * A piece of code that performs a specified {@link Action}, given a triggering {@link Event} - */ -public interface ActionExecutor { - - /** - * Executes a specified {@link Action}, given a triggering {@link Event}. - * - * @param action the {@link Action} to execute - * @param event the {@link Event} that triggered the action - * @return an integer status corresponding to what happened as defined by public constants of {@link org.oasis_open.contextserver.api.services.EventService} - */ - int execute(Action action, Event event); - -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionPostExecutor.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionPostExecutor.java b/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionPostExecutor.java deleted file mode 100644 index 2737aaf..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionPostExecutor.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.actions; - -import org.oasis_open.contextserver.api.rules.Rule; - -/** - * An action to be executed after all {@link Rule}-derived have been processed. - */ -public interface ActionPostExecutor { - /** - * Performs the action. - * - * @return {@code true} if the operation succeeded, {@code false} otherwise - */ - boolean execute(); -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionType.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionType.java b/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionType.java deleted file mode 100644 index b093d6b..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/actions/ActionType.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.actions; - -import org.oasis_open.contextserver.api.Parameter; -import org.oasis_open.contextserver.api.PluginType; -import org.oasis_open.contextserver.api.Tag; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlTransient; -import java.io.Serializable; -import java.util.*; - -/** - * A type definition for {@link Action}s. - */ -public class ActionType implements PluginType, Serializable { - - private static final long serialVersionUID = -3522958600710010934L; - private String id; - private String nameKey; - private String descriptionKey; - private String actionExecutor; - private Set<Tag> tags = new TreeSet<Tag>(); - private Set<String> tagIds = new LinkedHashSet<String>(); - private long pluginId; - private List<Parameter> parameters = new ArrayList<Parameter>(); - - /** - * Instantiates a new Action type. - */ - public ActionType() { - } - - /** - * Instantiates a new Action type. - * - * @param id the id - * @param nameKey the name key - */ - public ActionType(String id, String nameKey) { - this.id = id; - this.nameKey = nameKey; - } - - /** - * Retrieves the id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Retrieves the {@link java.util.ResourceBundle} key used to localize this ActionType's name. - * - * @return the {@link java.util.ResourceBundle} key used to localize this ActionType's name - */ - public String getNameKey() { - if (nameKey == null) { - nameKey = "action." + id + ".name"; - } - return nameKey; - } - - /** - * Sets the name key. - * - * @param nameKey the name key - */ - public void setNameKey(String nameKey) { - this.nameKey = nameKey; - } - - /** - * Retrieves the {@link java.util.ResourceBundle} key used to localize this ActionType's description. - * - * @return the {@link java.util.ResourceBundle} key used to localize this ActionType's name - */ - public String getDescriptionKey() { - if (descriptionKey == null) { - descriptionKey = "action." + id + ".description"; - } - return descriptionKey; - } - - /** - * Sets the description key. - * - * @param descriptionKey the description key - */ - public void setDescriptionKey(String descriptionKey) { - this.descriptionKey = descriptionKey; - } - - @XmlTransient - public long getPluginId() { - return pluginId; - } - - public void setPluginId(long pluginId) { - this.pluginId = pluginId; - } - - /** - * Retrieves the action executor. - * - * @return the action executor - */ - public String getActionExecutor() { - return actionExecutor; - } - - /** - * Sets the action executor. - * - * @param actionExecutor the action executor - */ - public void setActionExecutor(String actionExecutor) { - this.actionExecutor = actionExecutor; - } - - /** - * Retrieves the tags used by this ActionType. - * - * @return the tags used by this ActionType - */ - @XmlTransient - public Set<Tag> getTags() { - return tags; - } - - /** - * Sets the tags used by this ActionType. - * - * @param tags the tags used by this ActionType - */ - public void setTags(Set<Tag> tags) { - this.tags = tags; - } - - /** - * Retrieves the identifiers of the tags used by this ActionType. - * - * @return the identifiers of the tags used by this ActionType - */ - @XmlElement(name = "tags") - public Set<String> getTagIds() { - return tagIds; - } - - /** - * Sets the identifiers of the tags used by this ActionType. - * - * @param tagIds the identifiers of the tags used by this ActionType - */ - public void setTagIds(Set<String> tagIds) { - this.tagIds = tagIds; - } - - /** - * Retrieves the parameters. - * - * @return the parameters - */ - public List<Parameter> getParameters() { - return parameters; - } - - /** - * Sets the parameters. - * - * @param parameters the parameters - */ - public void setParameters(List<Parameter> parameters) { - this.parameters = parameters; - } - - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ActionType that = (ActionType) o; - - if (!id.equals(that.id)) return false; - - return true; - } - - @Override - public int hashCode() { - return id.hashCode(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/campaigns/Campaign.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/campaigns/Campaign.java b/api/src/main/java/org/oasis_open/contextserver/api/campaigns/Campaign.java deleted file mode 100644 index 0e7191d..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/campaigns/Campaign.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.campaigns; - -import org.oasis_open.contextserver.api.Item; -import org.oasis_open.contextserver.api.Metadata; -import org.oasis_open.contextserver.api.MetadataItem; -import org.oasis_open.contextserver.api.conditions.Condition; - -import java.util.Date; - -/** - * A goal-oriented, time-limited marketing operation that needs to be evaluated for return on investment performance by tracking the ratio of visits to conversions. - */ -public class Campaign extends MetadataItem { - private static final long serialVersionUID = -1829542196982959946L; - - /** - * The Campaign ITEM_TYPE. - * - * @see Item for a discussion of ITEM_TYPE - */ - public static final String ITEM_TYPE = "campaign"; - - private Date startDate; - - private Date endDate; - - private Condition entryCondition; - - private Double cost; - - private String currency; - - private String primaryGoal; - - private String timezone; - - /** - * Instantiates a new Campaign. - */ - public Campaign() { - } - - /** - * Instantiates a new Campaign with the specified metadata. - * - * @param metadata the metadata - */ - public Campaign(Metadata metadata) { - super(metadata); - } - - /** - * Retrieves the start date for this Campaign. - * - * @return the start date - */ - public Date getStartDate() { - return startDate; - } - - /** - * Sets the start date for this Campaign. - * - * @param startDate the start date - */ - public void setStartDate(Date startDate) { - this.startDate = startDate; - } - - /** - * Retrieves the end date for this Campaign. - * - * @return the end date - */ - public Date getEndDate() { - return endDate; - } - - /** - * Sets the end date for this Campaign. - * - * @param endDate the end date - */ - public void setEndDate(Date endDate) { - this.endDate = endDate; - } - - /** - * Retrieves the entry condition that must be satisfied for users to be considered as taking part of this Campaign. - * - * @return the entry condition that must be satisfied for users to be considered as taking part of this Campaign - */ - public Condition getEntryCondition() { - return entryCondition; - } - - /** - * Sets the entry condition that must be satisfied for users to be considered as taking part of this Campaign.. - * - * @param entryCondition the entry condition that must be satisfied for users to be considered as taking part of this Campaign - */ - public void setEntryCondition(Condition entryCondition) { - this.entryCondition = entryCondition; - } - - /** - * Retrieves the cost incurred by this Campaign. - * - * @return the cost incurred by this Campaign - */ - public Double getCost() { - return cost; - } - - /** - * Sets the cost incurred by this Campaign. - * - * @param cost the cost incurred by this Campaign - */ - public void setCost(Double cost) { - this.cost = cost; - } - - /** - * Retrieves the currency associated to the Campaign's cost. - * - * @return the currency associated to the Campaign's cost - */ - public String getCurrency() { - return currency; - } - - /** - * Sets the currency associated to the Campaign's cost. - * - * @param currency the currency associated to the Campaign's cost - */ - public void setCurrency(String currency) { - this.currency = currency; - } - - /** - * Retrieves the identifier for this Campaign's primary {@link org.oasis_open.contextserver.api.goals.Goal}. - * - * @return the identifier for this Campaign's primary {@link org.oasis_open.contextserver.api.goals.Goal} - */ - public String getPrimaryGoal() { - return primaryGoal; - } - - /** - * Sets the identifier for this Campaign's primary {@link org.oasis_open.contextserver.api.goals.Goal}. - * - * @param primaryGoal the identifier for this Campaign's primary {@link org.oasis_open.contextserver.api.goals.Goal} - */ - public void setPrimaryGoal(String primaryGoal) { - this.primaryGoal = primaryGoal; - } - - /** - * Retrieves the timezone associated with this Campaign's start and end dates. - * - * @return the timezone associated with this Campaign's start and end dates - */ - public String getTimezone() { - return timezone; - } - - /** - * Sets the timezone associated with this Campaign's start and end dates. - * - * @param timezone the timezone associated with this Campaign's start and end dates - */ - public void setTimezone(String timezone) { - this.timezone = timezone; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/campaigns/CampaignDetail.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/campaigns/CampaignDetail.java b/api/src/main/java/org/oasis_open/contextserver/api/campaigns/CampaignDetail.java deleted file mode 100644 index 8fc379b..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/campaigns/CampaignDetail.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.campaigns; - -/** - * Details about a {@link Campaign}. - * - * Created by kevan on 03/06/15. - */ -public class CampaignDetail { - private long engagedProfiles = 0; - private long campaignSessionViews = 0; - private long campaignSessionSuccess = 0; - private long numberOfGoals = 0; - private double conversionRate; - private Campaign campaign; - - /** - * Instantiates a new Campaign detail. - * - * @param campaign the campaign - */ - public CampaignDetail(Campaign campaign) { - this.campaign = campaign; - } - - /** - * Retrieves the number of engaged profiles. - * - * @return the number of engaged profiles - */ - public long getEngagedProfiles() { - return engagedProfiles; - } - - /** - * Sets the number of engaged profiles. - * - * @param engagedProfiles the number of engaged profiles - */ - public void setEngagedProfiles(long engagedProfiles) { - this.engagedProfiles = engagedProfiles; - } - - /** - * Retrieves the number of goals. - * - * @return the number of goals - */ - public long getNumberOfGoals() { - return numberOfGoals; - } - - /** - * Sets the number of goals. - * - * @param numberOfGoals the number of goals - */ - public void setNumberOfGoals(long numberOfGoals) { - this.numberOfGoals = numberOfGoals; - } - - /** - * Retrieves the conversion rate. - * - * @return the conversion rate - */ - public double getConversionRate() { - return conversionRate; - } - - /** - * Sets the conversion rate. - * - * @param conversionRate the conversion rate - */ - public void setConversionRate(double conversionRate) { - this.conversionRate = conversionRate; - } - - /** - * Retrieves the associated campaign. - * - * @return the associated campaign - */ - public Campaign getCampaign() { - return campaign; - } - - /** - * Sets the associated campaign. - * - * @param campaign the campaign - */ - public void setCampaign(Campaign campaign) { - this.campaign = campaign; - } - - /** - * Retrieves the number of campaign session views. - * - * @return the number of campaign session views - */ - public long getCampaignSessionViews() { - return campaignSessionViews; - } - - /** - * Sets the number of campaign session views. - * - * @param campaignSessionViews the number of campaign session views - */ - public void setCampaignSessionViews(long campaignSessionViews) { - this.campaignSessionViews = campaignSessionViews; - } - - /** - * Retrieves the number of campaign session successes. - * - * @return the number of campaign session successes - */ - public long getCampaignSessionSuccess() { - return campaignSessionSuccess; - } - - /** - * Sets the number of campaign session successes. - * - * @param campaignSessionSuccess the number of campaign session successes - */ - public void setCampaignSessionSuccess(long campaignSessionSuccess) { - this.campaignSessionSuccess = campaignSessionSuccess; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/campaigns/events/CampaignEvent.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/campaigns/events/CampaignEvent.java b/api/src/main/java/org/oasis_open/contextserver/api/campaigns/events/CampaignEvent.java deleted file mode 100644 index 6f0e857..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/campaigns/events/CampaignEvent.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.campaigns.events; - -import org.oasis_open.contextserver.api.Item; -import org.oasis_open.contextserver.api.Metadata; -import org.oasis_open.contextserver.api.MetadataItem; - -import java.util.Date; - -/** - * A specific campaign event to help analyzing your key performance indicators by marking specific dates during your campaign. - * - * @author : rincevent Created : 17/03/15 - */ -public class CampaignEvent extends MetadataItem { - /** - * The CampaignEvent ITEM_TYPE. - * - * @see Item for a discussion of ITEM_TYPE - */ - public static final String ITEM_TYPE = "campaignevent"; - private static final long serialVersionUID = -20151703L; - private Date eventDate; - private String campaignId; - private Double cost; - private String currency; - private String timezone; - - /** - * Instantiates a new Campaign event. - */ - public CampaignEvent() { - } - - /** - * Instantiates a new Campaign event with the specified metadata. - * - * @param metadata the metadata - */ - public CampaignEvent(Metadata metadata) { - super(metadata); - } - - /** - * Retrieves the cost associated with this campaign event. - * - * @return the cost associated with this campaign event - */ - public Double getCost() { - return cost; - } - - /** - * Sets the cost. - * - * @param cost the cost - */ - public void setCost(Double cost) { - this.cost = cost; - } - - /** - * Retrieves the currency. - * - * @return the currency - */ - public String getCurrency() { - return currency; - } - - /** - * Sets the currency. - * - * @param currency the currency - */ - public void setCurrency(String currency) { - this.currency = currency; - } - - /** - * Retrieves the event date. - * - * @return the event date - */ - public Date getEventDate() { - return eventDate; - } - - /** - * Sets the event date. - * - * @param eventDate the event date - */ - public void setEventDate(Date eventDate) { - this.eventDate = eventDate; - } - - /** - * Retrieves the identifier of the associated {@link org.oasis_open.contextserver.api.campaigns.Campaign}. - * - * @return the identifier of the associated {@link org.oasis_open.contextserver.api.campaigns.Campaign} - */ - public String getCampaignId() { - return campaignId; - } - - /** - * Sets the campaign id. - * - * @param campaignId the campaign id - */ - public void setCampaignId(String campaignId) { - this.campaignId = campaignId; - } - - /** - * Retrieves the timezone. - * - * @return the timezone - */ - public String getTimezone() { - return timezone; - } - - /** - * Sets the timezone. - * - * @param timezone the timezone - */ - public void setTimezone(String timezone) { - this.timezone = timezone; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/conditions/Condition.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/conditions/Condition.java b/api/src/main/java/org/oasis_open/contextserver/api/conditions/Condition.java deleted file mode 100644 index 03f5fc3..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/conditions/Condition.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.conditions; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import java.util.HashMap; -import java.util.Map; - -/** - * A set of elements that can be evaluated. - */ -@XmlRootElement -public class Condition { - - ConditionType conditionType; - String conditionTypeId; - Map<String, Object> parameterValues = new HashMap<String, Object>(); - - /** - * Instantiates a new Condition. - */ - public Condition() { - } - - /** - * Instantiates a new Condition with the specified {@link ConditionType}. - * - * @param conditionType the condition type - */ - public Condition(ConditionType conditionType) { - setConditionType(conditionType); - } - - /** - * Retrieves the associated condition type. - * - * @return the condition type - */ - @XmlTransient - public ConditionType getConditionType() { - return conditionType; - } - - /** - * Sets the condition type. - * - * @param conditionType the condition type - */ - public void setConditionType(ConditionType conditionType) { - this.conditionType = conditionType; - this.conditionTypeId = conditionType.getId(); - } - - /** - * Retrieves the identifier of the associated condition type. - * - * @return the identifier of the associated condition type - */ - @XmlElement(name="type") - public String getConditionTypeId() { - return conditionTypeId; - } - - /** - * Sets the identifier of the associated condition type. - * - * @param conditionTypeId the identifier of the associated condition type - */ - public void setConditionTypeId(String conditionTypeId) { - this.conditionTypeId = conditionTypeId; - } - - /** - * Retrieves a Map of all parameter name - value pairs for this condition. - * - * @return a Map of all parameter name - value pairs for this condition - */ - public Map<String, Object> getParameterValues() { - return parameterValues; - } - - /** - * Determines whether this condition contains the parameter identified by the specified name. - * - * @param name the name identifying the parameter whose existence we want to determine - * @return {@code true} if this condition contains a parameter with the specified name, {@code false} otherwise - */ - public boolean containsParameter(String name) { - return parameterValues.containsKey(name); - } - - /** - * Retrieves the parameter identified by the specified name. - * - * @param name the name of the parameter to retrieve - * @return the value of the specified parameter or {@code null} if no such parameter exists - */ - public Object getParameter(String name) { - return parameterValues.get(name); - } - - /** - * Sets the parameter identified by the specified name to the specified value. If a parameter with that name already exists, replaces its value, otherwise adds the new - * parameter with the specified name and value. - * - * @param name the name of the parameter to set - * @param value the value of the parameter - */ - public void setParameter(String name, Object value) { - parameterValues.put(name, value); - } - - /** - * Sets the parameter name - value pairs for this profile. - * - * @param parameterValues a Map containing the parameter name - value pairs for this profile - */ - public void setParameterValues(Map<String, Object> parameterValues) { - this.parameterValues = parameterValues; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Condition condition = (Condition) o; - - if (!conditionTypeId.equals(condition.conditionTypeId)) return false; - if (!parameterValues.equals(condition.parameterValues)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = conditionTypeId.hashCode(); - result = 31 * result + parameterValues.hashCode(); - return result; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/conditions/ConditionType.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/conditions/ConditionType.java b/api/src/main/java/org/oasis_open/contextserver/api/conditions/ConditionType.java deleted file mode 100644 index 789878d..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/conditions/ConditionType.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.conditions; - -import org.oasis_open.contextserver.api.Parameter; -import org.oasis_open.contextserver.api.PluginType; -import org.oasis_open.contextserver.api.Tag; -import org.oasis_open.contextserver.api.rules.Rule; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import java.io.Serializable; -import java.util.*; - -/** - * ConditionTypes define new conditions that can be applied to items (for example to decide whether a rule needs to be triggered or if a profile is considered as taking part in a - * campaign) or to perform queries against the stored unomi data. They may be implemented in Java when attempting to define a particularly complex test or one that can better be - * optimized by coding it. They may also be defined as combination of other conditions. A simple condition could be: âUser is maleâ, while a more generic condition with - * parameters may test whether a given property has a specific value: âUser property x has value yâ. - */ -@XmlRootElement -public class ConditionType implements PluginType, Serializable { - private static final long serialVersionUID = -6965481691241954968L; - private String id; - private String nameKey; - private String descriptionKey; - private long pluginId; - private String conditionEvaluator; - private String queryBuilder; - private Condition parentCondition; - private Set<Tag> tags = new TreeSet<Tag>(); - private Set<String> tagIDs = new LinkedHashSet<String>(); - private List<Parameter> parameters = new ArrayList<Parameter>(); - private Rule autoCreateRule; - - /** - * Instantiates a new Condition type. - */ - public ConditionType() { - } - - /** - * Instantiates a new Condition type with the specified identifier and . - * - * @param id the id - * @param nameKey the name key - */ - public ConditionType(String id, String nameKey) { - this.id = id; - this.nameKey = nameKey; - } - - /** - * Retrieves the id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Retrieves the name key. - * - * @return the name key - */ - public String getNameKey() { - if (nameKey == null) { - nameKey = "condition." + id + ".name"; - } - return nameKey; - } - - /** - * Sets the name key. - * - * @param nameKey the name key - */ - public void setNameKey(String nameKey) { - this.nameKey = nameKey; - } - - /** - * Retrieves the description key. - * - * @return the description key - */ - public String getDescriptionKey() { - if (descriptionKey == null) { - descriptionKey = "condition." + id + ".description"; - } - return descriptionKey; - } - - /** - * Sets the description key. - * - * @param descriptionKey the description key - */ - public void setDescriptionKey(String descriptionKey) { - this.descriptionKey = descriptionKey; - } - - @XmlTransient - public long getPluginId() { - return pluginId; - } - - public void setPluginId(long pluginId) { - this.pluginId = pluginId; - } - - /** - * Retrieves the condition evaluator. - * - * @return the condition evaluator - */ - public String getConditionEvaluator() { - return conditionEvaluator; - } - - /** - * Sets the condition evaluator. - * - * @param conditionEvaluator the condition evaluator - */ - public void setConditionEvaluator(String conditionEvaluator) { - this.conditionEvaluator = conditionEvaluator; - } - - /** - * Retrieves the query builder. - * - * @return the query builder - */ - public String getQueryBuilder() { - return queryBuilder; - } - - /** - * Sets the query builder. - * - * @param queryBuilder the query builder - */ - public void setQueryBuilder(String queryBuilder) { - this.queryBuilder = queryBuilder; - } - - /** - * Retrieves the parent condition. - * - * @return the parent condition - */ - public Condition getParentCondition() { - return parentCondition; - } - - /** - * Sets the parent condition. - * - * @param parentCondition the parent condition - */ - public void setParentCondition(Condition parentCondition) { - this.parentCondition = parentCondition; - } - - /** - * Retrieves the tags used by this PropertyType. - * - * @return the tags used by this PropertyType - */ - @XmlTransient - public Set<Tag> getTags() { - return tags; - } - - /** - * Sets the tags used by this PropertyType. - * - * @param tags the tags used by this PropertyType - */ - public void setTags(Set<Tag> tags) { - this.tags = tags; - } - - /** - * Retrieves the identifiers of the tags used by this PropertyType. - * - * @return the identifiers of the tags used by this PropertyType - */ - @XmlElement(name = "tags") - public Set<String> getTagIDs() { - return tagIDs; - } - - /** - * Sets the identifiers of the tags used by this PropertyType. - * - * @param tagIds the identifiers of the tags used by this PropertyType - */ - public void setTagIDs(Set<String> tagIds) { - this.tagIDs = tagIds; - } - - /** - * Retrieves the defined {@link Parameter}s for this ConditionType. - * - * @return a List of the defined {@link Parameter}s for this ConditionType - */ - @XmlElement(name = "parameters") - public List<Parameter> getParameters() { - return parameters; - } - - /** - * Sets the List of the defined {@link Parameter}s for this ConditionType. - * - * @param parameters a List of the defined {@link Parameter}s for this ConditionType - */ - public void setParameters(List<Parameter> parameters) { - this.parameters = parameters; - } - - /** - * Retrieves the auto create rule. - * - * @return the auto create rule - */ - public Rule getAutoCreateRule() { - return autoCreateRule; - } - - /** - * Sets the auto create rule. - * - * @param autoCreateRule the auto create rule - */ - public void setAutoCreateRule(Rule autoCreateRule) { - this.autoCreateRule = autoCreateRule; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ConditionType that = (ConditionType) o; - - if (!id.equals(that.id)) return false; - - return true; - } - - @Override - public int hashCode() { - return id.hashCode(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/ChoiceListInitializer.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/ChoiceListInitializer.java b/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/ChoiceListInitializer.java deleted file mode 100644 index c6cddd6..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/ChoiceListInitializer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.conditions.initializers; - -import java.util.List; - -/** - * An initializer for a list of options. - */ -public interface ChoiceListInitializer { - - /** - * Returns a list of options for this choice list. - * - * @param context a context object containing supporting information - * @return a list of options for this choice list - */ - List<ChoiceListValue> getValues(Object context); -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/ChoiceListValue.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/ChoiceListValue.java b/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/ChoiceListValue.java deleted file mode 100644 index f72a78b..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/ChoiceListValue.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.conditions.initializers; - -/** - * List option object for various choice lists. - */ -public class ChoiceListValue implements Cloneable { - - private String id; - - private String name; - - public ChoiceListValue(String id, String name) { - this.id = id; - this.name = name; - } - - public String getId() { - return id; - } - - public String getName() { - return name; - } - - /** - * Returns a cloned instance of this choice list value object with the name, set to the provided localized name. - * - * @param localizedName - * the localized name for this choice list value object - * @return a cloned instance of this choice list value object with the name, set to the provided localized name - */ - public ChoiceListValue localizedCopy(String localizedName) { - try { - ChoiceListValue clone = (ChoiceListValue) clone(); - clone.name = localizedName; - - return clone; - } catch (CloneNotSupportedException e) { - throw new IllegalArgumentException(e); - } - - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/I18nSupport.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/I18nSupport.java b/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/I18nSupport.java deleted file mode 100644 index 6e05193..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/conditions/initializers/I18nSupport.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.conditions.initializers; - -/** - * Marker interface implemented by a {@link ChoiceListInitializer} to indicate that its values have to be localized for rendering. - * - * @author Sergiy Shyrkov - */ -public interface I18nSupport { - -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/goals/Goal.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/goals/Goal.java b/api/src/main/java/org/oasis_open/contextserver/api/goals/Goal.java deleted file mode 100644 index 73d840f..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/goals/Goal.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.goals; - -import org.oasis_open.contextserver.api.Metadata; -import org.oasis_open.contextserver.api.MetadataItem; -import org.oasis_open.contextserver.api.campaigns.Campaign; -import org.oasis_open.contextserver.api.conditions.Condition; - -/** - * A tracked activity / action that can be accomplished by site (scope) visitors. These are tracked in general because they relate to specific business objectives or are - * relevant to measure site/scope performance. - * Goals can be defined at the scope level or in the context of a particular {@link Campaign}. Either types of goals behave exactly the same way with the exception of two - * notable differences: - * <ul> - * <li>duration: scope-level goals are considered until removed while campaign-level goals are only considered for the campaign duration - * <li>audience filtering: any visitor is considered for scope-level goals while campaign-level goals only consider visitors who match the campaign's conditions - * </ul> - */ -public class Goal extends MetadataItem { - private static final long serialVersionUID = 6131648013470949983L; - - public static final String ITEM_TYPE = "goal"; - - private Condition startEvent; - - private Condition targetEvent; - - private String campaignId; - - public Goal() { - } - - public Goal(Metadata metadata) { - super(metadata); - } - - /** - * Retrieves the {@link Condition} determining the goal's start event if any, used for more complex goals where an action has to be accomplished first before evaluating the - * success of the final goal (funnel goal for example). - * - * @return the condition associated with the start event for this goal or {@code null} if no such event exists - */ - public Condition getStartEvent() { - return startEvent; - } - - public void setStartEvent(Condition startEvent) { - this.startEvent = startEvent; - } - - /** - * Retrieves the {@link Condition} determining the target event which needs to occur to consider the goal accomplished. - * - * @return the condition associated with the event determining if the goal is reached or not - */ - public Condition getTargetEvent() { - return targetEvent; - } - - public void setTargetEvent(Condition targetEvent) { - this.targetEvent = targetEvent; - } - - /** - * Retrieves the identifier of the campaign this goal is part of, if any. - * - * @return the identifier of the campaign this goal is part of, or {@code null} if this goal is not part of any campaign - */ - public String getCampaignId() { - return campaignId; - } - - public void setCampaignId(String campaignId) { - this.campaignId = campaignId; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/goals/GoalReport.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/goals/GoalReport.java b/api/src/main/java/org/oasis_open/contextserver/api/goals/GoalReport.java deleted file mode 100644 index 7b93360..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/goals/GoalReport.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.goals; - -import java.io.Serializable; -import java.util.List; - -/** - * Report information about a {@link Goal}. - */ -public class GoalReport implements Serializable { - private static final long serialVersionUID = -9150361970326342064L; - private Stat globalStats; - private List<Stat> split; - - public GoalReport() { - } - - public Stat getGlobalStats() { - return globalStats; - } - - public void setGlobalStats(Stat globalStats) { - this.globalStats = globalStats; - } - - public List<Stat> getSplit() { - return split; - } - - public void setSplit(List<Stat> split) { - this.split = split; - } - - /** - * Statistics - */ - public static class Stat implements Serializable { - private static final long serialVersionUID = 4306277648074263098L; - private String key; - private long startCount; - private long targetCount; - private double conversionRate; - private double percentage; - - public Stat() { - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public long getStartCount() { - return startCount; - } - - public void setStartCount(long startCount) { - this.startCount = startCount; - } - - public long getTargetCount() { - return targetCount; - } - - public void setTargetCount(long targetCount) { - this.targetCount = targetCount; - } - - public double getConversionRate() { - return conversionRate; - } - - public void setConversionRate(double conversionRate) { - this.conversionRate = conversionRate; - } - - public double getPercentage() { - return percentage; - } - - public void setPercentage(double percentage) { - this.percentage = percentage; - } - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/query/Aggregate.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/query/Aggregate.java b/api/src/main/java/org/oasis_open/contextserver/api/query/Aggregate.java deleted file mode 100644 index 7df3b5f..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/query/Aggregate.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.query; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * A specification for an aggregate as part of {@link AggregateQuery}s - */ -public class Aggregate { - private String type; - private String property; - private Map<String, Object> parameters = new HashMap<>(); - private List<DateRange> dateRanges = new ArrayList<>(); - private List<NumericRange> numericRanges = new ArrayList<>(); - private List<IpRange> ipRanges = new ArrayList<>(); - - - public Aggregate() { - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Map<String, Object> getParameters() { - return parameters; - } - - public void setParameters(Map<String, Object> parameters) { - this.parameters = parameters; - } - - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public List<NumericRange> getNumericRanges() { - return numericRanges; - } - - public List<DateRange> getDateRanges() { - return dateRanges; - } - - public void setDateRanges(List<DateRange> dateRanges) { - this.dateRanges = dateRanges; - } - - public List<IpRange> ipRanges() { - return ipRanges; - } - - public void setIpRanges(List<IpRange> ipRanges) { - this.ipRanges = ipRanges; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/query/AggregateQuery.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/query/AggregateQuery.java b/api/src/main/java/org/oasis_open/contextserver/api/query/AggregateQuery.java deleted file mode 100644 index 008bad1..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/query/AggregateQuery.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.query; - -import org.oasis_open.contextserver.api.conditions.Condition; - -/** - * A query by aggregate: results matching the specified {@link Condition} are aggregated using a given {@link Aggregate} specification, creating buckets which cardinality is - * calculated. The results of the query are returned as Map associating the bucket key to the cardinality of its member. - */ -public class AggregateQuery { - private Aggregate aggregate; - private Condition condition; - - /** - * Instantiates a new Aggregate query. - */ - public AggregateQuery() { - } - - /** - * Instantiates a new Aggregate query with the specified {@link Aggregate}. - * - * @param aggregate the aggregate - */ - public AggregateQuery(Aggregate aggregate) { - this.aggregate = aggregate; - } - - /** - * Instantiates a new Aggregate query with the specified {@link Condition}. - * - * @param condition the condition - */ - public AggregateQuery(Condition condition) { - this.condition = condition; - } - - /** - * Instantiates a new Aggregate query with the specified {@link Aggregate} and {@link Condition} - * - * @param aggregate the aggregate - * @param condition the condition - */ - public AggregateQuery(Aggregate aggregate, Condition condition) { - this.aggregate = aggregate; - this.condition = condition; - } - - /** - * Retrieves the aggregate. - * - * @return the aggregate - */ - public Aggregate getAggregate() { - return aggregate; - } - - /** - * Sets the aggregate. - * - * @param aggregate the aggregate - */ - public void setAggregate(Aggregate aggregate) { - this.aggregate = aggregate; - } - - /** - * Retrieves the condition. - * - * @return the condition - */ - public Condition getCondition() { - return condition; - } - - /** - * Sets the condition. - * - * @param condition the condition - */ - public void setCondition(Condition condition) { - this.condition = condition; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/query/DateRange.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/query/DateRange.java b/api/src/main/java/org/oasis_open/contextserver/api/query/DateRange.java deleted file mode 100644 index d5e9675..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/query/DateRange.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.query; - -/** - * A data range. - */ -public class DateRange { - public DateRange() { - } - - private String key; - private Object from; - private Object to; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public Object getFrom() { - return from; - } - - public void setFrom(Object from) { - this.from = from; - } - - public Object getTo() { - return to; - } - - public void setTo(Object to) { - this.to = to; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/query/IpRange.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/query/IpRange.java b/api/src/main/java/org/oasis_open/contextserver/api/query/IpRange.java deleted file mode 100644 index f60853b..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/query/IpRange.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.query; - -/** - * An IP address range. - */ -public class IpRange { - public IpRange() { - } - - private String key; - private String from; - private String to; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getFrom() { - return from; - } - - public void setFrom(String from) { - this.from = from; - } - - public String getTo() { - return to; - } - - public void setTo(String to) { - this.to = to; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/query/NumericRange.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/query/NumericRange.java b/api/src/main/java/org/oasis_open/contextserver/api/query/NumericRange.java deleted file mode 100644 index d0d8d44..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/query/NumericRange.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.query; - -/** - * A numeric range. - */ -public class NumericRange { - public NumericRange() { - } - - private String key; - private Double from; - private Double to; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public Double getFrom() { - return from; - } - - public void setFrom(Double from) { - this.from = from; - } - - public Double getTo() { - return to; - } - - public void setTo(Double to) { - this.to = to; - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/dc1d1520/api/src/main/java/org/oasis_open/contextserver/api/query/Query.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/oasis_open/contextserver/api/query/Query.java b/api/src/main/java/org/oasis_open/contextserver/api/query/Query.java deleted file mode 100644 index 18df06f..0000000 --- a/api/src/main/java/org/oasis_open/contextserver/api/query/Query.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.oasis_open.contextserver.api.query; - -import org.oasis_open.contextserver.api.conditions.Condition; - -/** - * A query wrapper gathering all elements needed for a potentially complex CXS query: {@link Condition}, offset, limit, sorting specification, etc. - * - * Created by kevan on 14/05/15. - */ -public class Query { - private String text; - private int offset; - private int limit; - private String sortby; - private Condition condition; - private boolean forceRefresh; - - /** - * Instantiates a new Query. - */ - public Query() { - } - - /** - * Retrieves the text to be used in full-text searches, if any. - * - * @return the text to be used in full-text searches or {@code null} if no full-text search is needed for this Query - */ - public String getText() { - return text; - } - - /** - * Sets to be used in full-text searches - * - * @param text the text to be used in full-text searches or {@code null} if no full-text search is needed for this Query - */ - public void setText(String text) { - this.text = text; - } - - - /** - * Retrieves the offset of the first element to be retrieved - * - * @return zero or a positive integer specifying the position of the first item to be retrieved in the total ordered collection of matching items - */ - public int getOffset() { - return offset; - } - - /** - * Sets the offset of the first element to be retrieved - * - * @param offset zero or a positive integer specifying the position of the first item to be retrieved in the total ordered collection of matching items - */ - public void setOffset(int offset) { - this.offset = offset; - } - - /** - * Retrieves the number of elements to retrieve. - * - * @return a positive integer specifying how many matching items should be retrieved or {@code -1} if all of them should be retrieved - */ - public int getLimit() { - return limit; - } - - /** - * Sets the number of elements to retrieve. - * - * @param limit a positive integer specifying how many matching items should be retrieved or {@code -1} if all of them should be retrieved - */ - public void setLimit(int limit) { - this.limit = limit; - } - - /** - * Retrieves the sorting specifications for this Query in String format, if any. - * - * @return an optional ({@code null} if no sorting is required) String of comma ({@code ,}) separated property names on which ordering should be performed, ordering elements - * according to the property order in the String, considering each in turn and moving on to the next one in case of equality of all preceding ones. Each property name is - * optionally followed by a column ({@code :}) and an order specifier: {@code asc} or {@code desc}. - */ - public String getSortby() { - return sortby; - } - - /** - * Sets the String representation of the sorting specifications for this Query if any. See {@link #getSortby()} method documentation for format. - * - * @param sortby the String representation of the sorting specifications for this Query or {@code null} if no sorting is required - */ - public void setSortby(String sortby) { - this.sortby = sortby; - } - - /** - * Retrieves the {@link Condition} associated with this Query. - * - * @return the {@link Condition} associated with this Query - */ - public Condition getCondition() { - return condition; - } - - /** - * Sets the {@link Condition} associated with this Query. - * - * @param condition the {@link Condition} associated with this Query - */ - public void setCondition(Condition condition) { - this.condition = condition; - } - - /** - * Determines whether or not an index refresh is needed before performing this Query - * - * @return {@code true} if an index refresh is needed before performing this Query, {@code false} otherwise - */ - public boolean isForceRefresh() { - return forceRefresh; - } - - /** - * Specifies whether or not an index refresh is needed before performing this Query. - * - * @param forceRefresh {@code true} if an index refresh is needed before performing this Query, {@code false} otherwise - */ - public void setForceRefresh(boolean forceRefresh) { - this.forceRefresh = forceRefresh; - } -}
