rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
logColumnExtraction(columnName, value);
public ArtifactFlag getFlagFromString(final String columnName) { assertOpen("getFlagFromString(String)"); assertOpenResult("getFlagFromString(String)"); logger.logVariable("columnName", columnName); try { final String value = resultSet.getString(columnName); return resultSet.wasNull() ? null : ArtifactFlag.valueOf(value); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("[GET INPUT STREAM]"); assertOpenResult("[GET INPUT STREAM]"); logger.logVariable("columnName", columnName);
assertConnectionIsOpen(); assertResultSetIsSet();
public InputStream getInputStream(final String columnName) { assertOpen("[GET INPUT STREAM]"); assertOpenResult("[GET INPUT STREAM]"); logger.logVariable("columnName", columnName); try { final InputStream value = resultSet.getBinaryStream(columnName); return resultSet.wasNull() ? null : value; } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
logColumnExtraction(columnName, value);
public InputStream getInputStream(final String columnName) { assertOpen("[GET INPUT STREAM]"); assertOpenResult("[GET INPUT STREAM]"); logger.logVariable("columnName", columnName); try { final InputStream value = resultSet.getBinaryStream(columnName); return resultSet.wasNull() ? null : value; } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen(); assertMetaData();
assertConnectionIsOpen(); assertMetaDataIsSet(); logStatement("select TABLE_NAME from PUBLIC.TABLES");
public void getMetaDataTables() { assertOpen(); assertMetaData(); try { resultSet = metaData.getTables(null, "PUBLIC", null, new String[] {"TABLE"}); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("getMetaDataTypeFromInteger(String)"); assertOpenResult("getMetaDataTypeFromInteger(String)"); logger.logVariable("columnName", columnName);
assertConnectionIsOpen(); assertResultSetIsSet();
public MetaDataType getMetaDataTypeFromInteger(final String columnName) { assertOpen("getMetaDataTypeFromInteger(String)"); assertOpenResult("getMetaDataTypeFromInteger(String)"); logger.logVariable("columnName", columnName); try { final Integer value = resultSet.getInt(columnName); return resultSet.wasNull() ? null : MetaDataType.fromId(value); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
logColumnExtraction(columnName, value);
public MetaDataType getMetaDataTypeFromInteger(final String columnName) { assertOpen("getMetaDataTypeFromInteger(String)"); assertOpenResult("getMetaDataTypeFromInteger(String)"); logger.logVariable("columnName", columnName); try { final Integer value = resultSet.getInt(columnName); return resultSet.wasNull() ? null : MetaDataType.fromId(value); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("getStateFromString(String)"); assertOpenResult("getStateFromString(String)"); logger.logVariable("columnName", columnName);
assertConnectionIsOpen(); assertResultSetIsSet();
public ArtifactState getStateFromString(final String columnName) { assertOpen("getStateFromString(String)"); assertOpenResult("getStateFromString(String)"); logger.logVariable("columnName", columnName); try { final String value = resultSet.getString(columnName); return resultSet.wasNull() ? null : ArtifactState.valueOf(value); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
logColumnExtraction(columnName, value);
public ArtifactState getStateFromString(final String columnName) { assertOpen("getStateFromString(String)"); assertOpenResult("getStateFromString(String)"); logger.logVariable("columnName", columnName); try { final String value = resultSet.getString(columnName); return resultSet.wasNull() ? null : ArtifactState.valueOf(value); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("getSystemMessageTypeFromInteger(String)"); assertOpenResult("getSystemMessageTypeFromInteger(String)"); logger.logVariable("columnName", columnName);
assertConnectionIsOpen(); assertResultSetIsSet();
public SystemMessageType getSystemMessageTypeFromInteger( final String columnName) { assertOpen("getSystemMessageTypeFromInteger(String)"); assertOpenResult("getSystemMessageTypeFromInteger(String)"); logger.logVariable("columnName", columnName); try { final Integer value = resultSet.getInt(columnName); return resultSet.wasNull() ? null : SystemMessageType.fromId(value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
logColumnExtraction(columnName, value);
public SystemMessageType getSystemMessageTypeFromInteger( final String columnName) { assertOpen("getSystemMessageTypeFromInteger(String)"); assertOpenResult("getSystemMessageTypeFromInteger(String)"); logger.logVariable("columnName", columnName); try { final Integer value = resultSet.getInt(columnName); return resultSet.wasNull() ? null : SystemMessageType.fromId(value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("getTypeFromString(String)"); assertOpenResult("getTypeFromString(String)"); logger.logVariable("columnName", columnName);
assertConnectionIsOpen(); assertResultSetIsSet();
public ArtifactType getTypeFromString(final String columnName) { assertOpen("getTypeFromString(String)"); assertOpenResult("getTypeFromString(String)"); logger.logVariable("columnName", columnName); try { final String value = resultSet.getString(columnName); return resultSet.wasNull() ? null : ArtifactType.valueOf(value); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
logColumnExtraction(columnName, value);
public ArtifactType getTypeFromString(final String columnName) { assertOpen("getTypeFromString(String)"); assertOpenResult("getTypeFromString(String)"); logger.logVariable("columnName", columnName); try { final String value = resultSet.getString(columnName); return resultSet.wasNull() ? null : ArtifactType.valueOf(value); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("getMetaData");
assertConnectionIsOpen();
public void openMetaData() { assertOpen("getMetaData"); try { metaData = connection.getMetaData(); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setBoolean(Integer,Boolean)"); assertPreparedStatement("setBoolean(Integer,Boolean)"); logIndexAndValue(index, value); try { preparedStatement.setBoolean(index, value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setBoolean(index, value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setBoolean(final Integer index, final Boolean value) { assertOpen("setBoolean(Integer,Boolean)"); assertPreparedStatement("setBoolean(Integer,Boolean)"); logIndexAndValue(index, value); try { preparedStatement.setBoolean(index, value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setBytes(Integer,Byte[])"); assertPreparedStatement("setBytes(Integer,Byte[])"); logIndexAndValue(index, value); try { preparedStatement.setBytes(index, value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setBytes(index, value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setBytes(final Integer index, final byte[] value) { assertOpen("setBytes(Integer,Byte[])"); assertPreparedStatement("setBytes(Integer,Byte[])"); logIndexAndValue(index, value); try { preparedStatement.setBytes(index, value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setEMail(Integer,EMail)"); assertPreparedStatement("setEMail(Integer,EMail)"); logIndexAndValue(index, value);
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value);
public void setEMail(final Integer index, final EMail value) { assertOpen("setEMail(Integer,EMail)"); assertPreparedStatement("setEMail(Integer,EMail)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setFlagAsInteger(Integer,ArtifactFlag)"); assertPreparedStatement("setFlagAsInteger(Integer,ArtifactFlag)"); logIndexAndValue(index, value); try { preparedStatement.setInt(index, value.getId()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setInt(index, value.getId()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setFlagAsInteger(final Integer index, final ArtifactFlag value) { assertOpen("setFlagAsInteger(Integer,ArtifactFlag)"); assertPreparedStatement("setFlagAsInteger(Integer,ArtifactFlag)"); logIndexAndValue(index, value); try { preparedStatement.setInt(index, value.getId()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setFlagAsString(Integer,ArtifactFlag)"); assertPreparedStatement("setFlagAsString(Integer,ArtifactFlag)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setString(index, value.toString()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setFlagAsString(final Integer index, final ArtifactFlag value) { assertOpen("setFlagAsString(Integer,ArtifactFlag)"); assertPreparedStatement("setFlagAsString(Integer,ArtifactFlag)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setInt(Integer,Integer)"); assertPreparedStatement("setInt(Integer,Integer)"); logIndexAndValue(index, value); try { preparedStatement.setInt(index, value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setInt(index, value); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setInt(final Integer index, final Integer value) { assertOpen("setInt(Integer,Integer)"); assertPreparedStatement("setInt(Integer,Integer)"); logIndexAndValue(index, value); try { preparedStatement.setInt(index, value); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setMetaDataAsString(Integer,MetaData)"); assertPreparedStatement("setMetaDataAsString(Integer,MetaData)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setString(index, value.toString()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setMetaDataAsString(final Integer index, final MetaData value) { assertOpen("setMetaDataAsString(Integer,MetaData)"); assertPreparedStatement("setMetaDataAsString(Integer,MetaData)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("Database session is not open."); assertPreparedStatement("Prepared statement has not been set."); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.getQualifiedUsername()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setString(index, value.getQualifiedUsername()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setQualifiedUsername(final Integer index, final JabberId value) { assertOpen("Database session is not open."); assertPreparedStatement("Prepared statement has not been set."); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.getQualifiedUsername()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setStateAsInteger(Integer,ArtifactState)"); assertPreparedStatement("setStateAsInteger(Integer,ArtifactState)"); logIndexAndValue(index, value); try { preparedStatement.setInt(index, value.getId()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setInt(index, value.getId()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setStateAsInteger(final Integer index, final ArtifactState value) { assertOpen("setStateAsInteger(Integer,ArtifactState)"); assertPreparedStatement("setStateAsInteger(Integer,ArtifactState)"); logIndexAndValue(index, value); try { preparedStatement.setInt(index, value.getId()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setStateAsString(Integer,ArtifactState)"); assertPreparedStatement("setStateAsString(Integer,ArtifactState)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setString(index, value.toString()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setStateAsString(final Integer index, final ArtifactState value) { assertOpen("setStateAsString(Integer,ArtifactState)"); assertPreparedStatement("setStateAsString(Integer,ArtifactState)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
public void setStream(final Integer index, final InputStream stream, final Integer streamLength) { assertOpen(""); assertPreparedStatement("");
public void setStream(final Integer index, final InputStream value, final Integer valueLength) { assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value, valueLength);
public void setStream(final Integer index, final InputStream stream, final Integer streamLength) { assertOpen(""); assertPreparedStatement(""); try { preparedStatement.setBinaryStream(index, stream, streamLength); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
preparedStatement.setBinaryStream(index, stream, streamLength);
preparedStatement.setBinaryStream(index, value, valueLength);
public void setStream(final Integer index, final InputStream stream, final Integer streamLength) { assertOpen(""); assertPreparedStatement(""); try { preparedStatement.setBinaryStream(index, stream, streamLength); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setTypeAsInteger(Integer,ArtifactType)"); assertPreparedStatement("setTypeAsInteger(Integer,ArtifactType)"); logIndexAndValue(index, value); try { preparedStatement.setInt(index, value.getId()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setInt(index, value.getId()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setTypeAsInteger(final Integer index, final ArtifactType value) { assertOpen("setTypeAsInteger(Integer,ArtifactType)"); assertPreparedStatement("setTypeAsInteger(Integer,ArtifactType)"); logIndexAndValue(index, value); try { preparedStatement.setInt(index, value.getId()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setTypeAsString(Integer,ArtifactType)"); assertPreparedStatement("setTypeString(Integer,ArtifactType)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setString(index, value.toString()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setTypeAsString(final Integer index, final ArtifactType value) { assertOpen("setTypeAsString(Integer,ArtifactType)"); assertPreparedStatement("setTypeString(Integer,ArtifactType)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
assertOpen("setUniqueId(Integer,UUID)"); assertPreparedStatement("setUniqueId(Integer,UUID)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); }
assertConnectionIsOpen(); assertPreparedStatementIsSet(); logColumnInjection(index, value); try { preparedStatement.setString(index, value.toString()); } catch (final SQLException sqlx) { throw new HypersonicException(sqlx); }
public void setUniqueId(final Integer index, final UUID value) { assertOpen("setUniqueId(Integer,UUID)"); assertPreparedStatement("setUniqueId(Integer,UUID)"); logIndexAndValue(index, value); try { preparedStatement.setString(index, value.toString()); } catch(final SQLException sqlx) { throw new HypersonicException(sqlx); } }
return (XMPPMethodResponse) idCollector.nextResult();
return (XMPPMethodResponse) idCollector.nextResult(3 * 1000);
public XMPPMethodResponse execute(final XMPPConnection xmppConnection) { // add an executed on parameter setParameter(Xml.All.EXECUTED_ON, DateUtil.getInstance()); // create a collector for the response final PacketCollector idCollector = createPacketCollector(xmppConnection); // send the internet query logVariable("preSendPacket", DateUtil.getInstance()); xmppConnection.sendPacket(this); logVariable("postSendPacket", DateUtil.getInstance()); // this sleep has been inserted because when packets are sent within // x milliseconds of each other, they tend to get swallowed by the // smack library try { Thread.sleep(75); } catch(final InterruptedException ix) {} // the timeout is used because the timeout is not expected to be long; // and it helps debug non-implemented responses logVariable("preResponseCollected", DateUtil.getInstance()); try { return (XMPPMethodResponse) idCollector.nextResult(); } catch (final ClassCastException ccx) { final String errorId = new ErrorHelper().getErrorId(ccx); logger.logError(errorId, ccx); logger.logError("name:{0}", name); logger.logError("xmppConnection:{0}", xmppConnection); throw new XMPPException(errorId); } finally { // re-set the parameters post execution logVariable("postResponseCollected", DateUtil.getInstance()); parameters.clear(); } }
protected LinkTool copyWith(String uri)
protected LinkTool copyWith(QueryPair pair)
protected LinkTool copyWith(String uri) { LinkTool copy = duplicate(); copy.uri = uri; return copy; }
copy.uri = uri;
if (copy.queryData != null) { copy.queryData = (ArrayList)this.queryData.clone(); } else { copy.queryData = new ArrayList(); } copy.queryData.add(pair);
protected LinkTool copyWith(String uri) { LinkTool copy = duplicate(); copy.uri = uri; return copy; }
this.browser = browser;
public Open(final Browser browser) { super(ActionId.DOCUMENT_OPEN); }
browser.runApplyFlagSeenArtifact(documentId, ArtifactType.DOCUMENT);
public void invoke(final Data data) { final Long documentId = (Long) data.get(DataKey.DOCUMENT_ID); getDocumentModel().open(documentId); }
final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId);
final JabberId userId, final UUID uniqueId, final Long versionId);
public List<DocumentVersion> readArchiveDocumentVersions( final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId);
final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId);
final JabberId userId, final UUID uniqueId, final Long versionId);
public List<DocumentVersion> readBackupDocumentVersions( final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId);
void initialize(final StreamSession session, final String streamId) { authenticate(session); fileServer.initialize(session, streamId); socketServer.initialize(session, streamId);
void initialize(final ServerSession session) { Assert.assertNotNull("Session is null.", session); Assert.assertNotNull("Session buffer size is null.", session.getBufferSize()); Assert.assertNotNull("Session charset is null.", session.getCharset()); Assert.assertNotNull("Session environment is null.", session.getEnvironment()); Assert.assertNotNull("Session id is null.", session.getId()); Assert.assertNotNull("Session inet address is null.", session.getInetAddress()); synchronized (SESSIONS) { SESSIONS.put(session.getId(), session); fileServer.initialize(session); socketServer.initialize(session); }
void initialize(final StreamSession session, final String streamId) { authenticate(session); fileServer.initialize(session, streamId); socketServer.initialize(session, streamId); }
void destroy(final StreamSession session, final String streamId) {
void destroy(final StreamSession session) {
void destroy(final StreamSession session, final String streamId) { authenticate(session); fileServer.destroy(session, streamId); socketServer.destroy(session, streamId); }
fileServer.destroy(session, streamId); socketServer.destroy(session, streamId);
synchronized (SESSIONS) { SESSIONS.remove(session.getId()); fileServer.destroy(session); socketServer.destroy(session); session.setId(null); }
void destroy(final StreamSession session, final String streamId) { authenticate(session); fileServer.destroy(session, streamId); socketServer.destroy(session, streamId); }
getController().displayDocumentHistoryListAvatar();
getController().displayDocumentHistoryAvatar();
public void fireSelection() { getController().selectDocument(getDocumentId()); getController().displayDocumentHistoryListAvatar(); }
listener.handleEvent(xmppEvent);
try { listener.handleEvent(xmppEvent); } catch (final Throwable t) { logger.logFatal(t, "Could not handle xmpp event {0}.", xmppEvent); }
<T extends XMPPEvent> void handleEvent(final T xmppEvent) { logger.pushContext(new Log4JContext() { public String getContext() { return xmppCore.getUserId().getUsername(); } }); logger.logVariable("xmppEvent", xmppEvent); final List<XMPPEventListener<T>> listeners = getListeners(xmppEvent.getClass()); for (final XMPPEventListener<T> listener : listeners) { listener.handleEvent(xmppEvent); } logger.popContext(); }
for (final File profileDirectorie : profileDirectories) { FileUtil.deleteTree(profileDirectorie);
for (final File profileDirectory : profileDirectories) { FileUtil.deleteTree(profileDirectory);
private void deleteProfiles(final FileSystem profileFileSystem) { final File[] profileDirectories = profileFileSystem.list("/", new FileFilter() { public boolean accept(final File pathname) { return pathname.getName().startsWith(displayName); } }, Boolean.FALSE); for (final File profileDirectorie : profileDirectories) { FileUtil.deleteTree(profileDirectorie); } }
super(null, name, description, createdOn, createdBy, keyHolder, id);
super(null, name, description, createdOn, createdBy, id);
public Document(final String name, final Calendar createdOn, final String createdBy, final String keyHolder, final String description, final File directory, final UUID id, final byte[] content, final String contentChecksum) { super(null, name, description, createdOn, createdBy, keyHolder, id); this.directory = directory; this.content = content; this.contentChecksum = contentChecksum; this.versions = new Vector<DocumentVersion>(3); }
final String xmlFileAbsolutePath = idToXmlFileLookup.get(id.toString()); if(null == xmlFileAbsolutePath) { return null; } else { return new File(xmlFileAbsolutePath); }
if(ids.contains(id)) { return new File(idToXmlFileLookup.get(id.toString())); } else { return null; }
public File lookupXmlFile(final UUID id) { final String xmlFileAbsolutePath = idToXmlFileLookup.get(id.toString()); if(null == xmlFileAbsolutePath) { return null; } else { return new File(xmlFileAbsolutePath); } }
protected quickfix.Session getQuickFixSession(Session nettySession, Message message) { quickfix.Session quickfixSession = getQuickFixSession(nettySession); if (quickfixSession == null) { SessionID sessionID = getSessionID(message, true); quickfixSession = (quickfix.Session) quickfixSessions.get(sessionID); if (quickfixSession != null) { ResponderAdapter r = (ResponderAdapter) quickfixSession.getResponder(); if (r != null) { logError(nettySession, sessionID, "session with multiple connections not allowed", null); nettySession.close(); return null; } } } if (quickfixSession == null) { logError(nettySession, null, "unknown QF session ID", null); nettySession.close(); return null; } return quickfixSession;
private quickfix.Session getQuickFixSession(Session nettySession) { return (quickfix.Session) quickfixSessionForNettySession.get(nettySession);
protected quickfix.Session getQuickFixSession(Session nettySession, Message message) { quickfix.Session quickfixSession = getQuickFixSession(nettySession); if (quickfixSession == null) { // No QF session for this Netty session, SessionID sessionID = getSessionID(message, true); quickfixSession = (quickfix.Session) quickfixSessions.get(sessionID); if (quickfixSession != null) { ResponderAdapter r = (ResponderAdapter) quickfixSession.getResponder(); if (r != null) { // QF session is bound to another Netty session. Not allowed. logError(nettySession, sessionID, "session with multiple connections not allowed", null); nettySession.close(); return null; } } } if (quickfixSession == null) { logError(nettySession, null, "unknown QF session ID", null); nettySession.close(); return null; } return quickfixSession; }
void index(final ArtifactIndex index) throws ParityException { logger.info("[LMODEL] [INDEX] [INDEX ARTIFACT]"); logger.debug(index); final InternalSessionModel iSModel = getInternalSessionModel(); final List<JabberId> jabberIds = new LinkedList<JabberId>(); jabberIds.add(index.getCreatedBy()); jabberIds.add(index.getKeyHolder()); jabberIds.addAll(index.getContacts()); final List<User> users = iSModel.readUsers(jabberIds); final List<User> contacts = filter(users, index.getContacts()); final User createdBy = filter(users, index.getKeyHolder()); final User keyHolder = filter(users, index.getCreatedBy()); final DocumentBuilder db = new DocumentBuilder(6); db.append(IDX_ARTIFACT_ID.setValue(index.getId()).toField()) .append(IDX_ARTIFACT_NAME.setValue(index.getName()).toField()) .append(IDX_ARTIFACT_CREATED_ON.setValue(index.getCreatedOn(), DateTools.Resolution.DAY).toField()) .append(IDX_ARTIFACT_CREATED_BY.setValue(createdBy).toField()) .append(IDX_ARTIFACT_KEYHOLDER.setValue(keyHolder).toField()) .append(IDX_ARTIFACT_CONTACTS.setValue(contacts).toField()); index(db.toDocument());
private void index(final Document document) throws ParityException { final IndexWriter indexWriter = openIndexWriter(); try { indexWriter.addDocument(document); indexWriter.optimize(); } catch(final IOException iox) { logger.error("[LMODEL] [INDEX] [INDEX DOCUMENT] [IO ERROR]", iox); logger.error(document); throw ParityErrorTranslator.translate(iox); } finally { closeIndexWriter(indexWriter); }
void index(final ArtifactIndex index) throws ParityException { logger.info("[LMODEL] [INDEX] [INDEX ARTIFACT]"); logger.debug(index); final InternalSessionModel iSModel = getInternalSessionModel(); final List<JabberId> jabberIds = new LinkedList<JabberId>(); jabberIds.add(index.getCreatedBy()); jabberIds.add(index.getKeyHolder()); jabberIds.addAll(index.getContacts()); final List<User> users = iSModel.readUsers(jabberIds); final List<User> contacts = filter(users, index.getContacts()); final User createdBy = filter(users, index.getKeyHolder()); final User keyHolder = filter(users, index.getCreatedBy()); final DocumentBuilder db = new DocumentBuilder(6); db.append(IDX_ARTIFACT_ID.setValue(index.getId()).toField()) .append(IDX_ARTIFACT_NAME.setValue(index.getName()).toField()) .append(IDX_ARTIFACT_CREATED_ON.setValue(index.getCreatedOn(), DateTools.Resolution.DAY).toField()) .append(IDX_ARTIFACT_CREATED_BY.setValue(createdBy).toField()) .append(IDX_ARTIFACT_KEYHOLDER.setValue(keyHolder).toField()) .append(IDX_ARTIFACT_CONTACTS.setValue(contacts).toField()); index(db.toDocument()); }
try { return IndexReader.open(workspace.getIndexDirectory()); }
try { return IndexReader.open(getIndexDirectory()); }
private IndexReader openIndexReader() throws ParityException { try { return IndexReader.open(workspace.getIndexDirectory()); } catch(final IOException iox) { logger.error("Could not open index.", iox); logger.error(workspace.getIndexDirectory()); throw ParityErrorTranslator.translate(iox); } }
logger.error("Could not open index.", iox); logger.error(workspace.getIndexDirectory());
logger.error("[LMODEL] [INDEX] [OPEN READER] [IO ERROR]", iox);
private IndexReader openIndexReader() throws ParityException { try { return IndexReader.open(workspace.getIndexDirectory()); } catch(final IOException iox) { logger.error("Could not open index.", iox); logger.error(workspace.getIndexDirectory()); throw ParityErrorTranslator.translate(iox); } }
public FieldBuilder setValue(final Long l) { this.value = l.toString();
public FieldBuilder setValue(final Calendar c, final DateTools.Resolution r) { this.value = DateTools.dateToString(c.getTime(), r);
public FieldBuilder setValue(final Long l) { this.value = l.toString(); return this; }
logger.debug("query:" + query.toString());
logger.info("[LMODEL] [INDEX] [SEARCH] [QUERY]"); logger.debug(query.toString());
public List<QueryHit> search(final String expression) { final List<Query> queries = createQueries(expression); final List<QueryHit> hits = new LinkedList<QueryHit>(); final QueryHitBuilder queryHitBuilder = new QueryHitBuilder(idField); Iterator iHits; for(final Query query : queries) { logger.debug("query:" + query.toString()); try { iHits = indexSearcher.search(query).iterator(); } catch(final IOException iox) { throw new IndexException("Could not search index.", iox); } while(iHits.hasNext()) { hits.add(queryHitBuilder.toQueryHit((Hit) iHits.next())); } } return hits; }
buttonPressed = new MesquiteInteger(1); prepareDialog(parent,title,buttonPressed);
prepareDialog(parent,title,buttonPressed);
public ExtensibleDialog (Frame parent, String title) { super(title); setFont(defaultBigFont); buttonPressed = new MesquiteInteger(1); prepareDialog(parent,title,buttonPressed); addWindowListener(this); }
public User create(final User user) {
public void create(final User user) {
public User create(final User user) { final Session session = openSession(); try { session.prepareStatement(SQL_CREATE); session.setQualifiedUsername(1, user.getId()); if(1 != session.executeUpdate()) throw new HypersonicException(""); final Long userId = session.getIdentity(); session.prepareStatement(SQL_CREATE_INFO); session.setLong(1, userId); session.setString(2, user.getFirstName()); session.setString(3, user.getLastName()); session.setString(4, user.getOrganization()); if(1 != session.executeUpdate()) throw new HypersonicException(""); user.setLocalId(userId); return user; } catch(final HypersonicException hx) { session.rollback(); throw hx; } finally { session.close(); } }
return user;
session.commit();
public User create(final User user) { final Session session = openSession(); try { session.prepareStatement(SQL_CREATE); session.setQualifiedUsername(1, user.getId()); if(1 != session.executeUpdate()) throw new HypersonicException(""); final Long userId = session.getIdentity(); session.prepareStatement(SQL_CREATE_INFO); session.setLong(1, userId); session.setString(2, user.getFirstName()); session.setString(3, user.getLastName()); session.setString(4, user.getOrganization()); if(1 != session.executeUpdate()) throw new HypersonicException(""); user.setLocalId(userId); return user; } catch(final HypersonicException hx) { session.rollback(); throw hx; } finally { session.close(); } }
public User create(final User user);
public void create(final User user);
public User create(final User user);
defaults.put("PopupMenu.background", Colors.Swing.MENU_BG); defaults.put("PopupMenu.foreground", Colors.Swing.MENU_FG); defaults.put("PopupMenu.font", BrowserConstants.Fonts.DefaultFont);
public static void init() { System.setProperty("sun.awt.noerasebackground", "true"); UIDefaults defaults = UIManager.getDefaults(); defaults.put("List.selectionBackground", Colors.Swing.DEFAULT_LIST_SELECTION_BG); defaults.put("List.selectionForeground", Colors.Swing.DEFAULT_LIST_SELECTION_FG); defaults.put("Menu.font", BrowserConstants.Fonts.DefaultFont); defaults.put("Menu.selectionBackground", Colors.Swing.MENU_SELECTION_BG); defaults.put("Menu.selectionForeground", Colors.Swing.MENU_SELECTION_FG); defaults.put("Menu.background", Colors.Swing.MENU_BG); defaults.put("Menu.foreground", Colors.Swing.MENU_FG); defaults.put("MenuItem.font", BrowserConstants.Fonts.DefaultFont); defaults.put("MenuItem.selectionBackground", Colors.Swing.MENU_ITEM_SELECTION_BG); defaults.put("MenuItem.selectionForeground", Colors.Swing.MENU_ITEM_SELECTION_FG); defaults.put("MenuItem.background", Colors.Swing.MENU_ITEM_BG); defaults.put("MenuItem.foreground", Colors.Swing.MENU_ITEM_FG); defaults.put("Menu.submenuPopupOffsetX", BrowserConstants.Menu.SUBMENU_POPUP_OFFSET_X); defaults.put("Menu.submenuPopupOffsetY", BrowserConstants.Menu.SUBMENU_POPUP_OFFSET_Y); try { final LookAndFeel laf; switch (OSUtil.getOS()) { case WINDOWS_XP: laf = new WindowsLookAndFeel(); break; case LINUX: laf = new MetalLookAndFeel(); break; default: throw Assert.createUnreachable("Unsupported operating system."); } UIManager.setLookAndFeel(laf); } catch(final Throwable t) { throw new RuntimeException(t); } defaults = UIManager.getDefaults(); defaults.put("ProgressBarUI", ThinkParityProgressBarUI.class.getName()); defaults.put("MenuItemUI", ThinkParityMenuItemUI.class.getName()); defaults.put("ScrollBarUI", ThinkParityScrollBarUI.class.getName()); }
c.insets.left = 275;
c.insets.left = 329;
private void initComponents() { searchJTextField = TextFactory.create(); // COLOR SearchText 237,241,244,255 searchJTextField.setBackground(new Color(237, 241, 244, 255)); // BORDER SearchText TopBottom 204,215,226,255 searchJTextField.setBorder(new TopBottomBorder(new Color(204, 215, 226, 255))); searchJTextField.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { searchJTextFieldActionPerformed(e); } }); searchJTextField.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(final DocumentEvent e) { searchJTextFieldChangedUpdate(e); } public void insertUpdate(final DocumentEvent e) { searchJTextFieldInsertUpdate(e); } public void removeUpdate(final DocumentEvent e) { searchJTextFieldRemoveUpdate(e); } }); searchJTextField.setTransferHandler(new CreateDocumentTxHandler(getBrowser())); searchLeftJLabel = LabelFactory.create(SEARCH_LEFT_ICON); searchRightJLabel = LabelFactory.create(SEARCH_RIGHT_ICON); final GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.EAST; c.insets.left = 275; add(searchLeftJLabel, c.clone()); c.anchor = GridBagConstraints.CENTER; c.fill = GridBagConstraints.BOTH; c.insets.left = 0; c.weightx = 1; add(searchJTextField, c.clone()); c.fill = GridBagConstraints.NONE; c.insets.left = 0; c.insets.right = 7; c.weightx = 0; add(searchRightJLabel, c.clone()); }
localFile.delete(); localFile.deleteParent();
localFile.deleteParentTree();
private void deleteLocal(final Long documentId) { final Document document = read(documentId); // delete audit final InternalAuditModel iAuditModel = getInternalAuditModel(); iAuditModel.delete(documentId); // delete versions final Collection<DocumentVersion> versions = listVersions(documentId); for(final DocumentVersion version : versions) { getLocalFile(document, version).delete(); documentIO.deleteVersion(version.getArtifactId(), version.getVersionId()); } // delete index getIndexModel().deleteDocument(documentId); // delete document final LocalFile localFile = getLocalFile(document); localFile.delete(); localFile.deleteParent(); documentIO.delete(documentId); }
public Comparator<Artifact> createByName(final Boolean isAscending) { return new NameComparator(isAscending);
public Comparator<Artifact> createByName() { return new NameComparator(Boolean.TRUE);
public Comparator<Artifact> createByName(final Boolean isAscending) { return new NameComparator(isAscending); }
public static synchronized byte[] read( InputStream inputStream) throws IOException { return read(inputStream, DEFAULT_CHARSET_NAME);
public static synchronized byte[] read(final InputStream inputStream) throws IOException { if(null == inputStream) { return null; } final ByteBuffer byteBuffer = ByteBuffer.allocate(inputStream.available()); final byte[] streamContentBuffer = new byte[BLOCK_SIZE]; int numBytesRead = inputStream.read(streamContentBuffer); while(-1 != numBytesRead) { byteBuffer.put(streamContentBuffer, 0, numBytesRead); numBytesRead = inputStream.read(streamContentBuffer); } return byteBuffer.array();
public static synchronized byte[] read( InputStream inputStream) throws IOException { return read(inputStream, DEFAULT_CHARSET_NAME); }
reader.open();
protected final File downloadStream(final String streamId) throws IOException { final File streamFile = workspace.createTempFile(streamId); final FileOutputStream stream = new FileOutputStream(streamFile); final StreamSession session = getSessionModel().createStreamSession(); final StreamReader reader = new StreamReader(session); reader.open(); try { reader.read(streamId, stream); } finally { try { stream.close(); } finally { reader.close(); } } return streamFile; }
reader.open();
protected final File downloadStream(final String streamId) throws IOException { final File streamFile = workspace.createTempFile(streamId); final FileOutputStream stream = new FileOutputStream(streamFile); final StreamSession session = getSessionModel().createStreamSession(); final StreamReader reader = new StreamReader(session); reader.open(); try { reader.read(streamId, stream); } finally { try { stream.close(); } finally { reader.close(); } } return streamFile; }
public Boolean doesVersionExist(final Long artifactId, final Long versionId) {
public Boolean doesVersionExist(final Long artifactId) {
public Boolean doesVersionExist(final Long artifactId, final Long versionId) { synchronized (getImplLock()) { return getImpl().doesVersionExist(artifactId, versionId); } }
return getImpl().doesVersionExist(artifactId, versionId);
return getImpl().doesVersionExist(artifactId);
public Boolean doesVersionExist(final Long artifactId, final Long versionId) { synchronized (getImplLock()) { return getImpl().doesVersionExist(artifactId, versionId); } }
super(); this.listeners = new ArrayList<SessionListener>(); this.xmppArchive = new XMPPArchive(this); this.xmppBackup = new XMPPBackup(this); this.xmppArtifact = new XMPPArtifact(this); this.xmppContainer = new XMPPContainer(this); this.xmppContact = new XMPPContact(this); this.xmppProfile = new XMPPProfile(this); this.xmppStream = new XMPPStream(this); this.xmppSystem = new XMPPSystem(this); this.xmppUser = new XMPPUser(this); }
this(null); }
public XMPPSessionImpl() { super(); this.listeners = new ArrayList<SessionListener>(); this.xmppArchive = new XMPPArchive(this); this.xmppBackup = new XMPPBackup(this); this.xmppArtifact = new XMPPArtifact(this); this.xmppContainer = new XMPPContainer(this); this.xmppContact = new XMPPContact(this); this.xmppProfile = new XMPPProfile(this); this.xmppStream = new XMPPStream(this); this.xmppSystem = new XMPPSystem(this); this.xmppUser = new XMPPUser(this); }
void decline(final EMail invitedAs, final JabberId invitedBy) throws SmackException {
void decline(final EMail invitedAs, final JabberId invitedBy) {
void decline(final EMail invitedAs, final JabberId invitedBy) throws SmackException { final XMPPMethod decline = new XMPPMethod("contact:declineinvitation"); decline.setParameter(Xml.Contact.INVITED_AS, invitedAs); decline.setParameter(Xml.Contact.INVITED_BY, invitedBy); decline.setParameter(Xml.Contact.DECLINED_BY, xmppCore.getJabberId()); execute(decline); }
publish.setParameter("comment", container.getComment());
void publish(final ContainerVersion container, final Map<DocumentVersion, String> documents, final List<JabberId> publishTo, final JabberId publishedBy, final Calendar publishedOn) { logger.logApiId(); logger.logVariable("container", container); logger.logVariable("documents", documents); logger.logVariable("publishTo", publishTo); logger.logVariable("publishedBy", publishedBy); logger.logVariable("publishedOn", publishedOn); int i = 0; final Set<Entry<DocumentVersion, String>> entries = documents.entrySet(); for (final Entry<DocumentVersion, String> entry : entries) { // publish artifact final XMPPMethod publishArtifact = new XMPPMethod(Service.Container.PUBLISH_ARTIFACT); publishArtifact.setParameter("uniqueId", container.getArtifactUniqueId()); publishArtifact.setParameter("versionId", container.getVersionId()); publishArtifact.setParameter("name", container.getName()); publishArtifact.setParameter("artifactCount", entries.size()); publishArtifact.setParameter("artifactIndex", i++); publishArtifact.setParameter("artifactUniqueId", entry.getKey().getArtifactUniqueId()); publishArtifact.setParameter("artifactVersionId", entry.getKey().getVersionId()); publishArtifact.setParameter("artifactName", entry.getKey().getName()); publishArtifact.setParameter("artifactType", entry.getKey().getArtifactType()); publishArtifact.setParameter("artifactChecksum", entry.getKey().getChecksum()); publishArtifact.setParameter("artifactStreamId", entry.getValue()); publishArtifact.setParameter("publishTo", "publishTo", publishTo); publishArtifact.setParameter("publishedBy", publishedBy); publishArtifact.setParameter("publishedOn", publishedOn); execute(publishArtifact); } // publish final XMPPMethod publish = new XMPPMethod(Service.Container.PUBLISH); publish.setParameter("uniqueId", container.getArtifactUniqueId()); publish.setParameter("versionId", container.getVersionId()); publish.setParameter("name", container.getName()); publish.setParameter("artifactCount", entries.size()); publish.setParameter("publishedBy", publishedBy); publish.setParameter("publishedTo", "publishedTo", publishTo); publish.setParameter("publishedOn", publishedOn); execute(publish); }
final UUID uniqueId, final Long versionId, final UUID documentUniqueId) {
final UUID uniqueId, final Long versionId) {
List<DocumentVersion> readDocumentVersions(final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { logger.logApiId(); logger.logVariable("userId", userId); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); final XMPPMethod readDocumentVersions = new XMPPMethod("archive:readdocumentversions"); readDocumentVersions.setParameter("userId", userId); readDocumentVersions.setParameter("uniqueId", uniqueId); readDocumentVersions.setParameter("versionId", versionId); readDocumentVersions.setParameter("documentUniqueId", documentUniqueId); return execute(readDocumentVersions, Boolean.TRUE).readResultDocumentVersions("documentVersions"); }
logger.logVariable("documentUniqueId", documentUniqueId);
List<DocumentVersion> readDocumentVersions(final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { logger.logApiId(); logger.logVariable("userId", userId); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); final XMPPMethod readDocumentVersions = new XMPPMethod("archive:readdocumentversions"); readDocumentVersions.setParameter("userId", userId); readDocumentVersions.setParameter("uniqueId", uniqueId); readDocumentVersions.setParameter("versionId", versionId); readDocumentVersions.setParameter("documentUniqueId", documentUniqueId); return execute(readDocumentVersions, Boolean.TRUE).readResultDocumentVersions("documentVersions"); }
readDocumentVersions.setParameter("documentUniqueId", documentUniqueId);
List<DocumentVersion> readDocumentVersions(final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { logger.logApiId(); logger.logVariable("userId", userId); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); final XMPPMethod readDocumentVersions = new XMPPMethod("archive:readdocumentversions"); readDocumentVersions.setParameter("userId", userId); readDocumentVersions.setParameter("uniqueId", uniqueId); readDocumentVersions.setParameter("versionId", versionId); readDocumentVersions.setParameter("documentUniqueId", documentUniqueId); return execute(readDocumentVersions, Boolean.TRUE).readResultDocumentVersions("documentVersions"); }
final UUID uniqueId, final Long versionId, final UUID documentUniqueId) {
final UUID uniqueId, final Long versionId) {
List<DocumentVersion> readDocumentVersions(final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { logger.logApiId(); logger.logVariable("userId", userId); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); final XMPPMethod readDocumentVersions = new XMPPMethod("backup:readdocumentversions"); readDocumentVersions.setParameter("userId", userId); readDocumentVersions.setParameter("uniqueId", uniqueId); readDocumentVersions.setParameter("versionId", versionId); readDocumentVersions.setParameter("documentUniqueId", documentUniqueId); return execute(readDocumentVersions, Boolean.TRUE).readResultDocumentVersions("documentVersions"); }
logger.logVariable("documentUniqueId", documentUniqueId);
List<DocumentVersion> readDocumentVersions(final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { logger.logApiId(); logger.logVariable("userId", userId); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); final XMPPMethod readDocumentVersions = new XMPPMethod("backup:readdocumentversions"); readDocumentVersions.setParameter("userId", userId); readDocumentVersions.setParameter("uniqueId", uniqueId); readDocumentVersions.setParameter("versionId", versionId); readDocumentVersions.setParameter("documentUniqueId", documentUniqueId); return execute(readDocumentVersions, Boolean.TRUE).readResultDocumentVersions("documentVersions"); }
readDocumentVersions.setParameter("documentUniqueId", documentUniqueId);
List<DocumentVersion> readDocumentVersions(final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { logger.logApiId(); logger.logVariable("userId", userId); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); final XMPPMethod readDocumentVersions = new XMPPMethod("backup:readdocumentversions"); readDocumentVersions.setParameter("userId", userId); readDocumentVersions.setParameter("uniqueId", uniqueId); readDocumentVersions.setParameter("versionId", versionId); readDocumentVersions.setParameter("documentUniqueId", documentUniqueId); return execute(readDocumentVersions, Boolean.TRUE).readResultDocumentVersions("documentVersions"); }
Contact read(final JabberId userId, final JabberId contactId) { logger.logApiId();
List<Contact> read(final JabberId userId) { logger.logApiId();
Contact read(final JabberId userId, final JabberId contactId) { logger.logApiId(); logger.logVariable("userId", userId); assertIsAuthenticatedUser(userId); final XMPPMethod read = new XMPPMethod("contact:read"); read.setParameter("userId", userId); read.setParameter("contactId", contactId); final XMPPMethodResponse response = execute(read, Boolean.TRUE); final Contact contact = new Contact(); contact.setId(response.readResultJabberId(Xml.Contact.JABBER_ID)); contact.setName(response.readResultString(Xml.Contact.NAME)); contact.setOrganization(response.readResultString(Xml.Contact.ORGANIZATION)); contact.setTitle(response.readResultString("title")); contact.addAllEmails(response.readResultEMails("emails")); return contact; }
final XMPPMethod read = new XMPPMethod("contact:read"); read.setParameter("userId", userId); read.setParameter("contactId", contactId); final XMPPMethodResponse response = execute(read, Boolean.TRUE); final Contact contact = new Contact(); contact.setId(response.readResultJabberId(Xml.Contact.JABBER_ID)); contact.setName(response.readResultString(Xml.Contact.NAME)); contact.setOrganization(response.readResultString(Xml.Contact.ORGANIZATION)); contact.setTitle(response.readResultString("title")); contact.addAllEmails(response.readResultEMails("emails")); return contact; }
final XMPPMethod readIds = new XMPPMethod("contact:readids"); readIds.setParameter("userId", userId); final XMPPMethodResponse response = execute(readIds, Boolean.TRUE); final List<JabberId> contactIds = response.readResultJabberIds("contactIds"); final List<Contact> contacts = new ArrayList<Contact>(contactIds.size()); for (final JabberId contactId : contactIds) { contacts.add(read(userId, contactId)); } return contacts; }
Contact read(final JabberId userId, final JabberId contactId) { logger.logApiId(); logger.logVariable("userId", userId); assertIsAuthenticatedUser(userId); final XMPPMethod read = new XMPPMethod("contact:read"); read.setParameter("userId", userId); read.setParameter("contactId", contactId); final XMPPMethodResponse response = execute(read, Boolean.TRUE); final Contact contact = new Contact(); contact.setId(response.readResultJabberId(Xml.Contact.JABBER_ID)); contact.setName(response.readResultString(Xml.Contact.NAME)); contact.setOrganization(response.readResultString(Xml.Contact.ORGANIZATION)); contact.setTitle(response.readResultString("title")); contact.addAllEmails(response.readResultEMails("emails")); return contact; }
final XMPPMethodResponse result = execute(method); return result.readResultJabberId("keyHolder");
return execute(method, Boolean.TRUE).readResultJabberId("keyHolder");
JabberId readKeyHolder(final JabberId userId, final UUID uniqueId) { final XMPPMethod method = new XMPPMethod("artifact:readkeyholder"); method.setParameter("userId", userId); method.setParameter("uniqueId", uniqueId); final XMPPMethodResponse result = execute(method); return result.readResultJabberId("keyHolder"); }
public QueueItem enqueue(final String message)
public QueueItem enqueue(final JID jid, final IQ iq)
public QueueItem enqueue(final String message) throws ParityServerModelException { synchronized(implLock) { return impl.enqueue(message); } }
synchronized(implLock) { return impl.enqueue(message); }
synchronized(implLock) { return impl.enqueue(jid, iq); }
public QueueItem enqueue(final String message) throws ParityServerModelException { synchronized(implLock) { return impl.enqueue(message); } }
final String usernameAtHost = new StringBuffer(username) .append("@").append(host).toString();
void login(final String username, final String password) throws ParityException { logger.info("login(String,String)"); logger.debug(username); logger.debug(mask(password)); final String host = preferences.getServerHost(); final Integer port = preferences.getServerPort(); synchronized(xmppHelperLock) { try { final String usernameAtHost = new StringBuffer(username) .append("@").append(host).toString(); // check that the preferences username@host matches the username // supplied if(preferences.isSetUsername()) { Assert.assertTrue( ASSERT_USERNAME_EQUALS_PREFS, usernameAtHost.equals(preferences.getUsername())); } // login xmppHelper.login(host, port, username, password); // set the username@host in the preferences if(!preferences.isSetUsername()) { preferences.setUsername(usernameAtHost); } } catch(SmackException sx) { logger.error("login(String,String)", sx); throw ParityErrorTranslator.translate(sx); } catch(RuntimeException rx) { logger.error("login(String,String)", rx); throw ParityErrorTranslator.translate(rx); } } }
usernameAtHost.equals(preferences.getUsername()));
username.equals(preferences.getUsername()));
void login(final String username, final String password) throws ParityException { logger.info("login(String,String)"); logger.debug(username); logger.debug(mask(password)); final String host = preferences.getServerHost(); final Integer port = preferences.getServerPort(); synchronized(xmppHelperLock) { try { final String usernameAtHost = new StringBuffer(username) .append("@").append(host).toString(); // check that the preferences username@host matches the username // supplied if(preferences.isSetUsername()) { Assert.assertTrue( ASSERT_USERNAME_EQUALS_PREFS, usernameAtHost.equals(preferences.getUsername())); } // login xmppHelper.login(host, port, username, password); // set the username@host in the preferences if(!preferences.isSetUsername()) { preferences.setUsername(usernameAtHost); } } catch(SmackException sx) { logger.error("login(String,String)", sx); throw ParityErrorTranslator.translate(sx); } catch(RuntimeException rx) { logger.error("login(String,String)", rx); throw ParityErrorTranslator.translate(rx); } } }
preferences.setUsername(usernameAtHost);
preferences.setUsername(username);
void login(final String username, final String password) throws ParityException { logger.info("login(String,String)"); logger.debug(username); logger.debug(mask(password)); final String host = preferences.getServerHost(); final Integer port = preferences.getServerPort(); synchronized(xmppHelperLock) { try { final String usernameAtHost = new StringBuffer(username) .append("@").append(host).toString(); // check that the preferences username@host matches the username // supplied if(preferences.isSetUsername()) { Assert.assertTrue( ASSERT_USERNAME_EQUALS_PREFS, usernameAtHost.equals(preferences.getUsername())); } // login xmppHelper.login(host, port, username, password); // set the username@host in the preferences if(!preferences.isSetUsername()) { preferences.setUsername(usernameAtHost); } } catch(SmackException sx) { logger.error("login(String,String)", sx); throw ParityErrorTranslator.translate(sx); } catch(RuntimeException rx) { logger.error("login(String,String)", rx); throw ParityErrorTranslator.translate(rx); } } }
xStream.registerConverter(new XMPPDocumentConverter()); xStream.alias("xmppdocument", XMPPDocument.class);
private void registerConverters(final XStream xStream) { xStream.registerConverter(new EncodedByteArrayConverter()); xStream.registerConverter(new ProjectConverter()); xStream.alias("project", Project.class); xStream.registerConverter(new DocumentConverter()); xStream.alias("document", Document.class); xStream.registerConverter(new DocumentContentConverter()); xStream.alias("documentcontent", DocumentContent.class); xStream.registerConverter(new DocumentVersionConverter()); xStream.alias("documentversion", DocumentVersion.class); xStream.registerConverter(new IndexConverter()); xStream.alias("index", Index.class); }
final TrayNotification notification = new TrayNotification();
final Notification notification = new Notification();
private void fireNotification(final String notificationMessage) { final TrayNotification notification = new TrayNotification(); notification.setMessage(notificationMessage); impl.fireNotification(notification); }
systemApplication.getContactModel().removeListener(contactListener); contactListener = null; systemApplication.getContainerModel().removeListener(containerListener); containerListener = null;
void end() { systemApplication.getDocumentModel().removeListener(documentListener); documentListener = null; systemApplication.getSessionModel().removeListener(sessionListener); sessionListener = null; }
void fireNotification(final TrayNotification notification) { synchronized(this) {
void fireNotification(final Notification notification) { synchronized (this) {
void fireNotification(final TrayNotification notification) { synchronized(this) { queue.add(notification); notifyAll(); } }
this.queue = new LinkedList<TrayNotification>();
this.queue = new LinkedList<Notification>();
SystemApplicationImpl(final SystemApplication sysApp) { super("[BROWSER2] [APP] [SYS] [THREAD]"); this.sysApp = sysApp; this.queue = new LinkedList<TrayNotification>(); }
contactListener = createContactListener(); systemApplication.getContactModel().addListener(contactListener); containerListener = createContainerListener(); systemApplication.getContainerModel().addListener(containerListener);
void start() { documentListener = createDocumentListener(); systemApplication.getDocumentModel().addListener(documentListener); sessionListener = createSessionListener(); systemApplication.getSessionModel().addListener(sessionListener); }
Document get(final UUID documentUniqueId) throws ParityException { logger.info("get(UUID)"); logger.debug(documentUniqueId); try { return documentIO.get(documentUniqueId); } catch(final RuntimeException rx) { logger.error("get(UUID)", rx);
Document get(final Long id) throws ParityException { logger.info("get(Long)"); logger.debug(id); try { return documentIO.get(id); } catch(RuntimeException rx) { logger.error("get(Long)", rx);
Document get(final UUID documentUniqueId) throws ParityException { logger.info("get(UUID)"); logger.debug(documentUniqueId); try { return documentIO.get(documentUniqueId); } catch(final RuntimeException rx) { logger.error("get(UUID)", rx); throw ParityErrorTranslator.translate(rx); } }
Collection<Document> list(final Comparator<Artifact> comparator) throws ParityException { logger.info("list(Comparator<Artifact>)"); logger.debug(comparator); try { final Collection<Document> documents = documentIO.list(); ArtifactSorter.sortDocuments(documents, comparator); return documents; } catch(RuntimeException rx) { logger.error("list(UUID,Comparator<Artifact>)", rx); throw ParityErrorTranslator.translate(rx); }
Collection<Document> list() throws ParityException { logger.info("list()"); return list(defaultComparator);
Collection<Document> list(final Comparator<Artifact> comparator) throws ParityException { logger.info("list(Comparator<Artifact>)"); logger.debug(comparator); try { final Collection<Document> documents = documentIO.list(); ArtifactSorter.sortDocuments(documents, comparator); return documents; } catch(RuntimeException rx) { logger.error("list(UUID,Comparator<Artifact>)", rx); throw ParityErrorTranslator.translate(rx); } }
xmppDocument.getCreatedBy(), xmppDocument.getUpdatedBy(),
xmppDocument.getReceivedFrom(), xmppDocument.getUpdatedBy(),
void receive(final XMPPDocument xmppDocument) throws ParityException { logger.info("receiveDocument(XMPPDocument)"); logger.debug(xmppDocument); try { Document document = get(xmppDocument.getUniqueId()); logger.debug(document); if(null == document) { document = receiveCreate(xmppDocument); } else { receiveUpdate(xmppDocument, document); } // audit the receiving auditor.recieve(document.getId(), xmppDocument.getVersionId(), xmppDocument.getCreatedBy(), xmppDocument.getUpdatedBy(), xmppDocument.getUpdatedOn()); } catch(IOException iox) { logger.error("receiveDocument(XMPPDocument)", iox); throw ParityErrorTranslator.translate(iox); } catch(RuntimeException rx) { logger.error("receiveDocument(XMPPDocument)", rx); throw ParityErrorTranslator.translate(rx); } }
protected static void assertNotNull(final String assertion, final Container container) { assertNotNull(assertion + " [CONTAINER IS NULL]", (Object) container); assertNotNull(assertion + " [CONTAINER'S CREATED BY IS NULL]", container.getCreatedBy()); assertNotNull(assertion + " [CONTAINER'S CREATED ON IS NULL]", container.getCreatedOn()); assertNotNull(assertion + " [CONTAINER'S FLAGS IS NULL]", container.getFlags()); assertNotNull(assertion + " [CONTAINER'S ID IS NULL]", container.getId()); assertNotNull(assertion + " [CONTAINER'S NAME IS NULL]", container.getName()); assertNotNull(assertion + " [CONTAINER'S REMOTE INFO IS NULL]", container.getRemoteInfo()); assertNotNull(assertion + " [CONTAINER'S UPDATED BY REMOTE INFO IS NULL]", container.getRemoteInfo().getUpdatedBy()); assertNotNull(assertion + " [CONTAINER'S UPDATED ON REMOTE INFO IS NULL]", container.getRemoteInfo().getUpdatedOn()); assertNotNull(assertion + " [CONTAINER'S STATE IS NULL]", container.getState()); assertNotNull(assertion + " [CONTAINER'S TYPE IS NULL]", container.getType()); assertNotNull(assertion + " [CONTAINER'S UNIQUE ID IS NULL]", container.getUniqueId()); assertNotNull(assertion + " [CONTAINER'S UPDATED BY IS NULL]", container.getUpdatedBy()); assertNotNull(assertion + " [CONTAINER'S UPDATED ON IS NULL]", container.getUpdatedOn());
protected static void assertNotNull(final String assertion, final Collection<DocumentVersion> versions) { assertNotNull(assertion + " [DOCUMENT VERSIONS IS NULL]", (Object) versions); for(final DocumentVersion version : versions) { assertNotNull(assertion, version); }
protected static void assertNotNull(final String assertion, final Container container) { assertNotNull(assertion + " [CONTAINER IS NULL]", (Object) container); assertNotNull(assertion + " [CONTAINER'S CREATED BY IS NULL]", container.getCreatedBy()); assertNotNull(assertion + " [CONTAINER'S CREATED ON IS NULL]", container.getCreatedOn()); assertNotNull(assertion + " [CONTAINER'S FLAGS IS NULL]", container.getFlags()); assertNotNull(assertion + " [CONTAINER'S ID IS NULL]", container.getId()); assertNotNull(assertion + " [CONTAINER'S NAME IS NULL]", container.getName()); assertNotNull(assertion + " [CONTAINER'S REMOTE INFO IS NULL]", container.getRemoteInfo()); assertNotNull(assertion + " [CONTAINER'S UPDATED BY REMOTE INFO IS NULL]", container.getRemoteInfo().getUpdatedBy()); assertNotNull(assertion + " [CONTAINER'S UPDATED ON REMOTE INFO IS NULL]", container.getRemoteInfo().getUpdatedOn()); assertNotNull(assertion + " [CONTAINER'S STATE IS NULL]", container.getState()); assertNotNull(assertion + " [CONTAINER'S TYPE IS NULL]", container.getType()); assertNotNull(assertion + " [CONTAINER'S UNIQUE ID IS NULL]", container.getUniqueId()); assertNotNull(assertion + " [CONTAINER'S UPDATED BY IS NULL]", container.getUpdatedBy()); assertNotNull(assertion + " [CONTAINER'S UPDATED ON IS NULL]", container.getUpdatedOn()); }
Class converterClass= Class.forName(className);
Class converterClass= forName(className);
public static Object invokeConstructor(String className, Object[] params) { try { Class converterClass= Class.forName(className); return ConstructorUtils.invokeConstructor(converterClass, params); } catch(Exception ex) { throw new JcrMappingException("Cannot create instance for class " + className, ex); } }
public static Object newInstance(String clazz) {
public static Object newInstance(Class clazz) {
public static Object newInstance(String clazz) { try { return Class.forName(clazz).newInstance(); } catch(Exception ex) { throw new JcrMappingException("Cannot create instance for class " + clazz, ex); } }
return Class.forName(clazz).newInstance();
return clazz.newInstance();
public static Object newInstance(String clazz) { try { return Class.forName(clazz).newInstance(); } catch(Exception ex) { throw new JcrMappingException("Cannot create instance for class " + clazz, ex); } }
public static ManageableCollection getManageableCollection(Object object) {
public static ManageableCollection getManageableCollection(String manageableCollectionClassName) {
public static ManageableCollection getManageableCollection(Object object) { try { if (object == null) { return null; } if (object instanceof ManageableCollection) { return (ManageableCollection) object; } if (object.getClass().equals(ArrayList.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Vector.class)) { ManageableVector manageableVector = new ManageableVector(); manageableVector.addAll((Collection) object); return manageableVector; } if (object.getClass().equals(HashSet.class)) { return new ManageableSet((Set) object); } if (object.getClass().equals(Collection.class) || object.getClass().equals(List.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Set.class)) { return new ManageableSet((Set) object); } } catch (Exception e) { throw new JcrMappingException("Impossible to create the manageable collection", e); } throw new JcrMappingException("Unsupported collection type :" + object.getClass().getName()); }
if (object == null) { return null; } if (object instanceof ManageableCollection) { return (ManageableCollection) object; } if (object.getClass().equals(ArrayList.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Vector.class)) { ManageableVector manageableVector = new ManageableVector(); manageableVector.addAll((Collection) object); return manageableVector; } if (object.getClass().equals(HashSet.class)) { return new ManageableSet((Set) object); } if (object.getClass().equals(Collection.class) || object.getClass().equals(List.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Set.class)) { return new ManageableSet((Set) object); }
return (ManageableCollection) ReflectionUtils.newInstance(manageableCollectionClassName);
public static ManageableCollection getManageableCollection(Object object) { try { if (object == null) { return null; } if (object instanceof ManageableCollection) { return (ManageableCollection) object; } if (object.getClass().equals(ArrayList.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Vector.class)) { ManageableVector manageableVector = new ManageableVector(); manageableVector.addAll((Collection) object); return manageableVector; } if (object.getClass().equals(HashSet.class)) { return new ManageableSet((Set) object); } if (object.getClass().equals(Collection.class) || object.getClass().equals(List.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Set.class)) { return new ManageableSet((Set) object); } } catch (Exception e) { throw new JcrMappingException("Impossible to create the manageable collection", e); } throw new JcrMappingException("Unsupported collection type :" + object.getClass().getName()); }
throw new JcrMappingException("Impossible to create the manageable collection", e);
throw new JcrMappingException("Cannot create manageable collection : " + manageableCollectionClassName, e);
public static ManageableCollection getManageableCollection(Object object) { try { if (object == null) { return null; } if (object instanceof ManageableCollection) { return (ManageableCollection) object; } if (object.getClass().equals(ArrayList.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Vector.class)) { ManageableVector manageableVector = new ManageableVector(); manageableVector.addAll((Collection) object); return manageableVector; } if (object.getClass().equals(HashSet.class)) { return new ManageableSet((Set) object); } if (object.getClass().equals(Collection.class) || object.getClass().equals(List.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Set.class)) { return new ManageableSet((Set) object); } } catch (Exception e) { throw new JcrMappingException("Impossible to create the manageable collection", e); } throw new JcrMappingException("Unsupported collection type :" + object.getClass().getName()); }
throw new JcrMappingException("Unsupported collection type :" + object.getClass().getName());
public static ManageableCollection getManageableCollection(Object object) { try { if (object == null) { return null; } if (object instanceof ManageableCollection) { return (ManageableCollection) object; } if (object.getClass().equals(ArrayList.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Vector.class)) { ManageableVector manageableVector = new ManageableVector(); manageableVector.addAll((Collection) object); return manageableVector; } if (object.getClass().equals(HashSet.class)) { return new ManageableSet((Set) object); } if (object.getClass().equals(Collection.class) || object.getClass().equals(List.class)) { ManageableArrayList manageableArrayList = new ManageableArrayList(); manageableArrayList.addAll((Collection) object); return manageableArrayList; } if (object.getClass().equals(Set.class)) { return new ManageableSet((Set) object); } } catch (Exception e) { throw new JcrMappingException("Impossible to create the manageable collection", e); } throw new JcrMappingException("Unsupported collection type :" + object.getClass().getName()); }
synchronized (xmppSession) { xmppSession.logout();
logger.logTraceId(); synchronized (xmppSession) { logger.logTraceId(); xmppSession.logout(); logger.logTraceId();
void logout() { logger.logApiId(); try { final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { xmppSession.logout(); } } catch (final Throwable t) { throw translateError(t); } }
logger.logTraceId();
void logout() { logger.logApiId(); try { final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { xmppSession.logout(); } } catch (final Throwable t) { throw translateError(t); } }
firstVersion = documentModel.readVersion( entry.getKey().getArtifactId(), Versioning.START);
firstVersion = documentModel.readEarliestVersion(entry.getKey().getArtifactId());
public List<DocumentView> readDocumentViews(final Long containerId, final Long versionId) { final Map<DocumentVersion, Delta> versions; final ContainerVersion previousVersion = containerModel.readPreviousVersion(containerId, versionId); if (null == previousVersion) { versions = containerModel.readDocumentVersionDeltas(containerId, versionId); } else { versions = containerModel.readDocumentVersionDeltas(containerId, versionId, previousVersion.getVersionId()); } final List<DocumentView> views = new ArrayList<DocumentView>(versions.size()); DocumentVersion firstVersion; DocumentView view; for (final Entry<DocumentVersion, Delta> entry : versions.entrySet()) { firstVersion = documentModel.readVersion( entry.getKey().getArtifactId(), Versioning.START); view = new DocumentView(); view.setDelta(entry.getValue()); view.setVersion(entry.getKey()); view.setFirstPublishedOn(firstVersion.getCreatedOn()); views.add(view); } return views; }
public void addListener(final XMPPExtensionListener l);
public void addListener(final XMPPArtifactListener l);
public void addListener(final XMPPExtensionListener l);