Examples of ConnectionData


Examples of org.springframework.social.connect.ConnectionData

    Connection<TestFacebookApi> facebookConnection = facebookConnectionFactory.createConnection(new ConnectionData("facebook", "12345", "Craig Walls", "http://facebook.com/habuma", "http://facebook.com/habuma/picture", "ACCESS_TOKEN", "SECRET", null, null));   
    usersConnectionRepository.createConnectionRepository("2").addConnection(facebookConnection);
  }

  private void insertTwitterConnection() {
    Connection<TestTwitterApi> twitterConnection = twitterConnectionFactory.createConnection(new ConnectionData("twitter", "habuma", "@habuma", "http://twitter.com/habuma", "http://twitter.com/habuma/picture", "ACCESS_TOKEN", "SECRET", "REFRESH_TOKEN", null));
    connectionRepository.addConnection(twitterConnection);
  }
View Full Code Here

Examples of org.springframework.social.connect.ConnectionData

    assertEquals("234567890", facebook.getApi().getAccessToken());
    facebook.refresh();
    connectionRepository.updateConnection(facebook);
    Connection<TestFacebookApi> facebook2 = connectionRepository.getPrimaryConnection(TestFacebookApi.class);
    assertEquals("765432109", facebook2.getApi().getAccessToken());
    ConnectionData data = facebook.createData();
    assertEquals("654321098", data.getRefreshToken());
  }
View Full Code Here

