• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DeleteAttributesRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.amazonaws.services.simpledb.model.DeleteAttributesRequest的典型用法代码示例。如果您正苦于以下问题:Java DeleteAttributesRequest类的具体用法?Java DeleteAttributesRequest怎么用?Java DeleteAttributesRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DeleteAttributesRequest类属于com.amazonaws.services.simpledb.model包,在下文中一共展示了DeleteAttributesRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: deleteAllAttributes

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
@Override
public void deleteAllAttributes(String itemName) {

  if (!initialised) {
    throw new IllegalStateException("The optimistic persister has not been initialised");
  }

  logger.log("About to delete all attributes from simpledb item: " + itemName);

  DeleteAttributesRequest deleteAttributesRequest = new DeleteAttributesRequest(
      simpleDbDomainName, itemName);
  AmazonSimpleDB client = getSimpleDBClient();
  client.deleteAttributes(deleteAttributesRequest);

  logger.log("Deleted all attributes from simpledb item.");
}
 
开发者ID:robinsteel,项目名称:Sqawsh,代码行数:17,代码来源:OptimisticPersister.java


示例2: delete

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
@Test
public void delete() {
  CassandraInstance instance = createMock(CassandraInstance.class);
  Capture<DeleteAttributesRequest> requestCapture = new Capture<DeleteAttributesRequest>();
  expect(domainFactory.createFromRing(RING_NAME)).andReturn(domain(RING_NAME));
  expect(instance.getId()).andReturn(ID).times(2);
  expect(instance.getDataCenter()).andReturn(DATACENTER);
  expect(instance.getRack()).andReturn(RACK);
  expect(instance.getHostName()).andReturn(HOSTNAME);
  expect(instance.getPublicIpAddress()).andReturn(PUBLIC_IP_ADDRESS);
  expect(instance.getFullyQualifiedDomainName()).andReturn(FULLY_QUALIFIED_DOMAIN_NAME);
  simpleDbClient.deleteAttributes(capture(requestCapture));
  replayAll();

  dao.delete(RING_NAME, instance);

  DeleteAttributesRequest request = requestCapture.getValue();
  assertEquals(DOMAIN, request.getDomainName());
  assertEquals(String.valueOf(ID), request.getItemName());
  assertAttributes(request);
}
 
开发者ID:signal,项目名称:agathon,代码行数:22,代码来源:SdbCassandraInstanceDaoTest.java


示例3: assertAttributes

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
private static void assertAttributes(DeleteAttributesRequest request) {
  assertEquals(6, request.getAttributes().size());
  for (Attribute attr : request.getAttributes()) {
    if (attr.getName().equals(SdbCassandraInstanceDao.ID_KEY)) {
      assertEquals(String.valueOf(ID), attr.getValue());
    } else if (attr.getName().equals(SdbCassandraInstanceDao.DATACENTER_KEY)) {
      assertEquals(DATACENTER, attr.getValue());
    } else if (attr.getName().equals(SdbCassandraInstanceDao.RACK_KEY)) {
      assertEquals(RACK, attr.getValue());
    } else if (attr.getName().equals(SdbCassandraInstanceDao.HOSTNAME_KEY)) {
      assertEquals(HOSTNAME, attr.getValue());
    } else if (attr.getName().endsWith(SdbCassandraInstanceDao.PUBLIC_IP_ADDRESS_KEY)) {
      assertEquals(PUBLIC_IP_ADDRESS, attr.getValue());
    } else if (attr.getName().endsWith(SdbCassandraInstanceDao.FULLY_QUALIFIED_DOMAIN_NAME_KEY)) {
      assertEquals(FULLY_QUALIFIED_DOMAIN_NAME, attr.getValue());
    } else {
      assertDuplicateAttribute(attr.getName(), attr.getValue());
    }
  }
}
 
开发者ID:signal,项目名称:agathon,代码行数:21,代码来源:SdbCassandraInstanceDaoTest.java


示例4: testDeleteAllAttributesCorrectlyCallsTheDatabase

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
public void testDeleteAllAttributesCorrectlyCallsTheDatabase() throws Exception {
  // ARRANGE
  initialiseOptimisticPersister();

  DeleteAttributesRequest deleteAttributesRequest = new DeleteAttributesRequest(
      testSimpleDBDomainName, testItemName);
  mockery.checking(new Expectations() {
    {
      oneOf(mockSimpleDBClient).deleteAttributes(with(equal(deleteAttributesRequest)));
    }
  });

  // ACT
  optimisticPersister.deleteAllAttributes(testItemName);
}
 
