Examples of EntityImpl


Examples of com.sun.org.apache.xerces.internal.dom.EntityImpl

        // don't add parameter entities!
        if(name.startsWith ("%"))
            return;
        if (fDocumentType != null) {
            NamedNodeMap entities = fDocumentType.getEntities ();
            EntityImpl entity = (EntityImpl)entities.getNamedItem (name);
            if (entity == null) {
                entity = (EntityImpl)fDocumentImpl.createEntity (name);
                entity.setBaseURI ((String)fBaseURIStack.peek ());
                entities.setNamedItem (entity);
            }
        }

        // create deferred node
View Full Code Here

Examples of mf.org.apache.xerces.dom.EntityImpl

            NamedNodeMap oldMap = node.getEntities();
            NamedNodeMap newMap = docType.getEntities();
            int length = oldMap.getLength();
            for (int i = 0; i < length; ++i) {
                Entity oldEntity = (Entity) oldMap.item(i);
                EntityImpl newEntity = (EntityImpl) fDocumentImpl.createEntity(oldEntity.getNodeName());
                newEntity.setPublicId(oldEntity.getPublicId());
                newEntity.setSystemId(oldEntity.getSystemId());
                newEntity.setNotationName(oldEntity.getNotationName());
                newMap.setNamedItem(newEntity);
            }
            /** Copy notations. */
            oldMap = node.getNotations();
            newMap = docType.getNotations();
View Full Code Here

Examples of mf.org.apache.xerces.dom.EntityImpl

        // don't add parameter entities!
        if(name.startsWith ("%"))
            return;
        if (fDocumentType != null) {
            NamedNodeMap entities = fDocumentType.getEntities ();
            EntityImpl entity = (EntityImpl)entities.getNamedItem (name);
            if (entity == null) {
                entity = (EntityImpl)fDocumentImpl.createEntity (name);
                entity.setBaseURI ((String)fBaseURIStack.peek ());
                entities.setNamedItem (entity);
            }
        }

        // create deferred node
View Full Code Here

Examples of mf.org.apache.xerces.dom.EntityImpl

        // don't add parameter entities!
        if(name.startsWith ("%"))
            return;
        if (fDocumentType != null) {
            NamedNodeMap entities = fDocumentType.getEntities ();
            EntityImpl entity = (EntityImpl)entities.getNamedItem (name);
            if (entity == null) {
                entity = (EntityImpl)fDocumentImpl.createEntity (name);
                entity.setPublicId (publicId);
                entity.setSystemId (literalSystemId);
                entity.setBaseURI (identifier.getBaseSystemId ());
                entities.setNamedItem (entity);
            }
        }

        // create deferred node
View Full Code Here

