Interface MeterUtilityAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface MeterUtilityAssignmentSession extends OsidSession

This session provides methods to re-assign Meters to Utility objects A Meter may appear in multiple Utility objects and removing the last reference to a Meter is the equivalent of deleting it. Each Utility may have its own authorizations governing who is allowed to operate on it.

Moving or adding a reference of a Meter to another Utility is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignMeters

      boolean canAssignMeters()
      Tests if this user can alter meter/utility mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignMetersToUtility

      boolean canAssignMetersToUtility(Id utilityId)
      Tests if this user can alter meter/utility mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      utilityId - the Id of the Utility
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - utilityId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableUtilityIds

      IdList getAssignableUtilityIds(Id utilityId) throws OperationFailedException
      Gets a list of utilities including and under the given utility node in which any meter can be assigned.
      Parameters:
      utilityId - the Id of the Utility
      Returns:
      list of assignable utility Ids
      Throws:
      NullArgumentException - utilityId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableUtilityIdsForMeter

      IdList getAssignableUtilityIdsForMeter(Id utilityId, Id meterId) throws OperationFailedException
      Gets a list of utilities including and under the given utility node in which a specific meter can be assigned.
      Parameters:
      utilityId - the Id of the Utility
      meterId - the Id of the Meter
      Returns:
      list of assignable utility Ids
      Throws:
      NullArgumentException - utility or meterId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignMeterToUtility

      void assignMeterToUtility(Id meterId, Id utilityId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Meter to a Utility .
      Parameters:
      meterId - the Id of the Meter
      utilityId - the Id of the Utility
      Throws:
      AlreadyExistsException - meterId is already assigned to utilityId
      NotFoundException - meterId or utilityId not found
      NullArgumentException - meterId or utilityId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignMeterFromUtility

      void unassignMeterFromUtility(Id meterId, Id utilityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Meter from a Utility .
      Parameters:
      meterId - the Id of the Meter
      utilityId - the Id of the Utility
      Throws:
      NotFoundException - meterId or utilityId not found or meterId not assigned to utilityId
      NullArgumentException - meterId or utilityId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.