PROD_PERM and PEList

philippe.mesmeur
philippe.mesmeur Newcomer
edited December 2024 in RFA

Hello,

I use the Java/RefinitivSDK 3.7.0.0 in order to receive RealTime data from TREP.

Once a RealTIme data is subscribed, the API notifies me through my implementation of the interface method OmmConsumerClient.onRefreshMsg(RefreshMsg refreshMsg, OmmConsumerEvent event)

The RefreshMsg argument provides:

  • the permission of the RealTime data (cf method ByteBuffer RefreshMsg.permissionData())
  • and also a PROD_PERM, that is an integer obtainable by getting the value of the field "PROD_PERM" (fields are obtained by calling refreshMsg.payload().fieldList())

For example, when subscribing to CZK2MD=, I get

  • permissionData: { 0x03, 0x01, 0x01, 0x28, 0x70, 0xC0 }
  • PROD_PERM: 2870

Today, I use the permissionData in order to "know" whether a user is allowed to use the RealTime data. Do do so, I use Java/RFA 8.2.1.L3 with something like:

    ByteBuffer dacsPermission;
    byte[] arr = new byte[dacsPermission.remaining()];
    dacsPermission.get(arr);
    AuthorizationLock authorizationLock = new AuthorizationLock(arr);

    ... 
    
    byte[] dacsLock = authorizationLock.getAuthorizationLock().clone();

    ...
    
    AuthorizationCheckResult authCheckResult =
            agent.checkSubscription(handle,
                    AuthorizationUsageType.DONT_PERFORM_USAGE_LOGGING,
                    AuthorizationRequestType.NORMAL_REQUEST_LOGGING,
                    new AuthorizationCheckStatus(),
                    "IDN_SELECTFEED",
                    "",
                    dacsLock);

    boolean isAuthorized = (authCheckResult == AuthorizationCheckResult.ACCESS_ALLOWED);

I would like to know if it is possible get the same information using the PROD_PERM instead of the permissionData.

Thank you to also explain the difference and/or the relationship between PROD_PERM and permissionData

Regards

Philippe

Best Answers

  • Gurpreet
    Gurpreet admin
    Answer ✓

    prod perm contains the PE code, which can be used to generate the dacs lock

    AuthorizationLock authLock = new AuthorizationLock( serviceID, AuthorizationLock.OR, vPEList );
    byte[] dacsLock = authLock.getAuthorizationLock();
    
    

    Why won't you want to use the permission data?

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    A DACS Lock contains both a service ID and PEs. Therefore, to access the data, users must have permission for both a service and content.

    Yes, you can use the getServiceAttributes to get service IDs. For example:

    11:06:55	AuthorizationAgent::getServiceAttrbutes() return successfulLookup
    11:06:55 Service Attributes Result:
    ID Name QOS Type Vendor
    =================================================================
    257 ATS1_7 R:0 SC IDN
    8093 ELEKTRON_RDF R:0 SC IDN
    8590 ELEKTRON_DD R:0 SC IDN
  • philippe.mesmeur
    philippe.mesmeur Newcomer
    Answer ✓

    thank you for this quick reply but I don't think it answers my question

    I think what I want to do is more simple; given an AuthorizationLock instance, how can I get/extract/obtain the PROD_PERM?

Answers

  • Hello Philippe,

    The field PROD_PERM contains the PE code for the item and can also be used for entitlement checks, although the permission data is a better option. This question and this one has more information about it.

  • *-Hello,

    First of all, thank you for this quick answer

    I am currently investigating the links you provided me.

    As I understand in your answer and also in PROD_PERM and DACS lock, it is possible to use whether permData or PROD_PERM, but it is better to use permData

    However, I do not really understand the answer to the question:

    Q: Any specific reason it is preferred to use permission data from refresh over PROD_PERM?

    A: With PROD_PERM, the client needs to use OpenDACS API to create a DACS lock from the PE. Then use the created DACS lock to perform CBE checks.

    Indeed, I think that for me, it would be really better to use PROD_PERM instead of permission data. (In the example I gave yesterday, I think it would be better for me to use PROD_PERM: 2870 instead of permissionData: { 0x03, 0x01, 0x01, 0x28, 0x70, 0xC0 }). Do think it could be a problem?

    Currently, the only thing I do with the permissionData is to create an AuthorizationLock. I would need to do the same from a PROD_PERM

    I tried to find how to do it but I didn't: can you explain me how to create an AuthorizationLock from a PROD_PERM

    Thank you

  • Thank you, it looks clear. I guess that every time I'll have to check the permission of one user for one market data, I'll have to create one AuthorizationLock with a vPEList containing one single entry, i.e. the PROD_PERM of the market data to be checked. Am I right?

    In order to use this way of creating an AuthorizationLock, I'll have to provide a serviceID, that is an integer. What is the best way of getting a serviceID from a serviceName (e.g. "IDN_SELECTFEED"). I found method AuthorizationAgent.getServiceAttributes(). Is there something better?

    Why won't you want to use the permission data?

    According to client's needs, my application is able to work with LSEG and/or Bloomberg realtime market data

    As Bloomberg's BlpAPI identifies the permission of its market data via an integer (called eid), it is easier for me (in order to be homogeneous) if I can do the same with LSEG permissions

    Regards,

    Philippe

  • Every thing is perfectly clear now

    If I have additional questions I'll come back to you

    Thank you

    Philippe

  • Hi,

    I realize that I'm missing one information: what is the best way (which RFA function should I use in order) to get/extract the PROD_PERM from the permissionData?

    In other word, which RFA function should I use in order to get - in my example - 2870 from { 0x03, 0x01, 0x01, 0x28, 0x70, 0xC0 }

    Thank you

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @philippe.mesmeur

    If you are using RFA Java, the code should be like this:

        public void processEvent(Event event)
    {


    OMMItemEvent ie = (OMMItemEvent)event;
    OMMMsg respMsg = ie.getMsg();

    byte [] dacsLock = null;
    if ((respMsg.getMsgModelType() == com.reuters.rfa.rdm.RDMMsgTypes.MARKET_PRICE) &&
    (respMsg.getMsgType()==com.reuters.rfa.omm.OMMMsg.MsgType.REFRESH_RESP))
    {
    if (respMsg.has(OMMMsg.HAS_PERMISSION_DATA)) {
    dacsLock = respMsg.getPermissionData().clone();
    System.out.println("DACS Lock was got from the Refresh");
    }

    }
    }

    }