de.deepamehta.plugins.accesscontrol
Class AccessControlPlugin

java.lang.Object
  extended by de.deepamehta.core.osgi.PluginActivator
      extended by de.deepamehta.plugins.accesscontrol.AccessControlPlugin
All Implemented Interfaces:
de.deepamehta.core.osgi.PluginContext, de.deepamehta.core.service.event.AllPluginsActiveListener, de.deepamehta.core.service.event.IntroduceAssociationTypeListener, de.deepamehta.core.service.event.IntroduceTopicTypeListener, de.deepamehta.core.service.event.PostCreateAssociationListener, de.deepamehta.core.service.event.PostCreateTopicListener, de.deepamehta.core.service.event.PostUpdateTopicListener, de.deepamehta.core.service.event.PreSendAssociationTypeListener, de.deepamehta.core.service.event.PreSendTopicTypeListener, de.deepamehta.core.service.event.ResourceRequestFilterListener, de.deepamehta.core.service.event.ServiceRequestFilterListener, de.deepamehta.core.service.EventListener, de.deepamehta.core.service.PluginService, AccessControlService, org.osgi.framework.BundleActivator

public class AccessControlPlugin
extends de.deepamehta.core.osgi.PluginActivator
implements AccessControlService, de.deepamehta.core.service.event.AllPluginsActiveListener, de.deepamehta.core.service.event.PostCreateTopicListener, de.deepamehta.core.service.event.PostCreateAssociationListener, de.deepamehta.core.service.event.PostUpdateTopicListener, de.deepamehta.core.service.event.IntroduceTopicTypeListener, de.deepamehta.core.service.event.IntroduceAssociationTypeListener, de.deepamehta.core.service.event.ServiceRequestFilterListener, de.deepamehta.core.service.event.ResourceRequestFilterListener, de.deepamehta.core.service.event.PreSendTopicTypeListener, de.deepamehta.core.service.event.PreSendAssociationTypeListener


Field Summary
 
Fields inherited from class de.deepamehta.core.osgi.PluginActivator
bundle, dms
 
Constructor Summary
AccessControlPlugin()
           
 
Method Summary
 void allPluginsActive()
          Setup access control for the default user and the default topicmap.
 AccessControlList getACL(de.deepamehta.core.DeepaMehtaObject object)
          Returns the Access Control List of a topic or an association.
 Permissions getAssociationPermissions(long assocId)
           
 Collection<de.deepamehta.core.Association> getAssociationsByCreator(String username)
           
 Collection<de.deepamehta.core.Association> getAssociationsByOwner(String username)
           
 String getCreator(de.deepamehta.core.DeepaMehtaObject object)
          Returns the creator of a topic or an association.
 String getOwner(de.deepamehta.core.DeepaMehtaObject object)
          Returns the owner of a topic or an association.
 Permissions getTopicPermissions(long topicId)
           
 Collection<de.deepamehta.core.Topic> getTopicsByCreator(String username)
           
 Collection<de.deepamehta.core.Topic> getTopicsByOwner(String username)
           
 String getUsername()
          Returns the username of the logged in user.
 de.deepamehta.core.Topic getUsername(String username)
          Returns the "Username" topic for the specified username.
 void init()
           
 void introduceAssociationType(de.deepamehta.core.AssociationType assocType)
           
 void introduceTopicType(de.deepamehta.core.TopicType topicType)
           
 void joinWorkspace(String username, long workspaceId)
           
 void joinWorkspace(de.deepamehta.core.Topic username, long workspaceId)
           
 void login()
          Checks weather the credentials in the authorization string match an existing User Account, and if so, creates an HTTP session.
 void logout()
          Logs the user out.
 void postCreateAssociation(de.deepamehta.core.Association assoc)
           
 void postCreateTopic(de.deepamehta.core.Topic topic)
           
 void postInstall()
           
 void postUpdateTopic(de.deepamehta.core.Topic topic, de.deepamehta.core.model.TopicModel newModel, de.deepamehta.core.model.TopicModel oldModel)
           
 void preSendAssociationType(de.deepamehta.core.AssociationType assocType)
           
 void preSendTopicType(de.deepamehta.core.TopicType topicType)
           
 void resourceRequestFilter(javax.servlet.http.HttpServletRequest servletRequest)
           
 void serviceRequestFilter(com.sun.jersey.spi.container.ContainerRequest containerRequest)
           
 void setACL(de.deepamehta.core.DeepaMehtaObject object, AccessControlList acl)
          Sets the Access Control List for a topic or an association.
 void setCreator(de.deepamehta.core.DeepaMehtaObject object, String username)
          Sets the creator of a topic or an association.
 void setOwner(de.deepamehta.core.DeepaMehtaObject object, String username)
          Sets the owner of a topic or an association.
 
Methods inherited from class de.deepamehta.core.osgi.PluginActivator
getBundleContext, getPluginName, getStaticResource, getUri, publishDirectory, serviceArrived, serviceGone, setCoreService, shutdown, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AccessControlPlugin

public AccessControlPlugin()
Method Detail

login

public void login()
Description copied from interface: AccessControlService
Checks weather the credentials in the authorization string match an existing User Account, and if so, creates an HTTP session. ### FIXDOC

Specified by:
login in interface AccessControlService

logout

public void logout()
Description copied from interface: AccessControlService
Logs the user out. That is invalidating the session associated with the JSESSION ID cookie. For a "non-private" DM installation the response is 204 No Content. For a "private" DM installation the response is 401 Authorization Required. In this case the webclient is supposed to shutdown the DM GUI then. The webclient of a "private" DM installation must only be visible/usable when logged in.

Specified by:
logout in interface AccessControlService

getUsername

public String getUsername()
Description copied from interface: AccessControlService
Returns the username of the logged in user.

Specified by:
getUsername in interface AccessControlService
Returns:
The username, or null if no user is logged in.

getUsername

public de.deepamehta.core.Topic getUsername(String username)
Description copied from interface: AccessControlService
Returns the "Username" topic for the specified username.

Specified by:
getUsername in interface AccessControlService
Returns:
The "Username" topic (type dm4.accesscontrol.username), or null if no such username exists.

getTopicPermissions

public Permissions getTopicPermissions(long topicId)
Specified by:
getTopicPermissions in interface AccessControlService

getAssociationPermissions

public Permissions getAssociationPermissions(long assocId)
Specified by:
getAssociationPermissions in interface AccessControlService

getCreator

public String getCreator(de.deepamehta.core.DeepaMehtaObject object)
Description copied from interface: AccessControlService
Returns the creator of a topic or an association.

Specified by:
getCreator in interface AccessControlService
Returns:
The username of the creator, or null if no creator is set.

setCreator

public void setCreator(de.deepamehta.core.DeepaMehtaObject object,
                       String username)
Description copied from interface: AccessControlService
Sets the creator of a topic or an association.

Specified by:
setCreator in interface AccessControlService

getOwner

public String getOwner(de.deepamehta.core.DeepaMehtaObject object)
Description copied from interface: AccessControlService
Returns the owner of a topic or an association.

Specified by:
getOwner in interface AccessControlService
Returns:
The username of the owner, or null if no owner is set.

setOwner

public void setOwner(de.deepamehta.core.DeepaMehtaObject object,
                     String username)
Description copied from interface: AccessControlService
Sets the owner of a topic or an association.

Specified by:
setOwner in interface AccessControlService

getACL

public AccessControlList getACL(de.deepamehta.core.DeepaMehtaObject object)
Description copied from interface: AccessControlService
Returns the Access Control List of a topic or an association.

Specified by:
getACL in interface AccessControlService
Returns:
The Access Control List. If no one was set an empty Access Control List is returned.

setACL

public void setACL(de.deepamehta.core.DeepaMehtaObject object,
                   AccessControlList acl)
