Subversion Repositories general

Rev

Rev 913 | Rev 918 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package ak.hostcaptain.core.model;

import java.util.Date;

/**
 *
 * @hibernate.class table="domains"
 */
public class InetDomain
        extends GeneralModelObject
{
        private Long   id;
        private String name;
        private User   owner;
        private Date   modStamp;

        protected InetDomain()
        {
        }

        /**
         *
         * @hibernate.id generator-class="native"
         */
        public Long getId()
        {
                return id;
        }

        public void setId(Long id)
        {
                this.id = id;
        }

        /**
         *
         * @hibernate.property
         */
        public String getName()
        {
                return name;
        }

        public void setName(String name)
        {
                this.name = name;
        }

        /**
         *
         * @hibernate.many-to-one
         */
        public User getOwner()
        {
                return owner;
        }

        public void setOwner(User owner)
        {
                this.owner = owner;
        }

        /**
         *
         * @hibernate.timestamp column="mod_stamp"
         */
        public Date getModStamp()
        {
                return modStamp;
        }

        public void setModStamp(Date modStamp)
        {
                this.modStamp = modStamp;
        }

        public String getTypeKey()
        {
                return ak.hostcaptain.core.CoreResources.TYPE_DOMAIN;
        }

        public String getIdentKey()
        {
                return ak.hostcaptain.core.CoreResources.IDENT_DOMAIN;
        }

        public Object[] getIdentParams()
        {
                return new Object[] { getName() };
        }

        public boolean viewableBy(User user)
        {
                return user.isSuperuser() || user.equals(owner);
        }

        public boolean editableBy(User user)
        {
                return user.isSuperuser();
        }

        public boolean deleteableBy(User user)
        {
                return user.isSuperuser();
        }
}