We are trying to use the Java DACS Open API, and are following the tutorial set down.
From tutorial 5 we are generating a dacs lock via the PE codes available to the dacsId requested for via
public List<String> getUserSubServiceList(Handle dacsHandle) throws InterruptedException
{
while (!statusMap.containsKey(dacsHandle)) {
Thread.sleep(10);
}
Vector<AuthorizationUserSubServices> serviceList = new Vector<>();
AuthorizationCheckStatus status = new AuthorizationCheckStatus();
try {
AuthorizationCheckResult authCheckResult = dacsAgent.getUserSubServiceList(dacsHandle, status, SERVICE_NAME, serviceList);
if (authCheckResult == AuthorizationCheckResult.ACCESS_ALLOWED) {
return serviceList.stream()
.map(AuthorizationUserSubServices::getSubServiceName).collect(Collectors.toList());
}
} catch(AuthorizationException ae) {
LOGGER.error("AuthorizationAgent.getUserServiceList() failed");
}
return Lists.emptyList();
}
and cross checking the returned SubService (PDP) codes against the
authCheckResult = dacsAgent.getPeToSubServiceList(status, SERVICE_NAME, listPeToSs)
to generate the list of PE codes to supply to the Lock.
AuthorizationLock lock = new AuthorizationLock(subscribedService.getServiceId(), AuthorizationLock.OR, peCodes);
byte[] dacsLock = lock.getAuthorizationLock();
The using a checkSubscription call on a RIC
AuthorizationCheckResult authCheckResult = dacsAgent.checkSubscription(dacsLoginHandle, authUsage,
AuthorizationRequestType.NORMAL_REQUEST_LOGGING, authCheckStatus, SERVICE_NAME, ric, dacsLock);
This call ALLWAYS returns AuthorizationCheckResult.ACCESS_ALLOWED, even for those RICS which are disallowed under DACS, and return an error when requesting over the EMA libraries in real-time.
So the questions are:
1. What are we doing wrong
2. Are we using the correct service name, currently we have it set to hEDD.