Lucio Lelii 2016-07-22 12:27:15 +00:00
parent da746b2635
commit e50087eb86
4 changed files with 54 additions and 3 deletions

View File

@ -14,6 +14,7 @@ import org.gcube.common.authorization.library.policies.Policy;
import org.gcube.common.authorization.library.policies.Service2ServicePolicy;
import org.gcube.common.authorization.library.policies.User2ServicePolicy;
import org.gcube.common.authorization.library.provider.ClientInfo;
import org.gcube.common.authorization.library.provider.ContainerInfo;
import org.gcube.common.authorization.library.provider.ExternalServiceInfo;
import org.gcube.common.authorization.library.provider.ServiceInfo;
import org.gcube.common.authorization.library.provider.UserInfo;
@ -27,7 +28,8 @@ public class AuthorizationEntry {
@XmlElementRefs({
@XmlElementRef(type = UserInfo.class),
@XmlElementRef(type = ServiceInfo.class),
@XmlElementRef(type = ExternalServiceInfo.class)
@XmlElementRef(type = ExternalServiceInfo.class),
@XmlElementRef(type = ContainerInfo.class)
})
ClientInfo clientInfo;

View File

@ -10,7 +10,6 @@ import org.gcube.common.scan.ClasspathScanner;
import org.gcube.common.scan.ClasspathScannerFactory;
import org.gcube.common.scan.matchers.NameMatcher;
import org.gcube.common.scan.resources.ClasspathResource;
import org.gcube.common.scope.api.ServiceMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlSeeAlso;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlSeeAlso(value={UserInfo.class, ServiceInfo.class, ExternalServiceInfo.class})
@XmlSeeAlso(value={UserInfo.class, ServiceInfo.class, ExternalServiceInfo.class, ContainerInfo.class})
public abstract class ClientInfo implements Serializable{
/**

View File

@ -0,0 +1,50 @@
package org.gcube.common.authorization.library.provider;
import java.util.Collections;
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 ContainerInfo extends ClientInfo{
/**
*
*/
private static final long serialVersionUID = 7940935464438497662L;
private String host;
private int port;
protected ContainerInfo() {}
public ContainerInfo(String host, int port) {
super();
this.host = host;
this.port = port;
}
@Override
public String getId() {
return String.format("%s:%s", host, port);
}
@Override
public List<String> getRoles() {
return Collections.emptyList();
}
public String getHost() {
return host;
}
public int getPort() {
return port;
}
}