Blue Mind
Release 1.0

net.bluemind.core.client.acl
Class AclClient

java.lang.Object
  extended by net.bluemind.core.client.impl.AbstractClientImpl
      extended by net.bluemind.core.client.acl.AclClient
All Implemented Interfaces:
IAcl, ISyncClient

public class AclClient
extends AbstractClientImpl
implements IAcl


Field Summary
 
Fields inherited from class net.bluemind.core.client.impl.AbstractClientImpl
logger
 
Constructor Summary
AclClient(java.lang.String backendUrl)
           
 
Method Summary
 boolean canAccess(AccessToken at, java.lang.String consumer, java.lang.Integer consumerId, java.lang.String entity, java.lang.Integer entityId)
          Check if consumer has access right on entity
 boolean canAdmin(AccessToken at, java.lang.String consumer, java.lang.Integer consumerId, java.lang.String entity, java.lang.Integer entityId)
          Check if consumer has admin right on entity
 boolean canRead(AccessToken at, java.lang.String consumer, java.lang.Integer consumerId, java.lang.String entity, java.lang.Integer entityId)
          Check if consumer has read right on entity
 boolean canWrite(AccessToken at, java.lang.String consumer, java.lang.Integer consumerId, java.lang.String entity, java.lang.Integer entityId)
          Check if consumer has write right on entity
 void denyAll(AccessToken at, java.lang.String entity, java.lang.Integer entityId)
          Remove all ACLs on a Blue Mind entity
 java.util.List<AclEntity> getAllowedEntities(AccessToken at, java.lang.String entity, java.lang.Integer userId, java.lang.String right)
          Get user allowed entities.
 java.util.List<AclEntity> getEntityConsumers(AccessToken at, java.lang.String entity, java.lang.Integer entityId)
          Get entity consumer list
 AccessToken login(java.lang.String login, java.lang.String password, java.lang.String origin)
           
 void logout(AccessToken at)
           
 void setConsumerRights(AccessToken at, java.lang.String consumer, java.lang.Integer consumerId, java.lang.String entity, java.lang.Integer entityId, Rights rights)
          Set Right on entity for consumer
 void setConsumersRights(AccessToken at, java.util.Collection<AclEntity> consumers, java.lang.String entity, java.lang.Integer entityId)
          Set consumer right on an entity
 void setRight(AccessToken at, java.lang.String consumer, java.lang.Integer consumerId, java.lang.String entity, java.lang.Integer entityId, java.lang.String action, java.lang.Integer right)
          Set action right on entity for consumer
 
Methods inherited from class net.bluemind.core.client.impl.AbstractClientImpl
checkServerError, execute, executeStream, executeVoid, initParams, setToken, sudo, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AclClient

public AclClient(java.lang.String backendUrl)
Method Detail

denyAll

public void denyAll(AccessToken at,
                    java.lang.String entity,
                    java.lang.Integer entityId)
             throws AuthFault,
                    ServerFault
Description copied from interface: IAcl
Remove all ACLs on a Blue Mind entity

Specified by:
denyAll in interface IAcl
Parameters:
at - Blue Mind AccessToken
entity - entity string, check IAcl
entityId - entity ID, check IAcl
Throws:
AuthFault
ServerFault

setRight

public void setRight(AccessToken at,
                     java.lang.String consumer,
                     java.lang.Integer consumerId,
                     java.lang.String entity,
                     java.lang.Integer entityId,
                     java.lang.String action,
                     java.lang.Integer right)
              throws AuthFault,
                     ServerFault
Description copied from interface: IAcl
Set action right on entity for consumer

Specified by:
setRight in interface IAcl
Parameters:
at - Blue Mind AccessToken
consumer - consumer string, check IAcl
consumerId - consumer ID, check IAcl
entity - entity string, check IAcl
entityId - entity ID, check IAcl
action - right action, check IAcl
right - set this right (1), unset this right (0)
Throws:
AuthFault
ServerFault

setConsumerRights

public void setConsumerRights(AccessToken at,
                              java.lang.String consumer,
                              java.lang.Integer consumerId,
                              java.lang.String entity,
                              java.lang.Integer entityId,
                              Rights rights)
                       throws AuthFault,
                              ServerFault
Description copied from interface: IAcl
Set Right on entity for consumer

Specified by:
setConsumerRights in interface IAcl
Parameters:
at - Blue Mind AccessToken
consumer - consumer string, check IAcl
consumerId - consumer string, check IAcl
entity - entity string, check IAcl
entityId - entity ID, check IAcl
rights - Right
Throws:
AuthFault
ServerFault

login

public AccessToken login(java.lang.String login,
                         java.lang.String password,
                         java.lang.String origin)