Description copied from interface: AccessControlService
Sets the Access Control List for a topic or an association.

Specified by:
setACL in interface AccessControlService

joinWorkspace

public void joinWorkspace(String username,
                          long workspaceId)
Specified by:
joinWorkspace in interface AccessControlService

joinWorkspace

public void joinWorkspace(de.deepamehta.core.Topic username,
                          long workspaceId)
Specified by:
joinWorkspace in interface AccessControlService

getTopicsByCreator

public Collection<de.deepamehta.core.Topic> getTopicsByCreator(String username)
Specified by:
getTopicsByCreator in interface AccessControlService

getTopicsByOwner

public Collection<de.deepamehta.core.Topic> getTopicsByOwner(String username)
Specified by:
getTopicsByOwner in interface AccessControlService

getAssociationsByCreator

public Collection<de.deepamehta.core.Association> getAssociationsByCreator(String username)
Specified by:
getAssociationsByCreator in interface AccessControlService

getAssociationsByOwner

public Collection<de.deepamehta.core.Association> getAssociationsByOwner(String username)
Specified by:
getAssociationsByOwner in interface AccessControlService

postInstall

public void postInstall()
Specified by:
postInstall in interface de.deepamehta.core.osgi.PluginContext
Overrides:
postInstall in class de.deepamehta.core.osgi.PluginActivator

init

public void init()
Specified by:
init in interface de.deepamehta.core.osgi.PluginContext
Overrides:
init in class de.deepamehta.core.osgi.PluginActivator

allPluginsActive

public void allPluginsActive()
Setup access control for the default user and the default topicmap. 1) assign default user to default workspace 2) assign default topicmap to default workspace 3) setup access control for default topicmap

Specified by:
allPluginsActive in interface de.deepamehta.core.service.event.AllPluginsActiveListener

postCreateTopic

public void postCreateTopic(de.deepamehta.core.Topic topic)
Specified by:
postCreateTopic in interface de.deepamehta.core.service.event.PostCreateTopicListener

postCreateAssociation

public void postCreateAssociation(de.deepamehta.core.Association assoc)
Specified by:
postCreateAssociation in interface de.deepamehta.core.service.event.PostCreateAssociationListener

postUpdateTopic

public void postUpdateTopic(de.deepamehta.core.Topic topic,
                            de.deepamehta.core.model.TopicModel newModel,
                            de.deepamehta.core.model.TopicModel oldModel)
Specified by:
postUpdateTopic in interface de.deepamehta.core.service.event.PostUpdateTopicListener

introduceTopicType

public void introduceTopicType(de.deepamehta.core.TopicType topicType)
Specified by:
introduceTopicType in interface de.deepamehta.core.service.event.IntroduceTopicTypeListener

introduceAssociationType

public void introduceAssociationType(de.deepamehta.core.AssociationType assocType)
Specified by:
introduceAssociationType in interface de.deepamehta.core.service.event.IntroduceAssociationTypeListener

serviceRequestFilter

public void serviceRequestFilter(com.sun.jersey.spi.container.ContainerRequest containerRequest)
Specified by:
serviceRequestFilter in interface de.deepamehta.core.service.event.ServiceRequestFilterListener

resourceRequestFilter

public void resourceRequestFilter(javax.servlet.http.HttpServletRequest servletRequest)
Specified by:
resourceRequestFilter in interface de.deepamehta.core.service.event.ResourceRequestFilterListener

preSendTopicType

public void preSendTopicType(de.deepamehta.core.TopicType topicType)
Specified by:
preSendTopicType in interface de.deepamehta.core.service.event.PreSendTopicTypeListener

preSendAssociationType

public void preSendAssociationType(de.deepamehta.core.AssociationType assocType)
Specified by:
preSendAssociationType in interface de.deepamehta.core.service.event.PreSendAssociationTypeListener


Copyright © 2014. All rights reserved.