Examples of Registry


Examples of org.objectweb.speedo.pobjects.map.Registry

    protected String getLoggerName() {
        return LOG_NAME + ".rt.map.TestMap";
    }

    public void testCreation1() {
        Registry r1 = new Registry("r1");
        Registry r2 = new Registry("r2");
        Registry r3 = new Registry("r3");
        r1.bind("a", r2);
        r1.bind("b", r3);

        PersistenceManager pm = pmf.getPersistenceManager();
        pm.makePersistent(r1);
View Full Code Here

Examples of org.openide.windows.TopComponent.Registry

        runInEventDispatchThread(new Runnable() {

            public void run() {
                windows = WindowManager.getDefault();
                Registry reg = windows.getRegistry();
                JFrame frame = (JFrame) windows.getMainWindow();
                JRootPane pane = frame.getRootPane();
                JLayeredPane layered = pane.getLayeredPane();
                Object[] comps = layered.getComponents();
                for (int i = 0; i < comps.length; i++) {
View Full Code Here

Examples of org.openmhealth.reference.data.Registry

      // Set the status and return the error message.
      response.setStatus(oauthResponse.getResponseStatus());
      return oauthResponse.getBody();
    }
    // Validate the scopes.
    Registry registry = Registry.getInstance();
    for(String scope : scopes) {
      if(registry.getSchemas(scope, null, 0, 1).size() != 1) {
        // Create the OAuth response.
        OAuthResponse oauthResponse =
          OAuthASResponse
            .errorResponse(HttpServletResponse.SC_BAD_REQUEST)
            .setError(CodeResponse.INVALID_SCOPE)
View Full Code Here

Examples of org.openqa.grid.internal.Registry

                if (HubHolder.hub == null) {
                    return Collections.emptyList();
                }

                Registry registry = HubHolder.hub.getRegistry();
                if (registry != null) {
                    for (RemoteProxy proxy : registry.getAllProxies()) {
                        for (TestSlot slot : proxy.getTestSlots()) {
                            URL host = slot.getProxy().getRemoteHost();
                            SeleniumTestSlotGroup grp = groups.get(host);
                            if (grp == null) {
                                grp = new SeleniumTestSlotGroup(host);
View Full Code Here

Examples of org.projectforge.registry.Registry

    }
  }

  public HibernateSearchDependentObjectsReindexer()
  {
    final Registry registry = Registry.instance();
    for (final RegistryEntry registryEntry : registry.getOrderedList()) {
      register(registryEntry);
    }
  }
View Full Code Here

Examples of org.simpleframework.xml.convert.Registry

    /*
     * ##################### Import Configs
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      registry.bind(Date.class, DateConverter.class);
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
     
      List<Configuration> list = readList(serializer, f, "configs.xml", "configs", Configuration.class, true);
      for (Configuration c : list) {
        if (c.getConf_key() == null || c.getDeleted()) {
          continue;
        }
        Configuration cfg = configurationDao.forceGet(c.getConf_key());
        if (cfg != null && !cfg.getDeleted()) {
          log.warn("Non deleted configuration with same key is found! old value: {}, new value: {}", cfg.getConf_value(), c.getConf_value());
        }
        c.setConfiguration_id(cfg == null ? null : cfg.getConfiguration_id());
        if (c.getUser() != null && c.getUser().getUser_id() == null) {
          c.setUser(null);
        }
        if (CONFIG_CRYPT_KEY.equals(c.getConf_key())) {
          try {
            Class.forName(c.getConf_value());
          } catch (ClassNotFoundException e) {
            c.setConf_value(MD5Implementation.class.getCanonicalName());
          }
        }
        configurationDao.update(c, null);
      }
    }

    log.info("Configs import complete, starting organization import");
    /*
     * ##################### Import Organizations
     */
    Serializer simpleSerializer = new Persister();
    {
      List<Organisation> list = readList(simpleSerializer, f, "organizations.xml", "organisations", Organisation.class);
      for (Organisation o : list) {
        long oldId = o.getOrganisation_id();
        o.setOrganisation_id(null);
        o = organisationDao.update(o, null);
        organisationsMap.put(oldId, o.getOrganisation_id());
      }
    }

    log.info("Organizations import complete, starting user import");
    /*
     * ##################### Import Users
     */
    {
      String jNameTimeZone = configurationDao.getConfValue("default.timezone", String.class, "Europe/Berlin");
      List<User> list = readUserList(f, "users.xml", "users");
      int minLoginLength = getMinLoginLength(configurationDao);
      for (User u : list) {
        if (u.getLogin() == null) {
          continue;
        }
        if (u.getType() == Type.contact && u.getLogin().length() < minLoginLength) {
          u.setLogin(UUID.randomUUID().toString());
        }
        //FIXME: OPENMEETINGS-750
        //Convert old Backups with OmTimeZone to new schema
       
        String tz = u.getTimeZoneId();
        if (tz == null) {
          u.setTimeZoneId(jNameTimeZone);
          u.setForceTimeZoneCheck(true);
        } else {
          u.setForceTimeZoneCheck(false);
        }
       
        u.setStarttime(new Date());
        long userId = u.getUser_id();
        u.setUser_id(null);
        if (u.getSipUser() != null && u.getSipUser().getId() != 0) {
          u.getSipUser().setId(0);
        }
        usersDao.update(u, -1L);
        usersMap.put(userId, u.getUser_id());
      }
    }

    log.info("Users import complete, starting room import");
    /*
     * ##################### Import Rooms
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
      registry.bind(RoomType.class, new RoomTypeConverter(roomTypeDao));
     
      List<Room> list = readList(serializer, f, "rooms.xml", "rooms", Room.class);
      for (Room r : list) {
        Long roomId = r.getRooms_id();

        // We need to reset ids as openJPA reject to store them otherwise
        r.setRooms_id(null);
        if (r.getModerators() != null) {
          for (Iterator<RoomModerator> i = r.getModerators().iterator(); i.hasNext();) {
            RoomModerator rm = i.next();
            if (rm.getUser().getUser_id() == null) {
              i.remove();
            }
          }
        }
        r = roomDao.update(r, null);
        roomsMap.put(roomId, r.getRooms_id());
      }
    }

    log.info("Room import complete, starting room organizations import");
    /*
     * ##################### Import Room Organisations
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      Serializer serializer = new Persister(strategy);
 
      registry.bind(Organisation.class, new OrganisationConverter(orgDao, organisationsMap));
      registry.bind(Room.class, new RoomConverter(roomDao, roomsMap));
     
      List<RoomOrganisation> list = readList(serializer, f, "rooms_organisation.xml", "room_organisations", RoomOrganisation.class);
      for (RoomOrganisation ro : list) {
        if (!ro.getDeleted()) {
          // We need to reset this as openJPA reject to store them otherwise
          ro.setRooms_organisation_id(null);
          roomOrganisationDao.update(ro, null);
        }
      }
    }

    log.info("Room organizations import complete, starting chat messages import");
    /*
     * ##################### Import Chat messages
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      Serializer serializer = new Persister(strategy);
 
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
      registry.bind(Room.class, new RoomConverter(roomDao, roomsMap));
     
      List<ChatMessage> list = readList(serializer, f, "chat_messages.xml", "chat_messages", ChatMessage.class, true);
      for (ChatMessage m : list) {
        chatDao.update(m);
      }
    }
   
    log.info("Chat messages import complete, starting appointement import");
    /*
     * ##################### Import Appointements
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      Serializer serializer = new Persister(strategy);
 
      registry.bind(AppointmentCategory.class, new AppointmentCategoryConverter(appointmentCategoryDaoImpl));
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
      registry.bind(AppointmentReminderTyps.class, new AppointmentReminderTypeConverter(appointmentReminderTypDaoImpl));
      registry.bind(Room.class, new RoomConverter(roomDao, roomsMap));
      registry.bind(Date.class, DateConverter.class);
     
      List<Appointment> list = readList(serializer, f, "appointements.xml", "appointments", Appointment.class);
      for (Appointment a : list) {
        Long appId = a.getId();

        // We need to reset this as openJPA reject to store them otherwise
        a.setId(null);
        if (a.getOwner() != null && a.getOwner().getUser_id() == null) {
          a.setOwner(null);
        }
        if (a.getRoom() != null && a.getRoom().getRooms_id() == null) {
          a.setRoom(null);
        }
        Long newAppId = appointmentDao.addAppointmentObj(a);
        appointmentsMap.put(appId, newAppId);
      }
    }

    log.info("Appointement import complete, starting meeting members import");
    /*
     * ##################### Import MeetingMembers
     *
     * Reminder Invitations will be NOT send!
     */
    {
      List<MeetingMember> list = readMeetingMemberList(f, "meetingmembers.xml", "meetingmembers");
      for (MeetingMember ma : list) {
        meetingMemberDao.update(ma);
      }
    }

    log.info("Meeting members import complete, starting ldap config import");
    /*
     * ##################### Import LDAP Configs
     */
    {
      List<LdapConfig> list = readList(simpleSerializer, f, "ldapconfigs.xml", "ldapconfigs", LdapConfig.class, true);
      for (LdapConfig c : list) {
        ldapConfigDao.addLdapConfigByObject(c);
      }
    }

    log.info("Ldap config import complete, starting cluster servers import");
    /*
     * ##################### Cluster servers
     */
    {
      List<Server> list = readList(simpleSerializer, f, "servers.xml", "servers", Server.class, true);
      for (Server s : list) {
        serverDao.update(s, null);
      }
    }

    log.info("Cluster servers import complete, starting OAuth2 servers import");
    /*
     * ##################### OAuth2 servers
     */
    {
      List<OAuthServer> list = readList(simpleSerializer, f, "oauth2servers.xml", "oauth2servers", OAuthServer.class, true);
      for (OAuthServer s : list) {
        auth2Dao.update(s, null);
      }
    }

    log.info("OAuth2 servers import complete, starting recordings import");
    /*
     * ##################### Import Recordings
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(Date.class, DateConverter.class);
     
      List<FlvRecording> list = readList(serializer, f, "flvRecordings.xml", "flvrecordings", FlvRecording.class, true);
      for (FlvRecording fr : list) {
        fr.setFlvRecordingId(0);
        if (fr.getRoom_id() != null) {
          fr.setRoom_id(roomsMap.get(fr.getRoom_id()));
        }
        if (fr.getOwnerId() != null) {
          fr.setOwnerId(usersMap.get(fr.getOwnerId()));
        }
        if (fr.getFlvRecordingMetaData() != null) {
          for (FlvRecordingMetaData meta : fr.getFlvRecordingMetaData()) {
            meta.setFlvRecordingMetaDataId(0);
            meta.setFlvRecording(fr);
          }
        }
        flvRecordingDao.update(fr);
      }
    }

    log.info("FLVrecording import complete, starting private message folder import");
    /*
     * ##################### Import Private Message Folders
     */
    {
      List<PrivateMessageFolder> list = readList(simpleSerializer, f, "privateMessageFolder.xml"
        , "privatemessagefolders", PrivateMessageFolder.class, true);
      for (PrivateMessageFolder p : list) {
        Long folderId = p.getPrivateMessageFolderId();
        PrivateMessageFolder storedFolder = privateMessageFolderDao.get(folderId);
        if (storedFolder == null) {
          p.setPrivateMessageFolderId(0);
          Long newFolderId = privateMessageFolderDao.addPrivateMessageFolderObj(p);
          messageFoldersMap.put(folderId, newFolderId);
        }
      }
    }

    log.info("Private message folder import complete, starting user contacts import");
    /*
     * ##################### Import User Contacts
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      Serializer serializer = new Persister(strategy);
 
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
     
      List<UserContact> list = readList(serializer, f, "userContacts.xml", "usercontacts", UserContact.class, true);
      for (UserContact uc : list) {
        Long ucId = uc.getUserContactId();
        UserContact storedUC = userContactsDao.get(ucId);

        if (storedUC == null && uc.getContact() != null && uc.getContact().getUser_id() != null) {
          uc.setUserContactId(0);
          if (uc.getOwner() != null && uc.getOwner().getUser_id() == null) {
            uc.setOwner(null);
          }
          Long newId = userContactsDao.addUserContactObj(uc);
          userContactsMap.put(ucId, newId);
        }
      }
    }

    log.info("Usercontact import complete, starting private messages item import");
    /*
     * ##################### Import Private Messages
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      Serializer serializer = new Persister(strategy);
 
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
      registry.bind(Room.class, new RoomConverter(roomDao, roomsMap));
      registry.bind(Date.class, DateConverter.class);
     
      List<PrivateMessage> list = readList(serializer, f, "privateMessages.xml", "privatemessages", PrivateMessage.class, true);
      boolean oldBackup = true;
      for (PrivateMessage p : list) {
        if (p.getFolderId() < 0) {
          oldBackup = false;
          break;
        }
       
      }
      for (PrivateMessage p : list) {
        p.setId(0);
        p.setFolderId(getNewId(p.getFolderId(), Maps.MESSAGEFOLDERS));
        p.setUserContactId(getNewId(p.getUserContactId(), Maps.USERCONTACTS));
        if (p.getRoom() != null && p.getRoom().getRooms_id() == null) {
          p.setRoom(null);
        }
        if (p.getTo() != null && p.getTo().getUser_id() == null) {
          p.setTo(null);
        }
        if (p.getFrom() != null && p.getFrom().getUser_id() == null) {
          p.setFrom(null);
        }
        if (p.getOwner() != null && p.getOwner().getUser_id() == null) {
          p.setOwner(null);
        }
        if (oldBackup && p.getOwner() != null && p.getOwner().getUser_id() != null
            && p.getFrom() != null && p.getFrom().getUser_id() != null
            && p.getOwner().getUser_id() == p.getFrom().getUser_id())
        {
          p.setFolderId(SENT_FOLDER_ID);
        }
        privateMessagesDao.update(p, null);
      }
    }

    log.info("Private message import complete, starting file explorer item import");
    /*
     * ##################### Import File-Explorer Items
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(Date.class, DateConverter.class);
     
      List<FileExplorerItem> list = readList(serializer, f, "fileExplorerItems.xml", "fileExplorerItems", FileExplorerItem.class, true);
      for (FileExplorerItem file : list) {
        // We need to reset this as openJPA reject to store them otherwise
        file.setFileExplorerItemId(0);
        Long roomId = file.getRoom_id();
        file.setRoom_id(roomsMap.containsKey(roomId) ? roomsMap.get(roomId) : null);
        if (file.getOwnerId() != null) {
          file.setOwnerId(usersMap.get(file.getOwnerId()));
        }
        fileExplorerItemDao.addFileExplorerItem(file);
      }
    }

    log.info("File explorer item import complete, starting file poll import");
    /*
     * ##################### Import Room Polls
     */
    {
      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);
 
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
      registry.bind(Room.class, new RoomConverter(roomDao, roomsMap));
      registry.bind(PollType.class, new PollTypeConverter(pollManager));
      registry.bind(Date.class, DateConverter.class);
     
      List<RoomPoll> list = readList(serializer, f, "roompolls.xml", "roompolls", RoomPoll.class, true);
      for (RoomPoll rp : list) {
        if (rp.getRoom() == null || rp.getRoom().getRooms_id() == null) {
          //room was deleted
View Full Code Here

Examples of org.wso2.carbon.registry.api.Registry

                String errMsg = "Exception while parsing policy: " + path;
                log.error(errMsg, e);
                throw new AxisFault(errMsg, e);
            }
        } else if (path.startsWith(UnifiedEndpointConstants.VIRTUAL_GOV_REG)) {
            Registry reg = SuperTenantCarbonContext.getCurrentContext(
                    msgContext.getConfigurationContext()).
                    getRegistry(RegistryType.SYSTEM_GOVERNANCE);
            path = path.substring(UnifiedEndpointConstants.VIRTUAL_GOV_REG.length());
            try {
                if (reg.resourceExists(path)) {
                    Resource policyResource = reg.get(path);
                    policyDoc = PolicyEngine.getPolicy(policyResource.getContentStream());
                }
            } catch (RegistryException e) {
                String errMsg = "Exception while loading policy from Governance registry: " + path;
                log.error(errMsg, e);
                throw new AxisFault(errMsg, e);
            }
        } else if (path.startsWith(UnifiedEndpointConstants.VIRTUAL_CONF_REG)) {
            Registry reg = SuperTenantCarbonContext.getCurrentContext(
                    msgContext.getConfigurationContext()).
                    getRegistry(RegistryType.SYSTEM_CONFIGURATION);
            path = path.substring(UnifiedEndpointConstants.VIRTUAL_CONF_REG.length());
            try {
                if (reg.resourceExists(path)) {
                    Resource policyResource = reg.get(path);
                    policyDoc = PolicyEngine.getPolicy(policyResource.getContentStream());
                }
            } catch (RegistryException e) {
                String errMsg = "Exception while loading policy from Configuration registry: " + path;
                log.error(errMsg, e);
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry

                                " is inactive. Cannot retrieve certificate.</h4>").getBytes());
            outputStream.flush();
        } else {

            RegistryService registryService = dataHolder.getRegistryService();
            Registry registry = registryService.getConfigSystemRegistry();

            String servicePath = RegistryResources.SERVICE_GROUPS
            + axisService.getAxisServiceGroup().getServiceGroupName()
            + RegistryResources.SERVICES + axisService.getName();

            Resource serviceResource = registry.get(servicePath);
            Association[] assoc = registry.getAssociations(servicePath, RegistryResources.Associations.PRIVATE_KEYSTORE);
           
            KeyStoreManager keyStoreManager = KeyStoreManager.getInstance(null);
           
            KeyStore keyStore = null;
            if(assoc.length < 1){

                boolean httpsEnabled = false;
                Association[] associations =
                    registry.getAssociations(servicePath, RegistryResources.Associations.EXPOSED_TRANSPORTS);
                for (Association association : associations) {
                    Resource resource = registry.get(association.getDestinationPath());
                    String transportProtocol = resource.getProperty(RegistryResources.Transports.PROTOCOL_NAME);
                    if(transportProtocol.equals("https")){
                        httpsEnabled = true;
                        break;
                    }
View Full Code Here

Examples of ratpack.registry.Registry

    ServerErrorHandler serverErrorHandler = (context, throwable1) -> {
      DefaultHandlingResult.this.throwable = throwable1;
      latch.countDown();
    };

    final Registry userRegistry = Registries.registry().
      add(ClientErrorHandler.class, clientErrorHandler).
      add(ServerErrorHandler.class, serverErrorHandler).
      build()
      .join(registry);

    final RenderController renderController = (object, context) -> {
      rendered = object;
      latch.countDown();
    };

    Stopper stopper = () -> {
      throw new UnsupportedOperationException("stopping not supported while unit testing");
    };

    ResponseTransmitter responseTransmitter = new ResponseTransmitter() {
      @Override
      public void transmit(HttpResponseStatus status, ByteBuf byteBuf) {
        sentResponse = true;
        body = new byte[byteBuf.readableBytes()];
        byteBuf.readBytes(body);
        byteBuf.release();
        eventController.fire(new DefaultRequestOutcome(request, new DefaultSentResponse(headers, new DefaultStatus(status)), System.currentTimeMillis()));
        latch.countDown();
      }

      @Override
      public void transmit(HttpResponseStatus responseStatus, BasicFileAttributes basicFileAttributes, Path file) {
        sentFile = file;
        eventController.fire(new DefaultRequestOutcome(request, new DefaultSentResponse(headers, status), System.currentTimeMillis()));
        latch.countDown();
      }

      @Override
      public Subscriber<ByteBuf> transmitter(HttpResponseStatus status) {
        throw new UnsupportedOperationException("streaming not supported while unit testing");
      }
    };

    ExecControl execControl = launchConfig.getExecController().getControl();
    Registry baseRegistry = NettyHandlerAdapter.buildBaseRegistry(stopper, launchConfig);
    Registry effectiveRegistry = baseRegistry.join(userRegistry);
    Response response = new DefaultResponse(execControl, responseHeaders, launchConfig.getBufferAllocator(), responseTransmitter);
    DefaultContext.ApplicationConstants applicationConstants = new DefaultContext.ApplicationConstants(launchConfig, renderController, next);
    requestConstants = new DefaultContext.RequestConstants(
      applicationConstants, bindAddress, request, response, null, eventController.getRegistry()
    );
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.