Examples of ResourceKey


Examples of com.adito.properties.impl.resource.ResourceKey

    }
   
    public FileSystemOptions getOptions(URI uri) {
        FileSystemOptions options = new FileSystemOptions();   
        FtpFileSystemConfigBuilder c = FtpFileSystemConfigBuilder.getInstance();
        String mode = Property.getProperty(new ResourceKey("ftp.mode", this.getNetworkPlace().getResourceType(), this.getNetworkPlace().getResourceId()));
        c.setPassiveMode(options, mode.equals("passive"));
        int idleTimeout = Property.getPropertyInt(new ResourceKey("ftp.idleTimeout", getNetworkPlace().getResourceType(), getNetworkPlace().getResourceId()));
        c.setIdleTimeout(options, idleTimeout);
        // TODO: Add resource attribute for all these settings.
        c.setUserDirIsRoot(options, true);
        String hostType = Property.getProperty(new ResourceKey("ftp.hostType", this.getNetworkPlace().getResourceType(), this.getNetworkPlace().getResourceId()));
        if (!"automatic".equals(hostType)) {
            c.setEntryParser(options, hostType);
        }
        return options;
    }
View Full Code Here

Examples of com.adito.properties.impl.resource.ResourceKey

           if(v.getDefinition().getVisibility() != AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
               if (v.getDefinition().getPropertyClass().getName().equals(PolicyAttributes.NAME)){
                   Property.setProperty(new PolicyAttributeKey(resource.getResourceId(), v.getName()), v.getDefinition().formatAttributeValue(v.getPropertyValue()), getSessionInfo(request));
               }
               else{
                   Property.setProperty(new ResourceKey(v.getDefinition().getName(), resource.getResourceType(), resource.getResourceId()), v.getDefinition().formatAttributeValue(v.getPropertyValue()), getSessionInfo(request));
               }
           }
        }
        return cleanUpAndReturnToReferer(mapping, form, request, response);
    }
View Full Code Here

Examples of com.adito.properties.impl.resource.ResourceKey

                            .getDefaultValue(), AttributeDefinition.UNKNOWN, 10, d.getMessageResourcesKey(), false, d.getLabel(), d.getDescription(), false, false, "");
            def.init(propertyClass);
           if (!def.isHidden() && isResourcePropertyDefinition(resource, d)) {
                    String value = def.getDefaultValue();
                    if (resource != null) {
                        value = Property.getProperty(new ResourceKey(def.getName(), resource.getResourceType(), resource.getResourceId()));
                    }
                    AttributeValueItem item = new AttributeValueItem(def, request, value, getSubCategoryString(resource));
                    userAttributeValueItems.add(item);
            }
        }
View Full Code Here

