Skip to content

Commit

Permalink
Refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilbonte21 committed Feb 14, 2024
1 parent 1ae5fd5 commit e5121f5
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 332 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ public class RangerPolicy extends RangerBaseModelObject implements java.io.Seria
private String zoneName;
private Boolean isDenyAllElse;
private Map<String, String> attributes;
private String policyFilterCriteria;
private String policyResourceCategory;

public RangerPolicy() {
this(null, null, null, null, null, null, null, null, null, null, null);
Expand Down Expand Up @@ -140,8 +138,6 @@ public RangerPolicy(String service, String name, String policyType, Integer poli
setZoneName(zoneName);
setConditions(conditions);
setIsDenyAllElse(isDenyAllElse);
setPolicyFilterCriteria(null);
setPolicyResourceCategory(null);

}

Expand Down Expand Up @@ -172,8 +168,6 @@ public void updateFrom(RangerPolicy other) {
setPolicyLabels(other.getPolicyLabels());
setZoneName(other.getZoneName());
setIsDenyAllElse(other.getIsDenyAllElse());
setPolicyFilterCriteria(other.getPolicyFilterCriteria());
setPolicyResourceCategory(other.getPolicyResourceCategory());
}

public Map<String, String> getAttributes() {
Expand Down Expand Up @@ -540,22 +534,6 @@ public void setIsDenyAllElse(Boolean isDenyAllElse) {
this.isDenyAllElse = isDenyAllElse == null ? Boolean.FALSE : isDenyAllElse;
}

public String getPolicyFilterCriteria() {
return policyFilterCriteria;
}

public void setPolicyFilterCriteria(String policyFilterCriteria) {
this.policyFilterCriteria = policyFilterCriteria;
}

public String getPolicyResourceCategory() {
return policyResourceCategory;
}

public void setPolicyResourceCategory(String policyResourceCategory) {
this.policyResourceCategory = policyResourceCategory;
}

@Override
public String toString( ) {
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -689,10 +667,6 @@ public StringBuilder toString(StringBuilder sb) {
}
sb.append(", zoneName=").append(zoneName);

sb.append(", policyFilterCriteria=").append(policyFilterCriteria);

sb.append(", policyResourceCategory=").append(policyResourceCategory);

sb.append(", isDenyAllElse={").append(isDenyAllElse).append("} ");

sb.append("}");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
package org.apache.atlas.authorizer.authorizers;

import org.apache.atlas.exception.AtlasBaseException;
import org.apache.atlas.model.instance.AtlasEntity;
import org.apache.atlas.model.instance.AtlasEntityHeader;
import org.apache.atlas.repository.graphdb.AtlasGraph;
import org.apache.atlas.repository.graphdb.AtlasVertex;
import org.apache.atlas.repository.store.graph.v2.EntityGraphRetriever;
import org.apache.atlas.type.AtlasEntityType;
import org.apache.atlas.type.AtlasTypeRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -15,12 +10,9 @@
import org.springframework.stereotype.Component;

import javax.inject.Inject;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

@Component
public class AuthorizerCommon {
Expand Down Expand Up @@ -55,18 +47,4 @@ public static Map<String, Object> getMap(String key, Object value) {
map.put(key, value);
return map;
}

public static AtlasEntityType getEntityTypeByName(String typeName) {
return typeRegistry.getEntityTypeByName(typeName);
}

public static AtlasEntity toAtlasEntityHeaderWithClassifications(String guid) throws AtlasBaseException {
//return new AtlasEntity(entityRetriever.toAtlasEntityHeaderWithClassifications(guid));
return new AtlasEntity(entityRetriever.toAtlasEntity(guid));
}

public static AtlasEntity toAtlasEntityHeaderWithClassifications(AtlasVertex vertex) throws AtlasBaseException {
//return new AtlasEntity(entityRetriever.toAtlasEntityHeaderWithClassifications(vertex));
return new AtlasEntity(entityRetriever.toAtlasEntity(vertex));
}
}
Loading

0 comments on commit e5121f5

Please sign in to comment.