Skip to content

Commit

Permalink
duplicate Ranger User and Role class to resolve cyclic dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mehtaanshul committed Nov 24, 2023
1 parent 62a1f3f commit efd8bca
Show file tree
Hide file tree
Showing 11 changed files with 901 additions and 7 deletions.
35 changes: 35 additions & 0 deletions auth-agents-common-temp/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apache-atlas</artifactId>
<groupId>org.apache.atlas</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>auth-agents-common-temp</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.htrace</groupId>
<artifactId>htrace-core4</artifactId>
<version>4.1.0-incubating</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
</dependencies>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* 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.apache.atlas.plugin.model;

import org.apache.htrace.shaded.fasterxml.jackson.annotation.JsonInclude;
import org.apache.atlas.plugin.util.RangerUserStoreUtil;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.HashMap;
import java.util.Map;

@JsonInclude(JsonInclude.Include.NON_NULL)
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class GroupInfo extends RangerBaseModelObject implements java.io.Serializable {

private static final long serialVersionUID = 1L;
private String name;
private String description;
private Map<String, String> otherAttributes;

public GroupInfo() {
this(null, null, null);
}

public GroupInfo(String name, String description, Map<String, String> otherAttributes) {
setName(name);
setDescription(description);
setOtherAttributes(otherAttributes);
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public Map<String, String> getOtherAttributes() {
return otherAttributes;
}

public void setOtherAttributes(Map<String, String> otherAttributes) {
this.otherAttributes = otherAttributes == null ? new HashMap<>() : otherAttributes;
}

@Override
public String toString() {
return "{name=" + name
+ ", description=" + description
+ ", otherAttributes=" + RangerUserStoreUtil.getPrintableOptions(otherAttributes)
+ "}";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/*
* 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.apache.atlas.plugin.model;

import org.apache.htrace.shaded.fasterxml.jackson.annotation.JsonInclude;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;

@JsonInclude(JsonInclude.Include.NON_NULL)
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class RangerBaseModelObject implements java.io.Serializable {
private static final long serialVersionUID = 1L;

private Long id;
private String guid;
private Boolean isEnabled;
private String createdBy;
private String updatedBy;
private Date createTime;
private Date updateTime;
private Long version;

public RangerBaseModelObject() {
setIsEnabled(null);
}

public void updateFrom(RangerBaseModelObject other) {
setIsEnabled(other.getIsEnabled());
}

/**
* @return the id
*/
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* @return the guid
*/
public String getGuid() {
return guid;
}
/**
* @param guid the guid to set
*/
public void setGuid(String guid) {
this.guid = guid;
}
/**
* @return the isEnabled
*/
public Boolean getIsEnabled() {
return isEnabled;
}
/**
* @param isEnabled the isEnabled to set
*/
public void setIsEnabled(Boolean isEnabled) {
this.isEnabled = isEnabled == null ? Boolean.TRUE : isEnabled;
}
/**
* @return the createdBy
*/
public String getCreatedBy() {
return createdBy;
}
/**
* @param createdBy the createdBy to set
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* @return the updatedBy
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* @param updatedBy the updatedBy to set
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* @return the createTime
*/
public Date getCreateTime() {
return createTime;
}
/**
* @param createTime the createTime to set
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* @return the updateTime
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* @param updateTime the updateTime to set
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* @return the version
*/
public Long getVersion() {
return version;
}
/**
* @param version the version to set
*/
public void setVersion(Long version) {
this.version = version;
}

@Override
public String toString( ) {
StringBuilder sb = new StringBuilder();

toString(sb);

return sb.toString();
}

public StringBuilder toString(StringBuilder sb) {
sb.append("id={").append(id).append("} ");
sb.append("guid={").append(guid).append("} ");
sb.append("isEnabled={").append(isEnabled).append("} ");
sb.append("createdBy={").append(createdBy).append("} ");
sb.append("updatedBy={").append(updatedBy).append("} ");
sb.append("createTime={").append(createTime).append("} ");
sb.append("updateTime={").append(updateTime).append("} ");
sb.append("version={").append(version).append("} ");

return sb;
}
}
Loading

0 comments on commit efd8bca

Please sign in to comment.