Examples of RemoteRegistry


Examples of com.peterhi.obsolete.RemoteRegistry

public class AboutMeServer {

  public static void main(String[] args) throws Exception {
    RudpLocalEndpoint endpoint = new MultithreadedRudpLocalEndpoint(22222);
    RemoteRegistry registry = new RemoteRegistry(endpoint);
    endpoint.run();

    ArrayList<String> friendNames = new ArrayList<String>();
   
    for (int i = 0; i < 100; i++) {
      friendNames.add("Friend " + i);
    }
   
    AboutMeImpl aboutMe = new AboutMeImpl(registry, "Jason", "True name is YZW.", friendNames);
    registry.register("aboutMe", aboutMe);
    Thread.sleep(5000);
    aboutMe.fireChanged("Notice 1!!!");
    Thread.sleep(5000);
    aboutMe.fireChanged("Notice 2!!!");
  }
View Full Code Here

Examples of com.peterhi.obsolete.RemoteRegistry

public class AboutMeClient {

  public static void main(String[] args) throws Exception {
    RudpLocalEndpoint endpoint = new MultithreadedRudpLocalEndpoint();
    final RemoteRegistry registry = new RemoteRegistry(endpoint);
    endpoint.run();
   
    SocketAddress address = new InetSocketAddress(InetAddress.getLocalHost(), 22222);
    final AboutMe aboutMe = registry.subscribe(address, "aboutMe", AboutMe.class);
    System.out.println("object = " + aboutMe);
    System.out.println("name = " + aboutMe.getName());
    System.out.println("description = " + aboutMe.getDescription());
    System.out.println("friends = " + aboutMe.getFriendNames(15));
   
    AboutMeListener listener = new AboutMeListener() {
      @Override
      public void changed(String notice) {
        System.out.println("Changed " + notice);
//        aboutMe.removeAboutMeListener(this);
        System.out.println("local empty after remove? " + registry.isLocalEmpty());
      }
    };
    aboutMe.addAboutMeListener(listener);
    System.out.println("local empty after add? " + registry.isLocalEmpty());
    aboutMe.addAboutMeListener(listener);
    System.out.println("local empty after add? " + registry.isLocalEmpty());
  }
View Full Code Here

Examples of org.wso2.carbon.registry.app.RemoteRegistry

