All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.abiquo.server.core.cloud.SSLCertificateDto Maven / Gradle / Ivy

/**
 * Copyright (C) 2008 Abiquo Holdings S.L.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.abiquo.server.core.cloud;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import com.abiquo.model.transport.SingleResourceTransportDto;
import com.abiquo.model.transport.WithProviderId;

/**
 * The only way to create a certificate is by embedding it into a Routing Rule, so it is created and
 * assigned to a routing rule. Abiquo will never store the certificates, so it is required that the
 * creation request ends at the provider. Abiquo does not provide methods to delete or modify
 * certificates, but they can be removed from the routing rules.
 */
@XmlRootElement(name = "sslcertificate")
@XmlType(propOrder = {"name", "providerId", "certificate", "privateKey", "intermediateCertificate"})
public class SSLCertificateDto extends SingleResourceTransportDto implements WithProviderId
{
    private static final long serialVersionUID = 6802371093591387546L;

    private static final String TYPE = "application/vnd.abiquo.sslcertificate";

    public static final String MEDIA_TYPE = TYPE + "+" + JSON;

    public static final String SHORT_MEDIA_TYPE_JSON = MEDIA_TYPE;

    public static final String SHORT_MEDIA_TYPE_XML = TYPE + "+" + XML;

    public static final String MEDIA_TYPE_XML = TYPE + "+" + XML + VERSION_PARAM + API_VERSION;

    public static final String MEDIA_TYPE_JSON = MEDIA_TYPE + VERSION_PARAM + API_VERSION;

    /** Friendly name */
    private String name;

    /** Identify the ssl certificate in the provider */
    private String providerId;

    /** PEM encoded certificate */
    private String certificate;

    /** Key for verifying the certificate */
    private String privateKey;

    /** Additional certificates in the verification chain */
    private String intermediateCertificate;

    public String getName()
    {
        return name;
    }

    public void setName(final String name)
    {
        this.name = name;
    }

    @Override
    public String getProviderId()
    {
        return providerId;
    }

    @Override
    public void setProviderId(final String providerId)
    {
        this.providerId = providerId;
    }

    public String getCertificate()
    {
        return certificate;
    }

    public void setCertificate(final String certificate)
    {
        this.certificate = certificate;
    }

    public String getPrivateKey()
    {
        return privateKey;
    }

    public void setPrivateKey(final String privateKey)
    {
        this.privateKey = privateKey;
    }

    public String getIntermediateCertificate()
    {
        return intermediateCertificate;
    }

    public void setIntermediateCertificate(final String intermediateCertificate)
    {
        this.intermediateCertificate = intermediateCertificate;
    }

    @Override
    public String getBaseMediaType()
    {
        return MEDIA_TYPE;
    }

    @Override
    public String getMediaType()
    {
        return MEDIA_TYPE_JSON;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy