Java Code Examples for java.security.acl.AclEntry#addPermission()

The following examples show how to use java.security.acl.AclEntry#addPermission() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SnmpAcl.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 2
Source File: SnmpAcl.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 3
Source File: SnmpAcl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 4
Source File: SnmpAcl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 5
Source File: SnmpAcl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 6
Source File: SnmpAcl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 7
Source File: SnmpAcl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 8
Source File: SnmpAcl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 9
Source File: SnmpAcl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 10
Source File: SnmpAcl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 11
Source File: SnmpAcl.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 12
Source File: SnmpAcl.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs the Java Dynamic Management(TM) Access Control List
 * based on IP addresses. The ACL will take the given owner name.
 * The current IP address will be the owner of the ACL.
 *
 * @param Owner The name of the ACL Owner.
 * @param aclFileName The name of the ACL File.
 *
 * @exception UnknownHostException If the local host is unknown.
 * @exception IllegalArgumentException If the ACL file doesn't exist.
 */
public SnmpAcl(String Owner, String aclFileName)
    throws UnknownHostException, IllegalArgumentException {
    trapDestList= new Hashtable<InetAddress, Vector<String>>();
    informDestList= new Hashtable<InetAddress, Vector<String>>();

    // PrincipalImpl() take the current host as entry
    owner = new PrincipalImpl();
    try {
        acl = new AclImpl(owner,Owner);
        AclEntry ownEntry = new AclEntryImpl(owner);
        ownEntry.addPermission(READ);
        ownEntry.addPermission(WRITE);
        acl.addEntry(owner,ownEntry);
    } catch (NotOwnerException ex) {
        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
                "SnmpAcl(String,String)",
                "Should never get NotOwnerException as the owner " +
                "is built in this constructor");
        }
    }
    if (aclFileName == null) setDefaultFileName();
    else setAuthorizedListFile(aclFileName);
    readAuthorizedListFile();
}
 
Example 13
Source File: SnmpAcl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resets this ACL to the values contained in the configuration file.
 *
 * @exception NotOwnerException If the principal attempting the reset is not an owner of this ACL.
 * @exception UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.
 */
public void rereadTheFile() throws NotOwnerException, UnknownHostException {
    alwaysAuthorized = false;
    acl.removeAll(owner);
    trapDestList.clear();
    informDestList.clear();
    AclEntry ownEntry = new AclEntryImpl(owner);
    ownEntry.addPermission(READ);
    ownEntry.addPermission(WRITE);
    acl.addEntry(owner,ownEntry);
    readAuthorizedListFile();
}
 
Example 14
Source File: SnmpAcl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resets this ACL to the values contained in the configuration file.
 *
 * @exception NotOwnerException If the principal attempting the reset is not an owner of this ACL.
 * @exception UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.
 */
public void rereadTheFile() throws NotOwnerException, UnknownHostException {
    alwaysAuthorized = false;
    acl.removeAll(owner);
    trapDestList.clear();
    informDestList.clear();
    AclEntry ownEntry = new AclEntryImpl(owner);
    ownEntry.addPermission(READ);
    ownEntry.addPermission(WRITE);
    acl.addEntry(owner,ownEntry);
    readAuthorizedListFile();
}
 
Example 15
Source File: SnmpAcl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resets this ACL to the values contained in the configuration file.
 *
 * @exception NotOwnerException If the principal attempting the reset is not an owner of this ACL.
 * @exception UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.
 */
public void rereadTheFile() throws NotOwnerException, UnknownHostException {
    alwaysAuthorized = false;
    acl.removeAll(owner);
    trapDestList.clear();
    informDestList.clear();
    AclEntry ownEntry = new AclEntryImpl(owner);
    ownEntry.addPermission(READ);
    ownEntry.addPermission(WRITE);
    acl.addEntry(owner,ownEntry);
    readAuthorizedListFile();
}
 
Example 16
Source File: SnmpAcl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resets this ACL to the values contained in the configuration file.
 *
 * @exception NotOwnerException If the principal attempting the reset is not an owner of this ACL.
 * @exception UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.
 */
public void rereadTheFile() throws NotOwnerException, UnknownHostException {
    alwaysAuthorized = false;
    acl.removeAll(owner);
    trapDestList.clear();
    informDestList.clear();
    AclEntry ownEntry = new AclEntryImpl(owner);
    ownEntry.addPermission(READ);
    ownEntry.addPermission(WRITE);
    acl.addEntry(owner,ownEntry);
    readAuthorizedListFile();
}
 
Example 17
Source File: SnmpAcl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resets this ACL to the values contained in the configuration file.
 *
 * @exception NotOwnerException If the principal attempting the reset is not an owner of this ACL.
 * @exception UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.
 */
public void rereadTheFile() throws NotOwnerException, UnknownHostException {
    alwaysAuthorized = false;
    acl.removeAll(owner);
    trapDestList.clear();
    informDestList.clear();
    AclEntry ownEntry = new AclEntryImpl(owner);
    ownEntry.addPermission(READ);
    ownEntry.addPermission(WRITE);
    acl.addEntry(owner,ownEntry);
    readAuthorizedListFile();
}
 
Example 18
Source File: SnmpAcl.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resets this ACL to the values contained in the configuration file.
 *
 * @exception NotOwnerException If the principal attempting the reset is not an owner of this ACL.
 * @exception UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.
 */
public void rereadTheFile() throws NotOwnerException, UnknownHostException {
    alwaysAuthorized = false;
    acl.removeAll(owner);
    trapDestList.clear();
    informDestList.clear();
    AclEntry ownEntry = new AclEntryImpl(owner);
    ownEntry.addPermission(READ);
    ownEntry.addPermission(WRITE);
    acl.addEntry(owner,ownEntry);
    readAuthorizedListFile();
}
 
Example 19
Source File: SnmpAcl.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resets this ACL to the values contained in the configuration file.
 *
 * @exception NotOwnerException If the principal attempting the reset is not an owner of this ACL.
 * @exception UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.
 */
public void rereadTheFile() throws NotOwnerException, UnknownHostException {
    alwaysAuthorized = false;
    acl.removeAll(owner);
    trapDestList.clear();
    informDestList.clear();
    AclEntry ownEntry = new AclEntryImpl(owner);
    ownEntry.addPermission(READ);
    ownEntry.addPermission(WRITE);
    acl.addEntry(owner,ownEntry);
    readAuthorizedListFile();
}
 
Example 20
Source File: SnmpAcl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resets this ACL to the values contained in the configuration file.
 *
 * @exception NotOwnerException If the principal attempting the reset is not an owner of this ACL.
 * @exception UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.
 */
public void rereadTheFile() throws NotOwnerException, UnknownHostException {
    alwaysAuthorized = false;
    acl.removeAll(owner);
    trapDestList.clear();
    informDestList.clear();
    AclEntry ownEntry = new AclEntryImpl(owner);
    ownEntry.addPermission(READ);
    ownEntry.addPermission(WRITE);
    acl.addEntry(owner,ownEntry);
    readAuthorizedListFile();
}