// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/FedoraClientException.java
// public class FedoraClientException extends Exception {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private int status;
// 
//     public FedoraClientException(String message) {
//         super(message, null);
//     }
// 
//     public FedoraClientException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      *
//      * @param status the HTTP status code of the error.
//      * @param message
//      */
//     public FedoraClientException(int status, String message) {
//         super(message);
//         this.status = status;
//     }
// 
//     /**
//      *
//      * @return the HTTP status code of the error
//      */
//     public int getStatus() {
//         return status;
//     }
// }
// 
// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/request/DescribeRepository.java
// public class DescribeRepository extends FedoraRequest<DescribeRepository> {
// 
//     /**
//      * <p>
//      * Format the response as XML. Defaults to "true".
//      * </p>
//      * 
//      * @param xml
//      *            Defaults to true.
//      * @return this builder
//      */
//     public DescribeRepository xml(boolean xml) {
//         addQueryParam("xml", Boolean.toString(xml));
//         return this;
//     }
// 
//     @Override
//     public DescribeRepositoryResponse execute() throws FedoraClientException {
//         return (DescribeRepositoryResponse) super.execute();
//     }
// 
//     @Override
//     public DescribeRepositoryResponse execute(FedoraClient fedora)
//             throws FedoraClientException {
//         // default to xml for the format, so we can parse the results
//         if (getFirstQueryParam("xml") == null) {
//             addQueryParam("xml", "true");
//         }
// 
//         WebResource wr =
//                 resource(fedora, "describe").queryParams(getQueryParams());
//         return new DescribeRepositoryResponse(wr.get(ClientResponse.class));
//     }
// 
// }


import com.yourmediashelf.fedora.generated.access.FedoraRepository;
import com.sun.jersey.api.client.ClientResponse;
import com.yourmediashelf.fedora.client.FedoraClientException;
import com.yourmediashelf.fedora.client.request.DescribeRepository;
/**
 * Copyright (C) 2010 MediaShelf <http://www.yourmediashelf.com/>
 *
 * This file is part of fedora-client.
 *
 * fedora-client 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.
 *
 * fedora-client 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with fedora-client.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.yourmediashelf.fedora.client.response;


/**
 * <p>A {@link FedoraResponse} for the {@link DescribeRepository} request.</p>
 *
 * @author Edwin Shin
 */
public class DescribeRepositoryResponse extends FedoraResponseImpl {

    private FedoraRepository repositoryInfo;

    public DescribeRepositoryResponse(ClientResponse cr)
            throws FedoraClientException {
        super(cr);
    }

    public String getRepositoryVersion() throws FedoraClientException {
        return getRepositoryInfo().getRepositoryVersion();
    }

    /**
     * Get the repository description. Note this method will fail if the request
     * specified xml=false rather than true.
     *
     * @return the Repository Info
     * @throws FedoraClientException
     */
// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/FedoraClientException.java
// public class FedoraClientException extends Exception {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private int status;
// 
//     public FedoraClientException(String message) {
//         super(message, null);
//     }
// 
//     public FedoraClientException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      *
//      * @param status the HTTP status code of the error.
//      * @param message
//      */
//     public FedoraClientException(int status, String message) {
//         super(message);
//         this.status = status;
//     }
// 
//     /**
//      *
//      * @return the HTTP status code of the error
//      */
//     public int getStatus() {
//         return status;
//     }
// }
// 
// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/request/DescribeRepository.java
// public class DescribeRepository extends FedoraRequest<DescribeRepository> {
// 
//     /**
//      * <p>
//      * Format the response as XML. Defaults to "true".
//      * </p>
//      * 
//      * @param xml
//      *            Defaults to true.
//      * @return this builder
//      */
//     public DescribeRepository xml(boolean xml) {
//         addQueryParam("xml", Boolean.toString(xml));
//         return this;
//     }
// 
//     @Override
//     public DescribeRepositoryResponse execute() throws FedoraClientException {
//         return (DescribeRepositoryResponse) super.execute();
//     }
// 
//     @Override
//     public DescribeRepositoryResponse execute(FedoraClient fedora)
//             throws FedoraClientException {
//         // default to xml for the format, so we can parse the results
//         if (getFirstQueryParam("xml") == null) {
//             addQueryParam("xml", "true");
//         }
// 
//         WebResource wr =
//                 resource(fedora, "describe").queryParams(getQueryParams());
//         return new DescribeRepositoryResponse(wr.get(ClientResponse.class));
//     }
// 
// }


// Path: fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/response/DescribeRepositoryResponse.java
import com.yourmediashelf.fedora.generated.access.FedoraRepository;
import com.sun.jersey.api.client.ClientResponse;
import com.yourmediashelf.fedora.client.FedoraClientException;
import com.yourmediashelf.fedora.client.request.DescribeRepository;

/**
 * Copyright (C) 2010 MediaShelf <http://www.yourmediashelf.com/>
 *
 * This file is part of fedora-client.
 *
 * fedora-client 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.
 *
 * fedora-client 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with fedora-client.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.yourmediashelf.fedora.client.response;


/**
 * <p>A {@link FedoraResponse} for the {@link DescribeRepository} request.</p>
 *
 * @author Edwin Shin
 */
public class DescribeRepositoryResponse extends FedoraResponseImpl {

    private FedoraRepository repositoryInfo;

    public DescribeRepositoryResponse(ClientResponse cr)
            throws FedoraClientException {
        super(cr);
    }

    public String getRepositoryVersion() throws FedoraClientException {
        return getRepositoryInfo().getRepositoryVersion();
    }

    /**
     * Get the repository description. Note this method will fail if the request
     * specified xml=false rather than true.
     *
     * @return the Repository Info
     * @throws FedoraClientException
     */
    public FedoraRepository getRepositoryInfo() throws FedoraClientException {