|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.access.AccessList
public class AccessList
Manages Access Permissions.
Nested Class Summary | |
---|---|
static class |
AccessList.Entry
Entries class |
Field Summary | |
---|---|
protected Map<ID,AccessList.Entry> |
accessMap
|
(package private) String |
description
|
(package private) boolean |
grantAll
|
Constructor Summary | |
---|---|
AccessList()
Default Constructor |
|
AccessList(Element root)
Construct from a StructuredDocument |
|
AccessList(InputStream stream)
Initialize access list from an InputStream |
|
AccessList(Map<ID,AccessList.Entry> map)
|
|
AccessList(URI uri)
Initialize access list from a URI e.g. file:/export/dist/acl.xml, e.g. http://configserver.net/edge.acl |
Method Summary | |
---|---|
void |
add(AccessList.Entry entry)
Adds an ACL entry |
Map<ID,AccessList.Entry> |
getAccessMap()
gets the entries list |
static String |
getAdvertisementType()
All messages have a type (in xml this is !doctype) which identifies the message |
String |
getDescrption()
gets the description of this access control |
Document |
getDocument(MimeMediaType asMimeType)
Returns the Document |
boolean |
getGrantAll()
Determine if all access is granted. |
void |
init(File fromFile)
Initialize access list from a file |
void |
init(URI uri)
Initialize the access list from a URI |
protected void |
initialize(XMLElement doc)
Process an individual element from the document. |
boolean |
isAllowed(ID id)
Determines if an entry has access |
void |
refresh(File file)
Deprecated. use URI variant |
void |
refresh(InputStream stream)
refresh the access list from a stream |
void |
refresh(URI uri)
refresh the access list from a URI |
void |
remove(AccessList.Entry entry)
Removes an ACL entry |
void |
setDescrption(String description)
sets the ACL description |
protected void |
setEntries(Map<ID,AccessList.Entry> map)
sets the entries list |
void |
setGrantAll(boolean grantAll)
Allows/denies all access |
String |
toString()
returns the document string representation of this object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Map<ID,AccessList.Entry> accessMap
String description
boolean grantAll
Constructor Detail |
---|
public AccessList()
public AccessList(InputStream stream) throws IOException
stream
- the input stream
IOException
- if an io error occurspublic AccessList(URI uri) throws IOException
uri
- the URI to the access control list
IOException
- if an i/o error occurspublic AccessList(Map<ID,AccessList.Entry> map)
map
- The map of addresses and permissions.public AccessList(Element root)
root
- root elementMethod Detail |
---|
public void init(URI uri) throws IOException
uri
- the refresh URI
IOException
- if an io error occurspublic void init(File fromFile) throws IOException
fromFile
- file to init from
IOException
- if an io error occurs@Deprecated public void refresh(File file)
file
- file to refresh frompublic void refresh(InputStream stream) throws IOException
stream
- the input stream
IOException
- if an io error occurspublic void refresh(URI uri) throws IOException
uri
- the refresh URI
IOException
- if an io error occurspublic String getDescrption()
public boolean getGrantAll()
true
then all access requests will be granted.public void setGrantAll(boolean grantAll)
grantAll
- If true
then all access requests will be granted.public void setDescrption(String description)
description
- The new descriptionprotected void setEntries(Map<ID,AccessList.Entry> map)
map
- The new access mappublic void add(AccessList.Entry entry)
entry
- the entry to addpublic void remove(AccessList.Entry entry)
entry
- the entry to removepublic boolean isAllowed(ID id)
id
- the PeerID
public Map<ID,AccessList.Entry> getAccessMap()
public Document getDocument(MimeMediaType asMimeType)
asMimeType
- mime type encoding
protected void initialize(XMLElement doc)
doc
- the elementpublic String toString()
toString
in class Object
public static String getAdvertisementType()
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |