common-authorization/src/main/java/org/gcube/common/authorization/library/AuthorizationEntry.java

62 lines
1.4 KiB
Java

package org.gcube.common.authorization.library;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class AuthorizationEntry {
private String clientId;
private List<String> roles;
private String context;
private List<CalledService> bannedServices = new ArrayList<CalledService>();
protected AuthorizationEntry(){}
public AuthorizationEntry(String clientId, List<String> roles, String context) {
super();
this.clientId = clientId;
this.roles = roles;
this.context = context;
}
public AuthorizationEntry(String userName, List<String> roles, String scope, List<CalledService> bannedServices) {
this(userName, roles, scope);
this.bannedServices = bannedServices;
}
public String getClientId() {
return clientId;
}
public List<String> getRoles() {
return roles;
}
public String getContext() {
return context;
}
public List<CalledService> getBannedServices() {
return bannedServices;
}
public void setBannedServices(List<CalledService> bannedServices) {
this.bannedServices = bannedServices;
}
@Override
public String toString() {
return "AuthorizationEntry [clientId=" + clientId + ", roles=" + roles
+ ", context=" + context + " bannedServices "+ bannedServices+"]";
}
}