001/*
002* file CcPermissions.java
003*
004* Licensed Materials - Property of IBM
005* Restricted Materials of IBM
006* 
007* com.ibm.rational.wvcm.stp.cc.CcPermissions
008*
009* (C) Copyright IBM Corporation 2008.  All Rights Reserved. 
010* Note to U.S. Government Users Restricted Rights:  Use, duplication or  
011* disclosure restricted by GSA ADP  Schedule Contract with IBM Corp. 
012*/
013
014package com.ibm.rational.wvcm.stp.cc;
015
016import javax.wvcm.WvcmException;
017
018/**
019 * <p>
020 * Interface which provides a method of distinguishing the aggregated
021 * results returned by a {@link CcElement#PERMISSIONS} property request.
022 * </p>
023 */
024public interface CcPermissions {
025    
026    /**
027     * Interface for accessing individual permissions (read, write,
028     * and execute) supported on ClearCase objects.
029     * 
030     */
031    public interface Permissions {
032        /** 
033         * Gets read permission
034         * @return true if enabled, otherwise false.
035         */
036        public boolean getRead();
037        /** 
038         * Gets write permission
039         * @return true if enabled, otherwise false.
040         */
041        public boolean getWrite();
042        /** 
043         * Gets execute permission
044         * @return true if enabled, otherwise false.
045         */
046        public boolean getExecute();
047        /**
048         * Sets read permission 
049         * @param t  true to enable, false to disable.
050         */
051        public void setRead(boolean t);
052        /**
053         * Sets write permission 
054         * @param t  true to enable, false to disable.
055         */
056        public void setWrite(boolean t);
057        /**
058         * Sets execute permission 
059         * @param t  true to enable, false to disable.
060         */
061        public void setExecute(boolean t);
062    }
063    
064    /**
065     * Gets the user name.
066     * @return user name
067     * @throws WvcmException
068     */
069    public String getUserName() throws WvcmException;
070    
071    /**
072     * Gets the group name.
073     * @return group name
074     * @throws WvcmException
075     */
076    public String getGroupName() throws WvcmException;
077    
078    /**
079     * Gets the permissions for user.
080     * @return permissions
081     * @throws WvcmException
082     */
083    public Permissions getUserPermissions() throws WvcmException;
084    
085    /**
086     * Gets the permissions for group.
087     * @return permissions
088     * @throws WvcmException
089     */
090    public Permissions getGroupPermissions() throws WvcmException;
091    
092    /**
093     * Gets the permissions for other.
094     * @return permissions
095     * @throws WvcmException
096     */
097    public Permissions getOtherPermissions() throws WvcmException;
098        
099    /**
100     * Gets the setuid setting.
101     * @return permissions
102     * @throws WvcmException
103     */
104    public boolean getSetuid() throws WvcmException;
105    
106    /**
107     * Gets the setgid setting.
108     * @return permissions
109     * @throws WvcmException
110     */
111    public boolean getSetgid() throws WvcmException;
112    
113    /**
114     * Sets the user name.
115     * @param name
116     * @throws WvcmException
117     */
118    public void setUserName(String name) throws WvcmException;
119    
120    /**
121     * Sets the group name.
122     * @param name
123     * @throws WvcmException
124     */
125    public void setGroupName(String name) throws WvcmException;
126    
127    /**
128     * Sets the setuid permission.
129     * @param value
130     * @throws WvcmException
131     */
132    public void setSetuid(boolean value) throws WvcmException;
133    
134    /**
135     * Sets the setgid permission.
136     * @param value
137     * @throws WvcmException
138     */
139    public void setSetgid(boolean value) throws WvcmException;
140    
141    /**
142     * Sets permissions for user.
143     * @param permissions
144     * @throws WvcmException
145     */
146    public void setUserPermissions(Permissions permissions) throws WvcmException;
147    
148    /** 
149     * Sets permissions for group.
150     * @param permissions
151     * @throws WvcmException
152     */
153    public void setGroupPermissions(Permissions permissions) throws WvcmException;
154    
155    /**
156     * Sets permissions for other.
157     * @param permissions
158     * @throws WvcmException
159     */
160    public void setOtherPermissions(Permissions permissions) throws WvcmException;
161
162    /**
163     * @deprecated For internal use only
164     */
165    public String toXml() throws WvcmException;
166    
167}