Interface EndpointAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface EndpointAdminSession extends OsidSession

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

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

The delete operations delete Endpoints.

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

  • Method Details

    • canCreateEndpoints

      boolean canCreateEndpoints()
      Tests if this user can create Endpoints. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Endpoint 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 Endpoint creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateEndpointWithRecordTypes

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

      EndpointForm getEndpointFormForCreate(Type[] endpointRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the endpoint form for creating new endpoints.
      Parameters:
      endpointRecordTypes - array of endpoint record types
      Returns:
      the endpoint form
      Throws:
      NullArgumentException - endpointRecordTypes 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.
    • createEndpoint

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

      boolean canUpdateEndpoints()
      Tests if this user can update Endpoints. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Endpoint 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 Endpoint modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getEndpointFormForUpdate

      Gets the endpoint form for updating an existing endpoint. A new endpoint form should be requested for each update transaction.
      Parameters:
      endpointId - the Id of the Endpoint
      Returns:
      the endpoint form
      Throws:
      NotFoundException - endpointId is not found
      NullArgumentException - endpointId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateEndpoint

      void updateEndpoint(EndpointForm endpointForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing endpoint.
      Parameters:
      endpointForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - endpointForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - endpointId or endpointForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - endpointForm did not originate from getEndpointFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteEndpoints

      boolean canDeleteEndpoints()
      Tests if this user can delete Endpoints. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Endpoint 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 Endpoint deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteEndpoint

      void deleteEndpoint(Id endpointId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a Endpoint.
      Parameters:
      endpointId - the Id of the Endpoint to remove
      Throws:
      NotFoundException - endpointId not found
      NullArgumentException - endpointId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageEndpointAliases

      boolean canManageEndpointAliases()
      Tests if this user can manage Id aliases for Endpoints . 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 Endpoint aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasEndpoint

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