当前位置: 首页>>代码示例>>Java>>正文


Java Authorizations.equals方法代码示例

本文整理汇总了Java中org.apache.accumulo.core.security.Authorizations.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Authorizations.equals方法的具体用法?Java Authorizations.equals怎么用?Java Authorizations.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.accumulo.core.security.Authorizations的用法示例。


在下文中一共展示了Authorizations.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: copyAuthorizations

import org.apache.accumulo.core.security.Authorizations; //导入方法依赖的package包/类
protected void copyAuthorizations() throws IOException {
    try {
        final SecurityOperations parentSecOps = parentConnector.securityOperations();
        final SecurityOperations childSecOps = childConnector.securityOperations();

        final Authorizations parentAuths = parentSecOps.getUserAuthorizations(parentUser);
        final Authorizations childAuths = childSecOps.getUserAuthorizations(childUser);
        // Add any parent authorizations that the child doesn't have.
        if (!childAuths.equals(parentAuths)) {
            log.info("Adding the authorization, \"" + parentAuths.toString() + "\", to the child user, \"" + childUser + "\"");
            final Authorizations newChildAuths = AccumuloRyaUtils.addUserAuths(childUser, childSecOps, parentAuths);
            childSecOps.changeUserAuthorizations(childUser, newChildAuths);
        }
    } catch (AccumuloException | AccumuloSecurityException e) {
        throw new IOException(e);
    }
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:18,代码来源:BaseCopyToolMapper.java

示例2: createTempTableIfNeeded

import org.apache.accumulo.core.security.Authorizations; //导入方法依赖的package包/类
/**
 * Creates the temp child table if it doesn't already exist in the parent.
 * @param childTableName the name of the child table.
 * @throws IOException
 */
public void createTempTableIfNeeded(final String childTableName) throws IOException {
    try {
        final AccumuloRdfConfiguration accumuloRdfConfiguration = new AccumuloRdfConfiguration(conf);
        accumuloRdfConfiguration.setTablePrefix(childTablePrefix);
        final Connector connector = AccumuloRyaUtils.setupConnector(accumuloRdfConfiguration);
        if (!connector.tableOperations().exists(childTableName)) {
            log.info("Creating table: " + childTableName);
            connector.tableOperations().create(childTableName);
            log.info("Created table: " + childTableName);
            log.info("Granting authorizations to table: " + childTableName);
            final SecurityOperations secOps = connector.securityOperations();
            secOps.grantTablePermission(userName, childTableName, TablePermission.WRITE);
            log.info("Granted authorizations to table: " + childTableName);

            final Authorizations parentAuths = secOps.getUserAuthorizations(userName);
            // Add child authorizations so the temp parent table can be accessed.
            if (!parentAuths.equals(childAuthorizations)) {
                final List<String> childAuthList = findUniqueAuthsFromChild(parentAuths.toString(), childAuthorizations.toString());
                tempChildAuths = Joiner.on(",").join(childAuthList);
                log.info("Adding the authorization, \"" + tempChildAuths + "\", to the parent user, \"" + userName + "\"");
                final Authorizations newAuths = AccumuloRyaUtils.addUserAuths(userName, secOps, new Authorizations(tempChildAuths));
                secOps.changeUserAuthorizations(userName, newAuths);
            }
        }
    } catch (TableExistsException | AccumuloException | AccumuloSecurityException e) {
        throw new IOException(e);
    }
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:34,代码来源:MergeTool.java


注:本文中的org.apache.accumulo.core.security.Authorizations.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。