Search in sources :

Example 1 with IConnectInitiatorPolicy

use of org.eclipse.ecf.core.security.IConnectInitiatorPolicy in project ecf by eclipse.

the class GenericAuthConsumerContainerSelector method createContainer.

@Override
protected IRemoteServiceContainer createContainer(ContainerTypeDescription containerTypeDescription, String containerTypeDescriptionName, @SuppressWarnings("rawtypes") Map properties) throws SelectContainerException {
    IRemoteServiceContainer result = super.createContainer(containerTypeDescription, containerTypeDescriptionName, properties);
    ISharedObjectContainerClient client = (ISharedObjectContainerClient) result.getContainer().getAdapter(ISharedObjectContainerClient.class);
    if (client != null) {
        client.setConnectInitiatorPolicy(new IConnectInitiatorPolicy() {

            public void refresh() {
            }

            public Object createConnectData(IContainer container, ID targetID, IConnectContext context) {
                // to the server.
                return getConnectData();
            }

            public int getConnectTimeout() {
                return 30000;
            }
        });
    }
    return result;
}
Also used : IRemoteServiceContainer(org.eclipse.ecf.remoteservice.IRemoteServiceContainer) IConnectContext(org.eclipse.ecf.core.security.IConnectContext) ISharedObjectContainerClient(org.eclipse.ecf.core.sharedobject.ISharedObjectContainerClient) IConnectInitiatorPolicy(org.eclipse.ecf.core.security.IConnectInitiatorPolicy) ID(org.eclipse.ecf.core.identity.ID) IContainer(org.eclipse.ecf.core.IContainer)

Example 2 with IConnectInitiatorPolicy

use of org.eclipse.ecf.core.security.IConnectInitiatorPolicy in project ecf by eclipse.

the class GenericClientApplication method createContainer.

protected ISharedObjectContainer createContainer() throws ContainerCreateException {
    IContainerFactory f = Activator.getDefault().getContainerManager().getContainerFactory();
    ClientSOContainer client = (ClientSOContainer) ((clientId == null) ? f.createContainer(GENERIC_CLIENT_CONTAINER_TYPE) : f.createContainer(GENERIC_CLIENT_CONTAINER_TYPE, clientId));
    if (password != null) {
        client.setConnectInitiatorPolicy(new IConnectInitiatorPolicy() {

            public void refresh() {
            // nothing
            }

            public Object createConnectData(IContainer container, ID targetID, IConnectContext context) {
                return password;
            }

            public int getConnectTimeout() {
                return 30000;
            }
        });
    }
    return client;
}
Also used : IConnectContext(org.eclipse.ecf.core.security.IConnectContext) ClientSOContainer(org.eclipse.ecf.provider.generic.ClientSOContainer) IConnectInitiatorPolicy(org.eclipse.ecf.core.security.IConnectInitiatorPolicy) ID(org.eclipse.ecf.core.identity.ID)

Example 3 with IConnectInitiatorPolicy

use of org.eclipse.ecf.core.security.IConnectInitiatorPolicy in project ecf by eclipse.

the class SSLGenericClientApplication method createContainer.

protected ISharedObjectContainer createContainer() throws ContainerCreateException {
    IContainerFactory f = Activator.getDefault().getContainerManager().getContainerFactory();
    ClientSOContainer client = (ClientSOContainer) ((clientId == null) ? f.createContainer(GENERIC_SSL_CLIENT) : f.createContainer(GENERIC_SSL_CLIENT, clientId));
    if (password != null) {
        client.setConnectInitiatorPolicy(new IConnectInitiatorPolicy() {

            public void refresh() {
            // nothing
            }

            public Object createConnectData(IContainer container, ID targetID, IConnectContext context) {
                return password;
            }

            public int getConnectTimeout() {
                return 30000;
            }
        });
    }
    return client;
}
Also used : IConnectContext(org.eclipse.ecf.core.security.IConnectContext) ClientSOContainer(org.eclipse.ecf.provider.generic.ClientSOContainer) IConnectInitiatorPolicy(org.eclipse.ecf.core.security.IConnectInitiatorPolicy) ID(org.eclipse.ecf.core.identity.ID)

Aggregations

ID (org.eclipse.ecf.core.identity.ID)3 IConnectContext (org.eclipse.ecf.core.security.IConnectContext)3 IConnectInitiatorPolicy (org.eclipse.ecf.core.security.IConnectInitiatorPolicy)3 ClientSOContainer (org.eclipse.ecf.provider.generic.ClientSOContainer)2 IContainer (org.eclipse.ecf.core.IContainer)1 ISharedObjectContainerClient (org.eclipse.ecf.core.sharedobject.ISharedObjectContainerClient)1 IRemoteServiceContainer (org.eclipse.ecf.remoteservice.IRemoteServiceContainer)1