001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kim.api.identity.entity;
017
018import org.kuali.rice.core.api.mo.common.GloballyUnique;
019import org.kuali.rice.core.api.mo.common.Identifiable;
020import org.kuali.rice.core.api.mo.common.Versioned;
021import org.kuali.rice.core.api.mo.common.active.Inactivatable;
022import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationContract;
023import org.kuali.rice.kim.api.identity.citizenship.EntityCitizenshipContract;
024import org.kuali.rice.kim.api.identity.employment.EntityEmploymentContract;
025import org.kuali.rice.kim.api.identity.external.EntityExternalIdentifierContract;
026import org.kuali.rice.kim.api.identity.name.EntityNameContract;
027import org.kuali.rice.kim.api.identity.personal.EntityBioDemographicsContract;
028import org.kuali.rice.kim.api.identity.personal.EntityEthnicityContract;
029import org.kuali.rice.kim.api.identity.principal.PrincipalContract;
030import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferencesContract;
031import org.kuali.rice.kim.api.identity.residency.EntityResidencyContract;
032import org.kuali.rice.kim.api.identity.type.EntityTypeContactInfoContract;
033import org.kuali.rice.kim.api.identity.visa.EntityVisaContract;
034
035import java.util.List;
036
037
038/**
039 * Represents an Entity (person/vendor/system) within the Rice system. 
040 * 
041 * @author Kuali Rice Team (rice.collab@kuali.org)
042 *
043 */
044public interface EntityContract extends Versioned, GloballyUnique, Inactivatable, Identifiable {
045
046        /**
047         * Gets this {@link EntityContract}'s identity types
048         * @return the List of {@link org.kuali.rice.kim.api.identity.type.EntityTypeContactInfoContract}S for this {@link EntityContract}.
049         * The returned List will never be null, an empty List will be assigned and returned if needed. 
050         */
051        List<? extends EntityTypeContactInfoContract> getEntityTypeContactInfos();
052        
053    /**
054     * Gets this {@link EntityContract}'s principals
055     * @return the List of {@link PrincipalContract}s for this {@link EntityContract}.
056     * The returned List will never be null, an empty List will be assigned and returned if needed. 
057     */
058        List<? extends PrincipalContract> getPrincipals();
059
060        
061    /**
062     * Gets this {@link EntityContract}'s external identifiers
063     * @return the List of {@link org.kuali.rice.kim.api.identity.external.EntityExternalIdentifierContract}S for this {@link EntityContract}.
064     * The returned List will never be null, an empty List will be assigned and returned if needed. 
065     */
066        List<? extends EntityExternalIdentifierContract> getExternalIdentifiers();
067
068    /**
069     * Gets this {@link EntityContract}'s affiliations
070     * @return the List of {@link EntityAffiliationContract}S for this {@link EntityContract}.
071     * The returned List will never be null, an empty List will be assigned and returned if needed. 
072     */
073        List<? extends EntityAffiliationContract> getAffiliations();
074
075        /**
076         * Gets this {@link EntityContract}'s names
077         * @return the List of {@link EntityNameContract}S for this {@link EntityContract}.
078     * The returned List will never be null, an empty List will be assigned and returned if needed. 
079         */
080        List<? extends EntityNameContract> getNames();
081        
082        
083    /**
084     * Gets this {@link EntityContract}'s employment information List
085     * @return the List of {@link org.kuali.rice.kim.api.identity.employment.EntityEmploymentContract}S for this {@link EntityContract}.
086     * The returned List will never be null, an empty List will be assigned and returned if needed. 
087     */
088        List<? extends EntityEmploymentContract> getEmploymentInformation();
089
090    /**
091     * Gets this {@link EntityContract}'s privacy preferences
092     * @return the {@link org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences} for this {@link EntityContract},
093     * or null if none has been assigned.
094     */ 
095        EntityPrivacyPreferencesContract getPrivacyPreferences();
096        
097        /**
098         * Gets this {@link EntityContract}'s demographic information
099         * @return the {@link EntityBioDemographicsContract} for this {@link EntityContract},
100         * or null if none has been assigned.
101         */
102        EntityBioDemographicsContract getBioDemographics();
103        
104    /**
105     * Gets this {@link EntityContract}'s citizenship information
106     * @return the List of {@link EntityCitizenshipContract}s for this {@link EntityContract}.
107     * The returned List will never be null, an empty List will be assigned and returned if needed. 
108     */
109        List<? extends EntityCitizenshipContract> getCitizenships();
110        
111        /**
112         * Gets this {@link EntityContract}'s identity type for the given type code
113         * @param entityTypeCode the type code
114         * @return the EntityEntityType object corresponding to the given code or null if this
115         * identity does not have data for that type.
116         */
117        EntityTypeContactInfoContract getEntityTypeContactInfoByTypeCode(String entityTypeCode);
118        
119        /**
120         * Gets this {@link EntityContract}'s employment information
121         * @return the primary {@link org.kuali.rice.kim.api.identity.employment.EntityEmploymentContract} for this {@link EntityContract},
122         * or null if none has been assigned.
123         */
124        EntityEmploymentContract getPrimaryEmployment();
125
126        /**
127         * Gets this {@link EntityContract}'s default affiliation
128     * @return the default {@link EntityAffiliationContract} for the identity.  If no default is defined, then
129     * it returns the first one found.  If none are defined, it returns null.
130     */
131        EntityAffiliationContract getDefaultAffiliation();
132        
133        /**
134         * Gets this {@link EntityContract}'s external identifier for the given type code
135         * @param externalIdentifierTypeCode the type code
136     * @return the {@link org.kuali.rice.kim.api.identity.external.EntityExternalIdentifierContract} for this {@link EntityContract}, or null if none has been assigned.
137     */
138        EntityExternalIdentifierContract getEntityExternalIdentifier( String externalIdentifierTypeCode );
139        
140        /** 
141         * Gets this {@link EntityContract}'s default name
142         * @return the default {@link EntityNameContract} record for the identity.  If no default is defined, then
143         * it returns the first one found.  If none are defined, it returns null.
144         */
145        EntityNameContract getDefaultName();
146
147    /**
148     * Gets this {@link EntityContract}'s ethnicities
149     * @return the List of {@link org.kuali.rice.kim.api.identity.personal.EntityEthnicityContract}S for this {@link EntityContract}.
150     * The returned List will never be null, an empty List will be assigned and returned if needed. 
151     */
152        public List<? extends EntityEthnicityContract> getEthnicities();
153
154    /**
155     * Gets this {@link EntityContract}'s residencies
156     * @return the List of {@link org.kuali.rice.kim.api.identity.residency.EntityResidencyContract}S for this {@link EntityContract}.
157     * The returned List will never be null, an empty List will be assigned and returned if needed. 
158     */
159        public List<? extends EntityResidencyContract> getResidencies();
160
161    /**
162     * Gets this {@link EntityContract}'s visas
163     * @return the List of {@link org.kuali.rice.kim.api.identity.visa.EntityVisaContract}S for this {@link EntityContract}.
164     * The returned List will never be null, an empty List will be assigned and returned if needed. 
165     */
166        public List<? extends EntityVisaContract> getVisas();
167
168}