Interface ProfileAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
ProfileBatchAdminSession

public interface ProfileAdminSession extends OsidSession

This session creates, updates, and deletes Profiles . The data for create and update is provided by the consumer via the form object. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Profile , a ProfileForm is requested using getProfileFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned ProfileForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the ProfileForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each ProfileForm corresponds to an attempted transaction.

For updates, ProfileForms are requested to the Profile Id that is to be updated using getProfileFormForUpdate() . Similarly, the Profile has metadata about the data that can be updated and it can perform validation before submitting the update. The Profile can only be used once for a successful update and cannot be reused.

The delete operations delete Profiles .

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • canCreateProfiles

      boolean canCreateProfiles()
      Tests if this user can create Profiles . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Profile will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Returns:
      false if Profile creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateProfileWithRecordTypes

      boolean canCreateProfileWithRecordTypes(Type[] profileRecordTypes)
      Tests if this user can create a single Profile using the desired record types. While ProfileManager.getProfileRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Profile . Providing an empty array tests if a Profile can be created with no records.
      Parameters:
      profileRecordTypes - array of profile recod types
      Returns:
      true if Profile creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - profileRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getProfileFormForCreate

      ProfileForm getProfileFormForCreate(Type[] profileRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the profile form for creating new profiles. A new form should be requested for each create transaction.
      Parameters:
      profileRecordTypes - array of profile recod types
      Returns:
      the profile form
      Throws:
      NullArgumentException - profileRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form with requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createProfile

      Creates a new Profile .
      Parameters:
      profileForm - the form for this Profile
      Returns:
      the new Profile
      Throws:
      IllegalStateException - profileForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - profileForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - profileForm did not originate from getProfileFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateProfiles

      boolean canUpdateProfiles()
      Tests if this user can update Profiles . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Profile will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if Profile modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getProfileFormForUpdate

      ProfileForm getProfileFormForUpdate(Id profileId) throws NotFoundException, OperationFailedException
      Gets the profile form for updating an existing profile. A new profile form should be requested for each update transaction.
      Parameters:
      profileId - the Id of the Profile
      Returns:
      the profile form
      Throws:
      NotFoundException - profileId is not found
      NullArgumentException - profileId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • updateProfile

      void updateProfile(ProfileForm profileForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing profile.
      Parameters:
      profileForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - profileForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - profileForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - profileForm did not originate from getProfileFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteProfiles

      boolean canDeleteProfiles()
      Tests if this user can delete profiles. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Profile will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
      Returns:
      false if Profile deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteProfile

      Deletes a Profile .
      Parameters:
      profileId - the Id of the Profile to remove
      Throws:
      NotFoundException - profileId not found
      NullArgumentException - profileId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageProfileAliases

      boolean canManageProfileAliases()
      Tests if this user can manage Id aliases for Profiles . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if Profile aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasProfile

      Adds an Id to a Profile for the purpose of creating compatibility. The primary Id of the Profile is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another profile it is reassigned to the given profile Id .
      Parameters:
      profileId - the Id of a Profile
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - profileId not found
      NullArgumentException - profileId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.