All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jelastic.api.system.persistence.Subdomain Maven / Gradle / Ivy

The newest version!
/*Server class MD5: 380678fab49194f0266626e1b096b515*/
package com.jelastic.api.system.persistence;

import com.jelastic.api.common.Constants;
import com.jelastic.api.core.orm.dao.AbstractEntity;

// @author Maksym Shevchuk
/**
 * @name Jelastic API Client
 * @version 8.11.2
 * @copyright Jelastic, Inc.
 */
public class Subdomain extends AbstractEntity implements Cloneable {

    private String domain;

    private AppNodes env;

    private SoftNodeGroup softNodeGroup;

    private SoftwareNode softNode;

    private Domain topDomain;

    public Subdomain() {
    }

    public Subdomain(String domain, AppNodes env) {
        this.domain = domain;
        this.env = env;
    }

    public Subdomain(String domain, AppNodes env, SoftNodeGroup nodeGroup) {
        this.domain = domain;
        this.env = env;
        this.softNodeGroup = nodeGroup;
    }

    public Subdomain(String domain, AppNodes env, SoftwareNode softNode) {
        this.domain = domain;
        this.env = env;
        this.softNode = softNode;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public AppNodes getEnv() {
        return env;
    }

    public void setEnv(AppNodes env) {
        this.env = env;
    }

    public SoftNodeGroup getNodeGroup() {
        return softNodeGroup;
    }

    public void setNodeGroup(SoftNodeGroup nodeGroup) {
        this.softNodeGroup = nodeGroup;
    }

    public SoftwareNode getSoftNode() {
        return softNode;
    }

    public void setSoftNode(SoftwareNode softNode) {
        this.softNode = softNode;
    }

    public Domain getTopDomain() {
        return topDomain;
    }

    public void setTopDomain(Domain topDomain) {
        this.topDomain = topDomain;
    }

    public boolean isTopLevel() {
        return topDomain != null;
    }

    public String getSeparator() {
        return isTopLevel() ? Constants.HYPHEN_SEPARATOR : Constants.DOT_SEPARATOR;
    }

    @Override
    protected Object clone() {
        Subdomain subdomain = new Subdomain(this.domain, this.env, this.softNodeGroup);
        subdomain.setSoftNode(this.softNode);
        subdomain.setTopDomain(this.topDomain);
        return subdomain;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy