Package org.yamcs.parameter
Class ParameterWithIdRequestHelper
java.lang.Object
org.yamcs.parameter.ParameterWithIdRequestHelper
- All Implemented Interfaces:
ParameterConsumer
This sits in front of the ParameterRequestManager and implements subscriptions based on NamedObjectId taking care to
send to the consumers the parameters with the requested id.
A client can request in fact the same parameter with two different names and they will get it twice each time.
In addition it can also provide updates on parameter expirations.
TODO: impose some subscription limits
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
addItemsToRequest
(int subscriptionId, List<Yamcs.NamedObjectId> idList, User user) int
addRequest
(List<Yamcs.NamedObjectId> idList, boolean checkExpiration, User user) int
addRequest
(List<Yamcs.NamedObjectId> idList, User user) static ParameterWithId
static List<ParameterWithId>
checkNames
(ParameterRequestManager prm, List<Yamcs.NamedObjectId> idList) getPrm()
getValuesFromCache
(int subscriptionId) retrieve the subscribed values from cachegetValuesFromCache
(List<Yamcs.NamedObjectId> idList, User user) Retrieve a list of parameter values from cache.void
quit()
void
removeItemsFromRequest
(int subscriptionId, List<Yamcs.NamedObjectId> parameterIds, User user) void
removeRequest
(int subscriptionId) selectPrm
(ParameterRequestManager prm, User user) int
subscribeAll
(User user) switchPrm
(ParameterRequestManager newPrm, User user) Change processor and return the list of parameters that were valid in the old processor and are not anymorevoid
void
updateItems
(int subscriptionId, List<ParameterValue> items)
-
Constructor Details
-
ParameterWithIdRequestHelper
-
-
Method Details
-
addRequest
public int addRequest(List<Yamcs.NamedObjectId> idList, User user) throws InvalidIdentification, NoPermissionException -
addRequest
public int addRequest(List<Yamcs.NamedObjectId> idList, boolean checkExpiration, User user) throws InvalidIdentification, NoPermissionException -
addItemsToRequest
public void addItemsToRequest(int subscriptionId, List<Yamcs.NamedObjectId> idList, User user) throws InvalidIdentification, NoPermissionException -
checkName
public static ParameterWithId checkName(ParameterRequestManager prm, Yamcs.NamedObjectId id) throws InvalidIdentification - Throws:
InvalidIdentification
-
checkNames
public static List<ParameterWithId> checkNames(ParameterRequestManager prm, List<Yamcs.NamedObjectId> idList) throws InvalidIdentification - Throws:
InvalidIdentification
-
removeRequest
public void removeRequest(int subscriptionId) -
removeItemsFromRequest
public void removeItemsFromRequest(int subscriptionId, List<Yamcs.NamedObjectId> parameterIds, User user) throws NoPermissionException - Throws:
NoPermissionException
-
getPrm
-
subscribeAll
- Throws:
NoPermissionException
-
getValuesFromCache
retrieve the subscribed values from cache- Parameters:
subscriptionId
-- Returns:
-
getValuesFromCache
public List<ParameterValueWithId> getValuesFromCache(List<Yamcs.NamedObjectId> idList, User user) throws InvalidIdentification, NoPermissionException Retrieve a list of parameter values from cache. This call does not block.- Parameters:
idList
-user
-- Returns:
- Throws:
InvalidIdentification
NoPermissionException
-
updateItems
- Specified by:
updateItems
in interfaceParameterConsumer
-
unselectPrm
public void unselectPrm() -
selectPrm
public List<Yamcs.NamedObjectId> selectPrm(ParameterRequestManager prm, User user) throws NoPermissionException - Throws:
NoPermissionException
-
switchPrm
public List<Yamcs.NamedObjectId> switchPrm(ParameterRequestManager newPrm, User user) throws NoPermissionException Change processor and return the list of parameters that were valid in the old processor and are not anymore- Throws:
NoPermissionException
-
quit
public void quit()
-