下面列出了java.security.acl.AclEntry#addPermission ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}
/**
* 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();
}