Package com.adito.policyframework

Examples of com.adito.policyframework.Resource


     * @param response response
     * @return newly created resource ID
     * @throws Exception on any error
     */
    protected Resource commitCreatedResource(ActionMapping mapping, AbstractResourceForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        Resource resource = form.getResource();
        return resource.getResourceType().createResource(resource, getSessionInfo(request));
    }
View Full Code Here


     */
    public ActionForward toogleShowPersonalPolicies(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                                    HttpServletResponse response) throws Exception {
        AbstractResourceForm policyForm = (AbstractResourceForm) form;

        Resource resource = ResourceStack.peekEditingStack(request.getSession());
        SessionInfo session = this.getSessionInfo(request);

        PropertyList selectedPolicies = new PropertyList();
        String requestSelectedPolicies = request.getParameter("selectedPolicies");
        if (!Util.isNullOrTrimmedBlank(requestSelectedPolicies)) {
View Full Code Here

          }   
         
          // Filter the list of available resources so that only launch-able resources are available
          List<Resource> filteredResources = new ArrayList<Resource>();
          for(Iterator resourceIterator = ResourceUtil.getGrantedResource(agent.getSession(), resourceType).iterator(); resourceIterator.hasNext(); ) {
              Resource resource = (Resource)resourceIterator.next();
              if(resource.getLaunchRequirement() == LaunchRequirement.LAUNCHABLE ||
                              ( resource.getLaunchRequirement() == LaunchRequirement.REQUIRES_WEB_SESSION && agent.getSession().getHttpSession() != null)) {
                  filteredResources.add(resource);
              }
          }
         
          // Send the list of resource IDs and names back to the agent
          ByteArrayWriter response = new ByteArrayWriter();
          response.writeInt(filteredResources.size());
          for (Resource resource : filteredResources) {
            response.writeInt(resource.getResourceId());
            response.writeString(resource.getResourceDisplayName());
          }
          request.setRequestData(response.toByteArray());
          return true;
        }
      } catch (Exception e) {
View Full Code Here

    if (request.getRequestName().equals("setupAndLaunchApplication") && request.getRequestData()!=null) {

      try {
        ByteArrayReader reader = new ByteArrayReader(request.getRequestData());
        int id = (int)reader.readInt();
        Resource resource = ApplicationsPlugin.APPLICATION_SHORTCUT_RESOURCE_TYPE.getResourceById(id);
        if (resource == null) {
          throw new Exception("No resource with ID " + id);
        }
        Policy policy = LaunchSessionManager.getLaunchRequestPolicy(null, agent.getSession(), resource);
        if (resource.sessionPasswordRequired(agent.getSession())) {
          // TODO: prompt user for credentials through agent!
          return true;
        } else {
          LaunchSession launchSession = LaunchSessionFactory.getInstance().createLaunchSession(agent.getSession(),
            resource,
View Full Code Here

TOP

Related Classes of com.adito.policyframework.Resource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.