Package org.yamcs.parameter
Class ParameterWithIdRequestHelper
- java.lang.Object
-
- org.yamcs.parameter.ParameterWithIdRequestHelper
-
- All Implemented Interfaces:
ParameterConsumer
public class ParameterWithIdRequestHelper extends Object implements 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
Constructors Constructor Description ParameterWithIdRequestHelper(ParameterRequestManager prm, ParameterWithIdConsumer listener)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItemsToRequest(int subscriptionId, List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList, User user)intaddRequest(List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList, boolean checkExpiration, User user)intaddRequest(List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList, User user)static ParameterWithIdcheckName(ParameterRequestManager prm, org.yamcs.protobuf.Yamcs.NamedObjectId id)static List<ParameterWithId>checkNames(ParameterRequestManager prm, List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList)ParameterRequestManagergetPrm()List<ParameterValueWithId>getValuesFromCache(int subscriptionId)retrieve the subscribed values from cacheList<ParameterValueWithId>getValuesFromCache(List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList, User user)voidquit()voidremoveItemsFromRequest(int subscriptionId, List<org.yamcs.protobuf.Yamcs.NamedObjectId> parameterIds, User user)voidremoveRequest(int subscriptionId)List<org.yamcs.protobuf.Yamcs.NamedObjectId>selectPrm(ParameterRequestManager prm, User user)intsubscribeAll(User user)List<org.yamcs.protobuf.Yamcs.NamedObjectId>switchPrm(ParameterRequestManager newPrm, User user)Change processor and return the list of parameters that were valid in the old processor and are not anymorevoidunselectPrm()voidupdateItems(int subscriptionId, List<ParameterValue> items)
-
-
-
Constructor Detail
-
ParameterWithIdRequestHelper
public ParameterWithIdRequestHelper(ParameterRequestManager prm, ParameterWithIdConsumer listener)
-
-
Method Detail
-
addRequest
public int addRequest(List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList, User user) throws InvalidIdentification, NoPermissionException
-
addRequest
public int addRequest(List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList, boolean checkExpiration, User user) throws InvalidIdentification, NoPermissionException
-
addItemsToRequest
public void addItemsToRequest(int subscriptionId, List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList, User user) throws InvalidIdentification, NoPermissionException
-
checkName
public static ParameterWithId checkName(ParameterRequestManager prm, org.yamcs.protobuf.Yamcs.NamedObjectId id) throws InvalidIdentification
- Throws:
InvalidIdentification
-
checkNames
public static List<ParameterWithId> checkNames(ParameterRequestManager prm, List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList) throws InvalidIdentification
- Throws:
InvalidIdentification
-
removeRequest
public void removeRequest(int subscriptionId)
-
removeItemsFromRequest
public void removeItemsFromRequest(int subscriptionId, List<org.yamcs.protobuf.Yamcs.NamedObjectId> parameterIds, User user) throws NoPermissionException- Throws:
NoPermissionException
-
getPrm
public ParameterRequestManager getPrm()
-
subscribeAll
public int subscribeAll(User user) throws NoPermissionException
- Throws:
NoPermissionException
-
getValuesFromCache
public List<ParameterValueWithId> getValuesFromCache(int subscriptionId)
retrieve the subscribed values from cache- Parameters:
subscriptionId-- Returns:
-
getValuesFromCache
public List<ParameterValueWithId> getValuesFromCache(List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList, User user) throws InvalidIdentification, NoPermissionException
-
updateItems
public void updateItems(int subscriptionId, List<ParameterValue> items)- Specified by:
updateItemsin interfaceParameterConsumer
-
unselectPrm
public void unselectPrm()
-
selectPrm
public List<org.yamcs.protobuf.Yamcs.NamedObjectId> selectPrm(ParameterRequestManager prm, User user) throws NoPermissionException
- Throws:
NoPermissionException
-
switchPrm
public List<org.yamcs.protobuf.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()
-
-