com.groiss.org
Interface RemoteOrgData

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
OrgData

public interface RemoteOrgData
extends java.rmi.Remote

This interface allows access to the organizational data stored in @enterprise.


Method Summary
 java.util.List<java.lang.String> checkPasswordPolicy(java.lang.String password)
          Check a password against the password policy.
 OrgTree createOrgTree()
          Return a new organizational tree.
 OrgUnit createOrgUnit()
          Create a new OrgUnit object.
 Permission createPermission()
          Create a new Permission
 PermissionList createPermissionList()
          Create a new PermissionList
 Right createRight()
          Create a new Right.
 Role createRole()
          Create a new Role object.
 User createUser()
          Create a new User object.
 UserRole createUserRole()
          Create a new user-role relation
 void delete(Persistent o)
          Delete the object including right check.
 void deleteCascade(OrgUnit ou)
          Delete the passed organizational unit and also objects which are of no use without it.
 void deleteObjectExtension(Persistent obj, java.lang.String formclass)
          delete the object extension for the given object.
<T> T
get(java.lang.Class<? extends T> c, long oid)
          Get an object from the org-data database.
<T> T
get(java.lang.String classname, long oid)
          Get an object from the org-data database.
 Application getApplication(long oid)
          Get an application from the org-data database.
<T> T
getById(java.lang.Class<? extends T> c, java.lang.String id)
          Get an object from the org-data database.
<T> T
getById(java.lang.String classname, java.lang.String id)
          Get an object from the org-data database.
 OrgUnit getHomeOrg(User u)
          Return the Org.unit where the user has the home role.
 java.util.List<LogEntry> getLogEntries(java.lang.String classname, long oid, java.util.Date from, java.util.Date to)
          Returns a list of log entries for the specified object (identified by passed oid and classname) which were made withing the specified time range
 Persistent getObjectExtension(Persistent obj, java.lang.String formclass, boolean create)
          Returns the extension object to a persistent.
 OrgUnit getOrgUnit(long oid)
          Get an OrgUnit from the org-data database.
 java.lang.String getPolicyInfoText(User u)
          Checks if there are any hints for the user according to the password policy.
 Right getRight(long oid)
          Get an Right from the org-data database.
 Role getRole(long oid)
          Get an Role from the org-data database.
 java.util.Map<? extends Role,java.util.Set<java.lang.String>> getRoles(User u)
          Returns a Map of the roles - and depts - of a user.
 java.util.List<Role> getRoles(User u, OrgUnit d)
          Return the roles a user has in a OrgUnit.
 java.util.List<OrgUnit> getSubOrgs(OrgUnit ou, OrgTree tree)
          Return the list of the organizational units that are below the given oe in the given tree.
 OrgUnit getSuperOrg(OrgUnit ou, OrgTree tree)
          Return the organizational unit that is above the given oe in the given tree.
 User getUser(long oid)
          Get an user from the org-data database.
 java.lang.String getUserProperty(User u, java.lang.String key)
          Use this method to get a user property.
<P extends Persistent>
P
getVersion(P o, java.util.Date d)
          Returns the version of the object at a given date.
 boolean hasRight(User u, Right r, java.lang.Object o)
          Checks whether the given user has the given right on the given object.
 boolean hasRole(User u, Role r, OrgUnit d, Application appl)
          Has the user u the role r in the org.unit d?
 void insert(Persistent o)
          Insert the object including right check.
 boolean isInTree(OrgUnit ou, OrgTree tree)
          Is the given org-unit in the specified org-tree.
<T> java.util.List<T>
list(java.lang.Class<? extends T> c, java.lang.String cond, java.lang.String order)
          Deprecated. since ep 8.0, use list(Class, String, String, Object[])
<T> java.util.List<T>
list(java.lang.Class<? extends T> c, java.lang.String cond, java.lang.String order, java.lang.Object[] bindVars)
          Get a list of objects from the org-data database.
 java.util.List<Persistent> list(java.lang.String classname, java.lang.String cond, java.lang.String order, java.lang.Object[] bindVars)
          Get a list of objects from the org-data database.
 java.util.Map<User,java.lang.Object> listUsersWithRole(Role r, OrgUnit ou, Application appl)
          List the users that have a role
<T> java.util.List<T>
listWithRightCheck(User u, java.lang.Class<? extends T> clazz, java.lang.String condition, java.lang.String order, java.lang.Object[] args, Right right, Application app, boolean ignoreDepts)
          Returns a list of all objects of the specified object class for which the specified user has the specified right and for which the condition matches.
<T extends Persistent>
java.util.List<T>
listWithRightCheck(User u, java.lang.String classname, java.lang.String condition, java.lang.String order, java.lang.Object[] bindVars, Right right, Application app, boolean ignoreDepts)
          Returns a list of all objects of the specified object class for which the specified user has the specified right and for which the condition matches.
 boolean mayDelete(User u, Persistent o)
          Check whether the user may delete the object.
 boolean mayExecute(User u, Persistent o)
          Check whether the user may execute the object (function).
 boolean mayInsert(User u, Persistent o)
          Check whether the user may create the object (insert it into the database).
 boolean mayUpdate(User u, Persistent o)
          Check whether the user may edit the object.
 boolean mayView(User u, Persistent o)
          Check whether the user may view the object.
 void placeOrgInTree(OrgUnit parent, OrgUnit child, OrgTree tree)
          Change the organizational hierarchy.
 User setPassword(User u, java.lang.String password)
          Set the password of a user.
 void setUserProperty(User u, java.lang.String key, java.lang.String value)
          Set a user property.
 void update(Persistent o)
          Update the object including right check.
 

Method Detail

get

<T> T get(java.lang.Class<? extends T> c,
          long oid)
      throws java.rmi.RemoteException
Get an object from the org-data database. The class is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Parameters:
c - the class
oid - the unique oid of the object
Returns:
the object, you can cast the result to the class you specified in the first argument
Throws:
java.rmi.RemoteException

get

<T> T get(java.lang.String classname,
          long oid)
      throws java.rmi.RemoteException
Get an object from the org-data database. The classname is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Parameters:
classname - the classname
oid - the unique oid of the object
Returns:
the object, you can cast the result to the class you specified in the first argument
Throws:
java.rmi.RemoteException

getUser

User getUser(long oid)
             throws java.rmi.RemoteException
Get an user from the org-data database.

Parameters:
oid - the unique oid of the object
Returns:
the requested user
Throws:
java.rmi.RemoteException

getUserProperty

java.lang.String getUserProperty(User u,
                                 java.lang.String key)
                                 throws java.rmi.RemoteException
Use this method to get a user property. The method accesses system defined as well as application defined properties.

Parameters:
u - The user of which you want to get a property.
key - The property key.
Returns:
Returns the property value as String or null if no such property exists.
Throws:
java.rmi.RemoteException

setUserProperty

void setUserProperty(User u,
                     java.lang.String key,
                     java.lang.String value)
                     throws java.rmi.RemoteException
Set a user property. The method accesses system defined as well as application defined properties.

Parameters:
u - The user of which you want to get a property.
key - The property key.
value - the property value
Throws:
java.rmi.RemoteException

getRole

Role getRole(long oid)
             throws java.rmi.RemoteException
Get an Role from the org-data database.

Parameters:
oid - the unique oid of the object
Returns:
the requested Role
Throws:
java.rmi.RemoteException

getRight

Right getRight(long oid)
               throws java.rmi.RemoteException
Get an Right from the org-data database.

Parameters:
oid - the unique oid of the object
Returns:
the requested Right
Throws:
java.rmi.RemoteException

getOrgUnit

OrgUnit getOrgUnit(long oid)
                   throws java.rmi.RemoteException
Get an OrgUnit from the org-data database.

Parameters:
oid - the unique oid of the object
Returns:
the requested OrgUnit
Throws:
java.rmi.RemoteException

getApplication

Application getApplication(long oid)
                           throws java.rmi.RemoteException
Get an application from the org-data database.

Parameters:
oid - the unique oid of the object
Returns:
the requested application
Throws:
java.rmi.RemoteException

getById

<T> T getById(java.lang.Class<? extends T> c,
              java.lang.String id)
          throws java.rmi.RemoteException
Get an object from the org-data database. The class is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Parameters:
c - the class
id - the id of the object
Returns:
the object, you can cast the result to the class you specified in the first argument
Throws:
java.rmi.RemoteException

getById

