本文整理汇总了Java中com.amazonaws.services.rds.model.DBInstance.setEndpoint方法的典型用法代码示例。如果您正苦于以下问题:Java DBInstance.setEndpoint方法的具体用法?Java DBInstance.setEndpoint怎么用?Java DBInstance.setEndpoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.services.rds.model.DBInstance
的用法示例。
在下文中一共展示了DBInstance.setEndpoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeInstance
import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
private DBInstance makeInstance(String instanceName, RdsInstanceStatus instanceStatus)
{
DBInstance dbInstance = new DBInstance();
dbInstance.setDBInstanceIdentifier(instanceName);
dbInstance.setDBInstanceStatus(instanceStatus == null ? UNKNOWN_STATUS : instanceStatus.toString());
Endpoint endpoint = new Endpoint();
endpoint.setAddress(STAGE_ENDPOINT_ADDRESS);
dbInstance.setEndpoint(endpoint);
DBSubnetGroup dbSubnetGroup = new DBSubnetGroup();
dbSubnetGroup.setDBSubnetGroupName(SUBNET_GROUP);
dbInstance.setDBSubnetGroup(dbSubnetGroup);
return dbInstance;
}
示例2: setUp
import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
this.clientProviderMock = mock(ClientProvider.class);
this.jobsPropertiesMock = mock(JobsProperties.class);
this.violationSinkMock = mock(ViolationSink.class);
this.amazonRDSClientMock = mock(AmazonRDSClient.class);
this.accountIdSupplierMock = mock(AccountIdSupplier.class);
this.exceptionHandlerMock = mock(JobExceptionHandler.class);
when(accountIdSupplierMock.get()).thenReturn(newHashSet("54321"));
// Jobsproperties
when(jobsPropertiesMock.getWhitelistedRegions()).thenReturn(newArrayList("eu-west-1"));
// Dbinstances
final Endpoint endpoint = new Endpoint();
endpoint.setAddress("aws.db.cn");
final Endpoint endpoint2 = new Endpoint();
endpoint2.setAddress("aws.db2.cn");
final DBInstance dbInstance1 = new DBInstance();
dbInstance1.setPubliclyAccessible(true);
dbInstance1.setEndpoint(endpoint);
final DBInstance dbInstance2 = new DBInstance();
dbInstance2.setPubliclyAccessible(false);
dbInstance2.setEndpoint(endpoint);
final DBInstance dbInstance3 = new DBInstance();
dbInstance3.setPubliclyAccessible(true);
dbInstance3.setEndpoint(endpoint2);
describeDBInstancesResultMock = new DescribeDBInstancesResult();
describeDBInstancesResultMock.setDBInstances(newArrayList(dbInstance1, dbInstance2, dbInstance3));
// clientprovider
when(clientProviderMock.getClient(any(), any(String.class), any(Region.class))).thenReturn(amazonRDSClientMock);
}