Examples of com.alibaba.antx.config.resource.util.ResourceKey

            throw new ConfigException(e);
        }
    }

    protected ChannelSftp getOrCreateChannel(ResourceURI uri) {
        final ResourceKey key = new ResourceKey(uri);
        ChannelSftp channel;

        synchronized (channels) {
            channel = (ChannelSftp) channels.get(key);

            if (channel == null) {
                try {
                    ResourceContext.get().setCurrentURI(uri.getURI());

                    com.jcraft.jsch.Session session = jsch.getSession(key.getUser(), key.getHost(), key.getPort());

                    session.setUserInfo(new UserInfo() {
                        private UsernamePassword up;

                        public String getPassphrase() {
                            return null;
                        }

                        public boolean promptPassphrase(String message) {
                            return true;
                        }

                        public String getPassword() {
                            return up == null ? null : up.getPassword();
                        }

                        public boolean promptPassword(String message) {
                            URI uri = ResourceContext.get().getCurrentURI();
                            String username = ResourceContext.get().getCurrentUsername();
                            Set visitedURIs = ResourceContext.get().getVisitedURIs();

                            message = "\nAuthentication required: \n" + uri + "\n";

                            up = getResourceManager().getAuthenticationHandler().authenticate(message, uri, username,
                                    visitedURIs.contains(key));

                            visitedURIs.add(key);

                            return up != null;
                        }

                        public boolean promptYesNo(String str) {
                            return true;
                        }

                        public void showMessage(String message) {
                        }
                    });

                    session.connect();

                    channel = (ChannelSftp) session.openChannel("sftp");
                    channel.connect();

                    String charset = uri.getOption("charset");

                    if (charset != null) {
                        channel.setFilenameEncoding(charset);
                    }

                    channels.put(key, channel);

                    // �ɹ���������Ա����ظ���ʾ��������
                    ResourceContext.get().getVisitedURIs().remove(new ResourceKey(new ResourceURI(uri.getURI())));
                } catch (RuntimeException e) {
                    throw e;
                } catch (Exception e) {
                    throw new ConfigException(e);
                } finally {
View Full Code Here

Examples of com.springsource.insight.intercept.resource.ResourceKey

        TimeRange range = new TimeRange(7365L, 3777347L);
        String actionName = "testExtraMetricsGeneration";
        Trace trace = createMockTrace(range, actionName);
        Frame root = trace.getRootFrame();
        EndPointName ep = EndPointName.valueOf(actionName);
        ResourceKey rKey = ep.makeKey();
        Collection<MetricsBag> mbList =
                ((EclipsePersistenceMetricsGenerator) gen).addExtraEndPointMetrics(trace, rKey, Collections.singletonList(root));
        assertEquals("Mismatched metrics count", 1, ListUtil.size(mbList));

        MetricsBag mb = ListUtil.getFirstMember(mbList);
View Full Code Here

Examples of org.apache.ws.resource.ResourceKey

   public void timerExpired( Timer timer )
   {
      LOG.debug( MSG.getMessage( Keys.CLEANING_EXPIRED_RESOURCES) );

      Calendar    currentTime = Calendar.getInstance(  );
      ResourceKey key;
      Resource    resource;
      LinkedList  list = new LinkedList(  );

      synchronized ( m_resources )
      {
View Full Code Here

Examples of org.exoplatform.resolver.ResourceKey

   }

   final public GroovyTemplate getTemplate(String url, ResourceResolver resolver, boolean cacheable) throws Exception
   {
      GroovyTemplate template;
      ResourceKey resourceId = resolver.createResourceKey(url);
      if (cacheable)
      {
         template = futureCache.get(resolver, resourceId);
      }
      else
View Full Code Here

Examples of org.exoplatform.resolver.ResourceKey

      return template;
   }

   final public void invalidateTemplate(String name, ResourceResolver resolver) throws Exception
   {
      ResourceKey resourceKey = resolver.createResourceKey(name);
      getTemplatesCache().remove(resourceKey);
   }
View Full Code Here

Examples of org.globus.wsrf.ResourceKey

        return this.serviceAddress;
    }

    public String getContextSecret(EndpointReferenceType ref)
            throws ContextBrokerException {
        final ResourceKey ctxKey = this.getResourceKey(ref);
        final ContextBrokerResource resource =
                                        this.findResourceNoSecurity(ctxKey);
        BootstrapInformation bootstrap = resource.getBootstrap();

        // current secret string is a separated list:
View Full Code Here

Examples of org.jfree.resourceloader.ResourceKey

        this.officeStylesCollection = parseStylesXml();
    }

    private OfficeStylesCollection parseStylesXml()
    {
        final ResourceKey contextKey = getRootHandler().getContext();
        final ResourceManager resourceManager = getRootHandler().getResourceManager();

        try
        {
            final ResourceKey key =
                    resourceManager.deriveKey(contextKey, "styles.xml");
            final Resource resource =
                    resourceManager.create(key, contextKey, OfficeStylesCollection.class);
            final OfficeStylesCollection styles =
                    (OfficeStylesCollection) resource.getResource();
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.