Examples of org.springframework.social.connect.ConnectionData

  }
 
  private void testConnectionRepository(ConnectionFactoryLocator cfl, ConnectionRepository connectionRepository) {
    assertNull(connectionRepository.findPrimaryConnection(Fake.class));
    ConnectionFactory<Fake> fakeCF = cfl.getConnectionFactory(Fake.class);
    Connection<Fake> connection = fakeCF.createConnection(new ConnectionData("fake", "bob", "Bob McBob", "http://www.twitter.com/mcbob", null, "someToken", "someSecret", null, null));
    connectionRepository.addConnection(connection);
    assertNotNull(connectionRepository.findPrimaryConnection(Fake.class));
    assertTrue(context.getBean(Fake.class).isAuthorized());
    assertNotNull(fake);
    assertTrue(fake.isAuthorized());
View Full Code Here

Examples of org.springframework.social.connect.ConnectionData

  }
 
  private void testConnectionRepository(ConnectionFactoryLocator cfl, ConnectionRepository connectionRepository) {
    assertNull(connectionRepository.findPrimaryConnection(Fake.class));
    ConnectionFactory<Fake> fakeCF = cfl.getConnectionFactory(Fake.class);
    Connection<Fake> connection = fakeCF.createConnection(new ConnectionData("fake", "bob", "Bob McBob", "http://www.twitter.com/mcbob", null, "someToken", "someSecret", null, null));
    connectionRepository.addConnection(connection);
    assertNotNull(connectionRepository.findPrimaryConnection(Fake.class));
    assertTrue(context.getBean(Fake.class).isAuthorized());
    assertNotNull(fake);
    assertTrue(fake.isAuthorized());
View Full Code Here

Examples of org.springframework.social.connect.ConnectionData

public class OAuth1ConnectionTest {
  @Test
  public void oauth1ConnectionSerializable() throws Exception {
    OAuth1Connection<FakeApi> connection = new OAuth1Connection<FakeApi>(
        new ConnectionData("a", "b", "c", "d", "e", "f", "g", "h", 123L),
        new FakeServiceProvider("i", "j"), new FakeApiAdapter());

    byte[] byteArray = SerializationUtils.serialize(connection);

    @SuppressWarnings("unchecked")
View Full Code Here

Examples of org.springframework.social.connect.ConnectionData

      List<Connection<?>> connections,boolean includeExpiredConnections) {
    Set<ConnectionKey> connectionKeys = new HashSet<ConnectionKey>();
    for (Connection<?> connection : connections) {
      if (includeExpiredConnections || !connection.hasExpired()) {

        ConnectionData connectionData = connection.createData();
        connectionKeys.add(new ConnectionKey(connectionData
            .getProviderId(), connectionData.getProviderUserId()));
      }
    }
    return connectionKeys;
  }
View Full Code Here

Examples of org.springframework.social.connect.ConnectionData

  @Autowired
  private ConnectionFactoryLocator connectionFactoryLocator;

  private Connection<SpringSocialSecurity> createSpringSocialSecurityConnectionFromProfile(SpringSocialProfile springSocialProfile)
  {
    ConnectionData connectionData = new ConnectionData(
        SpringSocialSecurityConnectionFactory.SPRING_SOCIAL_SECURITY_PROVIDER_NAME,
      springSocialProfile.getUserName(),
      springSocialProfile.getDisplayName(), springSocialProfile.getProfileUrl(),
      springSocialProfile.getImageUrl(), springSocialProfile.getPassword(),
      null, null, null);
View Full Code Here

Examples of org.springframework.social.connect.ConnectionData

  private static final String SIGNED_REQUEST = "T4PCp840PHnhgQwMgCSZODpDGqhLC4mFGaNG8oHW7WU.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImlzc3VlZF9hdCI6MTMzNTg5NDc5NiwidXNlciI6eyJjb3VudHJ5IjoidXMiLCJsb2NhbGUiOiJlbl9VUyJ9LCJ1c2VyX2lkIjoiNzM4MTQwNTc5In0";

  @Test
  public void disconnect() throws Exception {
    FacebookConnectionFactory connectionFactory = new FacebookConnectionFactory("clientId", CLIENT_SECRET);
    Connection<Facebook> connection = connectionFactory.createConnection(new ConnectionData("facebook", "738140579", "", "", "", "", "", "", null));
    StubUsersConnectionRepository usersConnectionRepository = new StubUsersConnectionRepository();
    ConnectionRepository connectionRepository = usersConnectionRepository.createConnectionRepository("habuma");
    connectionRepository.addConnection(connection);
    assertEquals(1, connectionRepository.findAllConnections().size());
    DisconnectController controller = new DisconnectController(usersConnectionRepository, CLIENT_SECRET);
View Full Code Here

Examples of pl.balon.gwt.diagrams.client.connection.data.ConnectionData

    }
   
    Connector c1 = (Connector) connectors.get(0);
    Connector c2 = (Connector) connectors.get(1);
   
    ConnectionData data = new ConnectionData();
   
    Point center1 = new Point(c1.getLeft() + c1.getWidth()/2, c1.getTop() + c1.getHeight()/2);
    Point center2 = new Point(c2.getLeft() + c2.getWidth()/2, c2.getTop() + c2.getHeight()/2);

    Point diff = new Point(center2.left - center1.left, center2.top - center1.top);

    int leftSign = diff.left >= 0 ? -1 : 1
    int topSign = diff.top >= 0 ? -1 : 1
   
    //c1 vertical
    int top = c1.getHeight()/2;
    int left = diff.top != 0 ? top * diff.left / Math.abs(diff.top) : Integer.MAX_VALUE;
    top *= -topSign;
   
    if( Math.abs(left) > c1.getWidth()/2 ){
      //c1 horizontal
      left = c1.getWidth()/2;
      top = diff.left != 0 ? left * diff.top / Math.abs(diff.left) : Integer.MAX_VALUE;
      left *= -leftSign;
    }
    data.getPoints().add(new Point(center1.left + left, center1.top + top));

    //c2 vertical
    top = c2.getHeight()/2;
    left = diff.top != 0 ? top * diff.left / Math.abs(diff.top) : Integer.MAX_VALUE;
    top *= topSign;
    left = -left;
   
    if( Math.abs(left) > c2.getWidth()/2 ){
      //c2 horizontal
      left = c2.getWidth()/2;
      top = diff.left != 0 ? left * diff.top / Math.abs(diff.left) : Integer.MAX_VALUE;
      left *= leftSign;
      top = -top;
    }
    data.getPoints().add(new Point(center2.left + left, center2.top + top));

    return data;
  }
View Full Code Here

Examples of pl.balon.gwt.diagrams.client.connection.data.ConnectionData

    }
   
    Connector c1 = (Connector) connectors.get(0);
    Connector c2 = (Connector) connectors.get(1);
   
    ConnectionData data = new ConnectionData();
   
    data.getPoints().add(new Point( c1.getLeft() + c1.getWidth()/2, c1.getTop() + c1.getHeight()/2 ));
    data.getPoints().add(new Point( c1.getLeft() + c1.getWidth()/2, c2.getTop() + c2.getHeight()/2 ));
    data.getPoints().add(new Point( c2.getLeft() + c2.getWidth()/2, c2.getTop() + c2.getHeight()/2 ));
   
    return data;
  }
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.