2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
23 * THIS FILE CONTAINS PROPRIETARY INFORMATION OF
24 * AT&T AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN
25 * ACCORDANCE WITH APPLICABLE AGREEMENTS.
27 * Copyright (c) 2014 AT&T Knowledge Ventures
28 * Unpublished and Not for Publication
31 package org.onap.policy.rest.jpa;
33 import java.io.Serializable;
35 import javax.persistence.Column;
36 import javax.persistence.Entity;
37 import javax.persistence.GeneratedValue;
38 import javax.persistence.GenerationType;
39 import javax.persistence.Id;
40 import javax.persistence.NamedQuery;
41 import javax.persistence.Table;
42 import javax.persistence.Transient;
44 import com.att.research.xacml.api.Identifier;
47 @Table(name="RuleAlgorithms")
48 @NamedQuery(name="RuleAlgorithms.findAll", query="SELECT d FROM RuleAlgorithms d")
49 public class RuleAlgorithms implements Serializable {
50 private static final long serialVersionUID = 1L;
52 public static final char STANDARD = 'S';
53 public static final char CUSTOM = 'C';
56 @GeneratedValue(strategy = GenerationType.AUTO)
60 @Column(name="is_standard", nullable=false)
61 private char isStandard;
63 @Column(name="xacml_id", nullable=false, unique=true, length=255)
64 private String xacmlId;
66 @Column(name="short_name", nullable=false, length=64)
67 private String shortName;
69 public RuleAlgorithms(Identifier id, char standard) {
71 this.xacmlId = id.stringValue();
73 this.isStandard = standard;
75 public RuleAlgorithms(Identifier id) {
76 this(id, RuleAlgorithms.STANDARD);
79 public RuleAlgorithms() {
80 this(null, RuleAlgorithms.STANDARD);
87 public void setId(int id) {
91 public char getIsStandard() {
92 return this.isStandard;
95 public void setIsStandard(char isStandard) {
96 this.isStandard = isStandard;
100 public boolean isStandard() {
101 return this.isStandard == RuleAlgorithms.STANDARD;
105 public boolean isCustom() {
106 return this.isStandard == RuleAlgorithms.CUSTOM;
109 public String getXacmlId() {
113 public void setXacmlId(String xacmlId) {
114 this.xacmlId = xacmlId;
117 public String getShortName() {
121 public void setShortName(String shortName) {
122 this.shortName = shortName;