Specified by:
login in interface ISyncClient
Overrides:
login in class AbstractClientImpl

logout

public void logout(AccessToken at)
Specified by:
logout in interface ISyncClient
Overrides:
logout in class AbstractClientImpl

canAccess

public boolean canAccess(AccessToken at,
                         java.lang.String consumer,
                         java.lang.Integer consumerId,
                         java.lang.String entity,
                         java.lang.Integer entityId)
                  throws AuthFault,
                         ServerFault
Description copied from interface: IAcl
Check if consumer has access right on entity

Specified by:
canAccess in interface IAcl
Parameters:
at - Blue Mind AccessToken
consumer - consumer string, check IAcl
consumerId - consumer string, check IAcl
entity - entity string, check IAcl
entityId - entity ID, check IAcl
Returns:
true if consumer has access right on entity, false otherwise
Throws:
AuthFault
ServerFault

canRead

public boolean canRead(AccessToken at,
                       java.lang.String consumer,
                       java.lang.Integer consumerId,
                       java.lang.String entity,
                       java.lang.Integer entityId)
                throws AuthFault,
                       ServerFault
Description copied from interface: IAcl
Check if consumer has read right on entity

Specified by:
canRead in interface IAcl
Parameters:
at - Blue Mind AccessToken
consumer - consumer string, check IAcl
consumerId - consumer string, check IAcl
entity - entity string, check IAcl
entityId - entity ID, check IAcl
Returns:
true if consumer has read right on entity, false otherwise
Throws:
AuthFault
ServerFault

canWrite

public boolean canWrite(AccessToken at,
                        java.lang.String consumer,
                        java.lang.Integer consumerId,
                        java.lang.String entity,
                        java.lang.Integer entityId)
                 throws AuthFault,
                        ServerFault
Description copied from interface: IAcl
Check if consumer has write right on entity

Specified by:
canWrite in interface IAcl
Parameters:
at - Blue Mind AccessToken
consumer - consumer string, check IAcl
consumerId - consumer string, check IAcl
entity - entity string, check IAcl
entityId - entity ID, check IAcl
Returns:
true if consumer has write right on entity, false otherwise
Throws:
AuthFault
ServerFault

canAdmin

public boolean canAdmin(AccessToken at,
                        java.lang.String consumer,
                        java.lang.Integer consumerId,
                        java.lang.String entity,
                        java.lang.Integer entityId)
                 throws AuthFault,
                        ServerFault
Description copied from interface: IAcl
Check if consumer has admin right on entity

Specified by:
canAdmin in interface IAcl
Parameters:
at - Blue Mind AccessToken
consumer - consumer string, check IAcl
consumerId - consumer string, check IAcl
entity - entity string, check IAcl
entityId - entity ID, check IAcl
Returns:
true if consumer has admin right on entity, false otherwise
Throws:
AuthFault
ServerFault

getEntityConsumers

public java.util.List<AclEntity> getEntityConsumers(AccessToken at,
                                                    java.lang.String entity,
                                                    java.lang.Integer entityId)
                                             throws AuthFault,
                                                    ServerFault
Description copied from interface: IAcl
Get entity consumer list

Specified by:
getEntityConsumers in interface IAcl
Parameters:
at - Blue Mind AccessToken
entity - entity string, check IAcl
entityId - entity ID, check IAcl
Returns:
consumer AclEntity list
Throws:
AuthFault
ServerFault

getAllowedEntities

public java.util.List<AclEntity> getAllowedEntities(AccessToken at,
                                                    java.lang.String entity,
                                                    java.lang.Integer userId,
                                                    java.lang.String right)
                                             throws AuthFault,
                                                    ServerFault
Description copied from interface: IAcl
Get user allowed entities.

Specified by:
getAllowedEntities in interface IAcl
Parameters:
at - Blue Mind AccessToken
entity - entity string, check IAcl
userId - User ID
right - right string, check IAcl. Could be null to get allowed entities whatever user right on it
Returns:
entity AclEntity list for user
Throws:
AuthFault
ServerFault

setConsumersRights

public void setConsumersRights(AccessToken at,
                               java.util.Collection<AclEntity> consumers,
                               java.lang.String entity,
                               java.lang.Integer entityId)
                        throws AuthFault,
                               ServerFault
Description copied from interface: IAcl
Set consumer right on an entity

Specified by:
setConsumersRights in interface IAcl
Parameters:
at - Blue Mind AccessToken
consumers - consumer AclEntity list
entity - entity string, check IAcl
entityId - User ID
Throws:
AuthFault
ServerFault

Blue Mind
Release 1.0