receivingFromEndpoint.setAuthKey( new StringBuilder( PublicEncryptionFactory.encryptString( "1111" ) ) );
receivingFromEndpoint.setEnabled( true );
receivingFromEndpoint.setSending( true );//TODO: Shouldn't this be false as we are creating this end point to receive bundles from another server..?
receivingFromEndpoint.setGroupId( environment.getId() );
//Save the endpoint.
publisherEndPointAPI.saveEndPoint( receivingFromEndpoint );
//Find the bundle
Bundle bundle = APILocator.getBundleAPI().getBundleById( bundleId );
PublisherConfig basicConfig = new PublisherConfig();
basicConfig.setId( bundleId );