            if (configurationFrom == ConfigurationFromEnum.REMOTE_RESOURCE) {
                System.setProperty("javax.net.ssl.trustStore", "CARBON_HOME/resources/security/client-truststore.jks");
                System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
                System.setProperty("javax.net.ssl.trustStoreType","JKS");

                RemoteRegistry remoteConfigurationRegisitry = new RemoteRegistry(new URL(aspectConfigurationRegistryURL),
                    aspectConfigurationRegistryUsername,
                    aspectConfigurationRegistryPassword);

                Resource configurationResource = remoteConfigurationRegisitry.get(aspectConfigurationLocation);
                String xmlContent = new String((byte[])configurationResource.getContent());  
                OMElement checklistConfiguration = AXIOMUtil.stringToOM(xmlContent);
                Iterator stateElements = checklistConfiguration.getChildElements();
                                                          /*
                <lifecycle-configuration>
View Full Code Here

Examples of org.wso2.carbon.registry.app.RemoteRegistry

            if(password==null){
                handleException("Registry password is null");
            }

            log.info("Connecting to the remote registry " + registryURL);
            registry = new RemoteRegistry(new URL(registryURL), username, password);
            super.registry=registry;
            if (registry == null) {
                log.fatal("Unable to connect to the remote registry at : " + registryURL);
            } else {
                resTopicIndex = registry.get(getTopicIndexPath()); // call the topic index
View Full Code Here

Examples of org.wso2.carbon.registry.app.RemoteRegistry

import org.wso2.carbon.registry.core.session.UserRegistry;
public class RegistryRepositoryFactory implements RepositoryFactory{
    private Repository regRepo;
    public Repository getRepository(Map map) throws RepositoryException {

        RemoteRegistry remoteRegistry;
        Registry registry; // an admin registry
        try {
            RemoteRegistryService remoteRegistryService = new RemoteRegistryService((String)map.get("registryURL"),(String)map.get("userName"),(String)map.get("password"));
            if(regRepo == null) {
View Full Code Here

Examples of org.wso2.carbon.registry.app.RemoteRegistry

    String passWord;
    String fromPath;
    String toPath;
    String args0 = null;
    String key_store;
    RemoteRegistry remoteRegistry;

    if (args.length > 0) {
      args0 = args[0];
    }

    InputStreamReader is = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(is);

    System.out.println("Path to registry key_store file:");
    key_store = br.readLine();

    System.out.println("Registry URL :");

    registryURL = br.readLine();

    System.out.println("User Name :");

    userName = br.readLine();

    if ("".equals(userName)) {
      userName = null;
    }
    System.out.println("Password :");
    passWord = br.readLine();

    if ("".equals(passWord)) {
      passWord = null;
    }

    System.out.println("From Path :");
    fromPath = br.readLine();
    if ("".equals(fromPath)) {
      throw new Exception(
          " From path can not be null , you have to provide the local file system location!!");
    }
    System.out.println("To Path :");
    toPath = br.readLine();

    System.setProperty("javax.net.ssl.trustStore", key_store);
    System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
    System.setProperty("javax.net.ssl.trustStoreType", "JKS");

    if (userName == null) {
      remoteRegistry = new RemoteRegistry(new URL(registryURL));
    } else {
      remoteRegistry = new RemoteRegistry(new URL(registryURL), userName,
          passWord);
    }

    if (args0 == null) {
View Full Code Here

Examples of org.wso2.carbon.registry.app.RemoteRegistry

                clientPort = portProp;
            }

            if (registry == null) {
                server.start();
                registry = new RemoteRegistry(new URL("http://localhost:" + clientPort +
                                                      "/wso2registry"),
                                              "admin", "admin");
            }
        } catch (Exception e) {
            fail("Failed to initialize the registry.");
View Full Code Here

Examples of org.wso2.carbon.registry.app.RemoteRegistry

                handleException("Registry password is null");
            }

            log.info("Creating the remote registry " +
                    "from the passed values " + registryURL + " " + username + " " + password);
            registry = new RemoteRegistry(new URL(registryURL), username, password);
            super.registry=registry;
            if (registry == null) {
                log.fatal("Unable to create the remote " + "registry from the passed values " +
                        registryURL + " " + username + " " + password);
            } else {
View Full Code Here

Examples of org.wso2.carbon.registry.app.RemoteRegistry

            if (registryProvider != null) {
                return registryProvider.getRegistry(this.conURL, this.userName, this.password);
            }

            RegistryUtils.setTrustStoreSystemProperties();
            return new RemoteRegistry(this.conURL, this.userName, this.password);
        }
        if (registryService == null) {
            RegistryContext context = RegistryContext.getCloneContext();
            context.setRegistryRoot(registryRoot);
            context.setReadOnly(readOnly);
View Full Code Here

Examples of org.wso2.carbon.registry.app.RemoteRegistry

    private static void executeService() throws IOException, SQLException, ParseException {
        int serviceID = MySQLConnectionInitializer.getServiceID(StatusMonitorConstants.GADGET);

        if (ServiceLoginClient.loginChecker(StatusMonitorConstants.GADGETS_HOST, serviceID)) {
            try {
                registry = new RemoteRegistry(new URL(StatusMonitorConstants.GADGETS_HTTP +
                        "/t/" + authConfigBean.getTenant() + "/registry"),
                        authConfigBean.getUserName(), authConfigBean.getPassword());
            } catch (RegistryException e) {
                log.error(e);
            } catch (MalformedURLException e) {
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.