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


Java Group.getHref方法代码示例

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


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

示例1: getClients

import com.stormpath.sdk.group.Group; //导入方法依赖的package包/类
/**
 * Obtiene la lista de los registros de Client
 *
 * @return Colección de objetos de ClientDetailDTO
 * @generated
 */
@GET
public List<ClientDetailDTO> getClients() {
    String accountHref = req.getRemoteUser();
    if (accountHref != null) {
        Account account = Utils.getClient().getResource(accountHref, Account.class);
        for (Group gr : account.getGroups()) {
            switch (gr.getHref()) {
                case ADMIN_HREF:
                    if (page != null && maxRecords != null) {
                        this.response.setIntHeader("X-Total-Count", clientLogic.countClients());
                        return listEntity2DTO(clientLogic.getClients(page, maxRecords));
                    }
                    return listEntity2DTO(clientLogic.getClients());
                case CLIENT_HREF:
                    Integer id = (int) account.getCustomData().get("client_id");
                    List<ClientDetailDTO> list = new ArrayList();
                    list.add(new ClientDetailDTO(clientLogic.getClient(id.longValue())));
                    return list;
            }
        }
    } 
    return null;
}
 
开发者ID:Uniandes-MISO4203-backup,项目名称:turism-201620-2,代码行数:30,代码来源:ClientResource.java

示例2: getAgencys

import com.stormpath.sdk.group.Group; //导入方法依赖的package包/类
/**
 * Obtiene la lista de los registros de Agency
 *
 * @return Colección de objetos de AgencyDetailDTO
 * @generated
 */
@GET
public List<AgencyDetailDTO> getAgencys() {
    String accountHref = req.getRemoteUser();
    if (accountHref != null) {
        Account account = Utils.getClient().getResource(accountHref, Account.class);
        for (Group gr : account.getGroups()) {
            switch (gr.getHref()) {
                case ADMIN_HREF:
                    if (page != null && maxRecords != null) {
                    this.response.setIntHeader("X-Total-Count", agencyLogic.countAgencys());
                    return listEntity2DTO(agencyLogic.getAgencys(page, maxRecords));
                }
                return listEntity2DTO(agencyLogic.getAgencys());
                case AGENCY_HREF:
                    Integer id = (int) account.getCustomData().get("agency_id");
                    List<AgencyDetailDTO> list = new ArrayList();
                    list.add(new AgencyDetailDTO(agencyLogic.getAgency(id.longValue())));
                    return list;
            }
        }
    } 
    return null;
}
 
开发者ID:Uniandes-MISO4203-backup,项目名称:turism-201620-2,代码行数:30,代码来源:AgencyResource.java

示例3: register

import com.stormpath.sdk.group.Group; //导入方法依赖的package包/类
@Override
public void register(UserDTO user) {
    try {
       Account acct = createUser(user);
    for (Group gr : acct.getGroups()) {
        switch(gr.getHref()){
            case CLIENT_HREF:
            ClientEntity client = new ClientEntity();
            client.setName(user.getUserName());
            client = clientLogic.createClient(client);
            acct.getCustomData().put(CLIENT_CD, client.getId());
            break;
            case AGENCY_HREF:
            AgencyEntity provider = new AgencyEntity();
            provider.setName(user.getUserName());                
            provider = agencyLogic.createAgency(provider);
            acct.getCustomData().put(AGENCY_CD, provider.getId());  
            break;
            default:
             throw new WebApplicationException("Group link doen's match ");
        }
            
        }
    acct.getCustomData().save();
    } catch (ResourceException e) {
        throw new WebApplicationException(e, e.getStatus());
    }
}
 
开发者ID:Uniandes-MISO4203-backup,项目名称:turism-201620-2,代码行数:29,代码来源:UseResource.java

示例4: getGrpByName

import com.stormpath.sdk.group.Group; //导入方法依赖的package包/类
public final Group getGrpByName(final String grpName, final Directory dir) {
	GroupList groups = dir.getGroups();
	for (Group group : groups) {
		if (group.getName().equals(grpName)) {
			String dirHref = group.getHref();
			Group group2 = spbd.getResourceByHrefGroup(dirHref);
			return group2;
		}
	}
	return null;
}
 
开发者ID:IHTSDO,项目名称:OTF-User-Module,代码行数:12,代码来源:Storm2Model.java

示例5: buildGroup

import com.stormpath.sdk.group.Group; //导入方法依赖的package包/类
public final OtfGroup buildGroup(final Group grpIn) {
	String href = grpIn.getHref();
	return buildGroup(href);
}
 
开发者ID:IHTSDO,项目名称:OTF-User-Module,代码行数:5,代码来源:Storm2Model.java


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