61 lines
1.1 KiB
Java
61 lines
1.1 KiB
Java
package org.gcube.common.authorization.library.provider;
|
|
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
import org.gcube.common.authorization.library.ClientType;
|
|
|
|
import jakarta.xml.bind.annotation.XmlAccessType;
|
|
import jakarta.xml.bind.annotation.XmlAccessorType;
|
|
import jakarta.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;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "ContainerInfo [host=" + host + ", port=" + port + "]";
|
|
}
|
|
|
|
@Override
|
|
public ClientType getType() {
|
|
return ClientType.CONTAINER;
|
|
}
|
|
|
|
}
|