Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * This program is free software; you can redistribute it and/or modify it under the
   * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
   * Foundation.
   *
   * You should have received a copy of the GNU Lesser General Public License along with this
   * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
   * or from the Free Software Foundation, Inc.,
   * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU Lesser General Public License for more details.
  *
  * Copyright (c) 2009 Pentaho Corporation..  All rights reserved.
  */
 package org.pentaho.metadata.model.concept.security;
 
A security owner is a combination of a user or role type and the name of that user or role.

Author(s):
Matt
Since:
01-NOV-2006
 
 public class SecurityOwner implements SerializableCloneableComparable {
 
   private static final long serialVersionUID = 6657148420948786542L;
 
   public static enum OwnerType {
     USER("SecurityOwner.USER_USER"), ROLE("SecurityOwner.USER_ROLE");  //$NON-NLS-1$  //$NON-NLS-2$
 
     String description;
 
     OwnerType(String description) {
       this. = description;
     }
 
     public String getDescription() {
       return ;
     }
   }
 
   private OwnerType ownerType;
   private String ownerName;
 
   public SecurityOwner() {}
  
  

Parameters:
ownerType the type of ACL owner : user or role
ownerName the name or the user or role
rights
 
   public SecurityOwner(OwnerType ownerTypeString ownerName) {
     this. = ownerType;
     this. = ownerName;
   }

  

Returns:
the type of ACL : user or role
 
   public OwnerType getOwnerType() {
     return ;
   }

  

Parameters:
ownerType the type of owner to set: user or role
 
   public void setOwnerType(OwnerType ownerType) {
     this. = ownerType;
   }

  

Returns:
the name or the user or role
 
   public String getOwnerName() {
     return ;
   }

  

Parameters:
ownerName the name or the user or role
 
   public void setOwnerName(String ownerName) {
     this. = ownerName;
   }
   
   @Override
   public boolean equals(Object object) {
     if (!(object instanceof SecurityOwner)) {
       return false;
     }
     SecurityOwner s = (SecurityOwner)object;
     return  
       getOwnerType().equals(s.getOwnerType()) &&
       getOwnerName().equals(s.getOwnerName());
   }
  
  public String toString() {
    return "{class=SecurityOwner, ownerType=" + getOwnerType() + ", ownerName=" + getOwnerName() +"}"
  }
  public int compareTo(Object object) {
    return toString().compareTo(object.toString());
  }
New to GrepCode? Check out our FAQ X