Search in sources :

Example 16 with Wait

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);
}
Also used : Status(org.openecard.ws.schema.Status) CardInfoType(iso.std.iso_iec._24727.tech.schema.CardInfoType) StatusType(org.openecard.ws.schema.StatusType)

Aggregations

ConnectionHandleType (iso.std.iso_iec._24727.tech.schema.ConnectionHandleType)6 Result (oasis.names.tc.dss._1_0.core.schema.Result)5 Disconnect (iso.std.iso_iec._24727.tech.schema.Disconnect)4 ArrayList (java.util.ArrayList)4 ChannelHandleType (iso.std.iso_iec._24727.tech.schema.ChannelHandleType)3 EstablishContextResponse (iso.std.iso_iec._24727.tech.schema.EstablishContextResponse)3 IFDStatusType (iso.std.iso_iec._24727.tech.schema.IFDStatusType)3 Wait (iso.std.iso_iec._24727.tech.schema.Wait)3 BeginTransaction (iso.std.iso_iec._24727.tech.schema.BeginTransaction)2 BeginTransactionResponse (iso.std.iso_iec._24727.tech.schema.BeginTransactionResponse)2 DIDAuthenticate (iso.std.iso_iec._24727.tech.schema.DIDAuthenticate)2 DIDAuthenticateResponse (iso.std.iso_iec._24727.tech.schema.DIDAuthenticateResponse)2 DIDAuthenticationDataType (iso.std.iso_iec._24727.tech.schema.DIDAuthenticationDataType)2 PathSecurityType (iso.std.iso_iec._24727.tech.schema.PathSecurityType)2 Transmit (iso.std.iso_iec._24727.tech.schema.Transmit)2 TransmitResponse (iso.std.iso_iec._24727.tech.schema.TransmitResponse)2 WaitResponse (iso.std.iso_iec._24727.tech.schema.WaitResponse)2 BigInteger (java.math.BigInteger)2 WSException (org.openecard.common.WSHelper.WSException)2 Document (org.w3c.dom.Document)2