OSID Logo
OSID Specifications
room squatting package
Version 3.0.0
Release Candidate Preview
Interfaceosid.room.squatting.LeaseAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Leases. 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 Lease, a LeaseForm is requested using getLeaseFormForCreate() specifying the desired peers and record Types or none if no record Types are needed. The returned LeaseForm 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 LeaseForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each LeaseForm corresponds to an attempted transaction.

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

The delete operations delete Leases. To unmap a Lease from the current Campus, the LeaseCampusAssignmentSession should be used. These delete operations attempt to remove the Lease itself thus removing it from all known Campus catalogs.

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

MethodgetCampusId
Description

Gets the Campus Id associated with this session.

Returnosid.id.Idthe Campus Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetCampus
Description

Gets the Campus associated with this session.

Returnosid.room.Campusthe campus
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateLeases
Description

Tests if this user can create Leases. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Lease 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.

Returnboolean false if Lease creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateLeaseWithRecordTypes
Description

Tests if this user can create a single Lease using the desired record interface types. While RoomSquattingManager.getLeaseRecordTypes() can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specific Lease. Providing an empty array tests if a Lease can be created with no records.

Parametersosid.type.Type[]leaseRecordTypesarray of lease record types
Returnboolean true if Lease creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT leaseRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetLeaseFormForCreate
Description

Gets the lease form for creating new leases. A new form should be requested for each create transaction.

Parametersosid.id.IdroomIda room Id
osid.id.IdresourceIda tenant resource Id
osid.type.Type[]leaseRecordTypesarray of lease record types
Returnosid.room.squatting.LeaseFormthe lease form
ErrorsNOT_FOUND roomId or resourceId is not found
NULL_ARGUMENT roomId, resourceId, or leaseRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get from for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateLease
Description

Creates a new Lease.

Parametersosid.room.squatting.LeaseFormleaseFormthe form for this Lease
Returnosid.room.squatting.Leasethe new Lease
ErrorsILLEGAL_STATE leaseForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT leaseForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED leaseForm did not originate from getLeaseFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateLeases
Description

Tests if this user can update Leases. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Lease 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.

Returnboolean false if Lease modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetLeaseFormForUpdate
Description

Gets the lease form for updating an existing lease. A new lease form should be requested for each update transaction.

Parametersosid.id.IdleaseIdthe Id of the Lease
Returnosid.room.squatting.LeaseFormthe lease form
ErrorsNOT_FOUND leaseId is not found
NULL_ARGUMENT leaseId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateLease
Description

Updates an existing lease.

Parametersosid.room.squatting.LeaseFormleaseFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE leaseForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT leaseForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED leaseForm did not originate from getLeaseFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteLeases
Description

Tests if this user can delete Leases A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Lease 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.

Returnboolean false if Lease deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteLease
Description

Deletes a Lease.

Parametersosid.id.IdleaseIdthe Id of the Lease to remove
ErrorsNOT_FOUND leaseId not found
NULL_ARGUMENT leaseId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageLeaseAliases
Description

Tests if this user can manage Id aliases for Leases. 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.

Returnboolean false if Lease aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasLease
Description

Adds an Id to a Lease for the purpose of creating compatibility. The primary Id of the Lease is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another lease, it is reassigned to the given lease Id.

Parametersosid.id.IdleaseIdthe Id of a Lease
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND leaseId not found
NULL_ARGUMENT leaseId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.