import java.io.Serializable;
import java.util.Date;
-
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
-import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import lombok.Getter;
import lombok.Setter;
import org.onap.policy.common.im.MonitorTime;
-import org.onap.policy.drools.activestandby.DroolsPdpObject;
@Entity
//@Table(name="DroolsPdpEntity")
-@NamedQueries({
- @NamedQuery(name = "DroolsPdpEntity.findAll", query = "SELECT e FROM DroolsPdpEntity e "),
- @NamedQuery(name = "DroolsPdpEntity.deleteAll", query = "DELETE FROM DroolsPdpEntity WHERE 1=1")
- })
+@NamedQuery(name = "DroolsPdpEntity.findAll", query = "SELECT e FROM DroolsPdpEntity e ")
+@NamedQuery(name = "DroolsPdpEntity.deleteAll", query = "DELETE FROM DroolsPdpEntity WHERE 1=1")
@Getter
@Setter
public class DroolsPdpEntity extends DroolsPdpObject implements Serializable {
final FactHandle factHandle = policySession.getKieSession().insert(this);
// after 10 minutes, remove the object from Drools memory (if needed)
- PolicyEngineConstants.getManager().getExecutorService().schedule(
- new Runnable() {
- @Override
- public void run() {
- if (policySession.getKieSession().getObject(factHandle) != null) {
- // object has not been removed by application -- remove it here
- policySession.getKieSession().delete(factHandle);
- }
- }
- }, DELAY, TimeUnit.MILLISECONDS);
+ PolicyEngineConstants.getManager().getExecutorService().schedule(() -> {
+ if (policySession.getKieSession().getObject(factHandle) != null) {
+ // object has not been removed by application -- remove it here
+ policySession.getKieSession().delete(factHandle);
+ }
+ }, DELAY, TimeUnit.MILLISECONDS);
}
}
}
* ============LICENSE_START=======================================================
* policy-management
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed 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.
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
-
import java.util.HashMap;
import java.util.Map;
-
+import lombok.ToString;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.ToStringBuilder;
import org.onap.policy.common.gson.annotation.GsonJsonAnyGetter;
import org.onap.policy.common.gson.annotation.GsonJsonAnySetter;
import org.onap.policy.common.gson.annotation.GsonJsonIgnore;
/**
* Drools Related Information.
- *
+ *
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
+@ToString
public class ControllerConfiguration {
public static final String CONFIG_CONTROLLER_OPERATION_CREATE = "create";
/**
* (Required).
- *
+ *
*/
@JsonProperty("name")
@GsonJsonProperty("name")
/**
* Set of operations that can be applied to a controller: create, lock
* (Required).
- *
+ *
*/
@JsonProperty("operation")
@GsonJsonProperty("operation")
private String operation;
/**
* Maven Related Information.
- *
+ *
*/
@JsonProperty("drools")
@GsonJsonProperty("drools")
private DroolsConfiguration drools;
-
+
@JsonIgnore
@GsonJsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
-
+
protected static final Object NOT_FOUND_VALUE = new Object();
/**
* No args constructor for use in serialization.
- *
+ *
*/
public ControllerConfiguration() {
// Empty
/**
* Constructor.
- *
+ *
* @param name name
* @param operation operation
* @param drools drools
/**
* (Required).
- *
+ *
* @return
* The name
*/
/**
* (Required).
- *
+ *
* @param name
* The name
*/
/**
* Set of operations that can be applied to a controller: create, lock
* (Required).
- *
+ *
* @return
* The operation
*/
/**
* Set of operations that can be applied to a controller: create, lock
* (Required).
- *
+ *
* @param operation
* The operation
*/
/**
* Maven Related Information.
- *
+ *
* @return
* The drools
*/
/**
* Maven Related Information.
- *
+ *
* @param drools
* The drools
*/
return this;
}
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
@JsonAnyGetter
@GsonJsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
/**
* Get.
- *
+ *
* @param name name
* @return the object
*/
/**
* Set the property.
- *
+ *
* @param name property name
* @param value property value
*/
/**
* With - sets the property and additionally returns the object.
- *
+ *
* @param name property name
* @param value property value
* @return this
return new EqualsBuilder().append(name, rhs.name).append(operation, rhs.operation).append(drools, rhs.drools)
.append(additionalProperties, rhs.additionalProperties).isEquals();
}
-
+
/**
* Call set name.
- *
+ *
* @param value value
*/
public void callSetName(Object value) {
+ value.getClass().toString());
}
}
-
+
/**
* Call set operation.
- *
+ *
* @param value value
*/
public void callSetOperation(Object value) {
+ value.getClass().toString());
}
}
-
+
/**
* Call set drools.
- *
+ *
* @param value value
*/
public void callSetDrools(Object value) {
* Licensed 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.
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
-
import java.util.HashMap;
import java.util.Map;
-
+import lombok.ToString;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.ToStringBuilder;
import org.onap.policy.common.gson.annotation.GsonJsonAnyGetter;
import org.onap.policy.common.gson.annotation.GsonJsonAnySetter;
import org.onap.policy.common.gson.annotation.GsonJsonIgnore;
/**
* Maven Related Information.
- *
+ *
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
+@ToString
public class DroolsConfiguration {
/**
* Maven Artifact ID
* (Required).
- *
+ *
*/
@JsonProperty("artifactId")
@GsonJsonProperty("artifactId")
private String artifactId;
-
+
/**
* Maven Group ID
* (Required).
- *
+ *
*/
@JsonProperty("groupId")
@GsonJsonProperty("groupId")
private String groupId;
-
+
/**
* Maven Version
* (Required).
- *
+ *
*/
@JsonProperty("version")
@GsonJsonProperty("version")
private String version;
-
+
@JsonIgnore
@GsonJsonIgnore
private Map<String, Object> additionalProperties = new HashMap<>();
-
+
protected static final Object NOT_FOUND_VALUE = new Object();
/**
* No args constructor for use in serialization.
- *
+ *
*/
public DroolsConfiguration() {
// Empty
/**
* Constructor.
- *
+ *
* @param groupId group id
* @param artifactId artifact id
* @param version version
/**
* Maven Artifact ID
* (Required).
- *
+ *
* @return
* The artifactId
*/
/**
* Maven Artifact ID
* (Required).
- *
+ *
* @param artifactId
* The artifactId
*/
/**
* Maven Group ID
* (Required).
- *
+ *
* @return
* The groupId
*/
/**
* Maven Group ID
* (Required).
- *
+ *
* @param groupId
* The groupId
*/
/**
* Maven Version
* (Required).
- *
+ *
* @return
* The version
*/
/**
* Maven Version
* (Required).
- *
+ *
* @param version
* The version
*/
return this;
}
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
@JsonAnyGetter
@GsonJsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
/**
* Get declared property.
- *
+ *
* @param name property name
* @return the property object
*/
/**
* Set property value.
- *
+ *
* @param name property name
* @param value property value
*/
/**
* Set property value and return object.
- *
+ *
* @param name property name
* @param value property value
* @return this
.append(groupId, rhs.groupId).append(version, rhs.version)
.append(additionalProperties, rhs.additionalProperties).isEquals();
}
-
+
/**
* Call set artifact id.
- *
+ *
* @param value id
*/
public void callSetArtifactId(Object value) {
/**
* Call set group id.
- *
+ *
* @param value id
*/
public void callSetGroupId(Object value) {
/**
* Call set version.
- *
+ *
* @param value version
*/
public void callSetVersion(Object value) {
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import lombok.ToString;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.ToStringBuilder;
import org.onap.policy.common.gson.annotation.GsonJsonAnyGetter;
import org.onap.policy.common.gson.annotation.GsonJsonAnySetter;
import org.onap.policy.common.gson.annotation.GsonJsonIgnore;
* ENGINE-CONFIGURATION.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
+@ToString
public class PdpdConfiguration {
/** Controller Entity ID. */
return this;
}
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
@JsonAnyGetter
@GsonJsonAnyGetter
public Map<String, Object> getAdditionalProperties() {