Package rocks.xmpp.core.stanza.model

Examples of rocks.xmpp.core.stanza.model.AbstractPresence$Status


  private GetObjectExtendedResponse toGetObjectExtendedResponse(S3GetObjectResponse engineResponse) {
    GetObjectExtendedResponse response = new GetObjectExtendedResponse();
    int resultCode = engineResponse.getResultCode();

    GetObjectResult result = new GetObjectResult();
    Status param1 = new Status();
    param1.setCode( resultCode );
    param1.setDescription( engineResponse.getResultDescription());
    result.setStatus( param1 );

    if ( 200 == resultCode || 206 == resultCode )
    {
         result.setData(engineResponse.getData());
View Full Code Here


    return request;
  }
 
  private DeleteObjectResponse toDeleteObjectResponse(S3Response engineResponse) {
    DeleteObjectResponse response = new DeleteObjectResponse();
    Status status = new Status();
    status.setCode(engineResponse.getResultCode());
    status.setDescription(engineResponse.getResultDescription());
    response.setDeleteObjectResponse(status);
    return response;
  }
View Full Code Here

    /**
     * Stores the current state machine configuration ({@link Status#getAllStates()}) in the system context.
     * @param scInstance the state machine instance holding the current configuration
     */
    public void setSystemAllStatesVariable(final SCInstance scInstance) {
        Status currentStatus = scInstance.getCurrentStatus();
        scInstance.getSystemContext().setLocal(SCXMLSystemContext.ALL_STATES_KEY, currentStatus.getAllStates());
    }
View Full Code Here

            request.setAuthentication(authentication);

            RecoverKeyBinding keyBinding = createRecoverKeyBinding();
            keyBinding.setKeyName(alias);

            Status status = new Status();
            status.setStatusValue(StatusValue.INDETERMINATE);
            keyBinding.setStatus(status);

            request.setRecoverKeyBinding(keyBinding);

            request.addRespondWith(RespondWith.PRIVATE_KEY);
View Full Code Here

            ValidateResult validateResult = getValidateResult(result);
            List keybinds = validateResult.getKeyBindingList();
            KeyBinding keybinding = (KeyBinding) keybinds.get(0);

            Status status = keybinding.getStatus();

            return StatusValue.VALID.equals(status.getStatusValue());

        } catch (Exception ex) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("", ex);
            }
View Full Code Here

        kb.setValidityInterval(notBefore, notAfter);
    }

    private void addStatus(boolean valid, KeyBinding kb) {
        Status status = new Status();
        status
                .setStatusValue((valid) ? StatusValue.VALID
                        : StatusValue.INVALID);
        if (valid) {
            status.addValidReason(ValidReason.ISSUER_TRUST);
            status.addValidReason(ValidReason.REVOCATION_STATUS);
            status.addValidReason(ValidReason.SIGNATURE);
            status.addValidReason(ValidReason.VALIDITY_INTERVAL);
        } else {
            status.addInvalidReason(InvalidReason.ISSUER_TRUST);
            status.addInvalidReason(InvalidReason.REVOCATION_STATUS);
            status.addInvalidReason(InvalidReason.SIGNATURE);
            status.addInvalidReason(InvalidReason.VALIDITY_INTERVAL);
        }
        kb.setStatus(status);
    }
View Full Code Here

        xmppSession.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                if (e.isIncoming()) {
                    // A client SHOULD "unlock" after having received a <message/> or <presence/> stanza from any other resource controlled by the peer (or a presence stanza from the locked resource); as a result, it SHOULD address its next message(s) in the chat session to the bare JID of the peer (thus "unlocking" the previous "lock") until it receives a message from one of the peer's full JIDs.
                    AbstractPresence presence = e.getPresence();
                    synchronized (chatSessions) {
                        Jid contact = presence.getFrom().asBareJid();
                        if (chatSessions.containsKey(contact)) {
                            for (ChatSession chatSession : chatSessions.get(contact).values()) {
                                chatSession.chatPartner = contact;
                            }
                        }
View Full Code Here

        });
        xmppSession.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                if (!e.isIncoming() && isEnabled()) {
                    AbstractPresence presence = e.getPresence();
                    if (presence.getTo() == null) {
                        synchronized (LastActivityManager.this) {
                            // If an available presence with <show/> value 'away' or 'xa' is sent, append last activity information.
                            if (lastActivityStrategy != null && lastActivityStrategy.getLastActivity() != null && presence.isAvailable() && (presence.getShow() == AbstractPresence.Show.AWAY || presence.getShow() == AbstractPresence.Show.XA) && presence.getExtension(LastActivity.class) == null) {
                                presence.getExtensions().add(new LastActivity(getSecondsSince(lastActivityStrategy.getLastActivity()), presence.getStatus()));
                            }
                        }
                    }
                }
            }
View Full Code Here

                }
            });
            xmppSession.addPresenceListener(new PresenceListener() {
                @Override
                public void handle(PresenceEvent e) {
                    AbstractPresence presence = e.getPresence();
                    if (!e.isIncoming() && (!presence.isAvailable() || presence.getShow() != AbstractPresence.Show.AWAY && presence.getShow() != AbstractPresence.Show.XA)) {
                        lastActivity = new Date();
                    }
                }
            });
        }
View Full Code Here

        });

        xmppSession.addPresenceListener(new PresenceListener() {
            @Override
            public void handle(PresenceEvent e) {
                AbstractPresence presence = e.getPresence();
                if (e.isIncoming()) {
                    boolean hasReachability = checkStanzaForReachabilityAndNotify(presence);
                    Jid contact = presence.getFrom().asBareJid();
                    if (!hasReachability && reachabilities.remove(contact) != null) {
                        // If no reachability was found in presence, check, if the contact has previously sent any reachability via presence.
                        notifyReachabilityListeners(contact, new ArrayList<Address>());
                    }
                } else {
                    if (presence.isAvailable() && presence.getTo() == null) {
                        synchronized (addresses) {
                            if (!addresses.isEmpty()) {
                                presence.getExtensions().add(new Reachability(new ArrayList<>(addresses)));
                            }
                        }
                    }
                }
            }
View Full Code Here

TOP

Related Classes of rocks.xmpp.core.stanza.model.AbstractPresence$Status

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