edu.vt.middleware.registry.manage.person
Class RegistryUpdater

java.lang.Object
  extended by edu.vt.middleware.registry.common.CommonRegistryFinder
      extended by edu.vt.middleware.registry.manage.person.RegistryUpdater

public final class RegistryUpdater
extends CommonRegistryFinder

RegistryUpdater implements the details of changing person data in the Virginia Tech Registry.

Version:
$Revision: 7780 $
Author:
Daniel Fisher

Field Summary
private static Log LOG
          Log for this class
 
Constructor Summary
RegistryUpdater(EntityManager em)
          This creates a RegistryUpdater with the supplied Entity Manager.
 
Method Summary
 void addAffiliation(Long uid, PersonAffiliation affiliation)
          This attempts to add a new person affiliation entry record to the registry for the supplied UID.
 void addInstantMessagingId(Long uid, String instantMessagingId)
          This attempts to add an instant messaging id for the supplied UID.
 void addLabeledUri(Long uid, String labeledUri)
          This attempts to add a labeled URI for the supplied UID.
 void addPersonRelation(String pid, Long uid, RoleType roleType)
          This adds the supplied related person to the person with the supplied PID in the supplied role.
 void addSuppressedAttribute(Long uid, PersonAttribute attribute)
          This attempts to add a suppressed attribute for the supplied UID.
 void archivePerson(Long uid, String personRecord, ArchiveType archiveType)
          This attempts to archive a person.
 Long createGuestPerson(Long sponsorUid)
          This attempts to add a new guest person entry record to the registry.
 Long createPerson()
          This attempts to add a new VT person entry record to the registry.
 Long createSponsoredPerson(Long sponsorUid)
          This attempts to add a new sponsored person entry record to the registry.
 void removeAffiliation(Long uid, PersonAffiliation affiliation)
          This attempts to remove the supplied affiliation for the supplied UID.
 boolean removeInstantMessagingId(Long uid, String instantMessagingId)
          This attempts to remove the instant messaging id with the supplied sequence number.
 boolean removeLabeledUri(Long uid, String labeledUri)
          This attempts to remove the labeled uri with the supplied sequence number.
 void removePerson(Long uid)
          This attempts to remove the person entry with the supplied UID.
 void removePersonRelation(String pid, Long uid, RoleType roleType)
          This removes the supplied related person from the person with the supplied PID in the supplied role.
 boolean removeSuppressedAttribute(Long uid, PersonAttribute attribute)
          This attempts to remove a suppressed attribute for the supplied UID.
 boolean setAffiliations(Long uid, Set<PersonAffiliation> affiliations)
          This attempts to set the supplied affiliations for the supplied UID.
 void setBirthdate(Long uid, Calendar birthdate)
          This attempts to modify the birth date for the supplied UID.
private  void setCertificate(Long uid, byte[] cert, String dn, CertificateType type)
          This sets a certificate of the supplied type for the supplied UID.
 void setConfidentialFlag(Long uid, Boolean confidential)
          This attempts to modify the confidential flag for the supplied UID.
 void setDeceasedFlag(Long uid, Boolean deceased)
          This attempts to modify the deceased flag for the supplied UID.
 void setIdentifier(Long uid, Identifier id)
          This attempts to set the supplied identifier for the supplied UID.
 void setResponsibleUid(Long uid, Long responsibleUid)
          This attempts to set the responsible person for the supplied UID.
 void setSMIMECertificate(Long uid, X509Certificate[] cert)
          This sets a X.509 S/MIME certificate for the supplied UID.
 void setX509Certificate(Long uid, X509Certificate cert)
          This sets a X.509 certificate for the supplied UID.
 
Methods inherited from class edu.vt.middleware.registry.common.CommonRegistryFinder
emailAccountExists, entitlementExists, flushAndRefresh, getAccountState, getDataTypes, getEntitlementData, getEntityManager, getGroup, getGroup, getPerson, getPerson, getPersonUid, getService, getService, getTicket, getTicket, getUserid, groupExists, guestIdExists, personExists, serviceExists, ticketExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG
Log for this class

Constructor Detail

RegistryUpdater

public RegistryUpdater(EntityManager em)
This creates a RegistryUpdater with the supplied Entity Manager.

Parameters:
em - EntityManager
Method Detail

createPerson

public Long createPerson()
                  throws ApplicationServerException
This attempts to add a new VT person entry record to the registry.

Returns:
Long - uid of the person created
Throws:
ApplicationServerException - if the method fails

createSponsoredPerson

public Long createSponsoredPerson(Long sponsorUid)
                           throws ApplicationServerException
This attempts to add a new sponsored person entry record to the registry.

Parameters:
sponsorUid - Long
Returns:
Long - uid of the person created
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the responsible uid cannot be found

createGuestPerson

public Long createGuestPerson(Long sponsorUid)
                       throws ApplicationServerException
This attempts to add a new guest person entry record to the registry.

Parameters:
sponsorUid - Long
Returns:
Long - uid of the person created
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the responsible uid cannot be found

addAffiliation

public void addAffiliation(Long uid,
                           PersonAffiliation affiliation)
                    throws ApplicationServerException
This attempts to add a new person affiliation entry record to the registry for the supplied UID.

Parameters:
uid - Long
affiliation - PersonAffiliation
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

removeAffiliation

public void removeAffiliation(Long uid,
                              PersonAffiliation affiliation)
                       throws ApplicationServerException
This attempts to remove the supplied affiliation for the supplied UID.

Parameters:
uid - Long to remove affiliatio entries for
affiliation - PersonAffiliation to remove
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

setAffiliations

public boolean setAffiliations(Long uid,
                               Set<PersonAffiliation> affiliations)
                        throws ApplicationServerException
