Interface MeterUtilityAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionvoidassignMeterToUtility(Id meterId, Id utilityId) Adds an existingMeterto aUtility.booleanTests if this user can alter meter/utility mappings.booleancanAssignMetersToUtility(Id utilityId) Tests if this user can alter meter/utility mappings.getAssignableUtilityIds(Id utilityId) Gets a list of utilities including and under the given utility node in which any meter can be assigned.getAssignableUtilityIdsForMeter(Id utilityId, Id meterId) Gets a list of utilities including and under the given utility node in which a specific meter can be assigned.voidunassignMeterFromUtility(Id meterId, Id utilityId) Removes aMeterfrom aUtility.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignMetersToUtility
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
utilityId- theIdof theUtility- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-utilityIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableUtilityIds
Gets a list of utilities including and under the given utility node in which any meter can be assigned.- Parameters:
utilityId- theIdof theUtility- Returns:
- list of assignable utility
Ids - Throws:
NullArgumentException-utilityIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableUtilityIdsForMeter
Gets a list of utilities including and under the given utility node in which a specific meter can be assigned.- Parameters:
utilityId- theIdof theUtilitymeterId- theIdof theMeter- Returns:
- list of assignable utility
Ids - Throws:
NullArgumentException-utilityormeterIdisnullOperationFailedException- 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 existingMeterto aUtility.- Parameters:
meterId- theIdof theMeterutilityId- theIdof theUtility- Throws:
AlreadyExistsException-meterIdis already assigned toutilityIdNotFoundException-meterIdorutilityIdnot foundNullArgumentException-meterIdorutilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignMeterFromUtility
void unassignMeterFromUtility(Id meterId, Id utilityId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aMeterfrom aUtility.- Parameters:
meterId- theIdof theMeterutilityId- theIdof theUtility- Throws:
NotFoundException-meterIdorutilityIdnot found ormeterIdnot assigned toutilityIdNullArgumentException-meterIdorutilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-