Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.Machine


            return;
        }
        try {
            InetAddress networkAddress = InetAddress.getByName(args[0]);
            InetAddress subnetMask = InetAddress.getByName(args[1]);
            Machine machine = new Machine(args[2]);

            InetAddressUtil util = new InetAddressUtil(new ConsoleLogger());
            if (util.contains(networkAddress, subnetMask, machine.getAddress())) {
                System.out.println("true");
            } else {
                System.out.println("false");
            }
        } catch (final UnknownHostException e) {
View Full Code Here


                User currentUser = identity.getUser();
                if (currentUser != null) {
                    value = currentUser.getId();
                }
            } else if (name.equals(IP_ADDRESS)) {
                Machine machine = identity.getMachine();
                if (machine != null) {
                    value = machine.getIp();
                }
            } else if (name.equals(ROLE_IDS)) {
                try {
                    Role[] roles = PolicyUtil.getRoles(request);
                    StringBuffer buf = new StringBuffer();
View Full Code Here

        if (user != null) {
            userId = user.getId();
        }
       
        String machineIp = null;
        Machine machine = identity.getMachine();
        if (machine != null) {
            machineIp = machine.getIp();
        }
       
        String[] roleIds = new String[roles.length];
        for (int i = 0; i < roles.length; i++) {
            roleIds[i] = roles[i].getId();
View Full Code Here

    }
    IPRange ipr = new FileIPRange();
    try {
      ipr.setNetworkAddress(args[0]);
      ipr.setSubnetMask(args[1]);
      if (ipr.contains(new Machine(args[2]))) {
        System.out.println("true");
      } else {
        System.out.println("false");
      }
    } catch (Exception e) {
View Full Code Here

    }
    IPRange ipr = new FileIPRange();
    try {
      ipr.setNetworkAddress(args[0]);
      ipr.setSubnetMask(args[1]);
      if (ipr.contains(new Machine(args[2]))) {
        System.out.println("true");
      } else {
        System.out.println("false");
      }
    } catch (Exception e) {
View Full Code Here

      userId = user.getId();
    }
    parameters.put(USER_ID, userId);

    String machineIp = "";
    Machine machine = identity.getMachine();
    if (machine != null) {
      machineIp = machine.getIp();
    }
    parameters.put(MACHINE, machineIp);
  }
View Full Code Here

        Session session = request.getSession(true);
        if (!hasValidIdentity(session)) {
            Identity identity = new Identity();
            String remoteAddress = request.getRemoteAddr();

            Machine machine = new Machine(remoteAddress);
            IPRange[] ranges = accreditableManager.getIPRangeManager().getIPRanges();
            for (int i = 0; i < ranges.length; i++) {
                if (ranges[i].contains(machine)) {
                    machine.addIPRange(ranges[i]);
                }
            }

            identity.addIdentifiable(machine);
            session.setAttribute(Identity.class.getName(), identity);
View Full Code Here

                    User user = identity.getUser();
                    if (user != null) {
                        value = user.getEmail();
                    }
                } else if (name.equals(IP_ADDRESS)) {
                    Machine machine = identity.getMachine();
                    if (machine != null) {
                        value = machine.getIp();
                    }
                } else if (name.equals(ROLE_IDS)) {
                    try {
                        Role[] roles = PolicyAuthorizer.getRoles(request);
                        String roleIds = "";
View Full Code Here

        User user = identity.getUser();
        if (user != null) {
            userId = user.getId();
        }

        Machine machine = identity.getMachine();
        if (machine != null) {
            ipAddress = machine.getIp();
        }

        Role[] roles = PolicyAuthorizer.getRoles(request);
        String[] roleIds = new String[roles.length];
        for (int i = 0; i < roles.length; i++) {
View Full Code Here

        if (user != null) {
            userId = user.getId();
        }
       
        String machineIp = null;
        Machine machine = identity.getMachine();
        if (machine != null) {
            machineIp = machine.getIp();
        }
       
        String[] roleIds = new String[roles.length];
        for (int i = 0; i < roles.length; i++) {
            roleIds[i] = roles[i].getId();
View Full Code Here

TOP

Related Classes of org.apache.lenya.ac.Machine

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.