// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/entity/format/SignatureFormat.java
// public class SignatureFormat extends GeneralEnum {
//     public static final String XAdES_NAME = "XAdES";
//     public static final String CAdES_NAME = "CAdES";
//     public static final String PAdES_NAME = "PAdES";
// 
//     public static final SignatureFormat XAdES = new SignatureXAdESFormat(XAdES_NAME);
//     public static final SignatureFormat CAdES = new SignatureCAdESFormat(CAdES_NAME);
//     public static final SignatureFormat PAdES = new SignaturePAdESFormat(PAdES_NAME);
// 
//     public SignatureFormat(String value) {
//         super(value);
//     }
// }
// 
// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/entity/format/SignatureXAdESFormat.java
// public class SignatureXAdESFormat extends SignatureFormat {
//     public SignatureXAdESFormat(String value) {
//         super(value);
//     }
// }
// 
// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/entity/level/SignatureXAdESLevel.java
// public class SignatureXAdESLevel extends SignatureLevel {
//     public static SignatureXAdESLevel BES = new SignatureXAdESLevel(SignatureLevel.BES);
//     public static SignatureXAdESLevel EPES = new SignatureXAdESLevel(SignatureLevel.EPES);
//     public static SignatureXAdESLevel T = new SignatureXAdESLevel(SignatureLevel.T);
//     public static SignatureXAdESLevel C = new SignatureXAdESLevel(SignatureLevel.C);
//     public static SignatureXAdESLevel X = new SignatureXAdESLevel(SignatureLevel.X);
//     public static SignatureXAdESLevel XL = new SignatureXAdESLevel(SignatureLevel.XL);
//     public static SignatureXAdESLevel A = new SignatureXAdESLevel(SignatureLevel.A);
// 
//     public SignatureXAdESLevel(String value) {
//         super(value);
//     }
// }
// 
// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/entity/packaging/SignatureXAdESPackaging.java
// public class SignatureXAdESPackaging extends SignaturePackaging {
//     public static SignatureXAdESPackaging ENVELOPING = new SignatureXAdESPackaging(SignaturePackaging.ENVELOPING);
//     public static SignatureXAdESPackaging ENVELOPED = new SignatureXAdESPackaging(SignaturePackaging.ENVELOPED);
//     public static SignatureXAdESPackaging DETACHED = new SignatureXAdESPackaging(SignaturePackaging.DETACHED);
// 
//     public SignatureXAdESPackaging(String value) {
//         super(value);
//     }
// }
// 
// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/exception/SignatureServiceUrlException.java
// public class SignatureServiceUrlException extends SignatureException {
//     public SignatureServiceUrlException() {
//     }
//     public SignatureServiceUrlException(Exception e) {
//         super(e);
//     }
// 
//     @Override
//     public String getMessage() {
//         return "The service URL was required but not specified!";
//     }
// }


import it.latraccia.dss.util.entity.format.SignatureFormat;
import it.latraccia.dss.util.entity.format.SignatureXAdESFormat;
import it.latraccia.dss.util.entity.level.SignatureXAdESLevel;
import it.latraccia.dss.util.entity.packaging.SignatureXAdESPackaging;
import it.latraccia.dss.util.exception.SignatureServiceUrlException;
/*
 * SD-DSS-Util, a Utility Library and a Command Line Interface for SD-DSS.
 * Copyright (C) 2013 La Traccia http://www.latraccia.it/en/
 * Developed by Francesco Pontillo
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see [http://www.gnu.org/licenses/].
 */

package it.latraccia.dss.util.builder.format;


/**
 * Date: 06/12/13
 * Time: 11.10
 *
 * @author Francesco Pontillo
 */
public class XAdESFormatBuilder extends FormatBuilder<SignatureXAdESFormat> {

    // FORMAT

    public XAdESFormatBuilder() {
        setFormat(SignatureFormat.XAdES);
    }

    // LEVEL

    public XAdESFormatBuilder BES() {
        setLevel(SignatureXAdESLevel.BES);
        return this;
    }

    public XAdESFormatBuilder EPES() {
        setLevel(SignatureXAdESLevel.EPES);
        return this;
    }

    public XAdESFormatBuilder T(String serviceUrl) throws SignatureServiceUrlException {
        setLevel(SignatureXAdESLevel.T);
        setServiceUrl(serviceUrl);
        return this;
    }

