Interface SignalAdminSession

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

public interface SignalAdminSession extends OsidSession

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

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

The delete operations delete Signals . To unmap a Signal from the current Map , the SignalMapAssignmentSession should be used. These delete operations attempt to remove the Signal itself thus removing it from all known Map catalogs.

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

  • Method Details

    • getMapId

      Id getMapId()
      Gets the Map Id associated with this session.
      Returns:
      the Map Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getMap

      Gets the Map associated with this session.
      Returns:
      the map
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateSignals

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

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

      SignalForm getSignalFormForCreate(Id pathId, Type[] signalRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the signal form for creating new signals. A new form should be requested for each create transaction.
      Parameters:
      pathId - Id of the path
      signalRecordTypes - array of signal record types
      Returns:
      the signal form
      Throws:
      NotFoundException - pathId is not found
      NullArgumentException - pathId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form with given record types
      Compliance:
      mandatory - This method must be implemented.
    • createSignal

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

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

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

      void updateSignal(SignalForm signalForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing signal.
      Parameters:
      signalForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - signalForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - signalId or signalForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - signalForm did not originate from getSignalFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteSignals

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

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

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

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