com.aipo.aws.rds.RDS.java Source code

Java tutorial

Introduction

Here is the source code for com.aipo.aws.rds.RDS.java

Source

/*
 * This file is part of the com.aipo.aws package.
 * Copyright (C) 2004-2011 Aimluck,Inc.
 * http://www.aipo.com
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

package com.aipo.aws.rds;

import com.aipo.aws.AWSContext;
import com.amazonaws.services.rds.AmazonRDS;
import com.amazonaws.services.rds.AmazonRDSClient;

/**
 * 
 */
public class RDS {

    public static AmazonRDS getClient() {
        AWSContext awsContext = AWSContext.get();
        if (awsContext == null) {
            throw new IllegalStateException("AWSContext is not initialized.");
        }
        AmazonRDS client = new AmazonRDSClient(awsContext.getAwsCredentials());
        String endpoint = awsContext.getRdsEndpoint();
        if (endpoint != null && endpoint != "") {
            client.setEndpoint(endpoint);
        }
        return client;
    }

}