<T> T getById(java.lang.String classname,
              java.lang.String id)
          throws java.lang.ClassNotFoundException,
                 java.rmi.RemoteException
Get an object from the org-data database. The classname is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Parameters:
classname - the classname
id - the id of the object
Returns:
the object, you can cast the result to the class you specified in the first argument
Throws:
java.lang.ClassNotFoundException
java.rmi.RemoteException

getHomeOrg

OrgUnit getHomeOrg(User u)
                   throws java.rmi.RemoteException
Return the Org.unit where the user has the home role.

Parameters:
u - the User
Returns:
the OrgUnit
Throws:
java.rmi.RemoteException

list

@Deprecated
<T> java.util.List<T> list(java.lang.Class<? extends T> c,
                                      java.lang.String cond,
                                      java.lang.String order)
                       throws java.rmi.RemoteException
Deprecated. since ep 8.0, use list(Class, String, String, Object[])

Get a list of objects from the org-data database. The class is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Parameters:
c - the class
cond - the condition expression
order - the order attribute(s), comma-separated if more than one
Returns:
a list of objects of the given class
Throws:
java.rmi.RemoteException

list

<T> java.util.List<T> list(java.lang.Class<? extends T> c,
                           java.lang.String cond,
                           java.lang.String order,
                           java.lang.Object[] bindVars)
                       throws java.rmi.RemoteException
Get a list of objects from the org-data database. The class is one of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Parameters:
c - the class
cond - the condition expression
order - the order attribute(s), comma-separated if more than one
bindVars - if the condition contains place holders for binding variables this array should contain the values
Returns:
a list of objects of the given class
Throws:
java.rmi.RemoteException

list

java.util.List<Persistent> list(java.lang.String classname,
                                java.lang.String cond,
                                java.lang.String order,
                                java.lang.Object[] bindVars)
                                throws java.rmi.RemoteException
Get a list of objects from the org-data database. The classname is one of fully qualified name of User, Right, Role, OrgUnit, Application, OrgTree. All of them from this package.

Parameters:
classname - the fully qualified name of the class of the object
cond - the condition expression
order - the order attribute(s), comma-separated if more than one
bindVars - if the condition contains place holders for binding variables this array should contain the values
Returns:
a list of objects of the given class
Throws:
java.rmi.RemoteException

getRoles

java.util.Map<? extends Role,java.util.Set<java.lang.String>> getRoles(User u)
                                                                       throws java.rmi.RemoteException
Returns a Map of the roles - and depts - of a user.

Parameters:
u - the user
Returns:
a Map where the first keys are the roles, the values are Sets again, containing strings of the form deptoid or form deptoid*depttreeoid. If the role is global, this Set is empty.
Throws:
java.rmi.RemoteException

getRoles

java.util.List<Role> getRoles(User u,
                              OrgUnit d)
                              throws java.rmi.RemoteException
Return the roles a user has in a OrgUnit.

Parameters:
u - the user
d - the OrgUnit
Returns:
a list of roles
Throws:
java.rmi.RemoteException

hasRole

boolean hasRole(User u,
                Role r,
                OrgUnit d,
                Application appl)
                throws java.rmi.RemoteException
Has the user u the role r in the org.unit d?

Parameters:
u - the user
r - the role
d - the OrgUnit
Returns:
true, if the user has the role.
Throws:
java.rmi.RemoteException

hasRight

boolean hasRight(User u,
                 Right r,
                 java.lang.Object o)
                 throws java.rmi.RemoteException
Checks whether the given user has the given right on the given object. See the description of the @enterprise right system for details.

Parameters:
u - the user
r - the right
o - the object (may be null)
Returns:
true if the user has the right
Throws:
java.rmi.RemoteException

listWithRightCheck

<T> java.util.List<T> listWithRightCheck(User u,
                                         java.lang.Class<? extends T> clazz,
                                         java.lang.String condition,
                                         java.lang.String order,
                                         java.lang.Object[] args,
                                         Right right,
                                         Application app,
                                         boolean ignoreDepts)
                                     throws java.rmi.RemoteException
Returns a list of all objects of the specified object class for which the specified user has the specified right and for which the condition matches.

Parameters:
u - the user
clazz - class which instances are wanted
condition - a SQL condition
order - a comma separated list of attribute names of the given class.
args - if the condition contains place holders for binding variables this array should contain the values
right - the right
app - the application which departement tree should be used for checking
ignoreDepts - ignore the right a user has via dept scope
Returns:
the list
Throws:
java.rmi.RemoteException

listWithRightCheck

<T extends Persistent> java.util.List<T> listWithRightCheck(User u,
                                                            java.lang.String classname,
                                                            java.lang.String condition,
                                                            java.lang.String order,
                                                            java.lang.Object[] bindVars,
                                                            Right right,
                                                            Application app,
                                                            boolean ignoreDepts)
                                                        throws java.rmi.RemoteException
Returns a list of all objects of the specified object class for which the specified user has the specified right and for which the condition matches.

Parameters:
u - the user
classname - the fully qualified name of the class of the object
condition - a SQL condition
order - a comma separated list of attribute names of the given class.
bindVars - if the condition contains place holders for binding variables this array should contain the values
right - the right
app - the application which departement tree should be used for checking
ignoreDepts - ignore the right a user has via dept scope
Returns:
the list
Throws:
java.rmi.RemoteException

mayInsert

boolean mayInsert(User u,
                  Persistent o)
                  throws java.rmi.RemoteException
Check whether the user may create the object (insert it into the database).

Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.
Throws:
java.rmi.RemoteException

mayUpdate

boolean mayUpdate(User u,
                  Persistent o)
                  throws java.rmi.RemoteException
Check whether the user may edit the object.

Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.
Throws:
java.rmi.RemoteException

mayView

boolean mayView(User u,
                Persistent o)
                throws java.rmi.RemoteException
Check whether the user may view the object.

Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.
Throws:
java.rmi.RemoteException

mayExecute

boolean mayExecute(User u,
                   Persistent o)
                   throws java.rmi.RemoteException
Check whether the user may execute the object (function).

Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.
Throws:
java.rmi.RemoteException

mayDelete

boolean mayDelete(User u,
                  Persistent o)
                  throws java.rmi.RemoteException
Check whether the user may delete the object.

Parameters:
u - the user requesting the access
o - the object
Returns:
true, if access is allowed.
Throws:
java.rmi.RemoteException

insert

void insert(Persistent o)
            throws java.rmi.RemoteException
Insert the object including right check.

Parameters:
o - the object
Throws:
java.rmi.RemoteException

update

void update(Persistent o)
            throws java.rmi.RemoteException
Update the object including right check.

Parameters:
o - the object
Throws:
java.rmi.RemoteException

delete

void delete(Persistent o)
            throws java.rmi.RemoteException
Delete the object including right check.

Parameters:
o - the object
Throws:
java.rmi.RemoteException

getVersion

<P extends Persistent> P getVersion(P o,
                                    java.util.Date d)
                                throws java.rmi.RemoteException
Returns the version of the object at a given date.

Parameters:
o - the object
d -
Returns:
a Persistent
Throws:
java.rmi.RemoteException

getLogEntries

java.util.List<LogEntry> getLogEntries(java.lang.String classname,
                                       long oid,
                                       java.util.Date from,
                                       java.util.Date to)
                                       throws java.rmi.RemoteException
Returns a list of log entries for the specified object (identified by passed oid and classname) which were made withing the specified time range

Parameters:
classname - the fully qualified name of the class of the object
oid - the oid of the object
from - the date for the start of the range
to - the date for the end of the range
Returns:
a list of log entries
Throws:
java.rmi.RemoteException

listUsersWithRole

java.util.Map<User,java.lang.Object> listUsersWithRole(Role r,
                                                       OrgUnit ou,
                                                       Application appl)
                                                       throws java.rmi.RemoteException
List the users that have a role

Parameters:
r - the role
ou - optional: the orgunit where the role is assigned
appl - optional application, necessary when checking hierarchic roles to use the correct department tree. if the argument is null the default tree is used.
Returns:
a map where the keys are users the values are lists of the departments where the user have the role. For global roles the values are Boolean.TRUE instead of a department list.
Throws:
java.rmi.RemoteException

checkPasswordPolicy

java.util.List<java.lang.String> checkPasswordPolicy(java.lang.String password)
                                                     throws java.rmi.RemoteException
Check a password against the password policy.

Parameters:
password - - the password string to check against the policy
Returns:
a vector of strings representing the reasons, why password does not fit the policy. null if password is ok
Throws:
java.rmi.RemoteException

getPolicyInfoText

java.lang.String getPolicyInfoText(User u)
                                   throws java.rmi.RemoteException
Checks if there are any hints for the user according to the password policy.

Parameters:
u - - the user
Returns:
a String with a policy info message, null if ther is no neccessary message.
Throws:
java.rmi.RemoteException

setPassword

User setPassword(User u,
                 java.lang.String password)
                 throws java.rmi.RemoteException
Set the password of a user. Note: Be aware that the User Object is updated and a BeanManager.commit() is called in this method.

Parameters:
u - the user, whose password should be changed
password - - the new password (plain string)
Returns:
the updated user object
Throws:
java.rmi.RemoteException

createUser

User createUser()
                throws java.rmi.RemoteException
Create a new User object.

Returns:
a new User
Throws:
java.rmi.RemoteException

createRole

Role createRole()
                throws java.rmi.RemoteException
Create a new Role object.

Returns:
a new Role
Throws:
java.rmi.RemoteException

createOrgUnit

OrgUnit createOrgUnit()
                      throws java.rmi.RemoteException
Create a new OrgUnit object.

Returns:
a new OrgUnit
Throws:
java.rmi.RemoteException

createUserRole

UserRole createUserRole()
                        throws java.rmi.RemoteException
Create a new user-role relation

Returns:
a new UserRole
Throws:
java.rmi.RemoteException

createRight

Right createRight()
                  throws java.rmi.RemoteException
Create a new Right.

Returns:
a new Right
Throws:
java.rmi.RemoteException

createPermission

Permission createPermission()
                            throws java.rmi.RemoteException
Create a new Permission

Returns:
a new Permission
Throws:
java.rmi.RemoteException

createPermissionList

PermissionList createPermissionList()
                                    throws java.rmi.RemoteException
Create a new PermissionList

Returns:
a new PermissionList
Throws:
java.rmi.RemoteException

deleteCascade

void deleteCascade(OrgUnit ou)
                   throws java.rmi.RemoteException
Delete the passed organizational unit and also objects which are of no use without it.

Parameters:
ou - the organizational unit to delete
Throws:
java.rmi.RemoteException

getSubOrgs

java.util.List<OrgUnit> getSubOrgs(OrgUnit ou,
                                   OrgTree tree)
                                   throws java.rmi.RemoteException
Return the list of the organizational units that are below the given oe in the given tree. If the argument ou is null, it returns the top level org-units of the given tree.

Throws:
java.rmi.RemoteException

getSuperOrg

OrgUnit getSuperOrg(OrgUnit ou,
                    OrgTree tree)
                    throws java.rmi.RemoteException
Return the organizational unit that is above the given oe in the given tree.

Throws:
java.rmi.RemoteException

createOrgTree

OrgTree createOrgTree()
                      throws java.rmi.RemoteException
Return a new organizational tree.

Throws:
java.rmi.RemoteException

placeOrgInTree

void placeOrgInTree(OrgUnit parent,
                    OrgUnit child,
                    OrgTree tree)
                    throws java.rmi.RemoteException
Change the organizational hierarchy. Note that each org.unit has zero or one parent org.units in an org.tree.

Parameters:
parent, - may be null.
child -
tree - the tree
Throws:
java.rmi.RemoteException

isInTree

boolean isInTree(OrgUnit ou,
                 OrgTree tree)
                 throws java.rmi.RemoteException
Is the given org-unit in the specified org-tree.

Parameters:
ou -
tree -
Returns:
true if the org-unit is part of the tree.
Throws:
java.rmi.RemoteException

getObjectExtension

Persistent getObjectExtension(Persistent obj,
                              java.lang.String formclass,
                              boolean create)
                              throws java.rmi.RemoteException
Returns the extension object to a persistent. If none exists and create is true, the extension is created.

Parameters:
obj - an object having extensions
formclass - the name of a form-class
create - if true extensions are created
Returns:
the extension object
Throws:
java.rmi.RemoteException

deleteObjectExtension

void deleteObjectExtension(Persistent obj,
                           java.lang.String formclass)
                           throws java.rmi.RemoteException
delete the object extension for the given object.

Throws:
java.rmi.RemoteException


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.