本文整理汇总了Java中org.easyrec.util.core.Security.isSignedIn方法的典型用法代码示例。如果您正苦于以下问题:Java Security.isSignedIn方法的具体用法?Java Security.isSignedIn怎么用?Java Security.isSignedIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.easyrec.util.core.Security
的用法示例。
在下文中一共展示了Security.isSignedIn方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: security
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
/**
* @param request
* @param action
*
*/
private ModelAndView security(HttpServletRequest request, String action) {
ModelAndView mav = new ModelAndView();
if (!Security.isSignedIn(request)) {
return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, action, MSG.ERROR);
}
RemoteTenant r = remoteTenantDAO.get(request);
if (r == null) {
return MessageBlock.createSingle(mav, MSG.TENANT_NOT_EXISTS, action, MSG.ERROR);
}
return mav;
}
示例2: refreshstatistics
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView refreshstatistics(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView();
List<Message> messages = new ArrayList<>();
String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
String url = ServletUtils.getSafeParameter(request, "url", "");
String description = ServletUtils.getSafeParameter(request, "description", "");
String signedInOperatorId = Security.signedInOperatorId(request);
Operator signedInOperator = Security.signedInOperator(request);
RemoteTenant remoteTenant = null;
remoteTenant = initializeView(request, mav, operatorId, tenantId, url, description, signedInOperatorId,
signedInOperator, remoteTenant);
if (!Security.isSignedIn(request)) {
messages.add(MSG.NOT_SIGNED_IN);
return MessageBlock.create(mav, messages, REFRESH_STATISTICS, MSG.ERROR);
}
if (!operatorDAO.exists(operatorId)) {
messages.add(MSG.NO_VALID_OPERATOR);
}
if (remoteTenant != null) {
remoteTenantService.updateTenantStatistics(remoteTenant.getId());
}
return MessageBlock.createSingle(mav, MSG.OPERATION_SUCCESSFUL, REFRESH_STATISTICS, MSG.SUCCESS);
}
示例3: create
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView create(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView("page");
String operatorId = Security.signedInOperatorId(request);
Operator operator = Security.signedInOperator(request);
String operatorIdPar = request.getParameter("operatorId");
if (Security.isDeveloper(request) || !Strings.isNullOrEmpty(operatorId))
mav.addObject("operatorId", operatorIdPar);
else
mav.addObject("operatorId", operatorId);
if (operator != null)
mav.addObject("apiKey", operator.getApiKey());
if (Security.isSignedIn(request)) {
mav.addObject("title", "easyrec :: create tenant");
mav.addObject("page", "easyrec/create");
mav.addObject("create", true);
mav.addObject("tenants", remoteTenantDAO.getTenantsFromOperator(operatorId));
Security.setAttribute(request, "tenantId", null);
mav.addObject("tenantId", (String) Security.getAttribute(request, "tenantId"));
} else {
mav.addObject("page", "home");
}
return mav;
}
示例4: security
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
/**
* @param request
* @param action
* @return
*/
private ModelAndView security(HttpServletRequest request, String action) {
ModelAndView mav = new ModelAndView();
if (!Security.isSignedIn(request)) {
return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, action, MSG.ERROR);
}
RemoteTenant r = remoteTenantDAO.get(request);
if (r == null) {
return MessageBlock.createSingle(mav, MSG.TENANT_NOT_EXISTS, action, MSG.ERROR);
}
return mav;
}
示例5: refreshstatistics
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView refreshstatistics(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView();
List<Message> messages = new ArrayList<Message>();
String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
String url = ServletUtils.getSafeParameter(request, "url", "");
String description = ServletUtils.getSafeParameter(request, "description", "");
String signedInOperatorId = Security.signedInOperatorId(request);
Operator signedInOperator = Security.signedInOperator(request);
RemoteTenant remoteTenant = null;
remoteTenant = initializeView(request, mav, operatorId, tenantId, url, description, signedInOperatorId,
signedInOperator, remoteTenant);
if (!Security.isSignedIn(request)) {
messages.add(MSG.NOT_SIGNED_IN);
return MessageBlock.create(mav, messages, REFRESH_STATISTICS, MSG.ERROR);
}
if (!operatorDAO.exists(operatorId)) {
messages.add(MSG.NO_VALID_OPERATOR);
}
if (remoteTenant != null) {
remoteTenantService.updateTenantStatistics(remoteTenant.getId());
}
return MessageBlock.createSingle(mav, MSG.OPERATION_SUCCESSFUL, REFRESH_STATISTICS, MSG.SUCCESS);
}
示例6: create
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView create(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView("page");
String operatorId = Security.signedInOperatorId(request);
Operator operator = Security.signedInOperator(request);
String operatorIdPar = request.getParameter("operatorId");
if (Security.isDeveloper(request) || !Strings.isNullOrEmpty(operatorId))
mav.addObject("operatorId", operatorIdPar);
else
mav.addObject("operatorId", operatorId);
if (operator != null)
mav.addObject("apiKey", operator.getApiKey());
if (Security.isSignedIn(request)) {
mav.addObject("title", "easyrec :: create tenant");
mav.addObject("page", "easyrec/create");
mav.addObject("create", true);
mav.addObject("tenants", remoteTenantDAO.getTenantsFromOperator(operatorId));
Security.setAttribute(request, "tenantId", null);
} else {
mav.addObject("page", "home");
}
return mav;
}
示例7: update
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView update(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView();
List<Message> messages = new ArrayList<Message>();
String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
String url = ServletUtils.getSafeParameter(request, "url", "");
String description = ServletUtils.getSafeParameter(request, "description", "");
String signedInOperatorId = Security.signedInOperatorId(request);
Operator signedInOperator = Security.signedInOperator(request);
RemoteTenant remoteTenant = null;
remoteTenant = initializeView(request, mav, operatorId, tenantId, url, description, signedInOperatorId,
signedInOperator, remoteTenant);
if (!Security.isSignedIn(request)) {
messages.add(MSG.NOT_SIGNED_IN);
return MessageBlock.create(mav, messages, UPDATE_TENANT, MSG.ERROR);
}
if (!operatorDAO.exists(operatorId)) {
messages.add(MSG.NO_VALID_OPERATOR);
}
if (remoteTenant == null) {
messages.add(MSG.TENANT_NOT_EXISTS);
}
if (!Web.isValidUrl(url) || url.equalsIgnoreCase("http://localhost/")) {
messages.add(MSG.NO_VALID_URL);
}
if (messages.size() > 0) {
return MessageBlock.create(mav, messages, UPDATE_TENANT, MSG.ERROR);
} else {
remoteTenantDAO.update(operatorId, remoteTenant.getId(), url, description);
itemDAO.emptyCache();
return MessageBlock.createSingle(mav, MSG.TENANT_UPDATED, UPDATE_TENANT, MSG.SUCCESS);
}
}
示例8: view
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView view(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView();
List<Message> messages = new ArrayList<Message>();
String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
String url = ServletUtils.getSafeParameter(request, "url", "");
String description = ServletUtils.getSafeParameter(request, "description", "");
String signedInOperatorId = Security.signedInOperatorId(request);
Operator signedInOperator = Security.signedInOperator(request);
RemoteTenant remoteTenant = null;
remoteTenant = initializeView(request, mav, operatorId, tenantId, url, description, signedInOperatorId,
signedInOperator, remoteTenant);
if (!Security.isSignedIn(request)) {
messages.add(MSG.NOT_SIGNED_IN);
return MessageBlock.create(mav, messages, VIEW_TENANTS, MSG.ERROR);
}
if (!operatorDAO.exists(operatorId)) {
messages.add(MSG.NO_VALID_OPERATOR);
}
if (messages.size() > 0 && !"easyrec".equals(operatorId)) {
return MessageBlock.create(mav, messages, VIEW_TENANTS, MSG.ERROR);
} else {
Security.setAttribute(request, "menu", "tenant");
mav.setViewName("easyrec/overview");
if (Security.signedInOperator(request) != null && remoteTenant != null) {
mav.addObject("tenant", remoteTenant);
}
mav.addObject("tenantsShow", remoteTenant != null);
}
String apiKey = Operator.DEFAULT_API_KEY;
if (signedInOperator != null) {
apiKey = signedInOperator.getApiKey();
}
mav.addObject("apiKey", apiKey);
mav.addObject("signedIn", Security.isSignedIn(request));
return mav;
}
示例9: viewhotrecommendations
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView viewhotrecommendations(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView();
List<Message> messages = new ArrayList<>();
String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
String url = ServletUtils.getSafeParameter(request, "url", "");
String description = ServletUtils.getSafeParameter(request, "description", "");
String signedInOperatorId = Security.signedInOperatorId(request);
Operator signedInOperator = Security.signedInOperator(request);
RemoteTenant remoteTenant = null;
remoteTenant = initializeView(request, mav, operatorId, tenantId, url, description, signedInOperatorId,
signedInOperator, remoteTenant);
if (!Security.isSignedIn(request)) {
messages.add(MSG.NOT_SIGNED_IN);
return MessageBlock.create(mav, messages, VIEW_HOT_RECOMMENDATIONS, MSG.ERROR);
}
if (!operatorDAO.exists(operatorId)) {
messages.add(MSG.NO_VALID_OPERATOR);
}
Security.setAttribute(request, "menu", "viewhotrecommendations");
// the page view provides the design with a side menu and the menu bar
mav.setViewName("page");
mav.addObject("title", "easyrec :: view hot recommendations");
mav.addObject("menubar", VIEW_HOT_RECOMMENDATIONS);
mav.addObject("page", "easyrec/viewhotrecommendations");
mav.addObject("tenantId", tenantId);
mav.addObject("tenants", remoteTenantDAO.getTenantsFromOperator(operatorId));
if (remoteTenant != null) {
mav.addObject("items", itemDAO.getHotItems(remoteTenant, 0, 100));
}
String apiKey = Operator.DEFAULT_API_KEY;
if (signedInOperator != null) {
apiKey = signedInOperator.getApiKey();
}
mav.addObject("apiKey", apiKey);
mav.addObject("signedIn", Security.isSignedIn(request));
return mav;
}
示例10: clustermanager
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView clustermanager(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView();
List<Message> messages = new ArrayList<>();
String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
String url = ServletUtils.getSafeParameter(request, "url", "");
String description = ServletUtils.getSafeParameter(request, "description", "");
String signedInOperatorId = Security.signedInOperatorId(request);
Operator signedInOperator = Security.signedInOperator(request);
RemoteTenant remoteTenant = null;
remoteTenant = initializeView(request, mav, operatorId, tenantId, url, description, signedInOperatorId,
signedInOperator, remoteTenant);
if (!Security.isSignedIn(request)) {
messages.add(MSG.NOT_SIGNED_IN);
return MessageBlock.create(mav, messages, VIEW_CLUSTER_MANAGER, MSG.ERROR);
}
if (!operatorDAO.exists(operatorId)) {
messages.add(MSG.NO_VALID_OPERATOR);
}
Security.setAttribute(request, "menu", VIEW_CLUSTER_MANAGER);
// the page view provides the design with a header and footer
mav.setViewName("page");
mav.addObject("title", "easyrec :: cluster manager");
mav.addObject("menubar", VIEW_CLUSTER_MANAGER);
mav.addObject("page", "easyrec/clustermanager");
mav.addObject("tenantId", tenantId);
mav.addObject("tenants", remoteTenantDAO.getTenantsFromOperator(operatorId));
if (remoteTenant != null) {
mav.addObject("items", itemDAO.getHotItems(remoteTenant, 0, 100));
}
String apiKey = Operator.DEFAULT_API_KEY;
if (signedInOperator != null) {
apiKey = signedInOperator.getApiKey();
}
mav.addObject("apiKey", apiKey);
mav.addObject("signedIn", Security.isSignedIn(request));
return mav;
}
示例11: viewhotrecommendations
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView viewhotrecommendations(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView();
List<Message> messages = new ArrayList<Message>();
String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
String url = ServletUtils.getSafeParameter(request, "url", "");
String description = ServletUtils.getSafeParameter(request, "description", "");
String signedInOperatorId = Security.signedInOperatorId(request);
Operator signedInOperator = Security.signedInOperator(request);
RemoteTenant remoteTenant = null;
remoteTenant = initializeView(request, mav, operatorId, tenantId, url, description, signedInOperatorId,
signedInOperator, remoteTenant);
if (!Security.isSignedIn(request)) {
messages.add(MSG.NOT_SIGNED_IN);
return MessageBlock.create(mav, messages, VIEW_HOT_RECOMMENDATIONS, MSG.ERROR);
}
if (!operatorDAO.exists(operatorId)) {
messages.add(MSG.NO_VALID_OPERATOR);
}
Security.setAttribute(request, "menu", "viewhotrecommendations");
// the page view provides the design with a side menu and the menu bar
mav.setViewName("page");
mav.addObject("title", "easyrec :: view hot recommendations");
mav.addObject("menubar", VIEW_HOT_RECOMMENDATIONS);
mav.addObject("page", "easyrec/viewhotrecommendations");
mav.addObject("tenantId", tenantId);
mav.addObject("tenants", remoteTenantDAO.getTenantsFromOperator(operatorId));
if (remoteTenant != null) {
mav.addObject("items", itemDAO.getHotItems(remoteTenant, 0, 100));
}
String apiKey = Operator.DEFAULT_API_KEY;
if (signedInOperator != null) {
apiKey = signedInOperator.getApiKey();
}
mav.addObject("apiKey", apiKey);
mav.addObject("signedIn", Security.isSignedIn(request));
return mav;
}
示例12: clustermanager
import org.easyrec.util.core.Security; //导入方法依赖的package包/类
public ModelAndView clustermanager(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView();
List<Message> messages = new ArrayList<Message>();
String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
String url = ServletUtils.getSafeParameter(request, "url", "");
String description = ServletUtils.getSafeParameter(request, "description", "");
String signedInOperatorId = Security.signedInOperatorId(request);
Operator signedInOperator = Security.signedInOperator(request);
RemoteTenant remoteTenant = null;
remoteTenant = initializeView(request, mav, operatorId, tenantId, url, description, signedInOperatorId,
signedInOperator, remoteTenant);
if (!Security.isSignedIn(request)) {
messages.add(MSG.NOT_SIGNED_IN);
return MessageBlock.create(mav, messages, VIEW_CLUSTER_MANAGER, MSG.ERROR);
}
if (!operatorDAO.exists(operatorId)) {
messages.add(MSG.NO_VALID_OPERATOR);
}
Security.setAttribute(request, "menu", VIEW_CLUSTER_MANAGER);
// the page view provides the design with a header and footer
mav.setViewName("page");
mav.addObject("title", "easyrec :: cluster manager");
mav.addObject("menubar", VIEW_CLUSTER_MANAGER);
mav.addObject("page", "easyrec/clustermanager");
mav.addObject("tenantId", tenantId);
mav.addObject("tenants", remoteTenantDAO.getTenantsFromOperator(operatorId));
if (remoteTenant != null) {
mav.addObject("items", itemDAO.getHotItems(remoteTenant, 0, 100));
}
String apiKey = Operator.DEFAULT_API_KEY;
if (signedInOperator != null) {
apiKey = signedInOperator.getApiKey();
}
mav.addObject("apiKey", apiKey);
mav.addObject("signedIn", Security.isSignedIn(request));
return mav;
}