    public XAdESFormatBuilder C(String serviceUrl) throws SignatureServiceUrlException {
        setLevel(SignatureXAdESLevel.C);
        setServiceUrl(serviceUrl);
        return this;
    }

// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/entity/format/SignatureFormat.java
// public class SignatureFormat extends GeneralEnum {
//     public static final String XAdES_NAME = "XAdES";
//     public static final String CAdES_NAME = "CAdES";
//     public static final String PAdES_NAME = "PAdES";
// 
//     public static final SignatureFormat XAdES = new SignatureXAdESFormat(XAdES_NAME);
//     public static final SignatureFormat CAdES = new SignatureCAdESFormat(CAdES_NAME);
//     public static final SignatureFormat PAdES = new SignaturePAdESFormat(PAdES_NAME);
// 
//     public SignatureFormat(String value) {
//         super(value);
//     }
// }
// 
// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/entity/format/SignatureXAdESFormat.java
// public class SignatureXAdESFormat extends SignatureFormat {
//     public SignatureXAdESFormat(String value) {
//         super(value);
//     }
// }
// 
// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/entity/level/SignatureXAdESLevel.java
// public class SignatureXAdESLevel extends SignatureLevel {
//     public static SignatureXAdESLevel BES = new SignatureXAdESLevel(SignatureLevel.BES);
//     public static SignatureXAdESLevel EPES = new SignatureXAdESLevel(SignatureLevel.EPES);
//     public static SignatureXAdESLevel T = new SignatureXAdESLevel(SignatureLevel.T);
//     public static SignatureXAdESLevel C = new SignatureXAdESLevel(SignatureLevel.C);
//     public static SignatureXAdESLevel X = new SignatureXAdESLevel(SignatureLevel.X);
//     public static SignatureXAdESLevel XL = new SignatureXAdESLevel(SignatureLevel.XL);
//     public static SignatureXAdESLevel A = new SignatureXAdESLevel(SignatureLevel.A);
// 
//     public SignatureXAdESLevel(String value) {
//         super(value);
//     }
// }
// 
// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/entity/packaging/SignatureXAdESPackaging.java
// public class SignatureXAdESPackaging extends SignaturePackaging {
//     public static SignatureXAdESPackaging ENVELOPING = new SignatureXAdESPackaging(SignaturePackaging.ENVELOPING);
//     public static SignatureXAdESPackaging ENVELOPED = new SignatureXAdESPackaging(SignaturePackaging.ENVELOPED);
//     public static SignatureXAdESPackaging DETACHED = new SignatureXAdESPackaging(SignaturePackaging.DETACHED);
// 
//     public SignatureXAdESPackaging(String value) {
//         super(value);
//     }
// }
// 
// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/exception/SignatureServiceUrlException.java
// public class SignatureServiceUrlException extends SignatureException {
//     public SignatureServiceUrlException() {
//     }
//     public SignatureServiceUrlException(Exception e) {
//         super(e);
//     }
// 
//     @Override
//     public String getMessage() {
//         return "The service URL was required but not specified!";
//     }
// }


// Path: sd-dss-util-lib/src/main/java/it/latraccia/dss/util/builder/format/XAdESFormatBuilder.java
import it.latraccia.dss.util.entity.format.SignatureFormat;
import it.latraccia.dss.util.entity.format.SignatureXAdESFormat;
import it.latraccia.dss.util.entity.level.SignatureXAdESLevel;
import it.latraccia.dss.util.entity.packaging.SignatureXAdESPackaging;
import it.latraccia.dss.util.exception.SignatureServiceUrlException;

/*
 * SD-DSS-Util, a Utility Library and a Command Line Interface for SD-DSS.
 * Copyright (C) 2013 La Traccia http://www.latraccia.it/en/
 * Developed by Francesco Pontillo
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see [http://www.gnu.org/licenses/].
 */

package it.latraccia.dss.util.builder.format;


/**
 * Date: 06/12/13
 * Time: 11.10
 *
 * @author Francesco Pontillo
 */
public class XAdESFormatBuilder extends FormatBuilder<SignatureXAdESFormat> {

    // FORMAT

    public XAdESFormatBuilder() {
        setFormat(SignatureFormat.XAdES);
    }

    // LEVEL

    public XAdESFormatBuilder BES() {
        setLevel(SignatureXAdESLevel.BES);
        return this;
    }

    public XAdESFormatBuilder EPES() {
        setLevel(SignatureXAdESLevel.EPES);
        return this;
    }

    public XAdESFormatBuilder T(String serviceUrl) throws SignatureServiceUrlException {
        setLevel(SignatureXAdESLevel.T);
        setServiceUrl(serviceUrl);
        return this;
    }

    public XAdESFormatBuilder C(String serviceUrl) throws SignatureServiceUrlException {
        setLevel(SignatureXAdESLevel.C);
        setServiceUrl(serviceUrl);
        return this;
    }

    public XAdESFormatBuilder X(String serviceUrl) throws SignatureServiceUrlException {