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

org.apache.jetspeed.sso.impl.SSOPrincipalImpl Maven / Gradle / Ivy

There is a newer version: 2.3.1
Show newest version
/* 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.jetspeed.sso.impl;

import java.sql.Timestamp;
import java.util.Collection;
import java.util.Vector;

import org.apache.jetspeed.security.om.InternalUserPrincipal;
import org.apache.jetspeed.sso.SSOPrincipal;

/**
* 

* SSOPrincipalImpl * Class used for mapping Principal information for a site. This is the short form of * the InternalPrincipalImpl * .

* * @author Roger Ruttimann */ public class SSOPrincipalImpl implements SSOPrincipal { /** The principal id. */ private long principalId; /** The class name. */ private String classname; /** The is mapping only. */ private boolean isMappingOnly = false; /** The full path. */ private String fullPath; /** The creation date. */ private Timestamp creationDate; /** The modified date. */ private Timestamp modifiedDate; /** The enabled state. */ private boolean enabled = true; /** Permissions not used by required by the interface*/ private Collection permissions; /** Remote principals for Principal */ private Collection remotePrincipals = new Vector(); /** SIteID for Remote principal */ private int siteID; /** *

* The special attribute telling OJB the object's concrete type. *

*

* NOTE: this attribute MUST be called ojbConcreteClass *

*/ protected String ojbConcreteClass; /** *

* InternalPrincipal implementation default constructor. *

*/ public SSOPrincipalImpl() { } /** *

* InternalPrincipal constructor given a classname and name. *

* * @param classname The classname. * @param fullPath The full path. */ public SSOPrincipalImpl(String classname, String fullPath) { this.ojbConcreteClass = classname; this.classname = classname; this.fullPath = fullPath; this.permissions = null; // Not used this.creationDate = new Timestamp(System.currentTimeMillis()); this.modifiedDate = this.creationDate; } /** * addRemotePrincipal() * adds a principal to the list of remote principals */ public void addRemotePrincipal(InternalUserPrincipal principal) { /* if (remotePrincipals == null) { remotePrincipals = new ArrayList(1); } */ remotePrincipals.add(principal); } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#getPrincipalId() */ public long getPrincipalId() { return this.principalId; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#setPrincipalId(int) */ public void setPrincipalId(long principalId) { this.principalId = principalId; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#getClassname() */ public String getClassname() { return this.classname; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#setClassname(java.lang.String) */ public void setClassname(String classname) { this.ojbConcreteClass = classname; this.classname = classname; } /** * @return Returns the isMappingOnly. */ public boolean isMappingOnly() { return isMappingOnly; } /** * @param isMappingOnly The isMappingOnly to set. */ public void setMappingOnly(boolean isMappingOnly) { this.isMappingOnly = isMappingOnly; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#getFullPath() */ public String getFullPath() { return this.fullPath; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#setFullPath(java.lang.String) */ public void setFullPath(String fullPath) { this.fullPath = fullPath; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#getPermissions() */ public Collection getPermissions() { return this.permissions; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#setPermissions(java.util.Collection) */ public void setPermissions(Collection permissions) { this.permissions = permissions; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#getCreationDate() */ public Timestamp getCreationDate() { return this.creationDate; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#setCreationDate(java.sql.Timestamp) */ public void setCreationDate(Timestamp creationDate) { this.creationDate = creationDate; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#getModifiedDate() */ public Timestamp getModifiedDate() { return this.modifiedDate; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#setModifiedDate(java.sql.Timestamp) */ public void setModifiedDate(Timestamp modifiedDate) { this.modifiedDate = modifiedDate; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#isEnabled() */ public boolean isEnabled() { return enabled; } /** * @see org.apache.jetspeed.security.om.InternalPrincipal#setEnabled(boolean) */ public void setEnabled(boolean enabled) { this.enabled = enabled; } /** * @return Returns the remotePrincipals. */ public Collection getRemotePrincipals() { return remotePrincipals; } /** * @param remotePrincipals The remotePrincipals to set. */ public void setRemotePrincipals(Collection remotePrincipals) { this.remotePrincipals = remotePrincipals; } /** * @return Returns the siteID. */ public int getSiteID() { return siteID; } /** * @param siteID The siteID to set. */ public void setSiteID(int siteID) { this.siteID = siteID; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy