rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
team = datum.aModel.readTeam(datum.containerId);
team = datum.cModel.readTeam(datum.containerId);
public void testHandleClose() { Set<User> team; try { datum.cInternalModel.handleClose(datum.containerId, datum.closedBy, datum.closedOn); } catch(final ParityException px) { fail(createFailMessage(px)); } final Container container = datum.cInternalModel.read(datum.containerId); assertNotNull(NAME, container); assertEquals(NAME + " [CONTAINER STATE DOES NOT MATCH EXPECTATION]", container.getState(), ArtifactState.CLOSED); team = datum.aModel.readTeam(datum.containerId); assertNotNull(NAME, team); assertEquals(NAME + " [TEAM SIZE DOES NOT MATCH EXPECTATION]", datum.eTeamSize.intValue(), team.size()); }
protected void setUp() throws Exception { super.setUp(); }
protected void setUp() throws Exception {}
protected void setUp() throws Exception { super.setUp(); }
protected void tearDown() throws Exception { super.tearDown(); }
protected void tearDown() throws Exception {}
protected void tearDown() throws Exception { super.tearDown(); }
public Container read(final Long containerId) { synchronized(implLock) { return impl.read(containerId); } }
public List<Container> read() { synchronized(implLock) { return impl.read(); } }
public Container read(final Long containerId) { synchronized(implLock) { return impl.read(containerId); } }
protected static void assertNotNull(final String assertion, final List<Container> containers) { assertNotNull(assertion + " [CONTAINERS IS NULL]", (Object) containers); for(final Container container : containers) { assertNotNull(assertion, container); }
protected static void assertNotNull(final String assertion, final ContainerDraft draft) { assertNotNull(assertion + " [DRAFT IS NULL]", (Object) draft); assertNotNull(assertion + " [DRAFT ID IS NULL]", draft.getId()); assertNotNull(assertion + " [DRAFT VERSION ID IS NULL]", draft.getVersionId());
protected static void assertNotNull(final String assertion, final List<Container> containers) { assertNotNull(assertion + " [CONTAINERS IS NULL]", (Object) containers); for(final Container container : containers) { assertNotNull(assertion, container); } }
void addTeamMember(final UUID uniqueId, final JabberId teamMemberId) {
void addTeamMember(final UUID uniqueId, final List<JabberId> team, final JabberId teamMemberId) {
void addTeamMember(final UUID uniqueId, final JabberId teamMemberId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("teamMemberId", teamMemberId); try { final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long artifactId = artifactModel.readId(uniqueId); final List<JabberId> team = artifactModel.readTeamIds(artifactId); final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { xmppSession.addTeamMember(localUserId(), team, uniqueId, teamMemberId); } } catch (final Throwable t) { throw translateError(t); } }
final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long artifactId = artifactModel.readId(uniqueId); final List<JabberId> team = artifactModel.readTeamIds(artifactId);
void addTeamMember(final UUID uniqueId, final JabberId teamMemberId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("teamMemberId", teamMemberId); try { final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long artifactId = artifactModel.readId(uniqueId); final List<JabberId> team = artifactModel.readTeamIds(artifactId); final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { xmppSession.addTeamMember(localUserId(), team, uniqueId, teamMemberId); } } catch (final Throwable t) { throw translateError(t); } }
final InternalArtifactModel artifactModel = getInternalArtifactModel();
final InternalArtifactModel artifactModel = getArtifactModel();
void confirmArtifactReceipt(final JabberId userId, final UUID uniqueId, final Long versionId, final JabberId receivedBy, final Calendar receivedOn) { logger.logApiId(); logger.logVariable("userId", userId); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("receivedBy", receivedBy); logger.logVariable("receivedOn", receivedOn); try { final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long artifactId = artifactModel.readId(uniqueId); final List<JabberId> team = artifactModel.readTeamIds(artifactId); final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized(xmppSession) { xmppSession.confirmArtifactReceipt(localUserId(), team, uniqueId, versionId, receivedBy, receivedOn); } } catch (final Throwable t) { throw translateError(t); } }
final InternalArtifactModel artifactModel = getInternalArtifactModel();
final InternalArtifactModel artifactModel = getArtifactModel();
void deleteDraft(final UUID uniqueId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); try { final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long artifactId = artifactModel.readId(uniqueId); final List<JabberId> team = artifactModel.readTeamIds(artifactId); final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { xmppSession.deleteDraft(localUserId(), team, uniqueId); } } catch (final Throwable t) { throw translateError(t); } }
final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) {
final JabberId userId, final UUID uniqueId, final Long versionId) {
List<DocumentVersion> readArchiveDocumentVersions( 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); try { final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { return xmppSession.readArchiveDocumentVersions(userId, uniqueId, versionId, documentUniqueId); } } catch (final Throwable t) { throw translateError(t); } }
logger.logVariable("documentUniqueId", documentUniqueId);
List<DocumentVersion> readArchiveDocumentVersions( 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); try { final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { return xmppSession.readArchiveDocumentVersions(userId, uniqueId, versionId, documentUniqueId); } } catch (final Throwable t) { throw translateError(t); } }
uniqueId, versionId, documentUniqueId);
uniqueId, versionId);
List<DocumentVersion> readArchiveDocumentVersions( 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); try { final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { return xmppSession.readArchiveDocumentVersions(userId, uniqueId, versionId, documentUniqueId); } } catch (final Throwable t) { throw translateError(t); } }
List<DocumentVersion> readBackupDocumentVersions( final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) {
List<DocumentVersion> readBackupDocumentVersions(final JabberId userId, final UUID uniqueId, final Long versionId) {
List<DocumentVersion> readBackupDocumentVersions( 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); try { final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { return xmppSession.readBackupDocumentVersions(userId, uniqueId, versionId, documentUniqueId); } } catch (final Throwable t) { throw translateError(t); } }
logger.logVariable("documentUniqueId", documentUniqueId);
List<DocumentVersion> readBackupDocumentVersions( 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); try { final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { return xmppSession.readBackupDocumentVersions(userId, uniqueId, versionId, documentUniqueId); } } catch (final Throwable t) { throw translateError(t); } }
uniqueId, versionId, documentUniqueId);
uniqueId, versionId);
List<DocumentVersion> readBackupDocumentVersions( 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); try { final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { return xmppSession.readBackupDocumentVersions(userId, uniqueId, versionId, documentUniqueId); } } catch (final Throwable t) { throw translateError(t); } }
void removeTeamMember(final UUID uniqueId, final JabberId teamMemberId) {
void removeTeamMember(final UUID uniqueId, final List<JabberId> team, final JabberId teamMemberId) {
void removeTeamMember(final UUID uniqueId, final JabberId teamMemberId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("teamMemberId", teamMemberId); try { final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long artifactId = artifactModel.readId(uniqueId); final List<JabberId> team = artifactModel.readTeamIds(artifactId); final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { xmppSession.removeTeamMember(localUserId(), team, uniqueId, teamMemberId); } } catch (final Throwable t) { throw translateError(t); } }
final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long artifactId = artifactModel.readId(uniqueId); final List<JabberId> team = artifactModel.readTeamIds(artifactId);
void removeTeamMember(final UUID uniqueId, final JabberId teamMemberId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("teamMemberId", teamMemberId); try { final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long artifactId = artifactModel.readId(uniqueId); final List<JabberId> team = artifactModel.readTeamIds(artifactId); final XMPPSession xmppSession = workspace.getXMPPSession(); synchronized (xmppSession) { xmppSession.removeTeamMember(localUserId(), team, uniqueId, teamMemberId); } } catch (final Throwable t) { throw translateError(t); } }
logger.logApiId();
SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final UUID uniqueId, final JabberId createdBy, final Calendar createdOn) { getArtifactModel().handleDraftCreated(uniqueId, createdBy, createdOn); } public void handleDraftDeleted(final UUID uniqueId, final JabberId deletedBy, final Calendar deletedOn) { getArtifactModel().handleDraftDeleted(uniqueId, deletedBy, deletedOn); } public void handleReceived(final UUID uniqueId, final Long versionId, final JabberId receivedBy, final Calendar receivedOn) { logger.logApiId(); getArtifactModel().handleReceived(uniqueId, versionId, receivedBy, receivedOn); } public void teamMemberAdded(final UUID uniqueId, final JabberId jabberId) { getArtifactModel().handleTeamMemberAdded(uniqueId, jabberId); } public void teamMemberRemoved(final UUID artifactUniqueId, final JabberId jabberId) { getArtifactModel().handleTeamMemberRemoved(artifactUniqueId, jabberId); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished(final JabberId publishedBy, final Calendar publishedOn, final UUID containerUniqueId, final Long containerVersionId, final String containerName, final Integer containerArtifactCount, final Integer containerArtifactIndex, final UUID artifactUniqueId, final Long artifactVersionId, final String artifactName, final ArtifactType artifactType, final String artifactChecksum, final String artifactStreamId) { getContainerModel().handleArtifactPublished(containerUniqueId, containerVersionId, containerName, artifactUniqueId, artifactVersionId, artifactName, artifactType, artifactChecksum, artifactStreamId, publishedBy, publishedOn); } public void handlePublished(final UUID uniqueId, final Long versionId, final String name, final Integer artifactCount, final JabberId publishedBy, final List<JabberId> publishedTo, final Calendar publishedOn) { getContainerModel().handlePublished(uniqueId, versionId, name, artifactCount, publishedBy, publishedTo, publishedOn); } }); xmppSession.addListener(new ContactListener() { public void handleContactDeleted(final JabberId deletedBy, final Calendar deletedOn) { getContactModel().handleContactDeleted(deletedBy, deletedOn); } public void handleContactUpdated(final JabberId contactId, final Calendar updatedOn) { getContactModel().handleContactUpdated(contactId, updatedOn); } public void handleInvitationAccepted(final JabberId acceptedBy, final Calendar acceptedOn) { getContactModel().handleInvitationAccepted(acceptedBy, acceptedOn); } public void handleInvitationDeclined(final EMail invitedAs, final JabberId declinedBy, final Calendar declinedOn) { getContactModel().handleInvitationDeclined(invitedAs, declinedBy, declinedOn); } public void handleInvitationDeleted(final EMail invitedAs, final JabberId deletedBy, final Calendar deletedOn) { getContactModel().handleInvitationDeleted(invitedAs, deletedBy, deletedOn); } public void handleInvitationExtended(final EMail invitedAs, final JabberId invitedBy, final Calendar invitedOn) { getContactModel().handleInvitationExtended(invitedAs, invitedBy, invitedOn); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); }
logger.logTraceId();
SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final UUID uniqueId, final JabberId createdBy, final Calendar createdOn) { getArtifactModel().handleDraftCreated(uniqueId, createdBy, createdOn); } public void handleDraftDeleted(final UUID uniqueId, final JabberId deletedBy, final Calendar deletedOn) { getArtifactModel().handleDraftDeleted(uniqueId, deletedBy, deletedOn); } public void handleReceived(final UUID uniqueId, final Long versionId, final JabberId receivedBy, final Calendar receivedOn) { logger.logApiId(); getArtifactModel().handleReceived(uniqueId, versionId, receivedBy, receivedOn); } public void teamMemberAdded(final UUID uniqueId, final JabberId jabberId) { getArtifactModel().handleTeamMemberAdded(uniqueId, jabberId); } public void teamMemberRemoved(final UUID artifactUniqueId, final JabberId jabberId) { getArtifactModel().handleTeamMemberRemoved(artifactUniqueId, jabberId); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished(final JabberId publishedBy, final Calendar publishedOn, final UUID containerUniqueId, final Long containerVersionId, final String containerName, final Integer containerArtifactCount, final Integer containerArtifactIndex, final UUID artifactUniqueId, final Long artifactVersionId, final String artifactName, final ArtifactType artifactType, final String artifactChecksum, final String artifactStreamId) { getContainerModel().handleArtifactPublished(containerUniqueId, containerVersionId, containerName, artifactUniqueId, artifactVersionId, artifactName, artifactType, artifactChecksum, artifactStreamId, publishedBy, publishedOn); } public void handlePublished(final UUID uniqueId, final Long versionId, final String name, final Integer artifactCount, final JabberId publishedBy, final List<JabberId> publishedTo, final Calendar publishedOn) { getContainerModel().handlePublished(uniqueId, versionId, name, artifactCount, publishedBy, publishedTo, publishedOn); } }); xmppSession.addListener(new ContactListener() { public void handleContactDeleted(final JabberId deletedBy, final Calendar deletedOn) { getContactModel().handleContactDeleted(deletedBy, deletedOn); } public void handleContactUpdated(final JabberId contactId, final Calendar updatedOn) { getContactModel().handleContactUpdated(contactId, updatedOn); } public void handleInvitationAccepted(final JabberId acceptedBy, final Calendar acceptedOn) { getContactModel().handleInvitationAccepted(acceptedBy, acceptedOn); } public void handleInvitationDeclined(final EMail invitedAs, final JabberId declinedBy, final Calendar declinedOn) { getContactModel().handleInvitationDeclined(invitedAs, declinedBy, declinedOn); } public void handleInvitationDeleted(final EMail invitedAs, final JabberId deletedBy, final Calendar deletedOn) { getContactModel().handleInvitationDeleted(invitedAs, deletedBy, deletedOn); } public void handleInvitationExtended(final EMail invitedAs, final JabberId invitedBy, final Calendar invitedOn) { getContactModel().handleInvitationExtended(invitedAs, invitedBy, invitedOn); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); }
add(DisplayFactory.create(DisplayId.TITLE), gbc.clone());
add(createDisplay(DisplayId.TITLE, BrowserWindow.Display.TITLE_HEIGHT), gbc.clone());
private void initComponents() { final GridBagConstraints gbc = new GridBagConstraints(); setLayout(new GridBagLayout()); gbc.anchor = GridBagConstraints.NORTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridy = 0; gbc.ipady = 28; gbc.weightx = 1.0; add(DisplayFactory.create(DisplayId.TITLE), gbc.clone()); gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.gridy++; gbc.ipady = 0; gbc.weighty = 1.0; add(DisplayFactory.create(DisplayId.CONTENT), gbc.clone()); gbc.anchor = GridBagConstraints.SOUTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridy++; gbc.ipady = 0; gbc.weighty = 0.0; add(DisplayFactory.create(DisplayId.STATUS), gbc.clone()); }
add(DisplayFactory.create(DisplayId.STATUS), gbc.clone());
add(createDisplay(DisplayId.STATUS, BrowserWindow.Display.STATUS_HEIGHT), gbc.clone());
private void initComponents() { final GridBagConstraints gbc = new GridBagConstraints(); setLayout(new GridBagLayout()); gbc.anchor = GridBagConstraints.NORTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridy = 0; gbc.ipady = 28; gbc.weightx = 1.0; add(DisplayFactory.create(DisplayId.TITLE), gbc.clone()); gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; gbc.gridy++; gbc.ipady = 0; gbc.weighty = 1.0; add(DisplayFactory.create(DisplayId.CONTENT), gbc.clone()); gbc.anchor = GridBagConstraints.SOUTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridy++; gbc.ipady = 0; gbc.weighty = 0.0; add(DisplayFactory.create(DisplayId.STATUS), gbc.clone()); }
public void addListener(final XMPPContactListener xmppPresenceListener);
public void addListener(final XMPPArtifactListener xmppArtifactListener);
public void addListener(final XMPPContactListener xmppPresenceListener);
public void removeListener(final XMPPContactListener xmppPresenceListener);
public void removeListener(final XMPPArtifactListener xmppArtifactListener);
public void removeListener(final XMPPContactListener xmppPresenceListener);
public static boolean sendToTarget(Message message, String senderCompID, String targetCompID) throws SessionNotFound { return sendToTarget(message, senderCompID, targetCompID, "");
public static boolean sendToTarget(Message message) throws SessionNotFound { return sendToTarget(message, "");
public static boolean sendToTarget(Message message, String senderCompID, String targetCompID) throws SessionNotFound { return sendToTarget(message, senderCompID, targetCompID, ""); }
} }); 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);
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) { searchJTextFieldKeyTyped(e); } }); searchLeftJLabel = LabelFactory.create(SEARCH_LEFT_ICON); searchLeftJLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(final MouseEvent e) { searchLeftJLabelMouseClicked(e); } }); searchRightJLabel = LabelFactory.create(SEARCH_RIGHT_ICON); final GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.EAST; c.insets.left = 167; 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()); }
synchronized(singletonLock) { return singleton.doCreateCheckBox(text, mnemonic); }
return SINGLETON.doCreateCheckBox(text, mnemonic);
public static JCheckBoxMenuItem createCheckBox(final String text, final Integer mnemonic) { synchronized(singletonLock) { return singleton.doCreateCheckBox(text, mnemonic); } }
public void setString(String key, String value) { setString(DEFAULT_SESSION_ID, key, value);
public void setString(SessionID sessionID, String key, String value) { getOrCreateSessionProperties(sessionID).setProperty(key, value);
public void setString(String key, String value) { setString(DEFAULT_SESSION_ID, key, value); }
public ScreenLogFactory(boolean incoming, boolean outgoing, boolean events) { this(incoming, outgoing, events, true);
public ScreenLogFactory(SessionSettings settings) { this(true, true, true); this.settings = settings;
public ScreenLogFactory(boolean incoming, boolean outgoing, boolean events) { this(incoming, outgoing, events, true); }
this.logger = new Log4JWrapper();
this.logger = new Log4JWrapper(getClass());
protected AbstractModelImpl(final Session session) { super(); this.configurationSql = new ConfigurationSql(); this.logger = new Log4JWrapper(); this.session = session; }
public double getBranchLength(int node);
public double getBranchLength(int node, boolean[] deleted);
public double getBranchLength(int node);
final javax.swing.JLabel jLabel = (javax.swing.JLabel) e.getSource(); popupDelegate.initialize(this, jLabel.getX(), jLabel.getY() + jLabel.getHeight(), jLabel.getWidth(), jLabel.getHeight()); popupDelegate.showForSort();
if (null != sortByDelegate) { final javax.swing.JLabel orderByJLabel = (javax.swing.JLabel) e.getSource(); final TabAvatarSortByPanel sortByPanel = new TabAvatarSortByPanel(); sortByPanel.setDelegate(sortByDelegate); sortByPanel.show(this, orderByJLabel.getX(), orderByJLabel.getY() + orderByJLabel.getHeight()); }
private void orderByJLabelMouseClicked(java.awt.event.MouseEvent e) {//GEN-FIRST:event_orderByJLabelMouseClicked final javax.swing.JLabel jLabel = (javax.swing.JLabel) e.getSource(); popupDelegate.initialize(this, jLabel.getX(), jLabel.getY() + jLabel.getHeight(), jLabel.getWidth(), jLabel.getHeight()); popupDelegate.showForSort(); }//GEN-LAST:event_orderByJLabelMouseClicked
public String getString(SessionID sessionID, String key) throws ConfigError, FieldConvertError { String value = getSessionProperties(sessionID).getProperty(key); if (value == null) { throw new ConfigError(key + " not defined"); } return value;
public String getString(String key) throws ConfigError, FieldConvertError { return getString(DEFAULT_SESSION_ID, key);
public String getString(SessionID sessionID, String key) throws ConfigError, FieldConvertError { String value = getSessionProperties(sessionID).getProperty(key); if (value == null) { throw new ConfigError(key + " not defined"); } return value; }
public boolean getBool(SessionID sessionID, String key) throws ConfigError, FieldConvertError { try { return BooleanConverter.convert(getString(sessionID, key)); } catch (FieldConvertError e) { throw new ConfigError(e); }
public boolean getBool(String key) throws ConfigError, FieldConvertError { return getBool(DEFAULT_SESSION_ID, key);
public boolean getBool(SessionID sessionID, String key) throws ConfigError, FieldConvertError { try { return BooleanConverter.convert(getString(sessionID, key)); } catch (FieldConvertError e) { throw new ConfigError(e); } }
SessionSchedule(int startDay, Calendar startTime, int endDay, Calendar endTime) { initialize(startDay, startTime, endDay, endTime);
SessionSchedule(SessionSettings settings, SessionID sessionID) throws ConfigError, FieldConvertError { boolean startDayPresent = settings.isSetting(sessionID, Session.SETTING_START_DAY); boolean endDayPresent = settings.isSetting(sessionID, Session.SETTING_END_DAY); if (startDayPresent && !endDayPresent) { throw new ConfigError("Session " + sessionID + ": StartDay used without EndDay"); } if (endDayPresent && !startDayPresent) { throw new ConfigError("Session " + sessionID + ": EndDay used without StartDay"); } boolean weeklySession = startDayPresent && endDayPresent; String startTimeString = settings.getString(sessionID, Session.SETTING_START_TIME); String endTimeString = settings.getString(sessionID, Session.SETTING_END_TIME); if (settings.isSetting(sessionID, Session.SETTING_TIMEZONE)) { String sessionTimeZoneID = settings.getString(sessionID, Session.SETTING_TIMEZONE); sessionTimeZone = TimeZone.getTimeZone(sessionTimeZoneID); if ("GMT".equals(sessionTimeZone.getID()) && !"GMT".equals(sessionTimeZoneID)) { throw new ConfigError("Unrecognized time zone '" + sessionTimeZoneID + "' for session " + sessionID); } } else { sessionTimeZone = TimeZone.getTimeZone("UTC"); } Matcher matcher = TIME_PATTERN.matcher(startTimeString); if (!matcher.find()) { throw new ConfigError("Session " + sessionID + ": could not parse start time '" + startTimeString + "'."); } Calendar localTime = SystemTime.getUtcCalendar(); localTime.setTimeZone(sessionTimeZone); localTime.set(Calendar.MILLISECOND, 0); localTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(matcher.group(1))); localTime.set(Calendar.MINUTE, Integer.parseInt(matcher.group(2))); localTime.set(Calendar.SECOND, Integer.parseInt(matcher.group(3))); Calendar startTime = SystemTime.getUtcCalendar(); startTime.setTime(localTime.getTime()); int startDay = NOT_SET; if (weeklySession) { startDay = getDay(settings, sessionID, Session.SETTING_START_DAY, NOT_SET); } matcher = TIME_PATTERN.matcher(endTimeString); if (!matcher.find()) { throw new ConfigError("Session " + sessionID + ": could not parse end time '" + endTimeString + "'."); } localTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(matcher.group(1))); localTime.set(Calendar.MINUTE, Integer.parseInt(matcher.group(2))); localTime.set(Calendar.SECOND, Integer.parseInt(matcher.group(3))); Calendar endTime = SystemTime.getUtcCalendar(); endTime.setTime(localTime.getTime()); int endDay = NOT_SET; if (weeklySession) { endDay = getDay(settings, sessionID, Session.SETTING_END_DAY, NOT_SET); } this.startTime = new TimeEndPoint(startDay, startTime); this.endTime = new TimeEndPoint(endDay, endTime);
SessionSchedule(int startDay, Calendar startTime, int endDay, Calendar endTime) { initialize(startDay, startTime, endDay, endTime); }
this.modelTestCase = modelTestCase;
ModelTestCaseHelper(final ModelTestCase modelTestCase) { super(); this.modelTestCase = modelTestCase; }
"parity", "thinkparity.dyndns.org", 5223, "junit");
"parity", "parity", "thinkparity.dyndns.org", 5223, "junit");
public static ModelTestUser getJUnit() { return new ModelTestUser( "parity", "thinkparity.dyndns.org", 5223, "junit"); }
public String getUsername() { return username; }
public String getUsername() { return username + "@" + serverHost; }
public String getUsername() { return username; }
final int selectedIndex = jList.getSelectedIndex();
public void reloadDocument(final Long documentId, final Boolean remoteReload) { final DisplayDocument displayDocument = getDisplayDocument(documentId); // if the display document is null; we can assume the document has been // deleted (it's not longer being created by the provider); so we find // the document and remove it if(null == displayDocument) { ListItem listItem; for(int i = 0; i < jListModel.size(); i++) { listItem = (ListItem) jListModel.get(i); if(listItem instanceof DocumentListItem) { if(((DocumentListItem) listItem).getDocumentId().equals(documentId)) { jListModel.remove(i); break; } } } } else { final ListItem listItem = DocumentListItem.create(displayDocument); // if the document list item is in the list; we need to remove it; // and re-add it. // // if the reload is not the result of a remote event; put it back // where it was; otherwise move it to the top if(jListModel.contains(listItem)) { final int selectedIndex = jList.getSelectedIndex(); final int index = jListModel.indexOf(listItem); jListModel.remove(index); if(remoteReload) { jListModel.add(0, listItem); } else { jListModel.add(index, listItem); } jList.setSelectedIndex(selectedIndex); } // if it's not in the list; just add it to the top else { jListModel.add(0, listItem); } } }
jList.setSelectedIndex(selectedIndex);
public void reloadDocument(final Long documentId, final Boolean remoteReload) { final DisplayDocument displayDocument = getDisplayDocument(documentId); // if the display document is null; we can assume the document has been // deleted (it's not longer being created by the provider); so we find // the document and remove it if(null == displayDocument) { ListItem listItem; for(int i = 0; i < jListModel.size(); i++) { listItem = (ListItem) jListModel.get(i); if(listItem instanceof DocumentListItem) { if(((DocumentListItem) listItem).getDocumentId().equals(documentId)) { jListModel.remove(i); break; } } } } else { final ListItem listItem = DocumentListItem.create(displayDocument); // if the document list item is in the list; we need to remove it; // and re-add it. // // if the reload is not the result of a remote event; put it back // where it was; otherwise move it to the top if(jListModel.contains(listItem)) { final int selectedIndex = jList.getSelectedIndex(); final int index = jListModel.indexOf(listItem); jListModel.remove(index); if(remoteReload) { jListModel.add(0, listItem); } else { jListModel.add(index, listItem); } jList.setSelectedIndex(selectedIndex); } // if it's not in the list; just add it to the top else { jListModel.add(0, listItem); } } }
final Integer modelIndex = jListModel.indexOf(listItem); jList.setSelectedIndex(modelIndex);
public void reloadDocument(final Long documentId, final Boolean remoteReload) { final DisplayDocument displayDocument = getDisplayDocument(documentId); // if the display document is null; we can assume the document has been // deleted (it's not longer being created by the provider); so we find // the document and remove it if(null == displayDocument) { ListItem listItem; for(int i = 0; i < jListModel.size(); i++) { listItem = (ListItem) jListModel.get(i); if(listItem instanceof DocumentListItem) { if(((DocumentListItem) listItem).getDocumentId().equals(documentId)) { jListModel.remove(i); break; } } } } else { final ListItem listItem = DocumentListItem.create(displayDocument); // if the document list item is in the list; we need to remove it; // and re-add it. // // if the reload is not the result of a remote event; put it back // where it was; otherwise move it to the top if(jListModel.contains(listItem)) { final int selectedIndex = jList.getSelectedIndex(); final int index = jListModel.indexOf(listItem); jListModel.remove(index); if(remoteReload) { jListModel.add(0, listItem); } else { jListModel.add(index, listItem); } jList.setSelectedIndex(selectedIndex); } // if it's not in the list; just add it to the top else { jListModel.add(0, listItem); } } }
protected Avatar(final String l18nContext, final ScrollPolicy scrollPolicy, final Color background) { super(l18nContext, background); this.errors = new LinkedList<Throwable>(); this.scrollPolicy = scrollPolicy;
protected Avatar(final String l18nContext) { this(l18nContext, ScrollPolicy.NONE);
protected Avatar(final String l18nContext, final ScrollPolicy scrollPolicy, final Color background) { super(l18nContext, background); this.errors = new LinkedList<Throwable>(); this.scrollPolicy = scrollPolicy; }
public FilterChain(final Filter<T> filter) { this.chain = new LinkedList<Filter<T>>(); addFilter(filter); }
public FilterChain() { this.chain = new HashSet<Filter<T>>(); }
public FilterChain(final Filter<T> filter) { this.chain = new LinkedList<Filter<T>>(); addFilter(filter); }
public static ListItem create(final Message message) { return new SystemMessageListItem(message);
public static ListItem create(final Document document, final Boolean isKeyHolder) { return new DocumentListItem(document, isKeyHolder);
public static ListItem create(final Message message) { return new SystemMessageListItem(message); }
return expanded.get(tabPanel);
return expanded.containsKey(tabPanel) ? expanded.get(tabPanel) : Boolean.FALSE;
private Boolean isExpanded(final TabPanel tabPanel) { return expanded.get(tabPanel); }
final TabPanel containerPanel = getContainerPanel(container); containerPanel.setMouseOver(isExpanded(containerPanel));
void syncContainer(final Long containerId, final Boolean remote) { debug(); final Container container = read(containerId); // remove the container from the panel list if (null == container) { removeContainerPanel(container); } else { if (containsContainerPanel(container)) { final TabPanel containerPanel = getContainerPanel(container); containerPanel.setMouseOver(isExpanded(containerPanel)); // if the reload is the result of a remote event add the container // at the top of the list; otherwise add it in the same location // it previously existed final Integer indexOfContainerPanel = indexOfContainerPanel(container); removeContainerPanel(container); if (remote) { addContainerPanel(0, container); } else { addContainerPanel(indexOfContainerPanel, container); } } else { addContainerPanel(0, container); } } synchronize(); debug(); }
addContainerPanel(0, container);
addContainerPanel(0, expanded, container);
void syncContainer(final Long containerId, final Boolean remote) { debug(); final Container container = read(containerId); // remove the container from the panel list if (null == container) { removeContainerPanel(container); } else { if (containsContainerPanel(container)) { final TabPanel containerPanel = getContainerPanel(container); containerPanel.setMouseOver(isExpanded(containerPanel)); // if the reload is the result of a remote event add the container // at the top of the list; otherwise add it in the same location // it previously existed final Integer indexOfContainerPanel = indexOfContainerPanel(container); removeContainerPanel(container); if (remote) { addContainerPanel(0, container); } else { addContainerPanel(indexOfContainerPanel, container); } } else { addContainerPanel(0, container); } } synchronize(); debug(); }
addContainerPanel(indexOfContainerPanel, container);
addContainerPanel(indexOfContainerPanel, expanded, container);
void syncContainer(final Long containerId, final Boolean remote) { debug(); final Container container = read(containerId); // remove the container from the panel list if (null == container) { removeContainerPanel(container); } else { if (containsContainerPanel(container)) { final TabPanel containerPanel = getContainerPanel(container); containerPanel.setMouseOver(isExpanded(containerPanel)); // if the reload is the result of a remote event add the container // at the top of the list; otherwise add it in the same location // it previously existed final Integer indexOfContainerPanel = indexOfContainerPanel(container); removeContainerPanel(container); if (remote) { addContainerPanel(0, container); } else { addContainerPanel(indexOfContainerPanel, container); } } else { addContainerPanel(0, container); } } synchronize(); debug(); }
for (final TabPanel visiblePanel : visiblePanels) { if (!listModel.contains(visiblePanel)) { listModel.add(visiblePanels.indexOf(visiblePanel), visiblePanel);
for (int i = 0; i < visiblePanels.size(); i++) { if (listModel.contains(visiblePanels.get(i))) { listModel.remove(i); listModel.add(i, visiblePanels.get(i)); } else { listModel.add(i, visiblePanels.get(i));
public void synchronize() { debug(); visiblePanels.clear(); for (final TabPanel containerPanel : containerPanels) { visiblePanels.add(containerPanel); if (isExpanded(containerPanel)) { visiblePanels.add(versionsPanels.get(containerPanel)); } } // add visible cells not in the model for (final TabPanel visiblePanel : visiblePanels) { if (!listModel.contains(visiblePanel)) { listModel.add(visiblePanels.indexOf(visiblePanel), visiblePanel); } } // prune cells in the model no longer visible final TabPanel[] obsolutePanels = new TabPanel[listModel.size()]; listModel.copyInto(obsolutePanels); for (final TabPanel obsoletePanel : obsolutePanels) { if (!visiblePanels.contains(obsoletePanel)) { listModel.removeElement(obsoletePanel); } } debug(); }
final TabPanel[] obsolutePanels = new TabPanel[listModel.size()]; listModel.copyInto(obsolutePanels); for (final TabPanel obsoletePanel : obsolutePanels) { if (!visiblePanels.contains(obsoletePanel)) { listModel.removeElement(obsoletePanel);
final TabPanel[] obsoletePanels = new TabPanel[listModel.size()]; listModel.copyInto(obsoletePanels); for (int i = 0; i < obsoletePanels.length; i++) { if (!visiblePanels.contains(obsoletePanels[i])) { listModel.removeElement(obsoletePanels[i]);
public void synchronize() { debug(); visiblePanels.clear(); for (final TabPanel containerPanel : containerPanels) { visiblePanels.add(containerPanel); if (isExpanded(containerPanel)) { visiblePanels.add(versionsPanels.get(containerPanel)); } } // add visible cells not in the model for (final TabPanel visiblePanel : visiblePanels) { if (!listModel.contains(visiblePanel)) { listModel.add(visiblePanels.indexOf(visiblePanel), visiblePanel); } } // prune cells in the model no longer visible final TabPanel[] obsolutePanels = new TabPanel[listModel.size()]; listModel.copyInto(obsolutePanels); for (final TabPanel obsoletePanel : obsolutePanels) { if (!visiblePanels.contains(obsoletePanel)) { listModel.removeElement(obsoletePanel); } } debug(); }
public Container read(final Long containerId) { return containerModel.read(containerId);
public List<Container> read() { return containerModel.read();
public Container read(final Long containerId) { return containerModel.read(containerId); }
versionsModel.addElement(new VersionCell( MessageFormat.format("Draft - {0} documents.", draft.getDocumentCount())));
final List<VersionContentCell> contents = new ArrayList<VersionContentCell>(documents.size() + users.size());
public void setDraft(final Container container, final ContainerDraft draft) { this.container = container; if (null != draft) { versionsModel.addElement(new VersionCell( MessageFormat.format("Draft - {0} documents.", draft.getDocumentCount()))); for (final Document document : draft.getDocuments()) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0} - {1}", document.getName(), draft.getState(document)))); } } }
versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0} - {1}", document.getName(), draft.getState(document))));
contents.add(new VersionContentCell(document, draft.getState(document)));
public void setDraft(final Container container, final ContainerDraft draft) { this.container = container; if (null != draft) { versionsModel.addElement(new VersionCell( MessageFormat.format("Draft - {0} documents.", draft.getDocumentCount()))); for (final Document document : draft.getDocuments()) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0} - {1}", document.getName(), draft.getState(document)))); } } }
versionsModel.addElement(new VersionCell(contents, draft));
public void setDraft(final Container container, final ContainerDraft draft) { this.container = container; if (null != draft) { versionsModel.addElement(new VersionCell( MessageFormat.format("Draft - {0} documents.", draft.getDocumentCount()))); for (final Document document : draft.getDocuments()) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0} - {1}", document.getName(), draft.getState(document)))); } } }
versionsModel.addElement(new VersionCell(MessageFormat.format( "Version - {0,date,MMM d, yyyy h:mm a} - {1}", version .getCreatedOn().getTime(), publishedBy.getName(), publishedBy.getTitle(), publishedBy.getOrganization())));
final List<VersionContentCell> contents = new ArrayList<VersionContentCell>(documents.size() + users.size());
public void add(final ContainerVersion version, final List<Document> documents, final Map<User, ArtifactReceipt> users, final User publishedBy) { this.versions.add(version); this.documents.put(version, documents); this.users.put(version, users); this.publishedBy.put(version, publishedBy); versionsModel.addElement(new VersionCell(MessageFormat.format( "Version - {0,date,MMM d, yyyy h:mm a} - {1}", version .getCreatedOn().getTime(), publishedBy.getName(), publishedBy.getTitle(), publishedBy.getOrganization()))); for (final Document document : documents) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", document.getName()))); } for (final Entry<User, ArtifactReceipt> entry : users.entrySet()) { if (null == entry.getValue()) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", entry.getKey().getName()))); } else { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format( "{0} - {1,date,MMM d, yyyy h:mm a}", entry .getKey().getName(), entry.getValue() .getReceivedOn().getTime()))); } } }
versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", document.getName())));
contents.add(new VersionContentCell(version, document));
public void add(final ContainerVersion version, final List<Document> documents, final Map<User, ArtifactReceipt> users, final User publishedBy) { this.versions.add(version); this.documents.put(version, documents); this.users.put(version, users); this.publishedBy.put(version, publishedBy); versionsModel.addElement(new VersionCell(MessageFormat.format( "Version - {0,date,MMM d, yyyy h:mm a} - {1}", version .getCreatedOn().getTime(), publishedBy.getName(), publishedBy.getTitle(), publishedBy.getOrganization()))); for (final Document document : documents) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", document.getName()))); } for (final Entry<User, ArtifactReceipt> entry : users.entrySet()) { if (null == entry.getValue()) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", entry.getKey().getName()))); } else { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format( "{0} - {1,date,MMM d, yyyy h:mm a}", entry .getKey().getName(), entry.getValue() .getReceivedOn().getTime()))); } } }
if (null == entry.getValue()) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", entry.getKey().getName()))); } else { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format( "{0} - {1,date,MMM d, yyyy h:mm a}", entry .getKey().getName(), entry.getValue() .getReceivedOn().getTime()))); }
contents.add(new VersionContentCell(entry.getKey(), entry.getValue()));
public void add(final ContainerVersion version, final List<Document> documents, final Map<User, ArtifactReceipt> users, final User publishedBy) { this.versions.add(version); this.documents.put(version, documents); this.users.put(version, users); this.publishedBy.put(version, publishedBy); versionsModel.addElement(new VersionCell(MessageFormat.format( "Version - {0,date,MMM d, yyyy h:mm a} - {1}", version .getCreatedOn().getTime(), publishedBy.getName(), publishedBy.getTitle(), publishedBy.getOrganization()))); for (final Document document : documents) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", document.getName()))); } for (final Entry<User, ArtifactReceipt> entry : users.entrySet()) { if (null == entry.getValue()) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", entry.getKey().getName()))); } else { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format( "{0} - {1,date,MMM d, yyyy h:mm a}", entry .getKey().getName(), entry.getValue() .getReceivedOn().getTime()))); } } }
versionsModel.addElement(new VersionCell(contents, version, publishedBy));
public void add(final ContainerVersion version, final List<Document> documents, final Map<User, ArtifactReceipt> users, final User publishedBy) { this.versions.add(version); this.documents.put(version, documents); this.users.put(version, users); this.publishedBy.put(version, publishedBy); versionsModel.addElement(new VersionCell(MessageFormat.format( "Version - {0,date,MMM d, yyyy h:mm a} - {1}", version .getCreatedOn().getTime(), publishedBy.getName(), publishedBy.getTitle(), publishedBy.getOrganization()))); for (final Document document : documents) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", document.getName()))); } for (final Entry<User, ArtifactReceipt> entry : users.entrySet()) { if (null == entry.getValue()) { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format("{0}", entry.getKey().getName()))); } else { versionsContentModel.addElement(new VersionContentCell( MessageFormat.format( "{0} - {1,date,MMM d, yyyy h:mm a}", entry .getKey().getName(), entry.getValue() .getReceivedOn().getTime()))); } } }
if(isLastItem()) { return new LeftBottomRightBorder(new Color(107, 111, 115, 255));} else { return new LeftRightBorder(new Color(107, 111, 115, 255)); }
return BorderFactory.createEmptyBorder();
public Border getBorder() { if(isLastItem()) { return new LeftBottomRightBorder(new Color(107, 111, 115, 255));} else { return new LeftRightBorder(new Color(107, 111, 115, 255)); } }
public Float getTextInsetFactor() { return BrowserConstants.PHI; }
public Float getTextInsetFactor() { return 3.0F; }
public Float getTextInsetFactor() { return BrowserConstants.PHI; }
public Boolean isClosed() { return ArtifactUtil.isClosed(getId(), getType()); }
public Boolean isClosed() { return closed; }
public Boolean isClosed() { return ArtifactUtil.isClosed(getId(), getType()); }
} else if (state.isLogonAlreadySent() && state.isLogonTimedOut()) { getLog().onEvent("Timed out waiting for logon response");
state.incrNextTargetMsgSeqNum(); } } catch (FieldException e) { generateReject(message, e.getSessionRejectReason(), e.getField()); } catch (FieldNotFound e) { if (sessionID.getBeginString().compareTo(FixVersions.BEGINSTRING_FIX42) >= 0 && message.isApp()) { generateBusinessReject(message, BusinessRejectReason.CONDITIONALLY_REQUIRED_FIELD_MISSING, e.field); } else { generateReject(message, SessionRejectReason.REQUIRED_TAG_MISSING, e.field); if (msgType.equals(MsgType.LOGON)) { getLog().onEvent("Required field missing from logon"); disconnect(); } } } catch (IncorrectDataFormat e) { generateReject(message, SessionRejectReason.INCORRECT_DATA_FORMAT_FOR_VALUE, e.field); } catch (IncorrectTagValue e) { generateReject(message, SessionRejectReason.VALUE_IS_INCORRECT, e.field); } catch (InvalidMessage e) { getLog().onEvent("Skipping invalid message: " + e.getMessage()); } catch (RejectLogon e) { String rejectMessage = e.getMessage() != null ? (": " + e.getMessage()) : ""; getLog().onEvent("Logon rejected" + rejectMessage); if (e.isLogoutBeforeDisconnect()) { generateLogout(e.getMessage()); } disconnect(); } catch (UnsupportedMessageType e) { if (sessionID.getBeginString().compareTo(FixVersions.BEGINSTRING_FIX42) >= 0) { generateBusinessReject(message, BusinessRejectReason.UNSUPPORTED_MESSAGE_TYPE, 0); } else { generateReject(message, "Unsupported message type"); } } catch (UnsupportedVersion e) { if (msgType.equals(MsgType.LOGOUT)) { nextLogout(message); } else { generateLogout("Incorrect BeginString"); state.incrNextTargetMsgSeqNum();
public synchronized void next() throws IOException { if (!enabled) { if (isLoggedOn()) { if (!state.isLogoutSent()) { getLog().onEvent("Initiated logout request"); generateLogout(state.getLogoutReason()); } } else { return; } } if (!checkSessionTime()) { reset(); return; } if (!state.isLogonReceived()) { if (state.isLogonSendNeeded()) { if (generateLogon()) { getLog().onEvent("Initiated logon request"); } else { getLog().onEvent("Error during logon request initiation"); } } else if (state.isLogonAlreadySent() && state.isLogonTimedOut()) { getLog().onEvent("Timed out waiting for logon response"); disconnect(); } return; } if (state.getHeartBeatInterval() == 0) { return; } if (state.isLogoutTimedOut()) { getLog().onEvent("Timed out waiting for logout response"); disconnect(); } if (state.isWithinHeartBeat()) { return; } if (state.isTimedOut()) { getLog().onEvent("Timed out waiting for heartbeat"); disconnect(); } else { if (state.isTestRequestNeeded()) { generateTestRequest("TEST"); state.incrementTestRequestCounter(); getLog().onEvent("Sent test request TEST"); } else if (state.isHeartBeatNeeded()) { generateHeartbeat(); } } }
public RSS() { super("Crawler.RSS");
public RSS(String name, String hostname, Integer port) { super("RSS." + name, hostname, port);
public RSS() { super("Crawler.RSS"); poller = new Poller(1); }
public void airBrushReceiveMessage(Message msg) {
public boolean airBrushReceiveMessage(Message msg) { if (super.airBrushReceiveMessage(msg)) return true;
public void airBrushReceiveMessage(Message msg) { if (msg.type.equals("Feed.RSS")) { try { switchFeed(new URL(msg.content)); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
return false;
public void airBrushReceiveMessage(Message msg) { if (msg.type.equals("Feed.RSS")) { try { switchFeed(new URL(msg.content)); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
s.setID(item.getGuid().getLocation().replaceAll("[^\\p{Print}]", "")); s.setAuthor(item.getCreator().replaceAll("[^\\p{Print}]", "")); s.setTitle(item.getTitle().replaceAll("[^\\p{Print}]", "")); s.setContent(item.getDescription().replaceAll("[^\\p{Print}]", "")); s.setPublicationDate(item.getDate());
try { s.setID(item.getGuid().getLocation() .replaceAll("[^\\p{Print}]", "")); } catch (Exception e) { System.out.println("Something went wicked."); } try { s.setAuthor(item.getCreator().replaceAll("[^\\p{Print}]", "")); } catch (Exception e) { System.out.println("Something went wicked."); } try { s.setTitle(item.getTitle().replaceAll("[^\\p{Print}]", "")); } catch (Exception e) { System.out.println("Something went wicked."); } try { s.setContent(item.getDescription().replaceAll("[^\\p{Print}]", "")); } catch (Exception e) { System.out.println("Something went wicked."); } try { s.setPublicationDate(item.getDate()); } catch (Exception e) { System.out.println("Something went wicked."); }
private void handleItem(ItemIF item) { Story s = new Story(); s.setID(item.getGuid().getLocation().replaceAll("[^\\p{Print}]", "")); s.setAuthor(item.getCreator().replaceAll("[^\\p{Print}]", "")); s.setTitle(item.getTitle().replaceAll("[^\\p{Print}]", "")); s.setContent(item.getDescription().replaceAll("[^\\p{Print}]", "")); s.setPublicationDate(item.getDate()); Message msg = new Message(); msg.to = "WB.Stories"; msg.type = "Story"; msg.content = s.toYAML(); airBrush.postMessage(msg); }
public CrawlerObject(String moduleName) { super(moduleName);
public CrawlerObject(String moduleName, String hostname, Integer port) { super("Crawler." + moduleName, hostname, port);
public CrawlerObject(String moduleName) { super(moduleName); }
public void airBrushReceiveMessage(Message msg);
public boolean airBrushReceiveMessage(Message msg);
public void airBrushReceiveMessage(Message msg);
public void setPublicationDate(String value) {
public void setPublicationDate(Date value) {
public void setPublicationDate(String value) { setProperty(keyPublicationDate, value); }
final Calendar publishedOn) throws IOException {
final Calendar publishedOn) {
void publish(final ContainerVersion container, final Map<DocumentVersion, String> documents, final List<JabberId> publishTo, final JabberId publishedBy, final Calendar publishedOn) throws IOException { 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); }
logger.logInfo("Remote event {0}.", packet.getClass().getName());
protected <U extends AbstractThinkParityIQ> void addEventHandler( final XMPPEventHandler<U> eventHandler, final Class<? extends U> queryType) { xmppCore.addPacketListener( new PacketListener() { @SuppressWarnings("unchecked") public void processPacket(final Packet packet) { logger.logInfo("Remote event {0}.", packet.getClass().getName()); try { eventHandler.handleEvent((U) packet); } catch (final Throwable t) { throw translateError(t); } } }, new PacketTypeFilter(queryType)); }
public final void setParameter(final String listName, final String itemName, final List<JabberId> values) { final List<XMPPMethodParameter> parameters = new ArrayList<XMPPMethodParameter>(values.size()); for (final JabberId value : values) { parameters.add(new XMPPMethodParameter(itemName, JabberId.class, value)); } this.parameters.add(new XMPPMethodParameter(listName, List.class, parameters));
public final void setParameter(final String name, final ArtifactType value) { parameters.add(new XMPPMethodParameter(name, ArtifactType.class, value));
public final void setParameter(final String listName, final String itemName, final List<JabberId> values) { final List<XMPPMethodParameter> parameters = new ArrayList<XMPPMethodParameter>(values.size()); for (final JabberId value : values) { parameters.add(new XMPPMethodParameter(itemName, JabberId.class, value)); } this.parameters.add(new XMPPMethodParameter(listName, List.class, parameters)); }
datum = new Fixture(new UpstreamHandler(server, session, streamId, new FileInputStream(streamFile)));
datum = new Fixture(new UpstreamHandler(server, session, streamId, streamFile.length(), new FileInputStream(streamFile)));
protected void setUp() throws Exception { super.setUp(); final File workingDirectory = new File(getOutputDirectory(), "working"); Assert.assertTrue(workingDirectory.mkdir(), "Could not create directory {0}.", workingDirectory); final File streamFile = getInputFiles()[0]; final StreamServer server = startStreamServer(DesdemonaTestUser.JUNIT, workingDirectory); final StreamSession session = createSession(DesdemonaTestUser.JUNIT, server); final String streamId = createStream(server, session, streamFile.getName()); datum = new Fixture(new UpstreamHandler(server, session, streamId, new FileInputStream(streamFile))); }
protected File getOutputDirectory() {
protected File getOutputDirectory(final String child) {
protected File getOutputDirectory() { final File outputDirectory = new File(getTestSession().getOutputDirectory(), getName()); if (!outputDirectory.exists()) { Assert.assertTrue(outputDirectory.mkdir(), "Could not create directory {0}.", outputDirectory); } return outputDirectory; }
new File(getTestSession().getOutputDirectory(), getName());
new File(getOutputDirectory(), child);
protected File getOutputDirectory() { final File outputDirectory = new File(getTestSession().getOutputDirectory(), getName()); if (!outputDirectory.exists()) { Assert.assertTrue(outputDirectory.mkdir(), "Could not create directory {0}.", outputDirectory); } return outputDirectory; }
final InputStream input) {
final Long streamSize, final InputStream input) {
UpstreamHandler(final StreamServer streamServer, final StreamSession streamSession, final String streamId, final InputStream input) { super(); this.logger = new Log4JWrapper(); this.streamServer = streamServer; this.streamSession = streamSession; this.streamId = streamId; this.input = input; }
this.streamSize = streamSize;
UpstreamHandler(final StreamServer streamServer, final StreamSession streamSession, final String streamId, final InputStream input) { super(); this.logger = new Log4JWrapper(); this.streamServer = streamServer; this.streamSession = streamSession; this.streamId = streamId; this.input = input; }
StreamUtil.copy(input, output, streamSession.getBufferSize());
while((len = input.read(b)) > 0) { logger.logDebug("UPSTREAM RECEIVED {0}/{1}", total += len, streamSize); output.write(b, 0, len); output.flush(); }
public void run() { logger.logApiId(); try { final OutputStream output = streamServer.openOutputStream(streamSession, streamId); try { StreamUtil.copy(input, output, streamSession.getBufferSize()); } finally { output.close(); } } catch (final IOException iox) { throw new StreamException(iox); } }
output.flush();
public void run() { logger.logApiId(); try { final OutputStream output = streamServer.openOutputStream(streamSession, streamId); try { StreamUtil.copy(input, output, streamSession.getBufferSize()); } finally { output.close(); } } catch (final IOException iox) { throw new StreamException(iox); } }
nf = new DecimalFormat(format, new DecimalFormatSymbols(getLocale()));
nf = new DecimalFormat(format, new DecimalFormatSymbols(locale));
public NumberFormat getNumberFormat(String format, Locale locale) { if (format == null) { return null; } NumberFormat nf = null; int style = getStyleAsInt(format); if (style < 0) { // we have a custom format nf = new DecimalFormat(format, new DecimalFormatSymbols(getLocale())); } else { // we have a standard format nf = getNumberFormat(style, locale); } return nf; }
searchJTextFieldKeyTyped(e);
searchJTextFieldActionPerformed(e);
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) { searchJTextFieldKeyTyped(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); } }); searchLeftJLabel = LabelFactory.create(SEARCH_LEFT_ICON); searchLeftJLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(final MouseEvent e) { searchLeftJLabelMouseClicked(e); } }); searchRightJLabel = LabelFactory.create(SEARCH_RIGHT_ICON); final GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.EAST; c.insets.left = 167; 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()); }
searchLeftJLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(final MouseEvent e) { searchLeftJLabelMouseClicked(e); } });
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) { searchJTextFieldKeyTyped(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); } }); searchLeftJLabel = LabelFactory.create(SEARCH_LEFT_ICON); searchLeftJLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(final MouseEvent e) { searchLeftJLabelMouseClicked(e); } }); searchRightJLabel = LabelFactory.create(SEARCH_RIGHT_ICON); final GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.EAST; c.insets.left = 167; 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()); }
searchJTextFieldKeyTyped(e);
searchJTextFieldActionPerformed(e);
public void actionPerformed(final ActionEvent e) { searchJTextFieldKeyTyped(e); }
public void artifactClosed(final UUID artifactUniqueId);
public void artifactClosed(final UUID artifactUniqueId, final JabberId artifactClosedBy);
public void artifactClosed(final UUID artifactUniqueId);
public void setUtcTimeStamp(int field, Date value, boolean includeMilliseconds) { String s = FieldValueConverter.UtcTimestampConverter.convert(value, includeMilliseconds); setField(new StringField(field, s));
public void setUtcTimeStamp(int field, Date value) { setUtcTimeStamp(field, value, false);
public void setUtcTimeStamp(int field, Date value, boolean includeMilliseconds) { String s = FieldValueConverter.UtcTimestampConverter.convert(value, includeMilliseconds); setField(new StringField(field, s)); }
public void audit(final ArchiveEvent event) throws HypersonicException;
public void audit(final AddTeamMemberEvent event) throws HypersonicException;
public void audit(final ArchiveEvent event) throws HypersonicException;
logger.debug(toolTip.getSize()); logger.debug(toolTip.getLocation());
public void start() { logger.debug(toolTip.getSize()); logger.debug(toolTip.getLocation()); timer.start(); }
logger.debug(toolTip.getSize()); logger.debug(toolTip.getLocation());
public void stop() { logger.debug(toolTip.getSize()); logger.debug(toolTip.getLocation()); timer.stop(); }
protected User getUser(final String username) throws ParityException {
protected User getUser(final String simpleUsername) throws ParityException {
protected User getUser(final String username) throws ParityException { final SessionModel sessionModel = getSessionModel(); Assert.assertTrue("getUser(String)", sessionModel.isLoggedIn()); final Collection<User> rosterEntries = sessionModel.getRosterEntries(); for(User user : rosterEntries) { if(user.getUsername().equals(username)) { return user; } } return null; }
if(user.getUsername().equals(username)) { return user; }
if(user.getSimpleUsername().equals(simpleUsername)) { return user; }
protected User getUser(final String username) throws ParityException { final SessionModel sessionModel = getSessionModel(); Assert.assertTrue("getUser(String)", sessionModel.isLoggedIn()); final Collection<User> rosterEntries = sessionModel.getRosterEntries(); for(User user : rosterEntries) { if(user.getUsername().equals(username)) { return user; } } return null; }
this.comparator = new StringComparator(doCompareAscending);
NameComparator(final Boolean doCompareAscending) { super(doCompareAscending); }
public int compare(Artifact o1, Artifact o2) { final int compareResult = o1.getName().compareTo(o2.getName()); if(0 == compareResult) { return subCompare(o1, o2); } else { return compareResult * resultMultiplier; }
public int compare(final Artifact o1, final Artifact o2) { final int compareResult = comparator.compare(o1.getName(), o2.getName()); if (0 == compareResult) { return subCompare(o1, o2); } else { return compareResult; }
public int compare(Artifact o1, Artifact o2) { final int compareResult = o1.getName().compareTo(o2.getName()); if(0 == compareResult) { return subCompare(o1, o2); } else { return compareResult * resultMultiplier; } }
new Thread(new StreamSocketDelegate(streamServer, clientSockets.peek()), clientSockets.peek().getRemoteSocketAddress().toString()).start();
final StreamSocketDelegate delegate = new StreamSocketDelegate(streamServer, clientSockets.peek()); new Thread(delegate, delegate.getName()).start();
public void run() { logger.logApiId(); logger.logVariable("run", run); try { while (run) { started = true; synchronized (this) { notifyAll(); } // attempt to establish a socket connection try { clientSockets.push(serverSocket.accept()); } catch (final SocketException sx) { if ("Socket closed".equals(sx.getMessage())) { logger.logInfo("Stream socket server shutdown."); synchronized (this) { notifyAll(); } return; } else { throw sx; } } // use the socket delegate to handle the streaming try { new Thread(new StreamSocketDelegate(streamServer, clientSockets.peek()), clientSockets.peek().getRemoteSocketAddress().toString()).start(); } catch (final Throwable t) { logger.logError(t, "Failed to negotiate stream {0}.", clientSockets.peek().getRemoteSocketAddress()); } finally { clientSockets.pop(); } } } catch (final Throwable t) { logger.logFatal(t, "Fatal stream socket server error."); } }
this.logger = new Log4JWrapper();
StreamSocketDelegate(final StreamServer streamServer, final Socket socket) throws IOException { super(); this.socket = socket; this.streamServer = streamServer; }
g2.drawImage(Images.BrowserTitle.HALO, leftLocation.x - 6, leftLocation.y - 7, null);
g2.drawImage(Images.BrowserTitle.HALO, leftLocation.x - 4, leftLocation.y - 4, null);
protected void paintComponent(final Graphics g) { super.paintComponent(g); if (searchJTextField.hasFocus()) { final Graphics2D g2 = (Graphics2D) g.create(); try { final Point leftLocation = leftJLabel.getLocation(); g2.drawImage(Images.BrowserTitle.HALO, leftLocation.x - 6, leftLocation.y - 7, null); } finally { g2.dispose(); } } }
public static String extract(final JTextField jTextField) { synchronized(singletonLock) { return singleton.doExtract(jTextField); }
public static Boolean extract(final JCheckBox jCheckBox) { synchronized(singletonLock) { return singleton.doExtract(jCheckBox); }
public static String extract(final JTextField jTextField) { synchronized(singletonLock) { return singleton.doExtract(jTextField); } }
public FieldException(int sessionRejectReason, int field) {
public FieldException(int sessionRejectReason) {
public FieldException(int sessionRejectReason, int field) { this.sessionRejectReason = sessionRejectReason; this.field = field; }
this.field = field;
this.field = -1;
public FieldException(int sessionRejectReason, int field) { this.sessionRejectReason = sessionRejectReason; this.field = field; }
public static double convert(String value) throws FieldConvertError { try { Matcher matcher = doublePattern.matcher(value); if (!matcher.matches()) { throw new NumberFormatException(); } return Double.parseDouble(value); } catch (NumberFormatException e) { throw new FieldConvertError("invalid double value: " + value);
public static String convert(double d) { synchronized (doubleFormat) { return doubleFormat.format(d);
public static double convert(String value) throws FieldConvertError { try { Matcher matcher = doublePattern.matcher(value); if (!matcher.matches()) { throw new NumberFormatException(); } return Double.parseDouble(value); } catch (NumberFormatException e) { throw new FieldConvertError("invalid double value: " + value); } }
public static Date convert(String value) throws FieldConvertError { verifyFormat(value); String dateString = value.substring(0, 8); Calendar c = getCalendarForDay(value, dateString); long timeOffset = (parseLong(value.substring(9, 11)) * 3600000L) + (parseLong(value.substring(12, 14)) * 60000L) + (parseLong(value.substring(15, 17)) * 1000L); if (value.length() == 21) { timeOffset += parseLong(value.substring(18, 21)); } return new Date(c.getTimeInMillis() + timeOffset);
public static String convert(Date d, boolean includeMilliseconds) { return getFormatter(includeMilliseconds).format(d);
public static Date convert(String value) throws FieldConvertError { verifyFormat(value); String dateString = value.substring(0, 8); Calendar c = getCalendarForDay(value, dateString); long timeOffset = (parseLong(value.substring(9, 11)) * 3600000L) + (parseLong(value.substring(12, 14)) * 60000L) + (parseLong(value.substring(15, 17)) * 1000L); if (value.length() == 21) { timeOffset += parseLong(value.substring(18, 21)); } return new Date(c.getTimeInMillis() + timeOffset); }
reloadKeys();
public void reload() { jListModel.clear(); reloadKeys(); reloadSystemMessages(); reloadDocuments(); }