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.XmlSeeAlso;
|
||||
|
||||
import org.gcube.common.authorization.library.ClientType;
|
||||
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@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 ClientType getType();
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import javax.xml.bind.annotation.XmlAccessType;
|
|||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.gcube.common.authorization.library.ClientType;
|
||||
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ContainerInfo extends ClientInfo{
|
||||
|
@ -50,6 +52,9 @@ public class ContainerInfo extends ClientInfo{
|
|||
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.XmlRootElement;
|
||||
|
||||
import org.gcube.common.authorization.library.ClientType;
|
||||
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ExternalServiceInfo extends ClientInfo{
|
||||
|
@ -43,5 +45,9 @@ public class ExternalServiceInfo extends ClientInfo{
|
|||
public List<String> getRoles() {
|
||||
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.XmlRootElement;
|
||||
|
||||
import org.gcube.common.authorization.library.ClientType;
|
||||
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ServiceInfo extends ClientInfo{
|
||||
|
@ -71,4 +73,8 @@ public class ServiceInfo extends ClientInfo{
|
|||
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.XmlRootElement;
|
||||
|
||||
import org.gcube.common.authorization.library.ClientType;
|
||||
|
||||
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
@ -75,5 +77,10 @@ public class UserInfo extends ClientInfo {
|
|||
public String toString() {
|
||||
return "UserInfo [clientId=" + clientId + ", roles=" + roles + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientType getType() {
|
||||
return ClientType.USER;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue