Search in sources :

Example 1 with GetAllRevisionsByUserDatabaseAction

use of org.bimserver.database.actions.GetAllRevisionsByUserDatabaseAction in project BIMserver by opensourceBIM.

the class ServiceImpl method getAllRevisionsByUser.

@Override
public List<SRevision> getAllRevisionsByUser(Long uoid) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession(OperationType.READ_ONLY);
    try {
        BimDatabaseAction<Set<Revision>> action = new GetAllRevisionsByUserDatabaseAction(session, getInternalAccessMethod(), uoid);
        List<SRevision> convertToSListRevision = getBimServer().getSConverter().convertToSListRevision(session.executeAndCommitAction(action));
        Collections.sort(convertToSListRevision, new SRevisionComparator(true));
        return convertToSListRevision;
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : SRevision(org.bimserver.interfaces.objects.SRevision) HashSet(java.util.HashSet) Set(java.util.Set) LinkedHashSet(java.util.LinkedHashSet) DatabaseSession(org.bimserver.database.DatabaseSession) GetAllRevisionsByUserDatabaseAction(org.bimserver.database.actions.GetAllRevisionsByUserDatabaseAction) ServiceException(org.bimserver.shared.exceptions.ServiceException) IOException(java.io.IOException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) SerializerException(org.bimserver.plugins.serializers.SerializerException) BcfException(org.opensourcebim.bcf.BcfException) UserException(org.bimserver.shared.exceptions.UserException) CannotBeScheduledException(org.bimserver.longaction.CannotBeScheduledException) DeserializeException(org.bimserver.plugins.deserializers.DeserializeException) ServerException(org.bimserver.shared.exceptions.ServerException) PluginException(org.bimserver.shared.exceptions.PluginException) MessagingException(javax.mail.MessagingException) AddressException(javax.mail.internet.AddressException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) MalformedURLException(java.net.MalformedURLException) FileAlreadyExistsException(java.nio.file.FileAlreadyExistsException) SRevisionComparator(org.bimserver.webservices.SRevisionComparator)

Aggregations

IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 MalformedURLException (java.net.MalformedURLException)1 FileAlreadyExistsException (java.nio.file.FileAlreadyExistsException)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1 MessagingException (javax.mail.MessagingException)1 AddressException (javax.mail.internet.AddressException)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 GetAllRevisionsByUserDatabaseAction (org.bimserver.database.actions.GetAllRevisionsByUserDatabaseAction)1 SRevision (org.bimserver.interfaces.objects.SRevision)1 CannotBeScheduledException (org.bimserver.longaction.CannotBeScheduledException)1 DeserializeException (org.bimserver.plugins.deserializers.DeserializeException)1 SerializerException (org.bimserver.plugins.serializers.SerializerException)1 PluginException (org.bimserver.shared.exceptions.PluginException)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 ServiceException (org.bimserver.shared.exceptions.ServiceException)1 UserException (org.bimserver.shared.exceptions.UserException)1