本文整理汇总了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;
}
示例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;
}
示例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());
}
}
示例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;
}
示例5: buildGroup
import com.stormpath.sdk.group.Group; //导入方法依赖的package包/类
public final OtfGroup buildGroup(final Group grpIn) {
String href = grpIn.getHref();
return buildGroup(href);
}