Package org.apache.ws.security.util

Examples of org.apache.ws.security.util.XmlSchemaDateFormat


        OMElement reqSecTokenElem = null;
        Node assertionElement = null;
        Token assertionToken = null;

        // Use GMT time in milliseconds
        zulu = new XmlSchemaDateFormat();

        // Add the Lifetime element
        TrustUtil.createLifetimeElement(wstVersion, rstrElem, zulu.format(notBefore), zulu
                .format(notAfter));
View Full Code Here


                            RahasConstants.WSP_PREFIX), rstrElem);
            appliesToElem.addChild(appliesToEpr);
        }

        // Use GMT time in milliseconds
        zulu = new XmlSchemaDateFormat();

        // Add the Lifetime element
        TrustUtil.createLifetimeElement(wstVersion, rstrElem, zulu.format(notBefore), zulu
                .format(notAfter));
        reqSecTokenElem = TrustUtil.createRequestedSecurityTokenElement(wstVersion, rstrElem);
View Full Code Here

                TrustUtil.createAppliesToElement(rstrElem, data
                        .getAppliesToAddress(), data.getAddressingNs());
            }

            // Use GMT time in milliseconds
            DateFormat zulu = new XmlSchemaDateFormat();

            // Add the Lifetime element
            TrustUtil.createLifetimeElement(wstVersion, rstrElem, zulu
                    .format(creationTime), zulu.format(expirationTime));

            // Create the RequestedSecurityToken element and add the SAML token
            // to it
            OMElement reqSecTokenElem = TrustUtil
                    .createRequestedSecurityTokenElement(wstVersion, rstrElem);
View Full Code Here

        String strNotBefore = validityIntervalElem
                .getAttributeValue(XKMS2Constants.Q_ATTR_NOT_BEFORE);
        String strNotOnOrAfter = validityIntervalElem
                .getAttributeValue(XKMS2Constants.Q_ATTR_NOT_ON_OR_AFTER);

        DateFormat zulu = new XmlSchemaDateFormat();

        try {
            if (strNotBefore != null) {
                Calendar calendar = Calendar.getInstance();
                calendar.setTime(zulu.parse(strNotBefore));
                validityInterval.setNotBefore(calendar);
            }

            if (strNotOnOrAfter != null) {
                Calendar calendar = Calendar.getInstance();
                calendar.setTime(zulu.parse(strNotOnOrAfter));
                validityInterval.setNotOnOrAfter(calendar);
            }

        } catch (ParseException xkmse) {
            throw new XKMSException(xkmse);
View Full Code Here

        OMText text = new OMTextImpl(dataHandler, element.getOMFactory());
        element.addChild(text);
    }

    public static String getTimeDate(Date date) {
        DateFormat zulu = new XmlSchemaDateFormat();
        return zulu.format(date);
    }
View Full Code Here

    public String getDateTime() throws XKMSException {
        if (dateTime == null) {
            throw new XKMSException("dateTime is not available");
        }
        DateFormat zulu = new XmlSchemaDateFormat();
        return zulu.format(dateTime.getTime());
    }
View Full Code Here

    }

    public void setDateTime(String dateTime) throws XKMSException {
        this.dateTime = Calendar.getInstance();

        DateFormat zulu = new XmlSchemaDateFormat();
        try {
            this.dateTime.setTime(zulu.parse(dateTime));
        } catch (ParseException e) {
            throw new XKMSException(e);
        }
    }
View Full Code Here

        this.notBefore = notBefore;
    }

    public void setNotBefore(String notBefore) throws XKMSException {
        this.notBefore = Calendar.getInstance();
        DateFormat zulu = new XmlSchemaDateFormat();
        try {
            this.notBefore.setTime(zulu.parse(notBefore));
        } catch (ParseException e) {
            throw new XKMSException(e);
        }
    }
View Full Code Here

        this.notOnOrAfter = notOnOrAfter;
    }

    public void setOnOrAfter(String notOnOrAfter) throws XKMSException {
        this.notOnOrAfter = Calendar.getInstance();
        DateFormat zulu = new XmlSchemaDateFormat();
        try {
            this.notOnOrAfter.setTime(zulu.parse(notOnOrAfter));
        } catch (ParseException e) {
            throw new XKMSException(e);
        }

    }
View Full Code Here

    public OMElement serialize(OMFactory factory) throws XKMSException {
        OMElement validityIntervalEle =
                factory.createOMElement(XKMS2Constants.ELE_VALIDITY_INTERVAL);
        OMNamespace emptyNs = factory.createOMNamespace("", "");
        if (notBefore != null) {
            DateFormat zulu = new XmlSchemaDateFormat();
            validityIntervalEle.addAttribute(XKMS2Constants.ATTR_NOT_BEFORE,
                                             zulu.format(notBefore.getTime()), emptyNs);

        }

        if (notOnOrAfter != null) {
            DateFormat zulu = new XmlSchemaDateFormat();
            validityIntervalEle.addAttribute(XKMS2Constants.ATTR_NOT_ON_OR_AFTER,
                                             zulu.format(notOnOrAfter.getTime()), emptyNs);

        }

        return validityIntervalEle;
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.security.util.XmlSchemaDateFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.