git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/authorization-common-library@130709 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
da746b2635
commit
e50087eb86
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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{
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue