git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/authorization-common-library@134801 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2e08673847
commit
e428070220
|
@ -0,0 +1,6 @@
|
||||||
|
package org.gcube.common.authorization.library;
|
||||||
|
|
||||||
|
public enum ClientType {
|
||||||
|
|
||||||
|
USER, SERVICE, EXTERNALSERVICE, CONTAINER
|
||||||
|
}
|
|
@ -8,6 +8,8 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.ClientType;
|
||||||
|
|
||||||
@XmlRootElement
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlSeeAlso(value={UserInfo.class, ServiceInfo.class, ExternalServiceInfo.class, ContainerInfo.class})
|
@XmlSeeAlso(value={UserInfo.class, ServiceInfo.class, ExternalServiceInfo.class, ContainerInfo.class})
|
||||||
|
@ -22,4 +24,6 @@ public abstract class ClientInfo implements Serializable{
|
||||||
|
|
||||||
public abstract List<String> getRoles();
|
public abstract List<String> getRoles();
|
||||||
|
|
||||||
|
public abstract ClientType getType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.ClientType;
|
||||||
|
|
||||||
@XmlRootElement
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class ContainerInfo extends ClientInfo{
|
public class ContainerInfo extends ClientInfo{
|
||||||
|
@ -50,6 +52,9 @@ public class ContainerInfo extends ClientInfo{
|
||||||
return "ContainerInfo [host=" + host + ", port=" + port + "]";
|
return "ContainerInfo [host=" + host + ", port=" + port + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ClientType getType() {
|
||||||
|
return ClientType.CONTAINER;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.ClientType;
|
||||||
|
|
||||||
@XmlRootElement
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class ExternalServiceInfo extends ClientInfo{
|
public class ExternalServiceInfo extends ClientInfo{
|
||||||
|
@ -44,4 +46,8 @@ public class ExternalServiceInfo extends ClientInfo{
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ClientType getType() {
|
||||||
|
return ClientType.EXTERNALSERVICE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.ClientType;
|
||||||
|
|
||||||
@XmlRootElement
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class ServiceInfo extends ClientInfo{
|
public class ServiceInfo extends ClientInfo{
|
||||||
|
@ -71,4 +73,8 @@ public class ServiceInfo extends ClientInfo{
|
||||||
return "ServiceInfo [serviceIdentifier=" + serviceIdentifier + "]";
|
return "ServiceInfo [serviceIdentifier=" + serviceIdentifier + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ClientType getType() {
|
||||||
|
return ClientType.SERVICE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.ClientType;
|
||||||
|
|
||||||
|
|
||||||
@XmlRootElement
|
@XmlRootElement
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@ -76,4 +78,9 @@ public class UserInfo extends ClientInfo {
|
||||||
return "UserInfo [clientId=" + clientId + ", roles=" + roles + "]";
|
return "UserInfo [clientId=" + clientId + ", roles=" + roles + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ClientType getType() {
|
||||||
|
return ClientType.USER;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue