|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.protocol.MessageHandler
public abstract class MessageHandler
The MessageHandler class should help guide the creation of all of the message handlers for each Inca server.
Nested Class Summary | |
---|---|
static class |
MessageHandler.Permittee
|
static class |
MessageHandler.PermitteeGroup
|
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
logger
logger that can be used by all MessageHandlers. |
Constructor Summary | |
---|---|
MessageHandler()
|
Method Summary | |
---|---|
static void |
errorReply(java.io.OutputStream output,
java.lang.String msg)
A convenience method that logs and writes an error message. |
abstract void |
execute(ProtocolReader reader,
java.io.OutputStream output,
java.lang.String dn)
Service an incoming request from a specified client DN, using specified i/o streams. |
static java.util.List<MessageHandler.Permittee> |
getAllPermittees()
|
static java.lang.String |
getPermissionsAsXml()
|
static java.util.List<MessageHandler.Permittee> |
getPermittees(MessageHandler.PermitteeGroup group)
|
static java.util.List<MessageHandler.Permittee> |
getPermittees(java.lang.String action)
Returns the set of DNs permitted to perform a specified action, or null if no permissions have been registered for that action. |
static boolean |
grantPeerPermission(java.lang.String name)
|
static boolean |
grantPermission(java.lang.String name,
java.lang.String action)
Indicate that a specified DN may perform a specified action. |
static boolean |
isPermitted(java.lang.String name,
java.lang.String action)
Returns true iff a specified DN may perform a specified action. |
static void |
resetPermissions()
Removes all permissions--useful for testing. |
static boolean |
revokeAllPermissions(java.lang.String action)
Indicate that a specified DN may no longer perform a specified action. |
static boolean |
revokePeerPermission(java.lang.String name)
|
static boolean |
revokePermission(java.lang.String name,
java.lang.String action)
Indicate that a specified DN may no longer perform a specified action. |
static void |
setPermissionsFromXml(java.lang.String xml)
|
static void |
setPermissionsFromXml(java.lang.String xml,
java.lang.String localDn)
|
static void |
setPermissionsPath(java.lang.String path)
Sets the path where DN permissions should be stored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger logger
Constructor Detail |
---|
public MessageHandler()
Method Detail |
---|
public static void setPermissionsPath(java.lang.String path)
path
- pathname of the permissions filepublic static boolean grantPermission(java.lang.String name, java.lang.String action)
name
- the entity DNaction
- the action to test
public static boolean revokePermission(java.lang.String name, java.lang.String action)
name
- the entity DNaction
- the action now forbidden to the DN
public static boolean revokeAllPermissions(java.lang.String action)
name
- the entity DNaction
- the action now forbidden to the DN
public static boolean grantPeerPermission(java.lang.String name)
name
- the entity DN
public static boolean revokePeerPermission(java.lang.String name)
name
-
public static boolean isPermitted(java.lang.String name, java.lang.String action)
name
- the entity DNaction
- the action to test
public static java.util.List<MessageHandler.Permittee> getPermittees(java.lang.String action)
action
- the action to test
public static java.util.List<MessageHandler.Permittee> getPermittees(MessageHandler.PermitteeGroup group)
group
-
public static java.util.List<MessageHandler.Permittee> getAllPermittees()
public static java.lang.String getPermissionsAsXml()
public static void setPermissionsFromXml(java.lang.String xml) throws javax.xml.parsers.ParserConfigurationException, javax.xml.xpath.XPathExpressionException, org.xml.sax.SAXException, java.io.IOException
xml
-
javax.xml.parsers.ParserConfigurationException
javax.xml.xpath.XPathExpressionException
java.io.IOException
org.xml.sax.SAXException
public static void setPermissionsFromXml(java.lang.String xml, java.lang.String localDn) throws javax.xml.parsers.ParserConfigurationException, javax.xml.xpath.XPathExpressionException, org.xml.sax.SAXException, java.io.IOException
xml
- localDn
-
javax.xml.parsers.ParserConfigurationException
javax.xml.xpath.XPathExpressionException
java.io.IOException
org.xml.sax.SAXException
public static void resetPermissions()
public abstract void execute(ProtocolReader reader, java.io.OutputStream output, java.lang.String dn) throws java.lang.Exception
reader
- the reader connected to the clientoutput
- the output stream connected to the clientdn
- the DN of the client, null if no authentication
java.lang.Exception
public static void errorReply(java.io.OutputStream output, java.lang.String msg)
output
- the output stream to use to send the error messagemsg
- the error message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |