use of iso.std.iso_iec._24727.tech.schema.Wait in project open-ecard by ecsec.
the class StatusHandler method handleRequest.
/**
* Handles a Status-Request by returning a status message describing the capabilities if the App.
*
* @param statusRequest Status Request possibly containing a session identifier for event registration.
* @return Status message.
*/
public StatusResponse handleRequest(StatusRequest statusRequest) {
Status status = new Status();
// user agent
StatusType.UserAgent ua = new StatusType.UserAgent();
ua.setName(AppVersion.getName());
ua.setVersionMajor(BigInteger.valueOf(AppVersion.getMajor()));
ua.setVersionMinor(BigInteger.valueOf(AppVersion.getMinor()));
ua.setVersionSubminor(BigInteger.valueOf(AppVersion.getPatch()));
status.setUserAgent(ua);
// API versions
StatusType.SupportedAPIVersions apiVersion = new StatusType.SupportedAPIVersions();
apiVersion.setName("http://www.bsi.bund.de/ecard/api");
apiVersion.setVersionMajor(ECardConstants.ECARD_API_VERSION_MAJOR);
apiVersion.setVersionMinor(ECardConstants.ECARD_API_VERSION_MINOR);
apiVersion.setVersionSubminor(ECardConstants.ECARD_API_VERSION_SUBMINOR);
status.getSupportedAPIVersions().add(apiVersion);
// supported cards
List<CardInfoType> cifs = rec.getCardInfos();
List<StatusType.SupportedCards> supportedCards = getSupportedCards(protocols, cifs);
status.getSupportedCards().addAll(supportedCards);
// supported DID protocols
status.getSupportedDIDProtocols().addAll(protocols);
// TODO: additional features
// add available cards
status.getConnectionHandle().addAll(getCardHandles());
// register session for wait for change
if (statusRequest.hasSessionIdentifier()) {
String sessionIdentifier = statusRequest.getSessionIdentifier();
eventHandler.addQueue(sessionIdentifier);
}
return new StatusResponse(status);
}
Aggregations