This attempts to set the supplied affiliations for the supplied UID.

Parameters:
uid - Long to remove affiliation entries for
affiliations - Set to set
Returns:
boolean - if we modified the Registry or not
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

removePerson

public void removePerson(Long uid)
                  throws ApplicationException
This attempts to remove the person entry with the supplied UID.

Parameters:
uid - Long to remove person entry for
Throws:
ApplicationException - if the method fails
NoResultFoundException - if the uid cannot be found

archivePerson

public void archivePerson(Long uid,
                          String personRecord,
                          ArchiveType archiveType)
                   throws ApplicationServerException
This attempts to archive a person.

Parameters:
uid - Long - uid of the person
personRecord - String the person record in DSML format
archiveType - ArchiveType the reason for the archiving of the person
Throws:
ApplicationServerException - if the method fails

setResponsibleUid

public void setResponsibleUid(Long uid,
                              Long responsibleUid)
                       throws ApplicationServerException
This attempts to set the responsible person for the supplied UID. If the responsible uid is null then this method does nothing.

Parameters:
uid - Long to modify
responsibleUid - Long to set
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid or responsible uid cannot be found

setIdentifier

public void setIdentifier(Long uid,
                          Identifier id)
                   throws ApplicationServerException
This attempts to set the supplied identifier for the supplied UID. If the identifier doesn't exist, it is created.

Parameters:
uid - Long to modify
id - Identifier to set
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

setBirthdate

public void setBirthdate(Long uid,
                         Calendar birthdate)
                  throws ApplicationServerException
This attempts to modify the birth date for the supplied UID.

Parameters:
uid - Long to modify
birthdate - Calendar to change
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

setDeceasedFlag

public void setDeceasedFlag(Long uid,
                            Boolean deceased)
                     throws ApplicationServerException
This attempts to modify the deceased flag for the supplied UID.

Parameters:
uid - Long to modify
deceased - Boolean to set
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

setConfidentialFlag

public void setConfidentialFlag(Long uid,
                                Boolean confidential)
                         throws ApplicationServerException
This attempts to modify the confidential flag for the supplied UID.

Parameters:
uid - Long to modify
confidential - Boolean to set
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

addSuppressedAttribute

public void addSuppressedAttribute(Long uid,
                                   PersonAttribute attribute)
                            throws ApplicationServerException
This attempts to add a suppressed attribute for the supplied UID.

Parameters:
uid - Long
attribute - PersonAttribute
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

removeSuppressedAttribute

public boolean removeSuppressedAttribute(Long uid,
                                         PersonAttribute attribute)
                                  throws ApplicationServerException
This attempts to remove a suppressed attribute for the supplied UID.

Parameters:
uid - Long
attribute - PersonAttribute
Returns:
boolean - if we actually removed a suppressed attr
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

setX509Certificate

public void setX509Certificate(Long uid,
                               X509Certificate cert)
                        throws ApplicationServerException
This sets a X.509 certificate for the supplied UID.

Parameters:
uid - Long that is a person in the registry
cert - X509Certificate X509 cert to set
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

setSMIMECertificate

public void setSMIMECertificate(Long uid,
                                X509Certificate[] cert)
                         throws ApplicationServerException
This sets a X.509 S/MIME certificate for the supplied UID.

Parameters:
uid - Long that is a person in the registry
cert - X509Certificate[] X509 S/MIME cert(s) to set
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

setCertificate

private void setCertificate(Long uid,
                            byte[] cert,
                            String dn,
                            CertificateType type)
                     throws ApplicationServerException
This sets a certificate of the supplied type for the supplied UID.

Parameters:
uid - Long that is a person in the registry
cert - byte[] to set
dn - String of the cert
type - CertificateType of cert to set
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

addLabeledUri

public void addLabeledUri(Long uid,
                          String labeledUri)
                   throws ApplicationServerException
This attempts to add a labeled URI for the supplied UID.

Parameters:
uid - Long
labeledUri - String
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

removeLabeledUri

public boolean removeLabeledUri(Long uid,
                                String labeledUri)
                         throws ApplicationServerException
This attempts to remove the labeled uri with the supplied sequence number.

Parameters:
uid - Long
labeledUri - String
Returns:
boolean - if we removed a uri or not
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

addInstantMessagingId

public void addInstantMessagingId(Long uid,
                                  String instantMessagingId)
                           throws ApplicationServerException
This attempts to add an instant messaging id for the supplied UID.

Parameters:
uid - Long
instantMessagingId - String
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

removeInstantMessagingId

public boolean removeInstantMessagingId(Long uid,
                                        String instantMessagingId)
                                 throws ApplicationServerException
This attempts to remove the instant messaging id with the supplied sequence number.

Parameters:
uid - Long
instantMessagingId - String
Returns:
boolean - whether the IM id was removed or not
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the uid cannot be found

addPersonRelation

public void addPersonRelation(String pid,
                              Long uid,
                              RoleType roleType)
                       throws ApplicationServerException
This adds the supplied related person to the person with the supplied PID in the supplied role.

Parameters:
pid - String of the owning person
uid - Long to add as related
roleType - RoleType of the related person
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the either person cannot be found

removePersonRelation

public void removePersonRelation(String pid,
                                 Long uid,
                                 RoleType roleType)
                          throws ApplicationServerException
This removes the supplied related person from the person with the supplied PID in the supplied role.

Parameters:
pid - String of the owning person
uid - Long to remove as related
roleType - RoleType of the person
Throws:
ApplicationServerException - if the method fails
NoResultFoundException - if the group or person cannot be found


Copyright © 2008 Virginia Tech. All Rights Reserved.