开发者ID:robinsteel,项目名称:Sqawsh,代码行数:16,代码来源:OptimisticPersisterTest.java


示例5: execute

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
public void execute() {
    DeleteAttributesRequest request = new DeleteAttributesRequest()
        .withDomainName(determineDomainName())
        .withItemName(determineItemName())
        .withExpected(determineUpdateCondition())
        .withAttributes(determineAttributes());
    log.trace("Sending request [{}] for exchange [{}]...", request, exchange);
    
    this.sdbClient.deleteAttributes(request);
    
    log.trace("Request sent");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:DeleteAttributesCommand.java


示例6: deleteAttributes

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
@Override
public DeleteAttributesResult deleteAttributes(DeleteAttributesRequest deleteAttributesRequest) throws AmazonServiceException, AmazonClientException {
    this.deleteAttributesRequest = deleteAttributesRequest;
    
    String domainName = deleteAttributesRequest.getDomainName();
    if ("MissingDomain".equals(domainName)) {
        throw new NoSuchDomainException(domainName);
    }
    return new DeleteAttributesResult();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:AmazonSDBClientMock.java


示例7: delete

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
public <T> void delete(String recordid, Class<T> dataClass)
		throws WPBIOException {
	try
	{
		DeleteAttributesRequest deleteAttributesRequest = new DeleteAttributesRequest(domainName, createInternalKey(recordid, dataClass));
		sdbClient.deleteAttributes(deleteAttributesRequest);
	} catch (Exception e)
	{
		throw new WPBIOException("Cannot delete record " + recordid, e);
	}		
}
 
开发者ID:webpagebytes,项目名称:aws-cms-plugins,代码行数:12,代码来源:WPBAwsSdbAdminDataStorage.java


示例8: remove

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public String remove(final Object key) {
    final String before = this.get(key);
    this.credentials.aws().deleteAttributes(
        new DeleteAttributesRequest()
            .withDomainName(this.table)
            .withItemName(this.label)
            .withAttributes(new Attribute().withName(key.toString()))
    );
    return before;
}
 
开发者ID:jcabi,项目名称:jcabi-simpledb,代码行数:15,代码来源:AwsItem.java


示例9: clear

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void clear() {
    this.credentials.aws().deleteAttributes(
        new DeleteAttributesRequest()
            .withDomainName(this.table)
            .withItemName(this.label)
    );
}
 
开发者ID:jcabi,项目名称:jcabi-simpledb,代码行数:12,代码来源:AwsItem.java


示例10: deleteAttributesImpl

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
@Override
public void deleteAttributesImpl(String domainName, String itemName) {
    LOGGER.debug("Delete Domain\"{}\" ItemName \"{}\"", domainName, itemName);

    Assert.notNull(domainName, "Domain name should not be null");
    Assert.notNull(itemName, "Item name should not be null");

    getDB().deleteAttributes(new DeleteAttributesRequest(domainName, itemName));
}
 
开发者ID:3pillarlabs,项目名称:spring-data-simpledb,代码行数:10,代码来源:SimpleDbTemplate.java


示例11: delete

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
@Override
public void delete(String itemName, Attribute attribute) throws Exception {

  if (!initialised) {
    throw new IllegalStateException("The optimistic persister has not been initialised");
  }

  logger.log("About to delete attribute from simpledb item: " + itemName);

  AmazonSimpleDB client = getSimpleDBClient();

  // We retry the delete if necessary if we get a
  // ConditionalCheckFailed exception, i.e. if someone else modifies the
  // database between us reading and writing it.
  RetryHelper
      .DoWithRetries(() -> {
        try {
          // Get existing attributes (and version number), via consistent
          // read:
          ImmutablePair<Optional<Integer>, Set<Attribute>> versionedAttributes = get(itemName);

          if (!versionedAttributes.left.isPresent()) {
            logger
                .log("A version number attribute did not exist - this means no attributes exist, so we have nothing to delete.");
            return null;
          }
          if (!versionedAttributes.right.contains(attribute)) {
            logger.log("The attribute did not exist - so we have nothing to delete.");
            return null;
          }

          // Since it seems impossible to update the version number while
          // deleting an attribute, we first mark the attribute as inactive,
          // and then delete it.
          ReplaceableAttribute inactiveAttribute = new ReplaceableAttribute();
          inactiveAttribute.setName(attribute.getName());
          inactiveAttribute.setValue("Inactive" + attribute.getValue());
          inactiveAttribute.setReplace(true);
          put(itemName, versionedAttributes.left, inactiveAttribute);

          // Now we can safely delete the attribute, as other readers will now
          // ignore it.
          UpdateCondition updateCondition = new UpdateCondition();
          updateCondition.setName(inactiveAttribute.getName());
          updateCondition.setValue(inactiveAttribute.getValue());
          // Update will proceed unless the attribute no longer exists
          updateCondition.setExists(true);

          Attribute attributeToDelete = new Attribute();
          attributeToDelete.setName(inactiveAttribute.getName());
          attributeToDelete.setValue(inactiveAttribute.getValue());
          List<Attribute> attributesToDelete = new ArrayList<>();
          attributesToDelete.add(attributeToDelete);
          DeleteAttributesRequest simpleDBDeleteRequest = new DeleteAttributesRequest(
              simpleDbDomainName, itemName, attributesToDelete, updateCondition);
          client.deleteAttributes(simpleDBDeleteRequest);
          logger.log("Deleted attribute from simpledb");
          return null;
        } catch (AmazonServiceException ase) {
          if (ase.getErrorCode().contains("AttributeDoesNotExist")) {
            // Case of trying to delete an attribute that no longer exists -
            // that's ok - it probably just means more than one person was
            // trying to delete the attribute at once. So swallow this
            // exception
            logger
                .log("Caught AmazonServiceException for AttributeDoesNotExist whilst deleting attribute so"
                    + " swallowing and continuing");
            return null;
          } else {
            throw ase;
          }
        }
      }, Exception.class, Optional.of("Database put failed - conditional check failed"), logger);
}
 
开发者ID:robinsteel,项目名称:Sqawsh,代码行数:75,代码来源:OptimisticPersister.java


示例12: deleteUser

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
@Override
public void deleteUser(User user,Map<String,Object> request) throws ProvisioningException {
	
	
	int approvalID = 0;
	
	
	
	
	if (request.containsKey("APPROVAL_ID")) {
		approvalID = (Integer) request.get("APPROVAL_ID");
	}
	
	Workflow workflow = (Workflow) request.get("WORKFLOW");
	
	String userid = user.getAttribs().get(this.uidAttrName).getValues().get(0);
	this.sdb.deleteAttributes(new DeleteAttributesRequest(this.userDomain,userid));
	this.cfgMgr.getProvisioningEngine().logAction(this.name,true, ActionType.Delete, approvalID, workflow, "userName",userid);
	try {
		Thread.sleep(1000);
	} catch (InterruptedException e) {
		
	}
}
 
开发者ID:TremoloSecurity,项目名称:OpenUnison,代码行数:25,代码来源:AmazonSimpleDBProvider.java


示例13: deleteItemAttribute

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
public static void deleteItemAttribute(String domainName, String itemName, String attributeName) {
    getInstance().deleteAttributes(new DeleteAttributesRequest(domainName, itemName)
            .withAttributes(new Attribute[]{new Attribute().withName(attributeName)}));
}
 
开发者ID:pgodzin,项目名称:QuotesSocial,代码行数:5,代码来源:SimpleDB.java


示例14: delete

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
@Override
public void delete(String ring, CassandraInstance instance) {
  DeleteAttributesRequest request = new DeleteAttributesRequest(
      domain(ring), String.valueOf(instance.getId()), buildDeleteAttributes(instance));
  client.deleteAttributes(request);
}
 
开发者ID:signal,项目名称:agathon,代码行数:7,代码来源:SdbCassandraInstanceDao.java


示例15: deleteItem

import com.amazonaws.services.simpledb.model.DeleteAttributesRequest; //导入依赖的package包/类
/**
 * Delete an item
 *
 * @param domainName table name
 * @param itemName   itemName for the item
 */
public static void deleteItem(String domainName, String itemName) {
    getInstance().deleteAttributes(new DeleteAttributesRequest(domainName, itemName));
}
 
开发者ID:pgodzin,项目名称:QuotesSocial,代码行数:10,代码来源:SimpleDB.java



注:本文中的com.amazonaws.services.simpledb.model.DeleteAttributesRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WorldMap类代码示例发布时间:2022-05-23
下一篇:
Java AbstractBean类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap