Package framework.generic

Examples of framework.generic.ClipsServerException


            s += "AuditDetails[ id: " + ad.id + ", sign: " + Converter.hexDump(ad.sign) + "]\n";
            Audit audit = findEntity(Audit.class, ad.id);
            audit.setDsa(Converter.hexDump(ad.sign));
            List list = findEntityWhatWithResCount(null, CollaboratorCertificate.class, new Field[]{new Field("collaborator.id", ad.collaboratorID)}, " ORDER BY a.id", 1);
            if (list.size() != 1){
                throw new ClipsServerException("Документ аудита не может быть подписан, т.к. не найден сертификат открытого ключа");
            }
            audit.setCertificate((CollaboratorCertificate) list.get(0));
            manager.persist(audit);
        }
        System.out.println("Save audit\n" + s + " in " + (new Date().getTime() - t1)+ " мс");
View Full Code Here


            deleteEntityList(CollaboratorSessionActive.class, f);
            manager.flush();
        } catch (ClipsServerException ex) {
            throw ex;
        } catch (Throwable ex) {
            throw new ClipsServerException("Внутренняя ошибка при очистке таблицы CollaboratorSessionActive (ошибка не критичная, только возникать будет периодически)", ex);
        }

        synchronized (sessionDataCash) {
            Iterator<Integer> it = sessionDataCash.keySet().iterator();
            while (it.hasNext()) {
View Full Code Here

                ex = e;
            }
            i++;
        }
        if (newSessionId == 0) {
            throw new ClipsServerException("Внутренняя ошибка: невозможно зарегистрировать сессию на сервере", ex);
        }
        return newSessionId;
  }
View Full Code Here

                ctx.close();
            } catch (Exception e) {
                e.printStackTrace();
                //do nothing
            }
            throw new ClipsServerException(str);

        } catch(AuthenticationException ex) {
            throw new ClipsServerException("Указан неверный LDAP логин или пароль.");
        } catch (Exception ex) {
            throw new ClipsServerException("Ошибка при попытке аутентификации.", ex);
        }
    }
View Full Code Here

                }
                ses = manager.find(CollaboratorSessionActive.class, aSessionId);
            }
        }
        if (ses == null) {
            throw new ClipsServerException("Внутренняя ошибка: Попытка завершить незарегистрированную сессию");
        }
        ses.decRefCount();
        if (ses.getRefCount() == 0) {
            manager.remove(ses);
        } else {
View Full Code Here

            ByteArrayOutputStream db = new ByteArrayOutputStream();
            ObjectOutputStream stream = new ObjectOutputStream(db);
            stream.writeObject(encrypted);
            return db.toByteArray();
        } catch (Exception ex) {
            throw new ClipsServerException("Не поддерживается шифрование RSA", ex);
        }
    }
View Full Code Here

    }

    public char[] decryptPasswd(byte[] encryption, PrivateKey privateKey) throws ClipsServerException {
        if (publicKey == null || privateKey == null) {
            //md5 cannot to be decrypted
            throw new ClipsServerException("Wrong usage of password encrypter");
        }

        try {
            ObjectInputStream streamIn = new ObjectInputStream(
                    new ByteArrayInputStream(encryption, 0, encryption.length));
            SealedObject encrypted = (SealedObject) streamIn.readObject();

            Cipher dec = Cipher.getInstance("RSA");
            dec.init(Cipher.DECRYPT_MODE, privateKey);
            byte msg[] = (byte[]) encrypted.getObject(dec);

            int passwdLength = msg.length - salt.length;
            byte passwd[] = new byte[passwdLength];
            System.arraycopy(msg, salt.length, passwd, 0, passwdLength);
            return SessionPassword.byte2char(passwd);

        } catch (Exception ex) {
            throw new ClipsServerException("Ошибка при расшифровке RSA", ex);
        }
    }
View Full Code Here

    protected <T extends GenericEntity> T findEntity(Class <T> entityClass, int id, String entityName) throws ClipsServerException {
        @SuppressWarnings("unchecked")
        T entity = manager.find(entityClass, id);
        if (entity == null) {
            throw new ClipsServerException("Отсутствует запись в таблице " + entityName + ", id:" + id);
        }
        return entity;
    }
View Full Code Here

    protected <T extends GenericEntity> T findEntity(Class <T> entityClass, int id)
            throws ClipsServerException {
        @SuppressWarnings("unchecked")
        T entity = manager.find(entityClass, id);
        if (entity == null) {
            throw new ClipsServerException("Отсутствует запись в таблице " +
                    getEntityHumanName(entityClass) + ", id:" + id);
        }
        return entity;
    }
View Full Code Here

            Query query = manager.createQuery(sql);
            setFieldsParamiters(query, list);
            query.executeUpdate();
        }
    catch (Exception ex) {
            throw new ClipsServerException("Попытка удаления не удалась: ", ex);
        }
    }
View Full Code Here

TOP

Related Classes of framework.generic.ClipsServerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.