public EClass getEClassForCid(short cid) throws BimserverDatabaseException { if (cid == -1) { throw new BimserverDatabaseException("Invalid cid: " + cid); } return cidToEclass[cid]; }
public EClass getEClassForOid(long oid) { try { return databaseSession.getEClassForOid(oid); } catch (BimserverDatabaseException e) { e.printStackTrace(); } return null; }
private void checkOpen() throws BimserverDatabaseException { if (state == SessionState.CLOSED) { throw new BimserverDatabaseException("Database session is closed"); } }
public EClass getEClassForCid(short cid) { try { return databaseSession.getEClass(cid); } catch (BimserverDatabaseException e) { e.printStackTrace(); } return null; }
public EClass getEClass(String packageName, String classifierName) throws BimserverDatabaseException { EClassifier eClassifier = getEClassifier(packageName, classifierName); if (eClassifier instanceof EClass) { return (EClass)eClassifier; } throw new BimserverDatabaseException("Classifier " + packageName + "." + classifierName + " is not an EClass"); }
public short getCid(EClass eClass) throws BimserverDatabaseException { Short cidOfEClass = database.getCidOfEClass(eClass); if (cidOfEClass == null) { throw new BimserverDatabaseException("EClass " + eClass.getName() + " not registered"); } return cidOfEClass; }
public ArrayDefinition convertFromSObject(SArrayDefinition input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); ArrayDefinition result = convertFromSObject(input, StoreFactory.eINSTANCE.createArrayDefinition(), session); return result; }
public ProfileDescriptor convertFromSObject(SProfileDescriptor input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); ProfileDescriptor result = convertFromSObject(input, StoreFactory.eINSTANCE.createProfileDescriptor(), session); return result; }
public ServiceField convertFromSObject(SServiceField input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); ServiceField result = convertFromSObject(input, StoreFactory.eINSTANCE.createServiceField(), session); return result; }
public TypeDefinition convertFromSObject(STypeDefinition input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); TypeDefinition result = convertFromSObject(input, StoreFactory.eINSTANCE.createTypeDefinition(), session); return result; }
public ServiceMethod convertFromSObject(SServiceMethod input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); ServiceMethod result = convertFromSObject(input, StoreFactory.eINSTANCE.createServiceMethod(), session); return result; }
public ObjectDefinition convertFromSObject(SObjectDefinition input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); ObjectDefinition result = convertFromSObject(input, StoreFactory.eINSTANCE.createObjectDefinition(), session); return result; }
@Override public HashMapVirtualObject next() throws BimserverDatabaseException { HashMapVirtualObject next = objectProvider.next(); if (next != null) { if (next == last) { throw new BimserverDatabaseException("Endless loop detected"); } last = next; objectListener.newObject(next); } return next; }
private void writeReference(IdEObject object, Object value, ByteBuffer buffer, EStructuralFeature feature) throws BimserverDatabaseException { IdEObject idEObject = (IdEObject) value; if (idEObject.getOid() < 0) { throw new BimserverDatabaseException("Writing a reference with oid " + idEObject.getOid() + ", this is not supposed to happen, referenced: " + idEObject.getOid() + " " + value + " from " + object.getOid() + " " + object); } buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.putLong(idEObject.getOid()); buffer.order(ByteOrder.BIG_ENDIAN); }
@Override public void commit(DatabaseSession databaseSession) throws BimserverLockConflictException, BimserverDatabaseException { Transaction bdbTransaction = getTransaction(databaseSession); try { bdbTransaction.commit(); } catch (LockConflictException e) { throw new BimserverLockConflictException(e); } catch (DatabaseException e) { throw new BimserverDatabaseException("", e); } }
public void addToObjectsToCommit(IdEObject idEObject) throws BimserverDatabaseException { if (idEObject.getOid() == -1) { throw new BimserverDatabaseException("Cannot store object with oid -1"); } if (objectsToCommit == null) { objectsToCommit = new ObjectsToCommit(); } objectsToCommit.put(idEObject); }
public RevisionRelated convertFromSObject(SRevisionRelated input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); RevisionRelated result = convertFromSObject(input, LogFactory.eINSTANCE.createRevisionRelated(), session); ((IdEObjectImpl)result).setOid(input.getOid()); ((IdEObjectImpl)result).setRid(input.getRid()); return result; }
public NewCheckoutAdded convertFromSObject(SNewCheckoutAdded input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); NewCheckoutAdded result = convertFromSObject(input, LogFactory.eINSTANCE.createNewCheckoutAdded(), session); ((IdEObjectImpl)result).setOid(input.getOid()); ((IdEObjectImpl)result).setRid(input.getRid()); return result; }
public NewObjectIDMUploaded convertFromSObject(SNewObjectIDMUploaded input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); NewObjectIDMUploaded result = convertFromSObject(input, LogFactory.eINSTANCE.createNewObjectIDMUploaded(), session); ((IdEObjectImpl)result).setOid(input.getOid()); ((IdEObjectImpl)result).setRid(input.getRid()); return result; }
public DatabaseCreated convertFromSObject(SDatabaseCreated input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); DatabaseCreated result = convertFromSObject(input, LogFactory.eINSTANCE.createDatabaseCreated(), session); ((IdEObjectImpl)result).setOid(input.getOid()); ((IdEObjectImpl)result).setRid(input.getRid()); return result; }