Examples of mf.org.apache.xerces.dom.EntityImpl

        //       that functionality. -Ac

        // create full node
        if (fDocumentType != null) {
            NamedNodeMap entities = fDocumentType.getEntities ();
            EntityImpl entity = (EntityImpl)entities.getNamedItem (name);
            if (entity == null) {
                entity = (EntityImpl)fDocumentImpl.createEntity (name);
                entity.setPublicId (publicId);
                entity.setSystemId (literalSystemId);
                entity.setNotationName (notation);
                entity.setBaseURI (identifier.getBaseSystemId ());
                entities.setNamedItem (entity);
            }
        }

        // create deferred node
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.model.impl.EntityImpl

        return searchConfiguration.getEntityType();
    }

    protected EntityImpl internalCreateEntity(String entityId, String internalId, Set<Attribute> attributes)
    {
        EntityImpl entity = new EntityImpl(searchConfiguration.getEntityType(), entityId, searchConfiguration.getAttributeDefinitionsMap());
        entity.setAttributes(attributes);
        if (internalId != null)
        {
            entity.setInternalId(internalId);
        }
        return entity;
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.core.model.EntityImpl

                try {
                    // When using the Cache, directly get the representations!
                    QueryResultList<Representation> representations = cache.findRepresentation((query));
                    results = new ArrayList<Entity>(representations.size());
                    for (Representation result : representations) {
                        Entity entity = new EntityImpl(getId(), result, null);
                        results.add(entity);
                        initEntityMetadata(entity, siteMetadata,
                            singletonMap(RdfResourceEnum.isChached.getUri(), (Object) Boolean.TRUE));
                    }
                    return new QueryResultListImpl<Entity>(query, results, Entity.class);
                } catch (YardException e) {
                    if (siteConfiguration.getEntitySearcherType() == null || isOfflineMode()) {
                        throw new SiteException("Unable to execute query on Cache "
                                + siteConfiguration.getCacheId(), e);
                    } else {
                        log.warn(
                            String.format(
                                "Error while performing query on Cache %s! Try to use remote site %s as fallback!",
                                siteConfiguration.getCacheId(), siteConfiguration.getQueryUri()), e);
                    }
                }
            } else {
                if (siteConfiguration.getEntitySearcherType() == null || isOfflineMode()) {
                    throw new SiteException(String.format(
                        "Unable to execute query on Cache %s because it is currently not active",
                        siteConfiguration.getCacheId()));
                } else {
                    log.warn(String.format(
                        "Cache %s currently not active will query remote Site %s as fallback",
                        siteConfiguration.getCacheId(), siteConfiguration.getQueryUri()));
                }
            }
        }
        QueryResultList<String> entityIds;
        if (entitySearcher == null) {
            throw new SiteException(String.format("EntitySearcher %s not available for remote site %s!",
                siteConfiguration.getEntitySearcherType(), siteConfiguration.getQueryUri()));
        }
        ensureOnline(siteConfiguration.getQueryUri(), entitySearcher.getClass());
        try {
            log.trace("Will use an entity-searcher [type :: {}][query-uri :: {}].", entitySearcher.getClass()
                    .toString(), EntitySearcher.QUERY_URI);
            entityIds = entitySearcher.findEntities(query);
        } catch (IOException e) {
            throw new SiteException(String.format(
                "Unable to execute query on remote site %s with entitySearcher %s!",
                siteConfiguration.getQueryUri(), siteConfiguration.getEntitySearcherType()), e);
        }
        int numResults = entityIds.size();
        List<Entity> entities = new ArrayList<Entity>(numResults);
        int errors = 0;
        SiteException lastError = null;
        for (String id : entityIds) {
            Entity entity;
            try {
                entity = getEntity(id);
                if (entity == null) {
                    log.warn("Unable to create Entity for ID that was selected by an FieldQuery (id=" + id
                            + ")");
                }
                entities.add(entity);
                // use the position in the list as resultSocre
                entity.getRepresentation().set(RdfResourceEnum.resultScore.getUri(),
                    Float.valueOf((float) numResults));
            } catch (SiteException e) {
                lastError = e;
                errors++;
                log.warn(String
View Full Code Here

Examples of org.apache.vysper.xmpp.addressing.EntityImpl

                Occupant sendingOccupant = room.findOccupantByJID(from);
               
                // sender must be participant in room
                if(sendingOccupant != null) {
                   
                    Entity roomAndSendingNick = new EntityImpl(room.getJID(), sendingOccupant.getName());
                    if(sendingOccupant.hasVoice()) {
                        // relay message to all occupants in room
                       
                        try {
                            if(stanza.getSubjects() != null && !stanza.getSubjects().isEmpty()) {
                                // subject message
                                if(!room.isRoomType(RoomType.OpenSubject) && !sendingOccupant.isModerator()) {
                                    // room only allows moderators to change the subject, and sender is not a moderator
                                    return createMessageErrorStanza(room.getJID(), from, stanza.getID(), StanzaErrorType.AUTH, StanzaErrorCondition.FORBIDDEN, stanza);
                                }
                            }
                        } catch (XMLSemanticError e) {
                            // not a subject message, ignore exception
                        }
                       
                        logger.debug("Relaying message to all room occupants");
                        for(Occupant occupent : room.getOccupants()) {
                            logger.debug("Relaying message to  {}", occupent);
                            List<Attribute> replaceAttributes = new ArrayList<Attribute>();
                            replaceAttributes.add(new Attribute("from", roomAndSendingNick.getFullQualifiedName()));
                            replaceAttributes.add(new Attribute("to", occupent.getJid().getFullQualifiedName()));
                           
                            relayStanza(occupent.getJid(),
                                    StanzaBuilder.createClone(stanza, true, replaceAttributes).build(),
                                    serverRuntimeContext);
                           
                        }
                       
                        // add to discussion history
                        room.getHistory().append(stanza, sendingOccupant);
                    } else {
                        return createMessageErrorStanza(room.getJID(), from, stanza.getID(), StanzaErrorType.MODIFY, StanzaErrorCondition.FORBIDDEN, stanza);
                    }
                } else {
                    return createMessageErrorStanza(room.getJID(), from, stanza.getID(), StanzaErrorType.MODIFY, StanzaErrorCondition.NOT_ACCEPTABLE, stanza);
                }
            } else {
                return createMessageErrorStanza(moduleDomain, from, stanza.getID(), StanzaErrorType.MODIFY, StanzaErrorCondition.ITEM_NOT_FOUND, stanza);
            }
        } else if(type == null  || type == MessageStanzaType.CHAT || type == MessageStanzaType.NORMAL) {
            // private message
            logger.debug("Received direct message to {}", roomWithNickJid);
            Room room = conference.findRoom(roomJid);
            if(room != null) {
                Occupant sendingOccupant = room.findOccupantByJID(from);
               
                // sender must be participant in room
                    if(roomWithNickJid.isResourceSet()) {
                        if(sendingOccupant != null) {
                            // got resource, private message for occupant
                            Occupant receivingOccupant = room.findOccupantByNick(roomWithNickJid.getResource());
                           
                            // must be sent to an existing occupant in the room
                            if(receivingOccupant != null) {
                               
                                Entity roomAndSendingNick = new EntityImpl(room.getJID(), sendingOccupant.getName());
                                logger.debug("Relaying message to  {}", receivingOccupant);
                                List<Attribute> replaceAttributes = new ArrayList<Attribute>();
                                replaceAttributes.add(new Attribute("from", roomAndSendingNick.getFullQualifiedName()));
                                replaceAttributes.add(new Attribute("to", receivingOccupant.getJid().getFullQualifiedName()));
                               
                                relayStanza(receivingOccupant.getJid(),
                                        StanzaBuilder.createClone(stanza, true, replaceAttributes).build(),
                                        serverRuntimeContext);
View Full Code Here

Examples of org.apache.vysper.xmpp.addressing.EntityImpl

        // TODO is this the right way to determine if the room is private?
        if(isRoomType(RoomType.FullyAnonymous) || isRoomType(RoomType.SemiAnonymous)) {
            // private room, return empty list
        } else {
            for(Occupant occupant : getOccupants()) {
                items.add(new Item(new EntityImpl(getJID(), occupant.getName())));
            }
        }
        return items;
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.addressing.EntityImpl

    }

    public Stanza started(SessionContext sessionContext, SessionStateHolder sessionStateHolder, Stanza authStanza) {

        // assign a self-created node name
        EntityImpl initiatingEntity = new EntityImpl(uuidGenerator.create(), sessionContext.getServerJID().getDomain(), null);
        sessionContext.setInitiatingEntity(initiatingEntity);

        sessionStateHolder.setState(SessionState.AUTHENTICATED);
        return new AuthorizationResponses().getSuccess();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.